1

Further refactor hyprland keybindings + integrate with rofi

This commit is contained in:
2023-05-25 20:25:26 +02:00
parent 62ef5ed0e2
commit c87226e644
6 changed files with 52 additions and 90 deletions

View File

@ -7,36 +7,41 @@
mylib,
pkgs,
...
}:
with lib;
with mylib.modules; let
}: let
cfg = config.modules.rofi;
in {
options.modules.rofi = import ./options.nix {inherit lib mylib;};
config = mkIf cfg.enable {
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
rofi-wayland
];
# Power Menu
(mylib.rofi.mkSimpleMenu
modules.hyprland.keybindings = let
power-menu =
mylib.rofi.mkSimpleMenu
"power"
{
"Poweroff" = "poweroff";
"Reboot" = "reboot";
"Reload Hyprland" = "hyprctl reload";
"Exit Hyprland" = "hyprctl dispatch exit";
})
];
};
in {
bindings = {
"$mainMod, A" = ["exec, rofi -show drun"];
"$mainMod, escape" = ["exec, \"${power-menu}\""];
};
};
home.activation = {
# NOTE: Keep the rofi config symlinked, to allow easy changes with hotreload
linkRofiConfig =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "~/NixFlake/config/rofi/rofi.rasi" "~/.config/rofi/config.rasi");
lib.hm.dag.entryAfter ["writeBoundary"]
(mylib.modules.mkLink "~/NixFlake/config/rofi/rofi.rasi" "~/.config/rofi/config.rasi");
linkRofiColors =
hm.dag.entryAfter ["writeBoundary"]
(mkLink "~/NixFlake/config/rofi/colors/${cfg.theme}.rasi" "~/.config/rofi/colors.rasi");
lib.hm.dag.entryAfter ["writeBoundary"]
(mylib.modules.mkLink "~/NixFlake/config/rofi/colors/${cfg.theme}.rasi" "~/.config/rofi/colors.rasi");
};
};
}