changed to setup script to /etc/skel
This commit is contained in:
39
arch_check/.config/hypr/scripts/hypridle.sh
Executable file
39
arch_check/.config/hypr/scripts/hypridle.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# __ __ _ ____
|
||||
# / // /_ _____ ____(_)__/ / /__
|
||||
# / _ / // / _ \/ __/ / _ / / -_)
|
||||
# /_//_/\_, / .__/_/ /_/\_,_/_/\__/
|
||||
# /___/_/
|
||||
#
|
||||
|
||||
SERVICE="hypridle"
|
||||
|
||||
print_status() {
|
||||
if pgrep -x "$SERVICE" >/dev/null ; then
|
||||
echo '{"text": "RUNNING", "class": "active", "tooltip": "Screen locking active\nLeft: Deactivate\nRight: Lock Screen"}'
|
||||
else
|
||||
echo '{"text": "NOT RUNNING", "class": "notactive", "tooltip": "Screen locking deactivated\nLeft: Activate\nRight: Lock Screen"}'
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
status)
|
||||
# Add a tiny delay to avoid race condition on startup
|
||||
sleep 0.2
|
||||
print_status
|
||||
;;
|
||||
toggle)
|
||||
if pgrep -x "$SERVICE" >/dev/null ; then
|
||||
killall "$SERVICE"
|
||||
else
|
||||
"$SERVICE" &
|
||||
fi
|
||||
# Give it a moment to start/stop before checking again
|
||||
sleep 0.2
|
||||
print_status
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {status|toggle}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user