Add Super + Ctrl + Backspace to toggle resolution between 1-2-3x

This commit is contained in:
David Heinemeier Hansson
2026-02-17 17:55:19 +01:00
parent 6ef727ab0b
commit f6719b1784
2 changed files with 24 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
# Get the current scale from the first monitor
CURRENT_SCALE=$(hyprctl monitors -j | jq -r '.[0].scale')
# Define the scaling cycle based on current scale
# Cycles through 1.00 → 2.00 → 3.13 → 1.00
case "$CURRENT_SCALE" in
1.00) NEW_SCALE="2" ;;
2.00) NEW_SCALE="3.13" ;;
3.13) NEW_SCALE="1" ;;
*) NEW_SCALE="2" ;;
esac
# Apply the new scale to all monitors
hyprctl monitors -j | jq -r '.[].name' | while read -r monitor; do
hyprctl keyword monitor "$monitor,preferred,auto,$NEW_SCALE"
done
# Notify the user
notify-send "󰍹 Display scaling set to ${NEW_SCALE}x"