Skip to content

Instantly share code, notes, and snippets.

@theblackhole
Created January 3, 2018 09:20
Show Gist options
  • Select an option

  • Save theblackhole/36de56b8cddf4e7ee33a501ba72759e1 to your computer and use it in GitHub Desktop.

Select an option

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)
#!/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