feat(binds): add view keybinds script

This commit is contained in:
2026-07-23 20:13:31 +01:00
parent 84f51e8365
commit 0513ab1abb
4 changed files with 25 additions and 6 deletions

View File

@@ -33,7 +33,6 @@ hl.on("hyprland.start", function()
hl.exec_cmd("/usr/lib/xdg-desktop-portal-hyprland &") hl.exec_cmd("/usr/lib/xdg-desktop-portal-hyprland &")
hl.exec_cmd("/usr/lib/xdg-desktop-portal &") hl.exec_cmd("/usr/lib/xdg-desktop-portal &")
hl.exec_cmd("hyprpaper") hl.exec_cmd("hyprpaper")
hl.exec_cmd("hypridle")
hl.exec_cmd("nextcloud") hl.exec_cmd("nextcloud")
hl.exec_cmd("waybar") hl.exec_cmd("waybar")
hl.exec_cmd("hyprctl setcursor breeze 24") hl.exec_cmd("hyprctl setcursor breeze 24")

View File

@@ -0,0 +1,4 @@
ipc = on
preload = /home/dylan/.wallpapers/monochrome.png
wallpaper = ,/home/dylan/.wallpapers/monochrome.png
splash = false

View File

@@ -70,8 +70,5 @@ hl.bind("ALT" .. " + " .. "TAB", hl.dsp.window.cycle_next(), { description = "Cy
hl.bind("SUPER" .. " + " .. "F", hl.dsp.exec_cmd(fileManager), { description = "File manager" }) hl.bind("SUPER" .. " + " .. "F", hl.dsp.exec_cmd(fileManager), { description = "File manager" })
hl.bind("SUPER" .. " + " .. "D", hl.dsp.exec_cmd(menu), { description = "App launcher" }) hl.bind("SUPER" .. " + " .. "D", hl.dsp.exec_cmd(menu), { description = "App launcher" })
hl.bind("SUPER" .. " + " .. "B", hl.dsp.exec_cmd(browser), { description = "Browser" }) hl.bind("SUPER" .. " + " .. "B", hl.dsp.exec_cmd(browser), { description = "Browser" })
hl.bind( hl.bind("SUPER + SHIFT + S", hl.dsp.exec_cmd('grim -g "$(slurp -d)" - | wl-copy'), { description = "Screenshot region to clipboard" })
"SUPER + SHIFT + S", hl.bind(mainMod .. " + slash", hl.dsp.exec_cmd(os.getenv("HOME") .. "/.config/hypr/scripts/show-binds.sh"), { description = "Show keybind cheat sheet" })
hl.dsp.exec_cmd('grim -g "$(slurp -d)" - | wl-copy'),
{ description = "Screenshot region to clipboard" }
)

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
hyprctl -j binds | jq -r '
def mods(m):
[ if m >= 64 then "SUPER" else empty end,
if (m % 16) >= 8 then "ALT" else empty end,
if (m % 8) >= 4 then "CTRL" else empty end,
if (m % 2) >= 1 then "SHIFT" else empty end ] | join("+");
[ .[] | select(.has_description)
| { k: "\(if .modmask > 0 then mods(.modmask) + "+" else "" end)\(.key)",
d: .description } ]
| sort_by(.k)
| (map(.k | length) | max) as $w
| .[] | "\(.k + (" " * ($w - (.k | length)))) \(.d)"
' | pr -2 -t -w 160 \
| yad --text-info \
--title="Hyprland Keybinds" \
--width=1250 --height=560 --center \
--fontname="monospace 10" \
--no-buttons --wrap=false