From abc0aee028707ff881b04ff1a85eb0b655f15bfe Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 4 Sep 2024 01:15:08 +0900 Subject: feat(home/gui): waybar: add scratchpad indicator --- home/profiles/gui/config/waybar/settings.nix | 14 ++++++++++++-- home/profiles/gui/config/waybar/style.nix | 4 ++++ 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'home/profiles/gui/config/waybar') diff --git a/home/profiles/gui/config/waybar/settings.nix b/home/profiles/gui/config/waybar/settings.nix index 9470824..341a1b3 100644 --- a/home/profiles/gui/config/waybar/settings.nix +++ b/home/profiles/gui/config/waybar/settings.nix @@ -1,4 +1,4 @@ -{ config, lib, neotheme }: +{ config, lib, pkgs, neotheme }: with neotheme.colors; @@ -10,7 +10,7 @@ in position = "top"; height = 22; modules-left = [ "wireplumber" "custom/separator" "cpu" "custom/separator" "memory" "custom/separator" "idle_inhibitor" ]; - modules-center = [ "sway/workspaces" ]; + modules-center = [ "sway/workspaces" "custom/scratchpad-indicator" ]; modules-right = [ "group/tray" "custom/separator" "network" "custom/separator" ] ++ lib.optionals (guiCfg.laptop.enable) [ "battery" "custom/separator" ] ++ [ "clock" ]; @@ -96,6 +96,16 @@ in tooltip = false; }; + "custom/scratchpad-indicator" = { + format = "(+{})"; + interval = 3; + return-type = "json"; + hide-empty-text = true; + exec = "${pkgs.writeShellScript "scratchpad-indicator" (import ../../scripts/scratchpad-indicator.nix)}"; + on-click = "exec swaymsg scratchpad show"; + on-click-right = "exec swaymsg move scratchpad"; + }; + "custom/separator" = { format = "|"; interval = "once"; diff --git a/home/profiles/gui/config/waybar/style.nix b/home/profiles/gui/config/waybar/style.nix index ac6aad7..1f5327e 100644 --- a/home/profiles/gui/config/waybar/style.nix +++ b/home/profiles/gui/config/waybar/style.nix @@ -107,6 +107,10 @@ in padding-right: 0.2rem; } + #custom-scratchpad-indicator { + color: #f0a0c0; + } + #custom-separator { color: #${alt1}; background-color: #${background}; -- cgit 1.4.1