Skip to content
/ rotBright Public

Linux bash scripts to get display, brightness, touchscreen (and pen) in tune

License

Notifications You must be signed in to change notification settings

qrti/rotBright

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rotBright - rotation & brightness

Linux bash scripts to get display, brightness, touchscreen (and pen) in tune

Linux distributions tend to neglect thorough special key handling, brightness control, touchscreen and pen support,
especially notebook, tablet and convertible users suffer from half-cooked, incorrect or missing implementation.

In many cases system devices are recognized correctly, so let's use what we got and try to mend it for daily use.


download

download repository from GitHub,
unzip and copy for example to: ~/rotBright

or

copy scripts to current directory
wget https://raw.github.com/qrti/rotBright/master/script/rotate.sh
wget https://raw.github.com/qrti/rotBright/master/script/bright.sh

or

check if git is installed
$ git --version

if git is not installed
$ sudo apt-get install git-all

clone shrink repository to current directory
$ git clone https://github.com/qrti/rotBright.git


configure

figure out your machines touch (and pen) device
$ xinput -list

edit the script
$ nano rotate.sh

if necessary replace preconfigured entries, for correct pen configuration see -> remarks

DEVICE0="pointer:ELAN22A6:00 04F3:22A6"             # Asus T102HA touchscreen
DEVICE1="ELAN22A6:00 04F3:22A6 Pen (0)"             #             pen
DEVICE2="ASUS HID Device ASUS HID Device Touchpad"  #             touchpad

leave an entry empty to not configure a device

DEVICE0="YOUR_DEVICE:xx xxxx:xxxx"      # your touchscreen
DEVICE1=

display rotation possibly sets brightness to maximum, so it has to be restored as well
executing rotate.sh will also call bright.sh and restore brightness if

RESTBRIGHT=true                         # restore brightness

execute

change directory
$ cd ~/rotBright

make scripts executable once
chmod a+x rotate.sh
chmod a+x bright.sh

execute rotation script
$ ./rotate.sh [+|normal|inverted|left|right|restore]

+ normal inverted left right restore
+90° 180° 90° 270° last used current

(counter clockwise)

execute brightness script
$ ./bright.sh [-|+|[10-100]|restore]

- + 10-100 restore
darker brighter absolute last used current

see configure to execute rotate.sh in combination with bright.sh


keyboard shortcuts

for convenient use you can bind rotation and brightness control to keys,
unfortunately on most laptops the special function key in combination with F1..F12 will not work,
so try to figure out unused combinations with CTRL and/or ALT

example for brightness advance
preferences/keyboard/shortcuts/custom shortcuts/add custom shortcut

name: Bright+
command: /home/USERNAME/rotBright/bright.sh +
key: CTRL-F6

replace USERNAME with your username


auto restore

to automatically restore last used rotation and brightness at system start do the following

preferences/startup applications/custom command

name: Restore Rotation and Brightness 
command: /home/USERNAME/rotBright/rotate.sh restore
startup delay: 15

replace USERNAME with your username
on fast systems startup delay can be reduced


remarks

- for correct pen restauration please consider

directly after boot a generic pen device will be listed with xinput
ELAN22A6:00 04F3:22A6 Pen

after first pen use a device instance is added to the list
ELAN22A6:00 04F3:22A6 Pen Pen (0)

use this instance in the script -> configure

- restoring pen orientation after boot and first pen use requires a manual
$ ./rotate.sh restore

- developed under Linux Mint on Asus T102HA Mini Transformer with Visual Studio Code
- not tested on other machines but might work well on various notebooks, tablets and convertibles

inspired by
https://www.linux.com/learn/how-configure-touchscreen-linux
https://askubuntu.com/questions/368317/rotate-touch-input-with-touchscreen-and-or-touchpad
https://gist.github.com/mildmojo/48e9025070a2ba40795c
https://ubuntuforums.org/archive/index.php/t-2313209.html
https://wiki.debian.org/InstallingDebianOn/Asus/T100TA#Screen_power_management

Donations are welcome!

https://www.paypal.com


history

V0.5
- initial version

V0.6
- proper touchpad support (thanks to np2048)
- fixed 'rotation +' bug

rotate V0.7
- corrected device entries


copyright

rotBright is published under the terms of MIT license

Copyright (c) 2019 qrt@qland.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Linux bash scripts to get display, brightness, touchscreen (and pen) in tune

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages