Created
January 3, 2018 09:20
-
-
Save theblackhole/36de56b8cddf4e7ee33a501ba72759e1 to your computer and use it in GitHub Desktop.
@MagicMint's (fixed) script to start Thunderbird in background (Cinnamon) (https://community.linuxmint.com/tutorial/view/2222)
This file contains hidden or 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
| #!/bin/bash | |
| # {~,/usr/local}/bin/thunderbird (MagicMint) O1010 | |
| # Start thunderbird minimized if desired | |
| mailer="/usr/bin/thunderbird" | |
| help_msg() { | |
| cat <<-EOF | |
| `awk 'FNR==3 {print gensub("# ", "", 1)}' "$0"` | |
| Usage: `basename $0` [-min] [URL] | [-h] | [--help] | |
| EOF | |
| } | |
| case $1 in | |
| -h | --help ) | |
| help_msg | |
| echo | |
| read -p "Press [Enter] to continue or [CTRL-C] to abort" | |
| eval $mailer --help 2>/dev/null | |
| ;; | |
| -min ) | |
| shift | |
| eval $mailer "$@" & | |
| until test $THUNDERWIN; do | |
| sleep 1 | |
| THUNDERWIN=`xdotool search --name ".*- Mozilla Thunderbird$"|head -n 1` | |
| done | |
| xdotool windowfocus --sync $THUNDERWIN | |
| xdotool key Ctrl+Alt+Super+Down | |
| ;; | |
| *) exec $mailer "$@" | |
| ;; | |
| esac | |
| #End of script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment