mirror of
https://github.com/don-philipe/knorke.git
synced 2025-11-08 22:57:03 +01:00
Compare commits
3 Commits
4fa74ea78c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f33155f3c | ||
|
|
d427081284 | ||
|
|
a7b10c63fa |
@@ -10,6 +10,7 @@ local gears = require("gears")
|
||||
local is_on
|
||||
local icon_dis
|
||||
local icon_enab
|
||||
local icon_conn
|
||||
|
||||
local widget = wibox.widget {
|
||||
{
|
||||
@@ -33,9 +34,10 @@ widget:buttons(awful.util.table.join(
|
||||
|
||||
-- Add icons vor various BT states.
|
||||
-- These icons should come as beautiful.icons
|
||||
function widget.set_icons(disabled, enabled)
|
||||
function widget.set_icons(disabled, enabled, connected)
|
||||
icon_dis = disabled
|
||||
icon_enab = enabled
|
||||
icon_conn = connected
|
||||
end
|
||||
|
||||
awful.tooltip(
|
||||
@@ -59,6 +61,7 @@ watch("bluetoothctl show", 5,
|
||||
function(_, stdout)
|
||||
-- Check if there bluetooth
|
||||
local checker = stdout:match("Powered: yes") -- If 'Powered: yes' string is detected on stdout
|
||||
-- TODO check for connection and set connected icon
|
||||
local widget_icon_nme
|
||||
if (checker ~= nil) then
|
||||
is_on = true
|
||||
|
||||
6
vpn.lua
6
vpn.lua
@@ -20,7 +20,7 @@ gears.timer {
|
||||
timeout = 10,
|
||||
autostart = true,
|
||||
callback = function ()
|
||||
awful.spawn.easy_async_with_shell("ifconfig | grep \"tun.*:\"",
|
||||
awful.spawn.easy_async_with_shell("ifconfig | grep \"tun.*:\\|wg.*:\"",
|
||||
function (stdout, _, _, _)
|
||||
if (stdout == "") then
|
||||
widget.icon:set_image(icon_vpn_noconn)
|
||||
@@ -48,11 +48,11 @@ awful.tooltip(
|
||||
preferred_positions = { "right", "left", "top", "bottom" },
|
||||
timer_function = function()
|
||||
local num_vpnc_proc = awful.spawn.with_shell("ps aux | grep vpnc | wc -l")
|
||||
if (num_vpnc_proc > 1) then
|
||||
if (tonumber(num_vpnc_proc) > 1) then
|
||||
return "VPNC"
|
||||
end
|
||||
local num_openconnect_proc = awful.spawn.with_shell("ps aux | grep openconnect | wc -l")
|
||||
if (num_openconnect_proc > 1) then
|
||||
if (tonumber(num_openconnect_proc) > 1) then
|
||||
return "OPENCONNECT"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user