Is there a way to make sure that a script added to Startup Applications runs last?
There are different ways to do this, But, a very simple way is to include a sleep command in the script at the very beginning of the script
For example:
sleep 20
This would ensure the main body of your script did not run until 20 seconds after startup. Thus, ensuring everything else had run beforehand.
Obviously, you can change the 20 to any number of seconds depending on the length of delay you need.
I used your delay idea, but it was not successful.
When the popup occurs, I hit my Enter key(or Return).
The scripts looks for Error in any open windows and then simulates the pressing of the Enter key.
#!/bin/bash
#
# SUPPOSED to close that highly annoying "Indicator Applet Complete" has quit unexpectedly popup
# Unfortunately it does not work.
#
winid=$(xdotool search --name "Error")
#
sleep 15
xdotool key --window "${winid}" Return
I also tried this
#!/bin/bash
# xdotool selectwindow This determines the window id or 2nd method
# xdotool search --name "Error"
#
# Does not work because for some reason, the window id is different every time ?
xdotool key --window 16777491 alt+F4
xdotool key --window 16777782 alt+F4
#16777782
#16777491
#16778087
Does the script work when you run it manually?
Yes, it runs manually.
put the "sleep 15" command before all other commands.