diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/desktop/niri/default.nix | 13 | ||||
| -rw-r--r-- | modules/desktop/rofi/default.nix | 50 | ||||
| -rw-r--r-- | modules/desktop/rofi/rofi-action.sh | 1 | ||||
| -rw-r--r-- | modules/networking/bluetui/default.nix | 6 | ||||
| -rw-r--r-- | modules/networking/impala/default.nix | 6 | ||||
| -rw-r--r-- | modules/networking/usque/default.nix | 14 | ||||
| -rw-r--r-- | modules/office/calcurse/default.nix | 6 | ||||
| -rw-r--r-- | modules/web/aria2/default.nix | 33 |
8 files changed, 77 insertions, 52 deletions
diff --git a/modules/desktop/niri/default.nix b/modules/desktop/niri/default.nix index b17ea12..3368766 100644 --- a/modules/desktop/niri/default.nix +++ b/modules/desktop/niri/default.nix @@ -80,8 +80,9 @@ in wayland.windowManager.niri = { enable = true; systemd.enable = true; - # Let Niri register its recommended GNOME portal implementation. - portalPackage = pkgs.xdg-desktop-portal-gnome; + # Don't let Niri register its own portal. We will use xdg.portal for the + # configuration of portal + portalPackage = null; }; # For setting the desktop wallpaper @@ -147,5 +148,13 @@ in "fill" ]; }; + + desktop.rofi.action.actions = [ + { + name = "Poweroff Monitors"; + command = "${lib.getExe cfg.niri.package} msg action power-off-monitors"; + icon = "network-vpn-symbolic"; + } + ]; }; } diff --git a/modules/desktop/rofi/default.nix b/modules/desktop/rofi/default.nix index 0c0e6df..2eab3f2 100644 --- a/modules/desktop/rofi/default.nix +++ b/modules/desktop/rofi/default.nix @@ -8,30 +8,6 @@ let cfg = config.desktop.rofi; base16Colors = import ../../colors/base16 { inherit config lib pkgs; }; - - actionOptionsString = lib.concatMapStringsSep "\\n" ( - action: action.name + lib.optionalString (action.icon != null) "\\0icon\\x1f${action.icon}" - ) cfg.action.actions; - - actionCasesString = lib.concatStringsSep "\n" ( - map (action: " \"${action.name}\") ${action.command} ;;") cfg.action.actions - ); - - actionScript = pkgs.writeShellApplication { - name = "rofi-action"; - runtimeInputs = [ - config.terminal.bash.package - cfg.package - ]; - text = - builtins.replaceStrings - [ - "@@OPTIONS@@" - ''"@@CASES@@") : ;;'' - ] - [ actionOptionsString actionCasesString ] - (builtins.readFile ./rofi-action.sh); - }; in { options.desktop.rofi = { @@ -70,7 +46,6 @@ in package = lib.mkOption { type = lib.types.package; readOnly = true; - default = actionScript; description = "The rofi-action script package."; }; }; @@ -106,5 +81,30 @@ in }; home.packages = lib.mkIf (cfg.action.actions != [ ]) [ cfg.action.package ]; + + desktop.rofi.action.package = pkgs.writeShellApplication { + name = "rofi-action"; + runtimeInputs = [ + config.terminal.bash.package + cfg.package + ]; + text = + let + actions = cfg.action.actions; + optionsString = lib.concatMapStringsSep "\\n" ( + action: action.name + lib.optionalString (action.icon != null) "\\0icon\\x1f${action.icon}" + ) actions; + casesString = lib.concatStringsSep "\n" ( + map (action: " \"${action.name}\") ${action.command} ;;") actions + ); + in + builtins.replaceStrings + [ + "@@OPTIONS@@" + ''"@@CASES@@") : ;;'' + ] + [ optionsString casesString ] + (builtins.readFile ./rofi-action.sh); + }; }; } diff --git a/modules/desktop/rofi/rofi-action.sh b/modules/desktop/rofi/rofi-action.sh index 1e09b75..844e0c9 100644 --- a/modules/desktop/rofi/rofi-action.sh +++ b/modules/desktop/rofi/rofi-action.sh @@ -8,6 +8,5 @@ options="@@OPTIONS@@" chosen=$(echo -e "$options" | rofi -dmenu -i -p "Action:") case "$chosen" in -# replacing "@@CASES@@") : ;; instead of @@CASES@@ for linter/formatter "@@CASES@@") : ;; esac diff --git a/modules/networking/bluetui/default.nix b/modules/networking/bluetui/default.nix index b715247..1e33ac2 100644 --- a/modules/networking/bluetui/default.nix +++ b/modules/networking/bluetui/default.nix @@ -24,14 +24,10 @@ in }; config = lib.mkIf cfg.enable { - home.file.".local/share/icons/hicolor/scalable/apps/bluetooth.svg" = { - source = ../../../assets/icons/apps/bluetooth.svg; - }; - xdg.desktopEntries."bluetui" = { name = "bluetui"; exec = "${lib.getExe config.terminal.kitty.package} -e ${lib.getExe cfg.package}"; - icon = "bluetooth"; + icon = "bluetooth-active-symbolic"; categories = [ "Network" ]; comment = "Bluetooth TUI client"; terminal = false; diff --git a/modules/networking/impala/default.nix b/modules/networking/impala/default.nix index f00ed58..3c52065 100644 --- a/modules/networking/impala/default.nix +++ b/modules/networking/impala/default.nix @@ -24,14 +24,10 @@ in }; config = lib.mkIf cfg.enable { - home.file.".local/share/icons/hicolor/scalable/apps/network-wireless.svg" = { - source = ../../../assets/icons/apps/network-wireless.svg; - }; - xdg.desktopEntries."impala" = { name = "impala"; exec = "${lib.getExe config.terminal.kitty.package} -e ${lib.getExe cfg.package}"; - icon = "network-wireless"; + icon = "network-wireless-signal-excellent-symbolic"; categories = [ "Network" ]; comment = "TUI for managing wifi on Linux"; terminal = false; diff --git a/modules/networking/usque/default.nix b/modules/networking/usque/default.nix index aa3304c..36ec12e 100644 --- a/modules/networking/usque/default.nix +++ b/modules/networking/usque/default.nix @@ -71,5 +71,19 @@ in (lib.mkIf cfg.warp.enable { home.packages = [ cfg.warp.package ]; }) + (lib.mkIf (cfg.warp.enable && config.desktop.enable) { + desktop.rofi.action.actions = [ + { + name = "WARP Connect"; + command = "${lib.getExe cfg.warp.package} connect"; + icon = "network-vpn-symbolic"; + } + { + name = "WARP Disconnect"; + command = "${lib.getExe cfg.warp.package} disconnect"; + icon = "network-vpn-disconnected-symbolic"; + } + ]; + }) ]; } diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix index c4053da..588cf02 100644 --- a/modules/office/calcurse/default.nix +++ b/modules/office/calcurse/default.nix @@ -90,10 +90,6 @@ in config = lib.mkMerge [ (lib.mkIf cfg.enable { - home.file.".local/share/icons/hicolor/scalable/apps/calcurse.svg" = { - source = ../../../assets/icons/apps/calcurse.svg; - }; - home.packages = [ cfg.package ]; xdg.configFile."calcurse/conf" = { text = @@ -110,7 +106,7 @@ in xdg.desktopEntries."calcurse" = { name = "calcurse"; exec = "${lib.getExe config.terminal.kitty.package} --class calcurse -e ${lib.getExe cfg.package}"; - icon = "calcurse"; + icon = "org.gnome.Calendar-symbolic"; categories = [ "Office" "Calendar" diff --git a/modules/web/aria2/default.nix b/modules/web/aria2/default.nix index 60e92c6..b9b00f5 100644 --- a/modules/web/aria2/default.nix +++ b/modules/web/aria2/default.nix @@ -2,7 +2,6 @@ { config, lib, - pkgs, ... }: let @@ -19,13 +18,29 @@ in }; }; - config = lib.mkIf cfg.enable { - programs.aria2 = { - enable = true; - settings = { - dir = "${config.home.homeDirectory}/Downloads"; + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + programs.aria2 = { + enable = true; + settings = { + dir = "${config.home.homeDirectory}/Downloads"; + }; + systemd.enable = true; }; - systemd.enable = true; - }; - }; + }) + (lib.mkIf (cfg.enable && config.desktop.enable) { + desktop.rofi.action.actions = [ + { + name = "aria2 Start"; + command = "systemctl --user start aria2"; + icon = "folder-download"; + } + { + name = "aria2 Stop"; + command = "systemctl --user stop aria2"; + icon = "folder-download"; + } + ]; + }) + ]; } |
