From ae94b7c449606bcd324a4d196782d2f342664d26 Mon Sep 17 00:00:00 2001 From: Hannes Date: Sat, 22 Aug 2026 21:53:57 +0200 Subject: [PATCH] changes with hypridle --- .gitignore | 4 +++- Readme.md | 3 +++ config/theme.lua | 2 ++ hypridle.conf | 22 ++++++++-------------- install.sh | 10 ++++++++++ scripts/hypridle/screen_off.sh.example | 3 +++ scripts/hypridle/screen_on.sh.example | 3 +++ scripts/hyprlock/uptime.sh | 2 +- 8 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 Readme.md create mode 100755 scripts/hypridle/screen_off.sh.example create mode 100755 scripts/hypridle/screen_on.sh.example diff --git a/.gitignore b/.gitignore index 75a8c97..7d9a63f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ hyprlock.conf hyprpaper.conf scripts/autostart/workspace -config/color.lua \ No newline at end of file +config/color.lua +scripts/hypridle/screen_off.sh +scripts/hypridle/screen_on.sh \ No newline at end of file diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..66bea73 --- /dev/null +++ b/Readme.md @@ -0,0 +1,3 @@ +# Readme of the repository +## If hypridle screen turning off breaks +Remove scripts/hypridle/screen_off.sh and scripts/hypridle/screen_on.sh \ No newline at end of file diff --git a/config/theme.lua b/config/theme.lua index 748b553..33f2241 100644 --- a/config/theme.lua +++ b/config/theme.lua @@ -135,6 +135,8 @@ hl.config({ background_color = 0x000000, on_focus_under_fullscreen = 0, middle_click_paste = false, + key_press_enables_dpms = true, + mouse_move_enables_dpms = true } }) diff --git a/hypridle.conf b/hypridle.conf index 5cce6c4..4ec36cf 100755 --- a/hypridle.conf +++ b/hypridle.conf @@ -1,22 +1,16 @@ +listener { + timeout = 200 + on-timeout = notify-send "You are idle!" + on-resume = notify-send "Welcome back!" +} + listener { timeout = 300 on-timeout = hyprlock } -# listener { -# timeout = 360 -# on-timeout = bash -c 'for o in $(hyprctl monitors -j | jq -r ".[].name"); do wlopm --off "$o"; done' -# on-resume = bash -c 'for o in $(hyprctl monitors -j | jq -r ".[].name"); do wlopm --on "$o"; done' -# } - listener { timeout = 360 - on-timeout = hyprctl dispatch "hl.dsp.dpms({action = 'off'})" - on-resume = hyprctl dispatch "hl.dsp.dpms({action = 'on'})" -} - -listener { - timeout = 250 # in seconds. - on-timeout = notify-send "You are idle!" # command to run when timeout has passed. - on-resume = notify-send "Welcome back!" # command to run when activity is detected after timeout has fired. + on-timeout = $XDG_CONFIG_HOME/hypr/scripts/screen_off.sh + on-resume = $XDG_CONFIG_HOME/hypr/scripts/screen_on.sh } \ No newline at end of file diff --git a/install.sh b/install.sh index 6da68b0..5f8af9d 100755 --- a/install.sh +++ b/install.sh @@ -95,6 +95,16 @@ mkdir -p "$SCRIPT_DIR/scripts/autostart" ok "color config created" } +[[ ! -f "$SCRIPT_DIR/config/color.lua" ]] && { + cp "$SCRIPT_DIR/examples/color.lua.example" "$SCRIPT_DIR/config/color.lua" + ok "color config created" +} + +[[ ! -f "$SCRIPT_DIR/config/color.lua" ]] && { + cp "$SCRIPT_DIR/examples/color.lua.example" "$SCRIPT_DIR/config/color.lua" + ok "color config created" +} + # ---------------------------- # Install # ---------------------------- diff --git a/scripts/hypridle/screen_off.sh.example b/scripts/hypridle/screen_off.sh.example new file mode 100755 index 0000000..7195ed7 --- /dev/null +++ b/scripts/hypridle/screen_off.sh.example @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +hyprctl dispatch "hl.dsp.dpms({action = 'off'})" +# alternative: wlopm --off '*' \ No newline at end of file diff --git a/scripts/hypridle/screen_on.sh.example b/scripts/hypridle/screen_on.sh.example new file mode 100755 index 0000000..6ea9ad6 --- /dev/null +++ b/scripts/hypridle/screen_on.sh.example @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +hyprctl dispatch "hl.dsp.dpms({action = 'on'})" +# alternative: wlopm --on '*' \ No newline at end of file diff --git a/scripts/hyprlock/uptime.sh b/scripts/hyprlock/uptime.sh index 6c19a54..cde742d 100755 --- a/scripts/hyprlock/uptime.sh +++ b/scripts/hyprlock/uptime.sh @@ -2,4 +2,4 @@ s=$(cut -d. -f1 /proc/uptime) h=$((s / 3600)) m=$(((s % 3600) / 60)) -printf "%02d:%02dh" "$h" "$m" \ No newline at end of file +printf "󱦟 %02d:%02dh" "$h" "$m" \ No newline at end of file