From e8cee85f7cfac5fc5d7d7546bc7d4902354d711c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 30 Jan 2026 19:41:23 +0100 Subject: [PATCH] hyprland: remove lockhelper, use hyprlock directly --- home/hosts/gunter/default.nix | 1 - home/hyprland/default.nix | 15 ++------------- home/hyprland/hypridle_gunter.conf | 12 ------------ home/hyprland/hypridle_magicman.conf | 19 ------------------- home/scripts/lockhelper.nix | 21 --------------------- home/scripts/lockhelper.sh | 21 --------------------- 6 files changed, 2 insertions(+), 87 deletions(-) delete mode 100644 home/hyprland/hypridle_gunter.conf delete mode 100644 home/hyprland/hypridle_magicman.conf delete mode 100644 home/scripts/lockhelper.nix delete mode 100644 home/scripts/lockhelper.sh diff --git a/home/hosts/gunter/default.nix b/home/hosts/gunter/default.nix index 8da9d85..4a4402c 100644 --- a/home/hosts/gunter/default.nix +++ b/home/hosts/gunter/default.nix @@ -55,7 +55,6 @@ ]; hyprland.enableStreamController = true; - hyprland.useLockHelper = true; hyprland.enableGrimblast = true; hyprland.enableWacom = true; hyprland.cursorNoHardware = true; diff --git a/home/hyprland/default.nix b/home/hyprland/default.nix index 0d769b9..815c71d 100644 --- a/home/hyprland/default.nix +++ b/home/hyprland/default.nix @@ -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," diff --git a/home/hyprland/hypridle_gunter.conf b/home/hyprland/hypridle_gunter.conf deleted file mode 100644 index 346b64e..0000000 --- a/home/hyprland/hypridle_gunter.conf +++ /dev/null @@ -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 -} diff --git a/home/hyprland/hypridle_magicman.conf b/home/hyprland/hypridle_magicman.conf deleted file mode 100644 index 4fe54f6..0000000 --- a/home/hyprland/hypridle_magicman.conf +++ /dev/null @@ -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. -} diff --git a/home/scripts/lockhelper.nix b/home/scripts/lockhelper.nix deleted file mode 100644 index f0c4cf5..0000000 --- a/home/scripts/lockhelper.nix +++ /dev/null @@ -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); -} diff --git a/home/scripts/lockhelper.sh b/home/scripts/lockhelper.sh deleted file mode 100644 index 48573ad..0000000 --- a/home/scripts/lockhelper.sh +++ /dev/null @@ -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