Skip to content

Instantly share code, notes, and snippets.

@mikaelz
Forked from thatarchguy/vpnwidget.lua
Created March 6, 2023 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikaelz/44197131ed4475628a46ca1d2bc05226 to your computer and use it in GitHub Desktop.
Save mikaelz/44197131ed4475628a46ca1d2bc05226 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(protonvpnwidget)
protonvpnwidget = wibox.widget.textbox()
protonvpnwidget:set_text(" ProtonVPN: N/A ")
protonvpnwidgettimer = timer({ timeout = 5 })
protonvpnwidgettimer:connect_signal("timeout",
function()
status = io.popen("systemctl is-active openvpn-client@protonvpn.service", "r")
if status:read() == 'active' then
protonvpnwidget:set_markup(" <span color='#00FF00'>ProtonVPN</span> ")
else
protonvpnwidget:set_markup(" <span color='#FF0000'>ProtonVPN</span> ")
end
status:close()
end
)
protonvpnwidgettimer:start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment