diff options
| author | Ja.KooLit <ejhay.games@gmail.com> | 2023-12-05 22:18:23 +0900 |
|---|---|---|
| committer | Ja.KooLit <ejhay.games@gmail.com> | 2023-12-05 22:18:23 +0900 |
| commit | 1076647509105071740491454c26aa7698a75d32 (patch) | |
| tree | a15db6be5e1fc01c745a35f219752ce38eec2107 /config/hypr/scripts/KeyHints.sh | |
| parent | 7a4ebde4975d78892e5c8f236888721ceca50e53 (diff) | |
updated keyhinds
Diffstat (limited to 'config/hypr/scripts/KeyHints.sh')
| -rwxr-xr-x | config/hypr/scripts/KeyHints.sh | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/config/hypr/scripts/KeyHints.sh b/config/hypr/scripts/KeyHints.sh index b4048dac..6017140a 100755 --- a/config/hypr/scripts/KeyHints.sh +++ b/config/hypr/scripts/KeyHints.sh @@ -1,15 +1,41 @@ #!/bin/bash -yad --width=1300 --height=1000 \ ---center \ ---title="Keybindings" \ ---no-buttons \ ---list \ ---column=Key: \ ---column=Description: \ ---column=Command: \ ---timeout=60 \ ---timeout-indicator=bottom \ +# Detect monitor resolution and scale +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/\.//') + +# Calculate width and height based on percentages and monitor resolution +width=$((x_mon * hypr_scale / 100)) +height=$((y_mon * hypr_scale / 100)) + +# Set maximum width and height +max_width=1200 +max_height=1000 + +# Set percentage of screen size for dynamic adjustment +percentage_width=70 +percentage_height=70 + +# Calculate dynamic width and height +dynamic_width=$((width * percentage_width / 100)) +dynamic_height=$((height * percentage_height / 100)) + +# Limit width and height to maximum values +dynamic_width=$(($dynamic_width > $max_width ? $max_width : $dynamic_width)) +dynamic_height=$(($dynamic_height > $max_height ? $max_height : $dynamic_height)) + +# Launch yad with calculated width and height +yad --width=$dynamic_width --height=$dynamic_height \ + --center \ + --title="Keybindings" \ + --no-buttons \ + --list \ + --column=Key: \ + --column=Description: \ + --column=Command: \ + --timeout=60 \ + --timeout-indicator=bottom \ "ESC" "close this app" "" "=" "SUPER KEY" "(SUPER KEY)" \ " enter" "Terminal" "(kitty)" \ " or D" "App Launcher" "(rofi)" \ |
