diff options
author | Amin Bandali <bandali@gnu.org> | 2020-10-06 00:14:12 -0400 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2020-10-06 00:14:12 -0400 |
commit | ca3a844af240ca87882522d14b530e0f1a6327ef (patch) | |
tree | b01f2630bf8e9af96d9dd40d8e19540544dd6b71 /.local/bin/toggle-tablet | |
parent | d7dee82420a04e5c92e5b5ad316e14a49bd4d689 (diff) | |
download | configs-ca3a844af240ca87882522d14b530e0f1a6327ef.tar.gz configs-ca3a844af240ca87882522d14b530e0f1a6327ef.tar.xz configs-ca3a844af240ca87882522d14b530e0f1a6327ef.zip |
Move user-level configs out of rc.org
I will keep rc.org around for now, only for system-level (global)
config files.
Diffstat (limited to '.local/bin/toggle-tablet')
-rwxr-xr-x | .local/bin/toggle-tablet | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.local/bin/toggle-tablet b/.local/bin/toggle-tablet new file mode 100755 index 0000000..c79a4f4 --- /dev/null +++ b/.local/bin/toggle-tablet @@ -0,0 +1,31 @@ +#!/bin/sh +# This script toggles between a 'normal' mode and a 'tablet' mode, doing +# a few things: + +# - rotates the screen using =xrandr=, so that rotating the physical +# display of my X220t would have the laptop's battery on the right +# hand side, +# - enables touch screen, +# - properly rotates the stylus pen and touch screen pointers, and +# - toggles between RGB and Vertical BGR sub-pixel order. + +case $(xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation) in + 0) # Screen is not rotated, we should rotate it right (90°) + xrandr -o 3 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 1 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 1 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 1 + xfconf-query -c xsettings -p /Xft/RGBA -s vbgr + ;; + 1) # Currently top is rotated right, we should set it normal (0°) + xrandr -o 0 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation -s 0 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Wacom_Rotation -s 0 + xfconf-query -c pointers -p /Wacom_ISDv4_E6_Finger_touch/Properties/Device_Enabled -s 0 + xfconf-query -c xsettings -p /Xft/RGBA -s rgb + ;; + *) + echo "Unknown result from 'xfconf-query -c pointers -p /Wacom_ISDv4_E6_Pen_stylus/Properties/Wacom_Rotation'" >&2 + exit 1 + ;; +esac |