From 5e801091f67d617dfb064fff00748241eb1fd009 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Thu, 25 Jul 2024 15:26:12 -0400 Subject: [PATCH] home: fuzzel,wlogout -> rofi (#62) * home: add rofi module with default settings * home/hyprland: switch to rofi * home/waybar: switch to rofi * home/wayland: switch to rofi * home/sway: switch to rofi * cleanup * home.rofi: remove unused emoji plugin --- homeManagerModules/apps/default.nix | 1 + homeManagerModules/apps/rofi/default.nix | 50 +++++++++++++++++++ homeManagerModules/apps/waybar/default.nix | 2 +- .../desktop/hyprland/settings.nix | 5 +- homeManagerModules/desktop/sway/settings.nix | 4 +- .../desktop/wayland/default.nix | 3 +- homeManagerModules/options.nix | 2 + 7 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 homeManagerModules/apps/rofi/default.nix diff --git a/homeManagerModules/apps/default.nix b/homeManagerModules/apps/default.nix index 51e76414..395e2eb6 100644 --- a/homeManagerModules/apps/default.nix +++ b/homeManagerModules/apps/default.nix @@ -14,6 +14,7 @@ ./librewolf ./mako ./nemo + ./rofi ./swaylock ./thunar ./tmux diff --git a/homeManagerModules/apps/rofi/default.nix b/homeManagerModules/apps/rofi/default.nix new file mode 100644 index 00000000..2ba180fd --- /dev/null +++ b/homeManagerModules/apps/rofi/default.nix @@ -0,0 +1,50 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.ar.home; +in { + config = lib.mkIf cfg.apps.rofi.enable { + programs.rofi = { + enable = true; + font = "NotoSansM Nerd Font ${toString config.gtk.font.size}"; + location = "center"; + package = pkgs.rofi-wayland; + plugins = [pkgs.rofi-power-menu]; + terminal = lib.getExe cfg.defaultApps.terminal; + theme = "glue_pro_blue"; + + extraConfig = { + click-to-exit = true; + combi-display-format = "{text}"; + combi-hide-mode-prefix = true; + + combi-modes = [ + "window" + "drun" + "ssh" + ]; + + display-drun = "  "; + display-filebrowser = "  "; + display-power-menu = "  "; + display-run = "  "; + display-ssh = "  "; + display-window = " 﩯 "; + drun-display-format = "{icon} {name}"; + hide-scrollbar = true; + hover-select = true; + me-accept-entry = "MousePrimary"; + me-select-entry = ""; + modes = "drun,window,ssh,combi,filebrowser"; + show-display-name = false; + show-icons = true; + sort = true; + window-format = " {c} {t}"; + window-thumbnail = false; + }; + }; + }; +} diff --git a/homeManagerModules/apps/waybar/default.nix b/homeManagerModules/apps/waybar/default.nix index 371b1df2..2c361ab5 100644 --- a/homeManagerModules/apps/waybar/default.nix +++ b/homeManagerModules/apps/waybar/default.nix @@ -165,7 +165,7 @@ "tray" = {"spacing" = 15;}; "custom/logout" = { - "on-click" = "${lib.getExe pkgs.wlogout}"; + "on-click" = ''${lib.getExe config.programs.rofi.package} -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"''; "format" = "󰗽"; }; diff --git a/homeManagerModules/desktop/hyprland/settings.nix b/homeManagerModules/desktop/hyprland/settings.nix index 895f19c0..576719b6 100644 --- a/homeManagerModules/desktop/hyprland/settings.nix +++ b/homeManagerModules/desktop/hyprland/settings.nix @@ -39,8 +39,8 @@ in { "$mod,E,exec,${lib.getExe cfg.defaultApps.editor}" "$mod,F,exec,${lib.getExe cfg.defaultApps.fileManager}" "$mod,F11,exec,pkill -SIGUSR1 waybar" - "$mod,M,exec,${lib.getExe pkgs.wlogout}" - "$mod,R,exec,${lib.getExe pkgs.fuzzel}" + ''$mod,M,exec,${lib.getExe config.programs.rofi.package} -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"'' + "$mod,R,exec,${lib.getExe config.programs.rofi.package} -show combi" "$mod,S,togglespecialworkspace,magic" "$mod,T,exec,${lib.getExe cfg.defaultApps.terminal}" "$mod,comma,exec,${lib.getExe pkgs.hyprnome} --previous" @@ -103,6 +103,7 @@ in { "blur,launcher" "blur,logout_dialog" "blur,notifications" + "blur,rofi" "blur,swayosd" "blur,waybar" "ignorezero,notifications" diff --git a/homeManagerModules/desktop/sway/settings.nix b/homeManagerModules/desktop/sway/settings.nix index 58fe762c..6fa7e0a7 100644 --- a/homeManagerModules/desktop/sway/settings.nix +++ b/homeManagerModules/desktop/sway/settings.nix @@ -89,9 +89,9 @@ in { "${modifier}+E" = "exec ${lib.getExe cfg.defaultApps.editor}"; "${modifier}+F" = "exec ${lib.getExe cfg.defaultApps.fileManager}"; "${modifier}+F11" = "exec pkill -SIGUSR1 waybar"; # Show/hide waybar - "${modifier}+M" = "exec ${lib.getExe pkgs.wlogout}"; + "${modifier}+M" = ''exec ${lib.getExe config.programs.rofi.package} -show power-menu -modi "power-menu:${lib.getExe pkgs.rofi-power-menu} --choices=logout/lockscreen/suspend/shutdown/reboot"''; "${modifier}+Period" = "workspace next"; - "${modifier}+R" = "exec ${lib.getExe pkgs.fuzzel}"; + "${modifier}+R" = "exec ${lib.getExe config.programs.rofi.package} -show combi"; "${modifier}+S" = "scratchpad show"; "${modifier}+Shift+Comma" = "move container to workspace prev; workspace prev"; "${modifier}+Shift+Period" = "move container to workspace next; workspace next"; diff --git a/homeManagerModules/desktop/wayland/default.nix b/homeManagerModules/desktop/wayland/default.nix index 888105d5..cbe89b13 100644 --- a/homeManagerModules/desktop/wayland/default.nix +++ b/homeManagerModules/desktop/wayland/default.nix @@ -6,12 +6,11 @@ }: { config = lib.mkIf (config.ar.home.desktop.hyprland.enable || config.ar.home.desktop.sway.enable) { ar.home.apps = { - fuzzel.enable = lib.mkDefault true; kitty.enable = lib.mkDefault true; mako.enable = lib.mkDefault true; + rofi.enable = lib.mkDefault true; swaylock.enable = lib.mkDefault true; waybar.enable = lib.mkDefault true; - wlogout.enable = lib.mkDefault true; }; dconf = { diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index dc0e6c1f..ae771b6b 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -60,7 +60,9 @@ in { type = lib.types.bool; }; + rofi.enable = lib.mkEnableOption "Rofi launcher."; swaylock.enable = lib.mkEnableOption "Swaylock screen locker."; + thunar.enable = lib.mkOption { description = "Thunar file manager."; default = cfg.defaultApps.fileManager == pkgs.xfce.thunar;