diff options
author | Justine Smithies <justine@smithies.me.uk> | 2024-12-16 18:44:24 +0000 |
---|---|---|
committer | Justine Smithies <justine@smithies.me.uk> | 2024-12-16 18:44:24 +0000 |
commit | 70e01478b0f62bbf11ead24ad7b64ce1978c1ea1 (patch) | |
tree | 34073b3a061a8402e1eef8d1c196625af5e607a3 | |
parent | 750258b09c9ab3e53e432cd3be4cec5a716608d4 (diff) |
Converted idleinhibit.sh from bash to sh.
-rwxr-xr-x | .config/eww/scripts/idleinhibit.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/.config/eww/scripts/idleinhibit.sh b/.config/eww/scripts/idleinhibit.sh index f31fb89..b1e5d63 100755 --- a/.config/eww/scripts/idleinhibit.sh +++ b/.config/eww/scripts/idleinhibit.sh @@ -1,20 +1,20 @@ -#!/usr/bin/env bash +#!/bin/sh # Swayidle toggle -function toggle { +toggle() { if pgrep "swayidle" > /dev/null then pkill swayidle notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Inactive" -else - read -r wallpaper<~/.cache/wallpaper - export wallpaper=$( echo $wallpaper) - swayidle -w \ - timeout 300 'swaylock -f -i $wallpaper' \ - timeout 600 'wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*' \ - before-sleep 'swaylock -f -i $wallpaper' & - notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Active" -fi + else + read -r wallpaper<~/.cache/wallpaper + export wallpaper="$($wallpaper)" + swayidle -w \ + timeout 300 "swaylock -f -i $wallpaper" \ + timeout 600 "wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*" \ + before-sleep "swaylock -f -i $wallpaper" & + notify-send --hint=string:x-canonical-private-synchronous:idleinhibit -u normal " Swayidle Active" + fi } case $1 in |