Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Nice trick! Your solution partially works but in an unexpected way. Now I have a sudo call at every iteration sudo_response=$(SUDO_ASKPASS=/bin/false sudo -A whoami 2>&1 | wc -l). As the loop runs at an interval lower than the timeout value, it means a sudo timeout can never occur. So there is actually no need for the rest of the logic. Commented Feb 24, 2023 at 13:29
  • Concerning the echo -e "\a" part, it doesn't focus the windows but I managed to do it with a gdbus call : gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "var mw = global.get_window_actors().map(w=>w.meta_window).find(mw=>mw.get_title().includes('script-name')); mw.activate(0)". The shell window title needs to be set with printf '\033]2;script-name\a'. Commented Feb 24, 2023 at 13:31