polybar and wireguard utilities addition.
This commit is contained in:
@@ -63,7 +63,7 @@ font-6 = siji:pixelsize=9;1
|
||||
modules-left = bspwm i3 xwindow
|
||||
;modules-left = i3
|
||||
modules-center = mpd
|
||||
modules-right = filesystem backlight volume xkeyboard memory cpu eth wlan wg0 wg1 temperature battery date powermenu
|
||||
modules-right = filesystem backlight volume xkeyboard memory cpu eth wlan wg temperature battery date powermenu
|
||||
|
||||
tray-position = right
|
||||
tray-padding = 2
|
||||
@@ -134,9 +134,10 @@ interval = 25
|
||||
|
||||
mount-0 = /
|
||||
mount-1 = /home
|
||||
mount-2 = /home/renato/cloud.renatorosa.com
|
||||
mount-3 = /home/renato/drive.silveirarosa.com
|
||||
#mount-2 = /media/renato/cloud.renatorosa.com
|
||||
#mount-3 = /media/renato/cloud.silveirarosa.com
|
||||
|
||||
#label-mounted = %fsname%:%{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
|
||||
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%%
|
||||
label-unmounted = (N/A)
|
||||
label-unmounted-foreground = ${colors.foreground-alt}
|
||||
@@ -372,6 +373,13 @@ format-disconnected-underline = ${self.format-connected-underline}
|
||||
label-disconnected = %ifname%
|
||||
label-disconnected-foreground = ${colors.foreground-alt}
|
||||
|
||||
[module/wg]
|
||||
type = custom/script
|
||||
exec = ~/src/sysadmin/polybar/wg.sh
|
||||
interval = 5
|
||||
# tail = true
|
||||
|
||||
|
||||
[module/wg0]
|
||||
inherit = module/eth
|
||||
interface = wg0
|
||||
@@ -520,6 +528,10 @@ animation-charging-2 =
|
||||
animation-charging-foreground = ${colors.foreground-alt}
|
||||
animation-charging-framerate = 750
|
||||
|
||||
label-charging = %percentage%% (%time%)
|
||||
label-discharging = %percentage%% (%time%)
|
||||
label-full = FULL
|
||||
|
||||
[module/battery-alt]
|
||||
type = internal/battery
|
||||
battery = BAT0
|
||||
|
||||
16
polybar/wg.sh
Executable file
16
polybar/wg.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
#printf "wg:" && (pgrep -a $(sudo wg)$ | head -n 1 | awk '{print $NF'} | cut -d '.' -f 1 && echo down) | head -n 1
|
||||
|
||||
wg=$(sudo wg);
|
||||
|
||||
if [ -z "$wg" ]; then
|
||||
echo "(down)";
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
handshake=$(echo "$wg" | grep handshake | cut -d ':' -f 2 | sed 's/minutes/min/' | sed 's/seconds/sec/');
|
||||
|
||||
transfer=$(echo "$wg" | grep transfer | cut -d ':' -f 2 | sed 's/sent/UL/' | sed 's/received,/DL/' | sed 's/iB//g') ;
|
||||
|
||||
printf "wg:$transfer($handshake)";
|
||||
Reference in New Issue
Block a user