1

Compare commits

...

2 Commits

2 changed files with 22 additions and 4 deletions

View File

@ -161,6 +161,7 @@ in {
* { * {
all: unset; all: unset;
font-family: ${color.font};
} }
.normal-icons { .normal-icons {
@ -605,8 +606,21 @@ in {
action = spawn "walker" "-m" "providerlist"; action = spawn "walker" "-m" "providerlist";
hotkey-overlay = {title = "Toggle the launcher.";}; hotkey-overlay = {title = "Toggle the launcher.";};
}; };
"Mod+Escape" = { "Mod+Escape" = let
action = spawn "walker"; powerMenu = mylib.rofi.mkSimpleMenu rec {
prompt = "Session";
attrs = {
"󰤂 Poweroff" = "poweroff";
"󰜉 Reboot" = "reboot";
"󰌾 Lock" = "loginctl lock-session";
# " Reload Hyprpanel" = "systemctl --user restart hyprpanel.service";
# " Reload Hyprland" = "hyprctl reload";
# " Exit Hyprland" = "hyprctl dispatch exit";
};
command = "walker -d -p ${prompt}";
};
in {
action = spawn "${powerMenu}/bin/rofi-menu-Session";
hotkey-overlay = {title = "Toggle the session menu.";}; hotkey-overlay = {title = "Toggle the session menu.";};
}; };
"Mod+C" = { "Mod+C" = {

View File

@ -21,7 +21,11 @@
|> builtins.attrValues |> builtins.attrValues
|> builtins.concatStringsSep "\n"; |> builtins.concatStringsSep "\n";
in in
prompt: attrs: {
prompt,
attrs,
command ? ''rofi -dmenu -p " ${prompt} " -i'',
}:
pkgs.writeScriptBin "rofi-menu-${prompt}" '' pkgs.writeScriptBin "rofi-menu-${prompt}" ''
#! ${pkgs.fish}/bin/fish #! ${pkgs.fish}/bin/fish
@ -29,7 +33,7 @@
set OPTIONS ${unpack-options attrs} set OPTIONS ${unpack-options attrs}
# We choose a single OPTION using Rofi # We choose a single OPTION using Rofi
set OPTION (echo -e (string join "\n" $OPTIONS) | rofi -dmenu -p " ${prompt} " -i) set OPTION (echo -e (string join "\n" $OPTIONS) | ${command})
# Check if the chosen OPTION is a valid choice from OPTIONS # Check if the chosen OPTION is a valid choice from OPTIONS
if not contains $OPTION $OPTIONS if not contains $OPTION $OPTIONS