dotfiles

My PC Dotfiles & Website
commit 6311d89bdeb8133868034d0319bea0b42209702e
parent aeb5386bc81504da9e35bf3d6bb7dcc7a6db54c6
Author: maydayv7 <maydayv7@gmail.com>
Date:   Fri, 24 May 2024 21:01:47 +0530

fix(Hyprland): Screen Locking

/* Take 6 */
I KNOW... BUT HEAR ME OUT, NOW IT ACTUALLY WORKS /s

Diffstat:

3 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/modules/gui/desktop/hyprland/apps/security.nix b/modules/gui/desktop/hyprland/apps/security.nix @@ -33,16 +33,15 @@ in { systemdTarget = "hyprland-session.target"; events = let - toggle = "${getExe pkgs.custom.hyprutils} toggle media"; - lock = command: "sh -c 'if ! ${getExe' pkgs.procps "pgrep"} -x swaylock; then ${command}; fi'"; + lock = pre: post: "sh -c 'if ! ${getExe' pkgs.procps "pgrep"} -x swaylock; then ${pre}; ${getExe locker} -f ${post}; fi'"; in [ { event = "before-sleep"; - command = lock "${getExe locker} -f"; + command = lock "" ""; } { event = "lock"; - command = lock "${toggle}; ${getExe locker} --grace 10; ${toggle}"; + command = lock "${getExe pkgs.playerctl} pause -a" "--grace 10"; } ]; diff --git a/scripts/commands.sh b/scripts/commands.sh @@ -5,10 +5,7 @@ temp(){ TEMP=/tmp/"$1" - if [ -z "$2" ] - then - rm -rf "$TEMP" - fi + rm -rf "$TEMP" mkdir -p "$TEMP" } diff --git a/scripts/hyprutils.nix b/scripts/hyprutils.nix @@ -21,7 +21,6 @@ fancy - Toggle Compositor Effects float - Toggle window floating in current workspace idle - Toggle Idle Daemon service - media - Persist and toggle audio playing state monitor - Toggle specified Monitor panel - Toggle top Panel shader - Toggle Compositor Shader @@ -71,8 +70,6 @@ in text = '' set +eu ${files.scripts.commands} - temp hyprutils preserve - show_album_art=true show_music_in_volume_indicator=true @@ -273,20 +270,6 @@ in notify idle -i "system-lock-screen" "Started Idle Daemon" fi ;; - "media") - FILE="$TEMP/toggle_media" - if test -f "$FILE" - then - rm "$FILE" - playerctl play - exit 0 - fi - if playerctl status | grep Playing - then - touch "$FILE" - playerctl pause -a - fi - ;; "monitor") if hyprctl monitors | grep "$3" then