Last active
January 1, 2016 21:59
-
-
Save Abdillah/8206655 to your computer and use it in GitHub Desktop.
To suppress ubuntu-sdk qml2puppet windows.
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
#!/bin/bash | |
minimize () { | |
# waiting 'ilegal' windows to load | |
sleep 3s | |
# identify windows with wmctrl id | |
for wid in $(wmctrl -l | grep Qml2Puppet) | |
do | |
if [[ "$wid" == 0x* ]] | |
then | |
# make the window on the most rear | |
wmctrl -i -r $wid -b toggle,below | |
fi | |
done | |
# focus main window of ubuntu-sdk | |
wmctrl -a "Qt Creator" | |
} | |
#VAR | |
COUNTER_FILE="~/.log/counter" | |
#MAIN: | |
CTR=$(cat $COUNTER_FILE) | |
# when the last window popped up, the script run | |
if [ $CTR -eq 2 ] | |
then | |
minimize & | |
echo 0 > $COUNTER_FILE | |
else | |
CTR=$[CTR + 1] | |
echo $CTR > $COUNTER_FILE | |
fi | |
# execute the real 'puppet' | |
(/usr/bin/qml2puppet.bak $*) | |
wait | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment