From a83409f8e6305e1663703014472c80d29d53a4fe Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Mon, 8 Apr 2024 07:05:08 -0400 Subject: [PATCH] ironbar(mullvad): Show server identifier in notification --- home/ironbar.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/home/ironbar.nix b/home/ironbar.nix index a65a2774..0c80043f 100644 --- a/home/ironbar.nix +++ b/home/ironbar.nix @@ -7,6 +7,7 @@ let inherit (pkgs) ironbar inotify-tools; mullvadScript = "ironbar/mullvad.fish"; + mullvadNotification = "ironbar/mullvad-notification.fish"; in { home.packages = [ ironbar ]; @@ -26,7 +27,7 @@ in } { type = "script"; - on_click_left = "notify-send -t 2000 \"Mullvad\" \"Changing location...\" && mullvad relay set location any && mullvad relay set location us"; + on_click_left = "~/.config/${mullvadNotification}"; cmd = "~/.config/${mullvadScript}"; mode = "watch"; } @@ -160,6 +161,20 @@ in } ''; + xdg.configFile.${mullvadNotification} = { + executable = true; + text = /* fish */ '' + #!/usr/bin/env fish + + mullvad relay set location any + mullvad relay set location us + + sleep 0.2 + + notify-send -t 2000 "Mullvad" "$(mullvad status | choose 2)" + ''; + }; + xdg.configFile.${mullvadScript} = { executable = true; text = /* fish */ ''