-
-
Save mikaelz/44197131ed4475628a46ca1d2bc05226 to your computer and use it in GitHub Desktop.
Awesomewm vpn widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 [email protected]", "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