1
0
Fork 0

Added command to safely exit fullscreen without crashing ubuntu (hopefully)

This commit is contained in:
Starbeamrainbowlabs 2016-02-10 17:47:41 +00:00
parent 14f1762da3
commit e3e4abf408
1 changed files with 15 additions and 0 deletions

15
exit_fullscreen.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
# From https://code.google.com/p/chromium/issues/detail?id=382126
ACTIVE=$(xdotool getactivewindow)
if [ -z "$ACTIVE" ]; then
exit
fi
FULLSCREEN_STATE=$(xprop -id $ACTIVE _NET_WM_STATE | grep "_NET_WM_STATE_FULLSCREEN")
if [ -z "$FULLSCREEN_STATE" ]; then
exit
fi
wmctrl -i -r $ACTIVE -b remove,fullscreen
wmctrl -i -r $ACTIVE -b remove,maximized_horz,maximized_vert
xdotool windowsize $ACTIVE 600 600