Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PROG='thunderbird'; # set to your program process name
- RUNNING=`ps auxw | grep $PROG | grep -v grep | wc -l`
- if [ "$RUNNING" == "1" ]; then
- # get PID
- PID=`ps auxw | grep $PROG | grep -v grep | awk '{print $2}'`
- # get window ID from PID
- WINID=`xdotool search --pid $PID | tail -1`
- # focus window, wait until focused, maximize with shortcut
- xdotool windowactivate --sync $WINID key --clearmodifiers --delay 100 ctrl+super+Up
- else
- # not running, run it
- $PROG
- fi
Advertisement
Add Comment
Please, Sign In to add comment