added wireguard polybar stuff
This commit is contained in:
parent
0e400e95ef
commit
8214587583
4
.config/polybar/90-polybar
Executable file
4
.config/polybar/90-polybar
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# copy to /etc/NetworkManager/dispatcher.d/90-polybar
|
||||||
|
|
||||||
|
polybar-msg hook wireguard-status 1
|
@ -26,6 +26,7 @@ height = 3%
|
|||||||
radius = 0
|
radius = 0
|
||||||
fixed-center = false
|
fixed-center = false
|
||||||
|
|
||||||
|
|
||||||
background = ${colors.background}
|
background = ${colors.background}
|
||||||
foreground = ${colors.foreground}
|
foreground = ${colors.foreground}
|
||||||
|
|
||||||
@ -42,12 +43,11 @@ module-margin-left = 1
|
|||||||
module-margin-right = 2
|
module-margin-right = 2
|
||||||
|
|
||||||
font-0 = fixed:pixelsize=10;1
|
font-0 = fixed:pixelsize=10;1
|
||||||
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
|
font-1 = "Hack Nerd Font:style=Regular:pixelsize=10;2"
|
||||||
font-2 = siji:pixelsize=10;1
|
|
||||||
|
|
||||||
modules-left = i3
|
modules-left = i3
|
||||||
modules-center =
|
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-position = right
|
||||||
tray-padding = 2
|
tray-padding = 2
|
||||||
@ -209,6 +209,17 @@ format-underline = #00b300
|
|||||||
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
|
hook-0 = $HOME/.config/polybar/spotifyd-meta.sh
|
||||||
initial = 1
|
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]
|
[settings]
|
||||||
screenchange-reload = true
|
screenchange-reload = true
|
||||||
;compositing-background = xor
|
;compositing-background = xor
|
||||||
|
21
.config/polybar/wireguard-info.sh
Executable file
21
.config/polybar/wireguard-info.sh
Executable 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 輦
|
||||||
|
|
20
.config/polybar/wireguard-switch.sh
Executable file
20
.config/polybar/wireguard-switch.sh
Executable 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"
|
Loading…
Reference in New Issue
Block a user