From 3f391bdab670b530c74dc2a44e346ab92d0d2559 Mon Sep 17 00:00:00 2001 From: traxys Date: Sat, 22 Apr 2023 17:10:25 +0200 Subject: [PATCH] personal-gui: Switch from wofi to rofi --- personal-gui/hm.nix | 24 ++++-------------------- personal-gui/wm/default.nix | 2 +- personal-gui/wm/i3.nix | 1 - personal-gui/wm/i3like.nix | 1 + personal-gui/wm/sway.nix | 10 ++-------- personal-gui/wm/wofi/config | 1 - personal-gui/wm/wofi/style.css | 30 ------------------------------ 7 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 personal-gui/wm/wofi/config delete mode 100644 personal-gui/wm/wofi/style.css diff --git a/personal-gui/hm.nix b/personal-gui/hm.nix index 12d86cd..dacfc69 100644 --- a/personal-gui/hm.nix +++ b/personal-gui/hm.nix @@ -52,26 +52,10 @@ programs.zathura.enable = true; - home.file = { - "bin/ssh-picker" = let - ssh_hosts = builtins.attrNames config.programs.ssh.matchBlocks; - ssh_specific = builtins.filter (h: !(lib.strings.hasInfix "*" h)) ssh_hosts; - ssh_specific_echo = builtins.map (h: "echo ${h}") ssh_specific; - - picker = - if config.wm.kind == "sway" - then "${pkgs.wofi}/bin/wofi -S dmenu" - else "${pkgs.rofi}/bin/rofi -dmenu"; - in { - text = '' - #!/usr/bin/env bash - - { - ${lib.strings.concatStringsSep "\n" ssh_specific_echo} - } | ${picker} | xargs ${config.terminal.command} ssh - ''; - executable = true; - }; + programs.rofi = { + enable = true; + theme = "solarized_alternate"; + terminal = "${config.terminal.command}"; }; xdg.desktopEntries.zklist = { diff --git a/personal-gui/wm/default.nix b/personal-gui/wm/default.nix index 2aeb6a6..29e8615 100644 --- a/personal-gui/wm/default.nix +++ b/personal-gui/wm/default.nix @@ -175,7 +175,7 @@ "${mod}+Return" = "exec ${config.terminal.command}"; "${mod}+p" = "mode resize"; "${mod}+Shift+P" = "restart"; - "${mod}+Shift+S" = "exec ~/bin/ssh-picker"; + "${mod}+Shift+S" = "exec ${config.programs.rofi.package}/bin/rofi -show ssh"; }; }; } diff --git a/personal-gui/wm/i3.nix b/personal-gui/wm/i3.nix index c6668e0..a487a15 100644 --- a/personal-gui/wm/i3.nix +++ b/personal-gui/wm/i3.nix @@ -89,7 +89,6 @@ in { }; wm.printScreen.command = mkDefault "${pkgs.maim}/bin/maim -s | ${pkgs.xclip}/bin/xclip -selection clipboard -t image/png"; - wm.menu.command = mkDefault "${pkgs.rofi}/bin/rofi -modi drun#run#ssh -show drun"; wm.exit.command = mkDefault "\"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'\""; xsession = { diff --git a/personal-gui/wm/i3like.nix b/personal-gui/wm/i3like.nix index eed0c79..12f977d 100644 --- a/personal-gui/wm/i3like.nix +++ b/personal-gui/wm/i3like.nix @@ -86,6 +86,7 @@ with lib; { command = mkOption { type = types.str; description = "Command to launch the menu"; + default = "${config.programs.rofi.package}/bin/rofi -show drun -show-icons"; }; }; diff --git a/personal-gui/wm/sway.nix b/personal-gui/wm/sway.nix index 8a26581..79a1cef 100644 --- a/personal-gui/wm/sway.nix +++ b/personal-gui/wm/sway.nix @@ -38,6 +38,8 @@ in { LIBSEAT_BACKEND = "logind"; }; + programs.rofi.package = pkgs.rofi-wayland; + services.mako = mkIf cfg.notifications.enable { enable = true; font = cfg.notifications.font; @@ -116,7 +118,6 @@ in { }; wm.printScreen.command = mkDefault "${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - wm.menu.command = mkDefault "${pkgs.wofi}/bin/wofi --show drun,run --allow-images"; wm.exit.command = mkDefault "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; wayland.windowManager.sway = { @@ -168,12 +169,5 @@ in { assigns = common.assigns; }; }; - - home.file = { - ".config/wofi/" = { - source = ./wofi; - recursive = true; - }; - }; }; } diff --git a/personal-gui/wm/wofi/config b/personal-gui/wm/wofi/config deleted file mode 100644 index 420ce7c..0000000 --- a/personal-gui/wm/wofi/config +++ /dev/null @@ -1 +0,0 @@ -width=700 diff --git a/personal-gui/wm/wofi/style.css b/personal-gui/wm/wofi/style.css deleted file mode 100644 index 72a8bcb..0000000 --- a/personal-gui/wm/wofi/style.css +++ /dev/null @@ -1,30 +0,0 @@ -/* base16-wofi (https://sr.ht/~knezi/base16-wofi) - * Base16 wofi template by knezi - * Chalk scheme by Chris Kempson (http://chriskempson.com) */ - -window { - background-color: #151515; - color: #d0d0d0; -} - -#entry:nth-child(odd) { - background-color: #151515; -} - -#entry:nth-child(even) { - background-color: #202020; -} - -#entry:selected { - background-color: #303030; -} - -#input { - background-color: #202020; - color: #b0b0b0; - border-color: #303030; -} - -#input:focus { - border-color: #ddb26f; -}