Hello community,
I’m currently working on customizing my Android setup using KLWP, and I’m having difficulties with formulas to display VPN connection status. I’ve tried several formulations based on suggestions, but encountered errors such as not displaying as expected, staying blank even when connected to VPN, or consistently showing “VPN activated” regardless of the VPN status.
Here are three formulas I’ve attempted:
-
$if(sh("ifconfig tun0", 1) = "ifconfig: tun0: No such device", "", "🔒")$ -
$if(sh("ifconfig | grep tun0", 1) != "", "Connection Secured", "")$ -
$if(sh("ifconfig tun0", 1) = "ifconfig: tun0: No such device", "🔓", "🔒")$ -
$if(sh("ifconfig tun0") = "ifconfig: tun0: No such device", "VPN Disconnected", "VPN Connected")$ -
$if(sh("route print | findstr 0.0.0.0 255.255.255.255") = "", "SSH Tunnel Disconnected", "SSH Tunnel Connected")$
I would appreciate any insights or suggestions to improve these formulas and correctly reflect the VPN connection status in KLWP. Thank you in advance for your help!