Unix3r

Build. Break. Learn. Repeat.

Starting0%
Skip to content

unix3r/dotfiles

Public
main
U Unix3r Initial commit: sway + waybar dotfiles (Catppuccin Mocha) eb290df
19 lines · 716 B Raw History
1#!/usr/bin/env bash
2# keybinds.sh — searchable cheat sheet built from the "#:" comments
3# in ~/.config/sway/config.d/*.conf
4source "$(dirname "$0")/_lib.sh"
5conf_dir="$HOME/.config/sway/config.d"
6
7awk '
8 /^[[:space:]]*#:/ { sub(/^[[:space:]]*#:[[:space:]]*/, ""); desc=$0; next }
9 /^[[:space:]]*bindsym/ && desc != "" {
10 key=$2; if (key ~ /^--/) key=$3
11 gsub(/\$mod/, "Super", key); gsub(/\$alt/, "Alt", key)
12 gsub(/\$left/, "h", key); gsub(/\$down/, "j", key)
13 gsub(/\$up/, "k", key); gsub(/\$right/, "l", key)
14 printf "%-26s %s\n", key, desc
15 desc=""; next
16 }
17 { desc="" }
18' "$conf_dir"/*.conf \
19 | menu "Keybindings" --width 720 --height 560 >/dev/null