From 36ec9283bde33fb393b8a2e41b8cafe174576f9f Mon Sep 17 00:00:00 2001 From: Ognjen Maric Date: Sun, 28 Sep 2014 17:59:00 +0200 Subject: [PATCH] Modified the rotate script to work with GNOME 3. --- thinkpad-yoga-rotate/rotate-screen.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/thinkpad-yoga-rotate/rotate-screen.sh b/thinkpad-yoga-rotate/rotate-screen.sh index 3ba2cb6..e56cc19 100755 --- a/thinkpad-yoga-rotate/rotate-screen.sh +++ b/thinkpad-yoga-rotate/rotate-screen.sh @@ -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