Hyprland: Improve Rofi keybindings menu
This commit is contained in:
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
grep -E "^bind =" ~/NixFlake/config/hyprland/hyprland.conf | sd "bind = " "" | rofi -dmenu -p " keys " -i
|
cat ~/.config/hypr/keybindings.info | rofi -dmenu -p " keys " -i
|
||||||
|
@ -33,6 +33,12 @@
|
|||||||
mkBind = key: action: "${key}, ${action}";
|
mkBind = key: action: "${key}, ${action}";
|
||||||
mkBinds = key: actions: builtins.map (mkBind key) actions;
|
mkBinds = key: actions: builtins.map (mkBind key) actions;
|
||||||
|
|
||||||
|
# These functions are used to generate the keybindings.info file for Rofi
|
||||||
|
mkBindHelpKey = key: ''${builtins.replaceStrings ["$mainMod " ", "] ["${cfg.keybindings.main-mod}-" "-"] key}'';
|
||||||
|
mkBindHelpAction = action: ''${builtins.replaceStrings [","] [""] action}'';
|
||||||
|
mkBindHelp = key: action: "<${mkBindHelpKey key}>: ${mkBindHelpAction action}";
|
||||||
|
mkBindsHelp = key: actions: builtins.map (mkBindHelp key) actions;
|
||||||
|
|
||||||
mkWallpaper = monitor: "${monitor}, ${config.home.homeDirectory}/NixFlake/wallpapers/${cfg.theme}.png";
|
mkWallpaper = monitor: "${monitor}, ${config.home.homeDirectory}/NixFlake/wallpapers/${cfg.theme}.png";
|
||||||
|
|
||||||
mkDelayedStart = str: "hyprctl dispatch exec \"sleep 5s && ${str}\"";
|
mkDelayedStart = str: "hyprctl dispatch exec \"sleep 5s && ${str}\"";
|
||||||
@ -164,6 +170,15 @@ in {
|
|||||||
libsForQt5.qtwayland
|
libsForQt5.qtwayland
|
||||||
kdePackages.qtwayland
|
kdePackages.qtwayland
|
||||||
];
|
];
|
||||||
|
|
||||||
|
file = {
|
||||||
|
".config/hypr/keybindings.info".text = lib.pipe (lib.mergeAttrs cfg.keybindings.bindings always-bind) [
|
||||||
|
(builtins.mapAttrs mkBindsHelp)
|
||||||
|
builtins.attrValues
|
||||||
|
builtins.concatLists
|
||||||
|
(builtins.concatStringsSep "\n")
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
Reference in New Issue
Block a user