aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorJaKooLit <jimmielovejay@gmail.com>2024-05-08 09:51:28 +0900
committerJaKooLit <jimmielovejay@gmail.com>2024-05-08 09:51:28 +0900
commit777b43ff16e642cfbfb1643f977c1de8d0d21050 (patch)
treeb3b269a827d35ce199fd561fac9c01f1561ac9f0 /config
parentb6d5b130202f8d366de3ea43afa5a51aac6ea820 (diff)
Wlogout.sh tweaked
small tweak waybar modules
Diffstat (limited to 'config')
-rwxr-xr-xconfig/hypr/scripts/Wlogout.sh55
-rw-r--r--config/waybar/modules2
2 files changed, 35 insertions, 22 deletions
diff --git a/config/hypr/scripts/Wlogout.sh b/config/hypr/scripts/Wlogout.sh
index 58e1fd68..f3746530 100755
--- a/config/hypr/scripts/Wlogout.sh
+++ b/config/hypr/scripts/Wlogout.sh
@@ -4,12 +4,14 @@
# wlogout (Power, Screen Lock, Suspend, etc)
# Set variables for parameters
-A_2160=680
-B_2160=750
-A_1440=500
-B_1440=550
-A_1080=400
-B_1080=400
+A_2160=450
+B_2160=450
+A_1600=400
+B_1600=400
+A_1440=350
+B_1440=350
+A_1080=50
+B_1080=50
A_720=50
B_720=50
@@ -23,22 +25,33 @@ fi
resolution=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .height / .scale' | awk -F'.' '{print $1}')
hypr_scale=$(hyprctl -j monitors | jq -r '.[] | select(.focused==true) | .scale')
-echo "Detected Resolution: $resolution"
-
# Set parameters based on screen resolution and scaling factor
if ((resolution >= 2160)); then
- wlogout --protocol layer-shell -b 3 -T $(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}") &
- echo "Setting parameters for resolution >= 2160p"
-elif ((resolution >= 1440)); then
- wlogout --protocol layer-shell -b 6 -T $(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}") &
- echo "Setting parameters for resolution >= 1440p"
-elif ((resolution >= 1080)); then
- wlogout --protocol layer-shell -b 6 -T $(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}") &
- echo "Setting parameters for resolution >= 1080p"
-elif ((resolution > 720)); then
- wlogout --protocol layer-shell -b 3 -T $(awk "BEGIN {printf \"%.0f\", $A_720 * 720 * $hypr_scale / $resolution}") -B $(awk "BEGIN {printf \"%.0f\", $B_720 * 720 * $hypr_scale / $resolution}") &
- echo "Setting parameters for resolution >= 720p"
+ T_val=$(awk "BEGIN {printf \"%.0f\", $A_2160 * 2160 * $hypr_scale / $resolution}")
+ B_val=$(awk "BEGIN {printf \"%.0f\", $B_2160 * 2160 * $hypr_scale / $resolution}")
+ echo "Setting parameters for resolution >= 4k"
+ wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
+elif ((resolution >= 1600 && resolution < 2160)); then
+ T_val=$(awk "BEGIN {printf \"%.0f\", $A_1600 * 1600 * $hypr_scale / $resolution}")
+ B_val=$(awk "BEGIN {printf \"%.0f\", $B_1600 * 1600 * $hypr_scale / $resolution}")
+ echo "Setting parameters for resolution >= 2.5k and < 4k"
+ wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
+elif ((resolution >= 1440 && resolution < 1600)); then
+ T_val=$(awk "BEGIN {printf \"%.0f\", $A_1440 * 1440 * $hypr_scale / $resolution}")
+ B_val=$(awk "BEGIN {printf \"%.0f\", $B_1440 * 1440 * $hypr_scale / $resolution}")
+ echo "Setting parameters for resolution >= 2k and < 2.5k"
+ wlogout --protocol layer-shell -b 6 -T $T_val -B $B_val &
+elif ((resolution >= 1080 && resolution < 1440)); then
+ T_val=$(awk "BEGIN {printf \"%.0f\", $A_1080 * 1080 * $hypr_scale / $resolution}")
+ B_val=$(awk "BEGIN {printf \"%.0f\", $B_1080 * 1080 * $hypr_scale / $resolution}")
+ echo "Setting parameters for resolution >= 1080p and < 2k"
+ wlogout --protocol layer-shell -b 3 -T $T_val -B $B_val &
+elif ((resolution >= 720 && resolution < 1080)); then
+ T_val=$(awk "BEGIN {printf \"%.0f\", $A_720 * 720 * $hypr_scale / $resolution}")
+ B_val=$(awk "BEGIN {printf \"%.0f\", $B_720 * 720 * $hypr_scale / $resolution}")
+ echo "Setting parameters for resolution >= 720p and < 1080p"
+ wlogout --protocol layer-shell -b 3 -T $T_val -B $B_val &
else
+ echo "Setting default parameters"
wlogout &
- echo "Setting default parameters for resolution <= 720p"
-fi \ No newline at end of file
+fi
diff --git a/config/waybar/modules b/config/waybar/modules
index f42f89d0..a2357e20 100644
--- a/config/waybar/modules
+++ b/config/waybar/modules
@@ -192,7 +192,7 @@
"critical": 15
},
"format": "{icon} {capacity}%",
- "format-charging": "{capacity}%",
+ "format-charging": " {capacity}%",
"format-plugged": "󱘖 {capacity}%",
"format-alt-click": "click",
"format-full": "{icon} Full",
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage