Notify überarbeitet

This commit is contained in:
Désiré Werner Menrath 2023-11-10 22:50:33 +01:00
parent 2eb6b6adfc
commit 397460c1b0

23
wire_g
View File

@ -52,23 +52,14 @@ wg_notify(){
notify-send --icon=${wg_pic}wg-vpn.png $"$active powered" notify-send --icon=${wg_pic}wg-vpn.png $"$active powered"
# autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind # autoconnect wird hier abgeschalten damit auch neu importierte nach einem Systemneustart nicht aktiv sind
nmcli con mod $active connection.autoconnect no nmcli con mod $active connection.autoconnect no
# ab hier beginnt yad notify
#Pipe erstellen
PIPE="$HOME/.pipe.tmp"
rm $PIPE > /dev/null 2>&1
mkfifo $PIPE
exec 3<> $PIPE
#Yad Dialog erstellen
yad --notification --listen --command= --icon-size=32 --no-middle <&3 &
#Menüeinträge definieren
echo "menu:\
Wire-G $open!/sbin/wire_g| \
$active stop!/sbin/wg_stop| " >&3
#Icon des Menübuttons definieren
echo "icon:${wg_pic}wg-vpn.png" >&3
#Name des Menüs definieren
echo "tooltip:$active $show" >&3
yad --notification \
--image="icon:${wg_pic}wg-vpn.png" \
--icon-size=32 --no-middle \
--text=$"$active $show" \
--menu="Wire-G $open ! sbin/wire_g
$active stop!/sbin/wg_stop" \
--command="menu"
} }
export -f wg_notify export -f wg_notify