aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts
diff options
context:
space:
mode:
authorJaKooLit <ejhay.games@gmail.com>2025-02-21 00:54:22 +0900
committerJaKooLit <ejhay.games@gmail.com>2025-02-21 00:54:22 +0900
commit5dac0fe1ae5a7b26aa3f66858d7e41c0d1cb2d85 (patch)
tree01ef518a5ea7a25fbb7c1620857dfa23aadb7b31 /config/hypr/scripts
parent080904cfa60eae95884d9d5a233078929afb03eb (diff)
the usual tweak.. never ending
Diffstat (limited to 'config/hypr/scripts')
-rwxr-xr-xconfig/hypr/scripts/Wlogout.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh
index 7659008e..1f720b18 100755
--- a/config/hypr/scripts/Wlogout.sh
+++ b/config/hypr/scripts/Wlogout.sh
@@ -19,13 +19,16 @@ fi
# Detect the current monitor's native resolution and scale
monitor_info=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true)')
-# extract some info
+
resolution=$(echo "$monitor_info" | jq -r '.height')
width=$(echo "$monitor_info" | jq -r '.width')
hypr_scale=$(echo "$monitor_info" | jq -r '.scale')
-# If hypr_scale >= 1.25 or resolution can't be detected, run wlogout with -b 3
-if [[ -z "$resolution" || ! "$resolution" =~ ^[0-9]+$ || -z "$hypr_scale" || $(awk "BEGIN {exit !($hypr_scale >= 1.25)}") -eq 1 ]]; then
+# Round hypr_scale to 2 decimal places for accurate comparison
+rounded_scale=$(echo "scale=2; $hypr_scale/1" | bc)
+
+# If resolution or scale is invalid or hypr_scale >= 1.25, run wlogout with -b 3
+if [[ -z "$resolution" || ! "$resolution" =~ ^[0-9]+$ || -z "$hypr_scale" || $(echo "$rounded_scale >= 1.25" | bc) -eq 1 ]]; then
echo "Hypr_scale is greater than or equal to 1.25 or resolution could not be detected, running wlogout with -b 3"
wlogout --protocol layer-shell -b 3 -T 100 -B 100 &
exit 0
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage