From ba2b5075683b95fa1592275f548548bef1382ff4 Mon Sep 17 00:00:00 2001 From: buffet Date: Mon, 7 Aug 2023 20:59:54 +0200 Subject: [PATCH] feat(sway): show mullvad status in bar --- programs/sway.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/programs/sway.nix b/programs/sway.nix index 35bdfc3..717969d 100644 --- a/programs/sway.nix +++ b/programs/sway.nix @@ -3,6 +3,7 @@ lib, ... }: { + # TODO: turn off primary selection programs.sway.enable = true; home-manager.users.buffet = { @@ -46,7 +47,13 @@ charge=+ fi - printf '%s %s ' "$charge$((energy_now * 100 / energy_full))%" "$(date +'%H:%M')" + if ${pkgs.mullvad}/bin/mullvad status | grep -q 'Connected to'; then + mullvad='&' + else + mullvad= + fi + + printf '%s %s %s ' "$mullvad" "$charge$((energy_now * 100 / energy_full))%" "$(date +'%H:%M')" sleep 3 done