Skip to content

Instantly share code, notes, and snippets.

@Abdillah
Last active January 1, 2016 21:59
Show Gist options
  • Save Abdillah/8206655 to your computer and use it in GitHub Desktop.
Save Abdillah/8206655 to your computer and use it in GitHub Desktop.
To suppress ubuntu-sdk qml2puppet windows.
#!/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