about summary refs log tree commit diff
path: root/home/profiles/gui/config
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2024-09-04 01:15:08 +0900
committersefidel <contact@sefidel.net>2024-09-04 20:46:57 +0900
commitabc0aee028707ff881b04ff1a85eb0b655f15bfe (patch)
tree8dcf6a6fa411035c5fba5353f0e23b36a9cc768a /home/profiles/gui/config
parentfb1fa5466912bb4211b4ca61be532725a79172ed (diff)
downloadnixrc-abc0aee028707ff881b04ff1a85eb0b655f15bfe.tar.gz
nixrc-abc0aee028707ff881b04ff1a85eb0b655f15bfe.zip
feat(home/gui): waybar: add scratchpad indicator
Diffstat (limited to 'home/profiles/gui/config')
-rw-r--r--home/profiles/gui/config/waybar/settings.nix14
-rw-r--r--home/profiles/gui/config/waybar/style.nix4
2 files changed, 16 insertions, 2 deletions
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};