From 782e61ea00fb81092cd05b949d6db885b30506dc Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 4 Aug 2024 17:49:07 +0200 Subject: usecases/sway: move from mako to swaync for notifications And adapt waybar for it --- usecases/desktop/graphical/waybar.nix | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'usecases/desktop/graphical/waybar.nix') diff --git a/usecases/desktop/graphical/waybar.nix b/usecases/desktop/graphical/waybar.nix index 15868fe..bad1e09 100644 --- a/usecases/desktop/graphical/waybar.nix +++ b/usecases/desktop/graphical/waybar.nix @@ -17,7 +17,7 @@ inputs: modules-left = [ "sway/workspaces" "sway/mode" ]; modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ]; modules-right = [ - "idle_inhibitor" + "custom/notification" "pulseaudio" "network#eth" "network#wlan" @@ -59,26 +59,26 @@ inputs: }; }; - idle_inhibitor = { + "custom/notification" = let + swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client"; + in { format = "{icon}"; format-icons = { - activated = ""; - deactivated = ""; + notification = "󰂜"; + none = "󰂜"; + dnd-notification = "󰪑"; + dnd-none = "󰪑"; + inhibited-notification = "󰂜"; + inhibited-none = "󰂜"; + dnd-inhibited-notification = "󰪑"; + dnd-inhibited-none = "󰪑"; }; - on-click = let - script = pkgs.writeShellApplication { - name = "switch-idle-mode"; - runtimeInputs = [pkgs.mako pkgs.gnugrep]; - text = '' - if makoctl mode | grep -q do-not-disturb; then - makoctl mode -r do-not-disturb - else - makoctl mode -a do-not-disturb - fi - ''; - }; - in - lib.getExe script; + tooltip = false; + return-type = "json"; + exec = "${swaync-client} -swb"; + on-click = "${swaync-client} -t -sw"; + on-click-right = "${swaync-client} -d -sw"; + escape = true; }; clock = { @@ -176,7 +176,7 @@ inputs: border-bottom: 3px solid ${foreground}; } - #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #idle_inhibitor { + #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #custom-notification { padding: 0 10px; margin: 0 5px; } @@ -263,7 +263,7 @@ inputs: background-color: #2980b9; } - #idle_inhibitor { + #custom-notification { background-color: ${lightBackground}; } -- cgit v1.2.3