aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorJa.KooLit <jimmielovejay@gmail.com>2023-12-04 00:07:48 +0900
committerGitHub <noreply@github.com>2023-12-04 00:07:48 +0900
commit2976d18143362fc76cabcb6275f145f517a45906 (patch)
tree74fd8b33e0029261fc19f3259c16c98c8260135a /config/hypr/scripts
parenta7847d0de3b53b84f39664f7dc6c3416213c762e (diff)
parent2ad7d3373353bc2440892f9bed9295066f93b4ae (diff)
Merge pull request #49 from JaKooLit/v2.1.15
return of wlogout. rofi-power is just pain 2 theme
Diffstat (limited to 'config/hypr/scripts')
-rwxr-xr-xconfig/hypr/scripts/RofiPower.sh63
-rwxr-xr-xconfig/hypr/scripts/Wlogout.sh19
2 files changed, 19 insertions, 63 deletions
diff --git a/config/hypr/scripts/RofiPower.sh b/config/hypr/scripts/RofiPower.sh
deleted file mode 100755
index c4202f97..00000000
--- a/config/hypr/scripts/RofiPower.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/bash
-
-#### By default will not show the keyboard shortcuts as it looks Hideous :)
-
-SwayLock=$HOME/.config/hypr/scripts/LockScreen.sh
-
-# CMDs
-uptime_info=$(uptime -p | sed -e 's/up //g')
-host=$(hostnamectl hostname)
-
-# Options with Icons and Text
-options=("Lock" "Suspend" "Logout" "Reboot" "Shutdown" "Hibernate")
-icons=("" "" "󰿅" "󱄌" "" "󰒲")
-
-# Rofi CMD
-rofi_cmd() {
- options_with_icons=()
- for ((i = 0; i < ${#options[@]}; i++)); do
- options_with_icons+=("${icons[$i]} ${options[$i]}")
- done
-
- chosen_option=$(printf "%s\n" "${options_with_icons[@]}" | \
- rofi -dmenu -i -p " $USER@$host" -mesg " Uptime: $uptime_info" \
- -kb-select-1 "l" \
- -kb-select-2 "u" \
- -kb-select-3 "e" \
- -kb-select-4 "r" \
- -kb-select-5 "s" \
- -kb-select-6 "h" \
- -theme ~/.config/rofi/config-powermenu.rasi | awk '{print $1}')
- echo "$chosen_option"
-}
-
-# Execute Command
-run_cmd() {
- case $1 in
- "")
- $SwayLock &
- ;;
- "")
- systemctl suspend
- ;;
- "󰿅")
- hyprctl dispatch exit 0
- ;;
- "󱄌")
- systemctl reboot
- ;;
- "")
- systemctl poweroff
- ;;
- "󰒲")
- systemctl hibernate
- ;;
- *)
- echo "choose: $1"
- ;;
- esac
-}
-
-# Actions
-chosen_option=$(rofi_cmd)
-run_cmd "${chosen_option% *}"
diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh
new file mode 100755
index 00000000..c8ce86c1
--- /dev/null
+++ b/config/hypr/scripts/Wlogout.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# If you have 1440p, better to use this
+#wlogout --protocol layer-shell -b 5 -T 600 -B 600 &
+
+# for 1080p
+wlogout --protocol layer-shell -b 5 -T 450 -B 450 &
+
+
+# Capture the PID of the wlogout process
+wlogout_pid=$!
+
+# Wait for up to 30 seconds for wlogout to exit gracefully
+timeout 30s tail --pid $wlogout_pid -f /dev/null
+
+# If wlogout is still running after the timeout, forcefully kill it
+if ps -p $wlogout_pid > /dev/null; then
+ kill -KILL $wlogout_pid
+fi
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage