Timeline for Focus bash window when prompting for sudo
Current License: CC BY-SA 4.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| S Feb 24, 2023 at 13:36 | history | edited | Nicolas Formichella | CC BY-SA 4.0 | Fix if condition |
| S Feb 24, 2023 at 13:36 | history | suggested | runningwild | CC BY-SA 4.0 | Fix if condition |
| Feb 24, 2023 at 13:33 | review | Suggested edits | |||
| S Feb 24, 2023 at 13:36 | |||||
| Feb 24, 2023 at 13:31 | comment | added | runningwild | 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'. | |
| Feb 24, 2023 at 13:29 | comment | added | runningwild | 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. | |
| Feb 24, 2023 at 13:27 | history | edited | Nicolas Formichella | CC BY-SA 4.0 | Fix comment |
| Feb 24, 2023 at 13:24 | vote | accept | runningwild | ||
| Feb 24, 2023 at 10:31 | history | answered | Nicolas Formichella | CC BY-SA 4.0 |