Modified the rotate script to work with GNOME 3.

This commit is contained in:
Ognjen Maric
2014-09-28 17:59:00 +02:00
parent b467380a42
commit 36ec9283bd
+3 -2
View File
@@ -6,13 +6,14 @@
user="$(who -u | grep -F '(:0)' | head -n 1 | awk '{print $1}')"
# A convenience function to run a command in the X server context
with_display() { DISPLAY=:0.0 su -c "$(printf "%q " "$@")" "$user"; }
with_display() { DISPLAY=:0 su -c "$(printf "%q " "$@")" "$user"; }
# As the same ACPI event is currently emitted for both going in and out
# of the tablet mode, we need to toggle the orientation
# Figure out the current rotation:
current=`with_display xrandr -q --verbose | grep eDP1 | cut -d " " -f5`
current=`with_display xrandr -q --verbose | grep eDP1 | grep -o -E 'left|normal' | head -1`
# Set the next orientation
case $current in