Created
July 8, 2020 09:23
-
-
Save replaid/fd90ef14ecc13b0c470c491bd5823438 to your computer and use it in GitHub Desktop.
Give Zenity foreground on macOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
zenity --password & | |
zenity_pid=$! | |
osascript<<EOF | |
tell application "System Events" | |
set processList to every process whose unix id is $zenity_pid | |
repeat with proc in processList | |
set the frontmost of proc to true | |
end repeat | |
end tell | |
EOF | |
# Can't use fg by default, that's for interactive shells. | |
# But this waits for all background processes to finish. | |
wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All this was inspired by withfig.com