added wireguard polybar stuff

This commit is contained in:
Niklas 2020-09-13 14:00:51 +02:00
parent 0e400e95ef
commit 8214587583
4 changed files with 59 additions and 3 deletions

4
.config/polybar/90-polybar Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
# copy to /etc/NetworkManager/dispatcher.d/90-polybar
polybar-msg hook wireguard-status 1

View File

@ -26,6 +26,7 @@ height = 3%
radius = 0
fixed-center = false
background = ${colors.background}
foreground = ${colors.foreground}
@ -42,12 +43,11 @@ module-margin-left = 1
module-margin-right = 2
font-0 = fixed:pixelsize=10;1
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1
font-1 = "Hack Nerd Font:style=Regular:pixelsize=10;2"
modules-left = i3
modules-center =
modules-right = spotifyd pulseaudio memory cpu wlan battery date
modules-right = spotifyd pulseaudio memory cpu wlan wireguard-status battery date
tray-position = right
tray-padding = 2
@ -209,6 +209,17 @@ format-underline = #00b300
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
initial = 1
[module/wireguard-status]
type = custom/ipc
format-foreground = ${colors.text}
format-underline = #00b300
click-left = $HOME/.config/polybar/wireguard-switch.sh
hook-0 = $HOME/.config/polybar/wireguard-info.sh
initial = 1
[settings]
screenchange-reload = true
;compositing-background = xor

View File

@ -0,0 +1,21 @@
#!/usr/bin/env sh
set -e
ID_LIGHT="0f9ed364-1b54-4a95-a45a-a24114f5be6b"
ID_FULL="fa9f53b2-29b4-4c0e-80ca-38937ef8cad8"
if nmcli connection show --active | grep "$ID_LIGHT" > /dev/null
then
echo -n 
exit 0
fi
if nmcli connection show --active | grep "$ID_FULL" > /dev/null
then
echo -n 聯
exit 0
fi
echo -n 輦

View File

@ -0,0 +1,20 @@
#!/usr/bin/env sh
set -e
ID_LIGHT="0f9ed364-1b54-4a95-a45a-a24114f5be6b"
ID_FULL="fa9f53b2-29b4-4c0e-80ca-38937ef8cad8"
if nmcli connection show --active | grep "$ID_LIGHT" > /dev/null
then
nmcli connection up "$ID_FULL"
exit 0
fi
if nmcli connection show --active | grep "$ID_FULL" > /dev/null
then
nmcli connection up "$ID_LIGHT"
exit 0
fi
nmcli connection up "$ID_LIGHT"