diff --git a/bin/omarchy-show-keybindings b/bin/omarchy-show-keybindings new file mode 100755 index 0000000..dec04a0 --- /dev/null +++ b/bin/omarchy-show-keybindings @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# A script to display Hyprland keybindings defined in your configuration +# using wofi for an interactive search menu. +USER_HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" + +# Process the configuration file to extract and format keybindings +# Updated to handle both "bind =" and "bind=" formats from Home Manager +grep -h '^[[:space:]]*bind' "$USER_HYPRLAND_CONF" | + awk -F, ' +{ + # Strip trailing comments + sub(/#.*/, ""); + + # Handle both "bind =" and "bind=" formats + # Remove the "bind[el]?[m]?=" part and surrounding whitespace + sub(/^[[:space:]]*bind[elm]*[[:space:]]*=[[:space:]]*/, "", $1); + + # Combine the modifier and key (first two fields) + key_combo = $1 " + " $2; + + # Clean up: strip leading/trailing spaces and normalize + gsub(/^[ \t]+|[ \t]+$/, "", key_combo); + gsub(/[ \t]+/, " ", key_combo); + + # Reconstruct the command from the remaining fields + action = ""; + for (i = 3; i <= NF; i++) { + action = action $i (i < NF ? "," : ""); + } + + # Clean up action: remove "exec, " prefix and trim + sub(/^[[:space:]]*exec[[:space:]]*,?[[:space:]]*/, "", action); + gsub(/^[ \t]+|[ \t]+$/, "", action); + + # Only print if we have both key combo and action + if (key_combo != "" && action != "") { + printf "%-35s → %s\n", key_combo, action; + } +}' | +flock --nonblock /tmp/.wofi.lock -c "wofi -dmenu -i --width 30% --height 40% -p 'Hyprland Keybindings' -O alphabetical" \ No newline at end of file diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 016e614..afc7a50 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -26,6 +26,12 @@ in { (import ./zsh.nix) ]; + home.file = { + ".local/share/omarchy/bin" = { + source = ../../bin; + recursive = true; + }; + }; home.packages = packages.homePackages; colorScheme = inputs.nix-colors.colorSchemes.${selectedTheme.base16-theme}; diff --git a/modules/home-manager/hyprland/bindings.nix b/modules/home-manager/hyprland/bindings.nix index 67eaa36..6568af2 100644 --- a/modules/home-manager/hyprland/bindings.nix +++ b/modules/home-manager/hyprland/bindings.nix @@ -21,6 +21,8 @@ in { "SUPER SHIFT, ESCAPE, exit," "SUPER CTRL, ESCAPE, exec, reboot" "SUPER SHIFT CTRL, ESCAPE, exec, systemctl poweroff" + "SUPER, K, exec, ~/.local/share/omarchy/bin/omarchy-show-keybindings" + # Control tiling "SUPER, J, togglesplit, # dwindle" diff --git a/modules/home-manager/hyprland/configuration.nix b/modules/home-manager/hyprland/configuration.nix index 084d697..773a3cf 100644 --- a/modules/home-manager/hyprland/configuration.nix +++ b/modules/home-manager/hyprland/configuration.nix @@ -21,7 +21,7 @@ in { "$browser" = lib.mkDefault "chromium --new-window --ozone-platform=wayland"; "$music" = lib.mkDefault "spotify"; "$passwordManager" = lib.mkDefault "1password"; - "$messenger" = lib.mkDefault "signal-desktop"; + "$messenger" = lib.mkDefault "tdesktop"; "$webapp" = lib.mkDefault "$browser --app"; monitor = cfg.monitors; diff --git a/modules/home-manager/hyprlock.nix b/modules/home-manager/hyprlock.nix index f303c9a..49fcec3 100644 --- a/modules/home-manager/hyprlock.nix +++ b/modules/home-manager/hyprlock.nix @@ -21,7 +21,6 @@ in { }; auth = { fingerprint.enabled = true; - fingerprint.placeholder_text = "  Enter Password 󰈷 "; }; background = { monitor = ""; @@ -46,7 +45,8 @@ in { font_color = foregroundRgb; placeholder_color = foregroundMutedRgb; - placeholder_text = "Enter Password"; + # placeholder_text = "Enter Password"; + placeholder_text = "  Enter Password 󰈷 "; check_color = "rgba(131, 192, 146, 1.0)"; fail_text = "Wrong";