View Single Post
  #2525  
Old 14.12.2022, 03:59
markifi markifi is offline
Baby Loader
 
Join Date: May 2020
Posts: 8
Default

what am i messing up with the notation here?
Quote:
callAsync(null, "if", "[", "!", "$(pgrep", "xdotool)", "]\;", "then", "xdotool", "getactivewindow", "sleep", "10", "windowactivate\;", "else", "sleep", "1\;", "fi\;");
i'm trying to do
Quote:
if [ ! $(pgrep xdotool) ]; then xdotool getactivewindow sleep 10 windowactivate; else echo "it's running"; fi;^C
if xdotool isn't running, run it, get the active window, sleep ten seconds and activate the same window regardless of something else opening in the meantime, if xdotool is running don't do anything basically. i'm having the mpv media player play whatever is downloaded on package finished but i can't figure out a better way to have it in the background than this, xdotool just activates the window that was already active before. and that works fine with
Quote:
xdotool getactivewindow sleep 10 windowactivate
but if multiple things get downloaded within that ten second time it gets confused as to which window it should switch back to if that makes any sense
Reply With Quote