Last active
December 26, 2015 01:49
-
-
Save yotamoron/7074005 to your computer and use it in GitHub Desktop.
A tiny script to refocus on a terminal once a command has finished running.
You will need xdotool installed.
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 | |
WINDOW_NAME=`xdotool getwindowname $WINDOWID` | |
shopt -s expand_aliases | |
source ~/.aliases | |
eval $@ | |
xdotool windowactivate --sync $WINDOWID | |
CURRENT_WINDOW_NAME=`xdotool getwindowname $WINDOWID` | |
while [ "$CURRENT_WINDOW_NAME" != "$WINDOW_NAME" ]; do | |
xdotool key --window $WINDOWID Ctrl+Right | |
CURRENT_WINDOW_NAME=`xdotool getwindowname $WINDOWID` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment