Notify überarbeitet

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

25
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 yad --notification \
PIPE="$HOME/.pipe.tmp" --image="icon:${wg_pic}wg-vpn.png" \
rm $PIPE > /dev/null 2>&1 --icon-size=32 --no-middle \
mkfifo $PIPE --text=$"$active $show" \
exec 3<> $PIPE --menu="Wire-G $open ! sbin/wire_g
#Yad Dialog erstellen $active stop!/sbin/wg_stop" \
yad --notification --listen --command= --icon-size=32 --no-middle <&3 & --command="menu"
#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
} }
export -f wg_notify export -f wg_notify