It works fine, but the notify-send is put "backwards" before other notifications, here's: an image:
It feels like my notification is in a different "group" or something...
The notification should come AFTER the mullvad notification.
service script:
[Unit]
Description=Turns off microphone at startup
#After=multi-user.target
After=syslog.target
[Service]
ExecStart=/opt/bin/microphone-status
User=tom
RemainAfterExit=yes
Environment="DISPLAY=:0.0" "XAUTHORITY=/home/tom/.Xauthority"
[Install]
WantedBy=multi-user.target
The script:
#!/bin/bash
sleep 10
#/usr/bin/update-notifier
/usr/bin/notify-send -u normal 'Why does it appear on top?'
#function check_state () {
# toggle_toggle=$(/usr/bin/amixer get Capture | grep -c "\[off\]")
# echo toggle+percent
# toggle_percent=$(/usr/bin/amixer get Capture | grep -c "\[0%\]")
# echo toggle_percent
# let toggle_result=$((toggle_toggle+toggle_percent))
# echo $((toggle_result))
#}
#check_state
#/usr/bin/notify-send -u normal $toggle_result # IF 4 = TURNED OFF, IF !=4 TURNED ON
#if [ $(/usr/bin/pgrep pavucontrol) > 0 ] ; then # Check if pavucontrol has processID = active
#echo "found pavucontrol"
# if [ $((toggle_result)) != 4 ] ; then # Turn off microphone once
# toggle off
# /usr/bin/killall -9 xfce4-notifyd
# /usr/bin/notify-send 'Microphone was left turned on' 'It was automatically disabled.'
# /usr/bin/amixer set Capture toggle
# /usr/bin/amixer set Capture 0
# /usr/bin/amixer set Capture 0%
# fi
#fi
exit 0
Another picture - the notification starts at a really weird place - at half at my taskbar