Skip to content

Instantly share code, notes, and snippets.

@ralfstx
Created June 8, 2012 13:32
Show Gist options
  • Save ralfstx/2895633 to your computer and use it in GitHub Desktop.
Save ralfstx/2895633 to your computer and use it in GitHub Desktop.
A shell script to set windows to fullscreen
#!/bin/bash
mode=
window=
usage() {
echo "Usage: $0 [on|off|toggle] [window]"
echo " default is to toggle fullscreen mode"
echo " window is a string contained in the window's title"
exit
}
while [ $# -gt 0 ]; do
if [ "$1" == "--help" ]; then
usage
elif [ -z $mode && "$1" == "on" ]; then
mode=add
elif [ -z $mode && "$1" == "off" ]; then
mode=remove
elif [ -z $mode && "$1" == "toggle" ]; then
mode=toggle
else
window="window $1"
fi
shift
done
if [ -z $mode ]; then
mode=toggle
fi
if [ -z $window ]; then
window=:SELECT:
fi
exec wmctrl -r "$window" -b $mode,fullscreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment