docs(hyprland): minimize disabled config diff

This commit is contained in:
2026-10-10 12:51:41 -04:00
parent 56507866bb
commit 7cf7ad819f
6 changed files with 153 additions and 182 deletions

View File

@@ -1,52 +1,47 @@
{ {
config, config,
lib, lib,
# pkgs, pkgs,
... ...
}: }:
# The lock screen: a hyprlock session-lock surface the compositor owns. # The lock screen: a hyprlock session-lock surface the compositor owns.
let let
user = config.user.name; user = config.user.name;
/* # The hyprlock this module installs, used by the lock keybind below.
Slice 1 disables the lock keybinds, so their supporting values stay hyprlock = "${config.home-manager.users.${user}.programs.hyprlock.package}/bin/hyprlock";
commented out with the bind block.
# The hyprlock this module installs, used by the lock keybind below. sleepIcon = builtins.fromJSON ''"\udb81\udcb2"'';
hyprlock = "${config.home-manager.users.${user}.programs.hyprlock.package}/bin/hyprlock"; sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"'';
sleepIcon = builtins.fromJSON ''"\udb81\udcb2"''; idleLockToggle = pkgs.writeShellScript "lockscreen-idle-inhibit-toggle" ''
sleepOffIcon = builtins.fromJSON ''"\udb81\udcb3"''; unit=lockscreen-idle-inhibit.service
idleLockToggle = pkgs.writeShellScript "lockscreen-idle-inhibit-toggle" '' refresh_waybar() {
unit=lockscreen-idle-inhibit.service ${pkgs.procps}/bin/pkill -RTMIN+9 waybar >/dev/null 2>&1 || true
}
refresh_waybar() { if ${pkgs.systemd}/bin/systemctl --user is-active --quiet "$unit"; then
${pkgs.procps}/bin/pkill -RTMIN+9 waybar >/dev/null 2>&1 || true ${pkgs.systemd}/bin/systemctl --user stop "$unit"
} refresh_waybar
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepIcon}"
exit 0
fi
if ${pkgs.systemd}/bin/systemctl --user is-active --quiet "$unit"; then if ${pkgs.systemd}/bin/systemd-run \
${pkgs.systemd}/bin/systemctl --user stop "$unit" --user \
refresh_waybar --collect \
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepIcon}" --unit=lockscreen-idle-inhibit \
exit 0 --description="Disable idle-triggered screen locking" \
fi ${pkgs.systemd}/bin/systemd-inhibit \
--what=idle \
if ${pkgs.systemd}/bin/systemd-run \ --who=lockscreen-hotkey \
--user \ --why="lock screen disabled by hotkey" \
--collect \ ${pkgs.coreutils}/bin/sleep infinity >/dev/null; then
--unit=lockscreen-idle-inhibit \ refresh_waybar
--description="Disable idle-triggered screen locking" \ ${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepOffIcon}"
${pkgs.systemd}/bin/systemd-inhibit \ fi
--what=idle \ '';
--who=lockscreen-hotkey \
--why="lock screen disabled by hotkey" \
${pkgs.coreutils}/bin/sleep infinity >/dev/null; then
refresh_waybar
${pkgs.swayosd}/bin/swayosd-client --custom-message "${sleepOffIcon}"
fi
'';
*/
in in
{ {
options.modules.desktop.session.hyprland.hyprlock.enable = options.modules.desktop.session.hyprland.hyprlock.enable =
@@ -87,14 +82,14 @@ in
}; };
}; };
# Lock on Super+X.
# The guard drops the keypress when a locker is already up, so a second
# hyprlock never stacks over the first.
/* /*
Slice 1 disables external Hyprland binds while the compositor config wayland.windowManager.hyprland.settings.bind = [
moves to a minimal Lua baseline. "$mod, X, exec, ${pkgs.procps}/bin/pidof hyprlock || ${hyprlock}"
"$mod CTRL, X, exec, ${idleLockToggle}"
wayland.windowManager.hyprland.settings.bind = [ ];
"$mod, X, exec, ${pkgs.procps}/bin/pidof hyprlock || ${hyprlock}"
"$mod CTRL, X, exec, ${idleLockToggle}"
];
*/ */
}; };
}; };

View File

@@ -1,19 +1,14 @@
{ {
config, config,
lib, lib,
# pkgs, pkgs,
... ...
}: }:
# mako as the notification daemon: toasts, a do-not-disturb mode, and history recall. # mako as the notification daemon: toasts, a do-not-disturb mode, and history recall.
let let
user = config.user.name; user = config.user.name;
/* makoctl = "${pkgs.mako}/bin/makoctl";
Slice 1 disables the Mako recall keybind, so its supporting value stays
commented out with the bind block.
makoctl = "${pkgs.mako}/bin/makoctl";
*/
in in
{ {
options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon"; options.modules.desktop.session.mako.enable = lib.mkEnableOption "the mako notification daemon";
@@ -37,13 +32,13 @@ in
}; };
}; };
# Recall the last notification from history, keyboard-only like the rest
# of the session.
# $mod is defined by the compositor config these binds share.
/* /*
Slice 1 disables external Hyprland binds while the compositor config wayland.windowManager.hyprland.settings.bind = [
moves to a minimal Lua baseline. "$mod, N, exec, ${makoctl} restore"
];
wayland.windowManager.hyprland.settings.bind = [
"$mod, N, exec, ${makoctl} restore"
];
*/ */
}; };
}; };

View File

@@ -1,31 +1,26 @@
{ {
config, config,
lib, lib,
# pkgs, pkgs,
... ...
}: }:
# rofi as the desktop launcher and dmenu-style menu frontend. # rofi as the desktop launcher and dmenu-style menu frontend.
let let
user = config.user.name; user = config.user.name;
/* # A session menu built on the same themed rofi, so the power actions look
Slice 1 disables the Rofi keybinds, so their supporting script stays # like every other menu the launcher drives.
commented out with the bind block. powerMenu = pkgs.writeShellScript "rofi-power-menu" ''
chosen=$(printf '%s\n' Lock Suspend 'Log out' Reboot 'Shut down' \
# A session menu built on the same themed rofi, so the power actions look | ${pkgs.rofi}/bin/rofi -dmenu -i -p Power)
# like every other menu the launcher drives. case "$chosen" in
powerMenu = pkgs.writeShellScript "rofi-power-menu" '' Lock) ${pkgs.systemd}/bin/loginctl lock-session ;;
chosen=$(printf '%s\n' Lock Suspend 'Log out' Reboot 'Shut down' \ Suspend) ${pkgs.systemd}/bin/systemctl suspend ;;
| ${pkgs.rofi}/bin/rofi -dmenu -i -p Power) 'Log out') ${pkgs.systemd}/bin/loginctl terminate-session "$XDG_SESSION_ID" ;;
case "$chosen" in Reboot) ${pkgs.systemd}/bin/systemctl reboot ;;
Lock) ${pkgs.systemd}/bin/loginctl lock-session ;; 'Shut down') ${pkgs.systemd}/bin/systemctl poweroff ;;
Suspend) ${pkgs.systemd}/bin/systemctl suspend ;; esac
'Log out') ${pkgs.systemd}/bin/loginctl terminate-session "$XDG_SESSION_ID" ;; '';
Reboot) ${pkgs.systemd}/bin/systemctl reboot ;;
'Shut down') ${pkgs.systemd}/bin/systemctl poweroff ;;
esac
'';
*/
in in
{ {
options.modules.desktop.session.rofi.enable = lib.mkEnableOption "the rofi launcher"; options.modules.desktop.session.rofi.enable = lib.mkEnableOption "the rofi launcher";
@@ -45,14 +40,13 @@ in
}; };
}; };
# The launcher and the session menu, kept next to the tool they drive.
# $mod is defined by the compositor config these binds share.
/* /*
Slice 1 disables external Hyprland binds while the compositor config wayland.windowManager.hyprland.settings.bind = [
moves to a minimal Lua baseline. "$mod, R, exec, ${pkgs.rofi}/bin/rofi -show drun"
"$mod SHIFT, X, exec, ${powerMenu}"
wayland.windowManager.hyprland.settings.bind = [ ];
"$mod, R, exec, ${pkgs.rofi}/bin/rofi -show drun"
"$mod SHIFT, X, exec, ${powerMenu}"
];
*/ */
}; };
}; };

View File

@@ -8,25 +8,20 @@
let let
user = config.user.name; user = config.user.name;
/* cliphist = "${pkgs.cliphist}/bin/cliphist";
Slice 1 disables the clipboard picker keybind, so its supporting values rofi = "${pkgs.rofi}/bin/rofi";
stay commented out with the bind block. wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
cliphist = "${pkgs.cliphist}/bin/cliphist"; # The picker reuses the themed rofi, so history looks like every other menu
rofi = "${pkgs.rofi}/bin/rofi"; # the launcher drives.
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; # decode is needed because list emits id-prefixed lines rather than the copied
# bytes, so the chosen id has to be resolved back before it can be re-copied.
# The picker reuses the themed rofi, so history looks like every other menu picker = pkgs.writeShellScript "clipboard-picker" ''
# the launcher drives. ${cliphist} list \
# decode is needed because list emits id-prefixed lines rather than the | ${rofi} -dmenu -i -p Clipboard \
# copied bytes must be resolved back before it can be re-copied. | ${cliphist} decode \
picker = pkgs.writeShellScript "clipboard-picker" '' | ${wl-copy}
${cliphist} list \ '';
| ${rofi} -dmenu -i -p Clipboard \
| ${cliphist} decode \
| ${wl-copy}
'';
*/
in in
{ {
options.modules.desktop.utilities.clipboard.enable = options.modules.desktop.utilities.clipboard.enable =
@@ -44,13 +39,11 @@ in
# session so uwsm starts and stops them with it. # session so uwsm starts and stops them with it.
services.cliphist.enable = true; services.cliphist.enable = true;
# $mod is defined by the compositor config these binds share.
/* /*
Slice 1 disables external Hyprland binds while the compositor config wayland.windowManager.hyprland.settings.bind = [
moves to a minimal Lua baseline. "$mod SHIFT, V, exec, ${picker}"
];
wayland.windowManager.hyprland.settings.bind = [
"$mod SHIFT, V, exec, ${picker}"
];
*/ */
}; };
}; };

View File

@@ -1,48 +1,43 @@
{ {
config, config,
lib, lib,
# pkgs, pkgs,
... ...
}: }:
# Keybound screen recording: pick a region, then toggle a video-only capture. # Keybound screen recording: pick a region, then toggle a video-only capture.
let let
user = config.user.name; user = config.user.name;
/* slurp = "${pkgs.slurp}/bin/slurp";
Slice 1 disables the recording keybind, so its supporting values stay wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder";
commented out with the bind block. notify-send = "${pkgs.libnotify}/bin/notify-send";
pgrep = "${pkgs.procps}/bin/pgrep";
pkill = "${pkgs.procps}/bin/pkill";
date = "${pkgs.coreutils}/bin/date";
mkdir = "${pkgs.coreutils}/bin/mkdir";
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
slurp = "${pkgs.slurp}/bin/slurp"; # A single key both starts and stops.
wf-recorder = "${pkgs.wf-recorder}/bin/wf-recorder"; # A running wf-recorder is stopped with SIGINT so it finalises the file.
notify-send = "${pkgs.libnotify}/bin/notify-send"; # Otherwise slurp picks a region and wf-recorder runs in the foreground until
pgrep = "${pkgs.procps}/bin/pgrep"; # that stop arrives, so this instance lives for the whole recording and then
pkill = "${pkgs.procps}/bin/pkill"; # reports it saved.
date = "${pkgs.coreutils}/bin/date"; # No -a means no audio is captured.
mkdir = "${pkgs.coreutils}/bin/mkdir"; toggle = pkgs.writeShellScript "screen-record-toggle" ''
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir"; if ${pgrep} -x wf-recorder >/dev/null; then
${pkill} -INT -x wf-recorder
exit 0
fi
# A single key both starts and stops. region=$(${slurp}) || exit 0
# A running wf-recorder is stopped with SIGINT so it finalises the file. dir="$(${xdgUserDir} VIDEOS)/Recordings"
# Otherwise slurp picks a region and wf-recorder runs in the foreground ${mkdir} -p "$dir"
# until that stop arrives. file="$dir/recording-$(${date} +%Y%m%d-%H%M%S).mp4"
# This instance lives for the whole recording and then reports it saved.
# No -a means no audio is captured.
toggle = pkgs.writeShellScript "screen-record-toggle" ''
if ${pgrep} -x wf-recorder >/dev/null; then
${pkill} -INT -x wf-recorder
exit 0
fi
region=$(${slurp}) || exit 0 ${notify-send} -a "Screen recording" "Recording started" "Region capture, no audio."
dir="$(${xdgUserDir} VIDEOS)/Recordings" ${wf-recorder} -g "$region" -f "$file"
${mkdir} -p "$dir" ${notify-send} -a "Screen recording" "Recording saved" "$file"
file="$dir/recording-$(${date} +%Y%m%d-%H%M%S).mp4" '';
${notify-send} -a "Screen recording" "Recording started" "Region capture, no audio."
${wf-recorder} -g "$region" -f "$file"
${notify-send} -a "Screen recording" "Recording saved" "$file"
'';
*/
in in
{ {
options.modules.desktop.utilities.recording.enable = options.modules.desktop.utilities.recording.enable =
@@ -50,13 +45,11 @@ in
config = lib.mkIf config.modules.desktop.utilities.recording.enable { config = lib.mkIf config.modules.desktop.utilities.recording.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# $mod is defined by the compositor config these binds share.
/* /*
Slice 1 disables external Hyprland binds while the compositor config wayland.windowManager.hyprland.settings.bind = [
moves to a minimal Lua baseline. "$mod SHIFT, R, exec, ${toggle}"
];
wayland.windowManager.hyprland.settings.bind = [
"$mod SHIFT, R, exec, ${toggle}"
];
*/ */
}; };
}; };

View File

@@ -1,7 +1,7 @@
{ {
config, config,
lib, lib,
# pkgs, pkgs,
... ...
}: }:
# Keyboard-driven screenshots copy to the clipboard before Satty opens for # Keyboard-driven screenshots copy to the clipboard before Satty opens for
@@ -9,33 +9,28 @@
let let
user = config.user.name; user = config.user.name;
/* grimblast = "${pkgs.grimblast}/bin/grimblast";
Slice 1 disables the screenshot keybinds and Satty rule, so their satty = "${pkgs.satty}/bin/satty";
supporting values stay commented out with the bind block. tee = "${pkgs.coreutils}/bin/tee";
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy";
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir";
grimblast = "${pkgs.grimblast}/bin/grimblast"; # Copy the original screenshot before Satty opens.
satty = "${pkgs.satty}/bin/satty"; # Satty copies and saves annotated screenshots when the user presses Enter.
tee = "${pkgs.coreutils}/bin/tee"; capture =
wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; target:
xdgUserDir = "${pkgs.xdg-user-dirs}/bin/xdg-user-dir"; pkgs.writeShellScript "screenshot-${target}" ''
dir="$(${xdgUserDir} PICTURES)/Screenshots"
# Copy the original screenshot before Satty opens. mkdir -p "$dir"
# Satty copies and saves annotated screenshots when the user presses Enter. ${grimblast} save ${target} - \
capture = | ${tee} >(${wl-copy}) \
target: | ${satty} --filename - \
pkgs.writeShellScript "screenshot-${target}" '' --output-filename "$dir/screenshot-%Y%m%d-%H%M%S.png" \
dir="$(${xdgUserDir} PICTURES)/Screenshots" --copy-command ${wl-copy} \
mkdir -p "$dir" --save-after-copy \
${grimblast} save ${target} - \ --early-exit \
| ${tee} >(${wl-copy}) \ --actions-on-enter save-to-clipboard
| ${satty} --filename - \ '';
--output-filename "$dir/screenshot-%Y%m%d-%H%M%S.png" \
--copy-command ${wl-copy} \
--save-after-copy \
--early-exit \
--actions-on-enter save-to-clipboard
'';
*/
in in
{ {
options.modules.desktop.utilities.screenshot.enable = options.modules.desktop.utilities.screenshot.enable =
@@ -43,19 +38,25 @@ in
config = lib.mkIf config.modules.desktop.utilities.screenshot.enable { config = lib.mkIf config.modules.desktop.utilities.screenshot.enable {
home-manager.users.${user} = { home-manager.users.${user} = {
# satty is a one-shot annotation surface, so float it rather than letting
# it claim a tile in the layout.
# windowrule v3 syntax: space-separated field/value tokens, comma
# separated, with matchers under a match: prefix and effects bare.
/* /*
Slice 1 disables external Hyprland rules and binds while the compositor wayland.windowManager.hyprland.settings.windowrule = [
config moves to a minimal Lua baseline. "float 1, match:class ^(com\\.gabm\\.satty)$"
];
*/
wayland.windowManager.hyprland.settings.windowrule = [ # Print with plain/Shift/Ctrl for region/window/full.
"float 1, match:class ^(com\\.gabm\\.satty)$" # Super+L is already the hjkl focus and movement bind, so screenshots take
]; # the Print key instead.
/*
wayland.windowManager.hyprland.settings.bind = [ wayland.windowManager.hyprland.settings.bind = [
", Print, exec, ${capture "area"}" ", Print, exec, ${capture "area"}"
"SHIFT, Print, exec, ${capture "active"}" "SHIFT, Print, exec, ${capture "active"}"
"CTRL, Print, exec, ${capture "screen"}" "CTRL, Print, exec, ${capture "screen"}"
]; ];
*/ */
}; };
}; };