|
| 1 | +#!/bin/bash |
| 2 | +## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
| 3 | +# Keyhints. Idea got from Garuda Hyprland |
| 4 | + |
| 5 | +# Detect monitor resolution and scale |
| 6 | +x_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .width') |
| 7 | +y_mon=$(hyprctl -j monitors | jq '.[] | select(.focused==true) | .height') |
| 8 | +hypr_scale=$(hyprctl -j monitors | jq '.[] | select (.focused == true) | .scale' | sed 's/\.//') |
| 9 | + |
| 10 | +# Calculate width and height based on percentages and monitor resolution |
| 11 | +width=$((x_mon * hypr_scale / 100)) |
| 12 | +height=$((y_mon * hypr_scale / 100)) |
| 13 | + |
| 14 | +# Set maximum width and height |
| 15 | +max_width=1200 |
| 16 | +max_height=1000 |
| 17 | + |
| 18 | +# Set percentage of screen size for dynamic adjustment |
| 19 | +percentage_width=70 |
| 20 | +percentage_height=70 |
| 21 | + |
| 22 | +# Calculate dynamic width and height |
| 23 | +dynamic_width=$((width * percentage_width / 100)) |
| 24 | +dynamic_height=$((height * percentage_height / 100)) |
| 25 | + |
| 26 | +# Limit width and height to maximum values |
| 27 | +dynamic_width=$(($dynamic_width > $max_width ? $max_width : $dynamic_width)) |
| 28 | +dynamic_height=$(($dynamic_height > $max_height ? $max_height : $dynamic_height)) |
| 29 | + |
| 30 | +# Launch yad with calculated width and height |
| 31 | +yad --width=$dynamic_width --height=$dynamic_height \ |
| 32 | + --center \ |
| 33 | + --title="Keybindings" \ |
| 34 | + --no-buttons \ |
| 35 | + --list \ |
| 36 | + --column=Key: \ |
| 37 | + --column=Description: \ |
| 38 | + --column=Command: \ |
| 39 | + --timeout-indicator=bottom \ |
| 40 | +"ESC" "close this app" "" "=" "SUPER KEY (Windows Key)" "(SUPER KEY)" \ |
| 41 | +" enter" "Terminal" "(alacritty)" \ |
| 42 | +" or D" "App Launcher" "(AGS)" \ |
| 43 | +" T" "Open File Manager" "(Nautilus)" \ |
| 44 | +" Q" "close active window" "(not kill)" \ |
| 45 | +" Shift Q " "closes a specified window" "(window)" \ |
| 46 | +" Alt V" "Clipboard Manager" "(cliphist)" \ |
| 47 | +" ALT R" "Reload Hyprland" "CHECK NOTIFICATION FIRST!!!" \ |
| 48 | +" Print" "screenshot" "(grim)" \ |
| 49 | +" Shift Print" "screenshot region" "(grim + slurp)" \ |
| 50 | +" Shift S" "screenshot region" "(swappy)" \ |
| 51 | +"ALT Print" "Screenshot active window" "active window only" \ |
| 52 | +"CTRL ALT P" "power-menu" "(AGS)" \ |
| 53 | +"CTRL ALT L" "screen lock" "(Hyprlock)" \ |
| 54 | +"CTRL ALT Del" "Hyprland Exit" "(SAVE YOUR WORK!!!)" \ |
| 55 | +" F" "Fullscreen" "Toggles to full screen" \ |
| 56 | +" ALT L" "Toggle Dwindle | Master Layout" "Hyprland Layout" \ |
| 57 | +" Shift F" "Toggle float" "single window" \ |
| 58 | +" ALT F" "Toggle all windows to float" "all windows" \ |
| 59 | +" Shift B" "Toggle Blur" "normal or less blur" \ |
| 60 | +" SHIFT G" "Gamemode! All animations OFF or ON" "toggle" \ |
| 61 | +" H" "Launch this app" "" \ |
| 62 | +" E" "View or EDIT Keybinds, Settings, Monitor" "" \ |
| 63 | +"" "" "" \ |
| 64 | +"More tips:" "https://github.com/JaKooLit/Hyprland-Dots/wiki" ""\ |
| 65 | + |
| 66 | + |
| 67 | + |
0 commit comments