hyprland: remove lockhelper, use hyprlock directly

This commit is contained in:
2026-01-30 19:41:23 +01:00
parent 27dd1a5716
commit e8cee85f7c
6 changed files with 2 additions and 87 deletions

View File

@@ -55,7 +55,6 @@
];
hyprland.enableStreamController = true;
hyprland.useLockHelper = true;
hyprland.enableGrimblast = true;
hyprland.enableWacom = true;
hyprland.cursorNoHardware = true;

View File

@@ -31,8 +31,6 @@ in
enableStreamController = mkEnableOption "streamcontroller service";
useLockHelper = mkEnableOption "use lockhelper script instead of hyprlock directly";
enableGrimblast = mkEnableOption "grimblast screenshot keybinds";
enableWacom = mkEnableOption "Wacom tablet device configuration";
@@ -108,11 +106,7 @@ in
enable = true;
settings = {
general = {
lock_cmd =
if cfg.useLockHelper then
"${pkgs.callPackage ../scripts/lockhelper.nix { }}/bin/lockhelper"
else
"${pkgs.hyprlock}/bin/hyprlock";
lock_cmd = "${pkgs.hyprlock}/bin/hyprlock";
ignore_dbus_inhibit = false;
};
listener = {
@@ -297,12 +291,7 @@ in
"$mainMod,D,exec,rofi-launcher"
"$mainMod,P,exec,rofi-rbw"
# hyprlock
"$shiftMainMod,l,exec,${
if cfg.useLockHelper then
"${pkgs.callPackage ../scripts/lockhelper.nix { }}/bin/lockhelper"
else
"${pkgs.hyprlock}/bin/hyprlock"
}"
"$shiftMainMod,l,exec,${pkgs.hyprlock}/bin/hyprlock"
# hyprland
"$mainMod,Q,killactive,"
"CTRLALT,Delete,exit,"

View File

@@ -1,12 +0,0 @@
general {
lock_cmd = hyprlock # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 240 # in seconds
on-timeout = lockhelper # command to run when timeout has passed
}

View File

@@ -1,19 +0,0 @@
general {
lock_cmd = lockhelper # dbus/sysd lock command (loginctl lock-session)
# unlock_cmd = notify-send "unlock!" # same as above, but unlock
before_sleep_cmd = lockhelper # command ran before sleep
# after_sleep_cmd = lockhelper # command ran after sleep
ignore_dbus_inhibit = false # whether to ignore dbus-sent idle-inhibit requests (used by e.g. firefox or steam)
}
listener {
timeout = 240 # in seconds
on-timeout = lockhelper # command to run when timeout has passed
# on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}
listener {
timeout = 900
on-timeout = systemctl suspend # command to run when timeout has passed
# on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired.
}

View File

@@ -1,21 +0,0 @@
{
writeShellApplication,
grim,
jq,
gawk,
hyprland,
hyprlock,
procps,
}:
writeShellApplication {
name = "lockhelper";
runtimeInputs = [
grim
jq
gawk
hyprland
hyprlock
procps
];
text = (builtins.readFile ./lockhelper.sh);
}

View File

@@ -1,21 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail
mkdir -p /tmp/lockscreen || true
monitor_lines=$(hyprctl monitors -j | jq -r '.[] | select (.name | contains ("DP")) | [.name, .description]| @tsv')
while IFS= read -r m; do
name=$(echo "$m" | awk -F $'\t' '{print $1}')
sum=$(echo "$m" | awk -F $'\t' '{printf $2}' | sha256sum | awk '{print substr($1,1,8)}')
grim -o "$name" "/tmp/lockscreen/$sum.png" || true
done <<< "$monitor_lines"
# Only lock if not already running
if [ -z "$(pgrep hyprlock)" ]
then
exec hyprlock
else
echo "Already locked"
fi