ich will einfach eine id= an das notify-send übergeben ohne dafür eine datei zu erstellen. wie mache ich das?
Code: Alles auswählen
#!/bin/bash
x="rfkill list bluetooth | grep -i yes"
y=$(eval "$x" | awk '{print $3}')
#ermitteln der notify-send ID ; pfad zu id datei
id=$(cat /home/user/tools/id)
#evtl in id Datei manuel erstellen. Inhalt zB. 88
if [[ $y = yes ]]; then
#notification und die id in id datei mit (-p) schreiben und mit (-r) ersetzen
notify-send -r "${id}" "Bluetooth" "Aktiviert"
rfkill unblock bluetooth
echo "Bluetooth aktiviert"
else
rfkill block bluetooth
echo "Bluetooth deaktiviert"
notify-send -r ${id} "Bluetooth" "Deaktiviert"
fi
der Sinn der -r (replace) Option ist das die Meldung überschrieben wird und nicht meine Meldungen zumüllt...danke
edit:
meine nerven

Code: Alles auswählen
notify-send -p -r "${id}" "Bluetooth" "Aktiviert" > /home/user/tools/id