From 478e782ebe3b8b8934db05acfebeebed815a1bd0 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Thu, 21 Apr 2022 22:43:23 -0300 Subject: [PATCH] sway: add gammastep to waybar --- users/misterio/home/desktop-sway/waybar.nix | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/users/misterio/home/desktop-sway/waybar.nix b/users/misterio/home/desktop-sway/waybar.nix index 1a0fe76c..f34f8570 100644 --- a/users/misterio/home/desktop-sway/waybar.nix +++ b/users/misterio/home/desktop-sway/waybar.nix @@ -37,7 +37,7 @@ let jsonOutput = { pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", perc ]; modules-right = [ "custom/gamemode" - "custom/ethminer" + "custom/gammastep" "custom/theme" "network" "custom/home" @@ -176,13 +176,23 @@ let jsonOutput = { pre ? "", text ? "", tooltip ? "", alt ? "", class ? "", perc exec-if = "${pkgs.gamemode}/bin/gamemoded --status | grep 'is active' -q"; interval = 3; - exec = '' - echo '{"tooltip": "Gamemode is active"}' - ''; - format = ""; + return-type = "json"; + exec = jsonOutput { + tooltip = "Gamemode is active"; + }; + format = " "; + }; + "custom/gammastep" = { + exec-if = "${pkgs.systemd}/bin/systemctl --user -q is-active gammastep"; + interval = 3; + return-type = "json"; + exec = jsonOutput { + tooltip = "Gammastep is active"; + }; + format = ""; }; "custom/theme" = { - interval = "10"; + interval = 10; return-type = "json"; max-length = 20; exec = jsonOutput {