mirror of
https://github.com/wassname/thinkpad-x380-yoga-scripts.git
synced 2026-09-12 13:00:29 +08:00
Modified the rotate script to work with GNOME 3.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user