Added alejandra input (for now) Reformatted all NIX files On branch main Your branch is up to date with 'origin/main'. Changes to be committed: modified: flake.lock modified: flake.nix modified: hosts/default/default.nix modified: hosts/default/hardware.nix modified: hosts/nixstation/default.nix modified: hosts/nixstation/hardware.nix modified: hosts/nixstation/host-packages.nix modified: hosts/zaneyos-24-vm/default.nix modified: hosts/zaneyos-24-vm/hardware.nix modified: hosts/zaneyos-oem/default.nix modified: hosts/zaneyos-oem/hardware.nix modified: modules/core/boot.nix modified: modules/core/cachix.nix modified: modules/core/default.nix modified: modules/core/flatpak.nix modified: modules/core/fonts.nix modified: modules/core/greetd.nix modified: modules/core/hardware.nix modified: modules/core/network.nix modified: modules/core/nfs.nix modified: modules/core/nh.nix modified: modules/core/overlays.nix modified: modules/core/printing.nix modified: modules/core/quickshell.nix modified: modules/core/sddm.nix modified: modules/core/services.nix modified: modules/core/starfish.nix modified: modules/core/steam.nix modified: modules/core/stylix.nix modified: modules/core/syncthing.nix modified: modules/core/thunar.nix modified: modules/core/user.nix modified: modules/core/virtualisation.nix modified: modules/core/xserver.nix modified: modules/drivers/amd-drivers.nix modified: modules/drivers/default.nix modified: modules/drivers/intel-drivers.nix modified: modules/drivers/local-hardware-clock.nix modified: modules/drivers/nvidia-amd-hybrid.nix modified: modules/drivers/nvidia-drivers.nix modified: modules/drivers/nvidia-prime-drivers.nix modified: modules/drivers/vm-guest-services.nix modified: modules/home/bash.nix modified: modules/home/bashrc-personal.nix modified: modules/home/cli/bat.nix modified: modules/home/cli/bottom.nix modified: modules/home/cli/btop.nix modified: modules/home/cli/cava.nix modified: modules/home/cli/fzf.nix modified: modules/home/cli/gh.nix modified: modules/home/cli/git.nix modified: modules/home/cli/htop.nix modified: modules/home/cli/lazygit.nix modified: modules/home/editors/antigravity.nix modified: modules/home/editors/doom-emacs-install.nix modified: modules/home/editors/doom-emacs.nix modified: modules/home/editors/evil-helix.nix modified: modules/home/editors/nvf.nix modified: modules/home/emoji.nix modified: modules/home/gtk.nix modified: modules/home/hyprland/animations-def.nix modified: modules/home/hyprland/animations-dynamic.nix modified: modules/home/hyprland/animations-end4.nix modified: modules/home/hyprland/animations-moving.nix modified: modules/home/hyprland/default.nix modified: modules/home/hyprland/env.nix modified: modules/home/hyprland/hypridle.nix modified: modules/home/hyprland/hyprland.nix modified: modules/home/hyprland/hyprlock.nix modified: modules/home/hyprland/pyprland.nix modified: modules/home/noctalia.nix modified: modules/home/obs-studio.nix modified: modules/home/overview.nix modified: modules/home/qt.nix modified: modules/home/rofi/config-long.nix modified: modules/home/rofi/default.nix modified: modules/home/rofi/rofi.nix modified: modules/home/scripts/default.nix modified: modules/home/scripts/emopicker9000.nix modified: modules/home/scripts/gemini-cli.nix modified: modules/home/scripts/hm-find.nix modified: modules/home/scripts/keybinds.nix modified: modules/home/scripts/note-from-clipboard.nix modified: modules/home/scripts/note.nix modified: modules/home/scripts/nvidia-offload.nix modified: modules/home/scripts/rofi-launcher.nix modified: modules/home/scripts/screenshootin.nix modified: modules/home/scripts/squirtle.nix modified: modules/home/scripts/task-waybar.nix modified: modules/home/scripts/wallsetter.nix modified: modules/home/scripts/web-search.nix modified: modules/home/scripts/zcli.nix modified: modules/home/starship-ddubs-1.nix modified: modules/home/starship.nix modified: modules/home/swappy.nix modified: modules/home/swaync.nix modified: modules/home/tealdeer.nix modified: modules/home/terminals/ghostty.nix modified: modules/home/terminals/kitty.nix modified: modules/home/terminals/wezterm.nix modified: modules/home/virtmanager.nix modified: modules/home/waybar/waybar-curved.nix modified: modules/home/waybar/waybar-ddubs-2.nix modified: modules/home/waybar/waybar-ddubs.nix modified: modules/home/waybar/waybar-dwm-2.nix modified: modules/home/waybar/waybar-jerry.nix modified: modules/home/waybar/waybar-nekodyke.nix modified: modules/home/waybar/waybar-simple.nix modified: modules/home/wlogout/default.nix modified: modules/home/xdg.nix modified: modules/home/yazi/default.nix modified: modules/home/yazi/keymap.nix modified: modules/home/yazi/theme.nix modified: modules/home/yazi/yazi.nix modified: modules/home/zoxide.nix modified: modules/home/zsh/default.nix modified: modules/home/zsh/zshrc-personal.nix modified: profiles/amd-hybrid/default.nix modified: profiles/amd/default.nix modified: profiles/intel/default.nix modified: profiles/nvidia-laptop/default.nix modified: profiles/nvidia/default.nix modified: profiles/vm/default.nix
67 lines
2 KiB
Nix
67 lines
2 KiB
Nix
{pkgs}:
|
||
pkgs.writeShellScriptBin "list-keybinds" ''
|
||
# check if rofi is already running
|
||
if pidof rofi > /dev/null; then
|
||
pkill rofi
|
||
fi
|
||
|
||
msg='☣️ NOTE ☣️: Clicking with Mouse or Pressing ENTER will have NO function'
|
||
|
||
# Parse keybind entries from the Nix config and format for rofi display
|
||
BIND_NIX="$HOME/zaneyos/modules/home/hyprland/binds.nix"
|
||
if [[ -f "$BIND_NIX" ]]; then
|
||
display_keybinds=$(
|
||
${pkgs.gawk}/bin/awk '
|
||
# Track when we enter any keybind array
|
||
/noctaliaBind/ { in_block = 1; next }
|
||
/rofiBind/ { in_block = 1; next }
|
||
/bindd[ ]*=/ && /\[/ { in_block = 1; next }
|
||
|
||
in_block {
|
||
# Check for end of array
|
||
if (/^[ ]*\]/) {
|
||
in_block = 0
|
||
next
|
||
}
|
||
|
||
# Extract quoted string from line
|
||
if (match($0, /"([^"]+)"/, arr)) {
|
||
line = arr[1]
|
||
|
||
# Split by comma to get: mods, key, desc, action, params
|
||
n = split(line, parts, ",")
|
||
if (n >= 3) {
|
||
# Extract and trim each part
|
||
mods = parts[1]
|
||
key = parts[2]
|
||
desc = parts[3]
|
||
|
||
gsub(/^[ \t]+|[ \t]+$/, "", mods)
|
||
gsub(/^[ \t]+|[ \t]+$/, "", key)
|
||
gsub(/^[ \t]+|[ \t]+$/, "", desc)
|
||
|
||
# Build display keybind
|
||
if (mods != "" && key != "") {
|
||
display = mods " + " key
|
||
gsub(/\$modifier/, "SUPER", display)
|
||
gsub(/ +/, " ", display)
|
||
|
||
# Output: "KEYBIND: Description"
|
||
if (desc != "") {
|
||
printf "%s: %s\n", display, desc
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
' "$BIND_NIX"
|
||
)
|
||
else
|
||
# Fallback: Show error message
|
||
display_keybinds="Error: Keybinds file not found at $BIND_NIX"
|
||
fi
|
||
|
||
# use rofi to display the keybinds with the modified content
|
||
echo "$display_keybinds" | rofi -dmenu -i -config ~/.config/rofi/config-long.rasi -mesg "$msg"
|
||
|
||
''
|