aboutsummaryrefslogtreecommitdiff
path: root/.config/eww/scripts
diff options
context:
space:
mode:
Diffstat (limited to '.config/eww/scripts')
-rwxr-xr-x.config/eww/scripts/idleinhibit.sh22
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