From 512f8f902c98fa4f74cab74c1fe4e83e18aad661 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 4 Dec 2023 23:18:53 +0900 Subject: wlogout-styling --- config/hypr/scripts/Wlogout.sh | 46 +++++++++++++++++++++++++++++++----------- config/hypr/v2.1.15 | 5 ----- config/hypr/v2.1.16 | 5 +++++ 3 files changed, 39 insertions(+), 17 deletions(-) delete mode 100644 config/hypr/v2.1.15 create mode 100644 config/hypr/v2.1.16 (limited to 'config/hypr') diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh index c8ce86c1..0cfb0907 100755 --- a/config/hypr/scripts/Wlogout.sh +++ b/config/hypr/scripts/Wlogout.sh @@ -1,19 +1,41 @@ #!/bin/bash -# If you have 1440p, better to use this -#wlogout --protocol layer-shell -b 5 -T 600 -B 600 & +# Check if wlogout is already running +if pgrep -x "wlogout" > /dev/null; then + pkill -x "wlogout" + exit 0 +fi -# for 1080p -wlogout --protocol layer-shell -b 5 -T 450 -B 450 & +# detect monitor res +x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width') +y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height') +hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//') +# Set parameters based on screen resolution +if [[ $x_mon =~ ^[0-9]+$ && $y_mon =~ ^[0-9]+$ && $hypr_scale =~ ^[0-9]+$ ]]; then + resolution=$((y_mon * hypr_scale / 100)) + + echo "Detected Resolution: $resolution" -# Capture the PID of the wlogout process -wlogout_pid=$! + if ((resolution >= 2160)); then + wlogout --protocol layer-shell -b 6 -T 600 -B 700 & + echo "Setting parameters for resolution >= 2160p" + elif ((resolution >= 1440)); then + wlogout --protocol layer-shell -b 6 -T 500 -B 550 & + echo "Setting parameters for resolution >= 1440p" + elif ((resolution >= 1080)); then + wlogout --protocol layer-shell -b 6 -T 400 -B 400 & + echo "Setting parameters for resolution >= 1080p" + elif ((resolution >= 720)); then + wlogout --protocol layer-shell -b 3 -T 50 -B 50 & + echo "Setting parameters for resolution >= 720p" + fi +fi -# Wait for up to 30 seconds for wlogout to exit gracefully -timeout 30s tail --pid $wlogout_pid -f /dev/null +# Give some time for wlogout to start and exit +#sleep 30 -# If wlogout is still running after the timeout, forcefully kill it -if ps -p $wlogout_pid > /dev/null; then - kill -KILL $wlogout_pid -fi +# Check if wlogout is still running after starting +#if pgrep -x "wlogout" > /dev/null; then +# pkill -x "wlogout" +#fi diff --git a/config/hypr/v2.1.15 b/config/hypr/v2.1.15 deleted file mode 100644 index 31b3414d..00000000 --- a/config/hypr/v2.1.15 +++ /dev/null @@ -1,5 +0,0 @@ -### https://github.com/JaKooLit ### -## https://github.com/JaKooLit/Hyprland-Dots -## This is to have a reference of which version would be - -## note that this will always be higher than the released versions \ No newline at end of file diff --git a/config/hypr/v2.1.16 b/config/hypr/v2.1.16 new file mode 100644 index 00000000..31b3414d --- /dev/null +++ b/config/hypr/v2.1.16 @@ -0,0 +1,5 @@ +### https://github.com/JaKooLit ### +## https://github.com/JaKooLit/Hyprland-Dots +## This is to have a reference of which version would be + +## note that this will always be higher than the released versions \ No newline at end of file -- cgit v1.2.3