From 4ce635661de19247f0669d451c292f8c369da2ee Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 22 Apr 2023 00:32:05 -0700 Subject: Show VPN status in mode-line --- oni/home/services/stumpwm/config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'oni/home') diff --git a/oni/home/services/stumpwm/config b/oni/home/services/stumpwm/config index 2c0ff58..252a983 100644 --- a/oni/home/services/stumpwm/config +++ b/oni/home/services/stumpwm/config @@ -16,6 +16,9 @@ (when (eq (sb-ext:process-status process) :exited) (run-hook *screen-unlocked-hook*))) +(defun vpn-connected-p () + (probe-file "/sys/class/net/vpn")) + (defcommand lock-screen () () "Lock the screen using i3lock. Run `*screen-locking-hook*' before locking it and run `*screen-unlocked-hook*' @@ -56,7 +59,12 @@ after it has been unlocked." '(:eval (or (ignore-errors (window-title (current-window))) "Unknown")) - "^>%d ")) + "^>" + '(:eval + (if (vpn-connected-p) + "^*5^B[VPN]^b^n " + "")) + "%d ")) (mode-line) (restore-from-file "default") -- cgit v1.2.3-54-g00ecf