Skip to content

Instantly share code, notes, and snippets.

@thatarchguy
Created October 21, 2014 23:58
Show Gist options
  • Save thatarchguy/c7ca4f89b324ac0d0e22 to your computer and use it in GitHub Desktop.
Save thatarchguy/c7ca4f89b324ac0d0e22 to your computer and use it in GitHub Desktop.
Awesomewm vpn widget
-- add this to your rc.lua, or include it as a dependency
-- Don't forget to add this to the layout section:
-- right_layout:add(vpnwidget)
vpnwidget = wibox.widget.textbox()
vpnwidget:set_text(" VPN: N/A ")
vpnwidgettimer = timer({ timeout = 5 })
vpnwidgettimer:connect_signal("timeout",
function()
status = io.popen("ls /var/run | grep 'openvpn'", "r")
if status:read() == nil then
vpnwidget:set_markup(" <span color='#FF0000'>VPN: OFF</span> ")
else
vpnwidget:set_markup(" <span color='#00FF00'>VPN: ON</span> ")
end
status:close()
end
)
vpnwidgettimer:start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment