-
-
Save Envek/639573 to your computer and use it in GitHub Desktop.
Terminal touchscreen manipulation script (from console)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Данный скрипт управляет возможностями энергосбережения монитора в X.Org | |
# ./dpms enable -- Разрешает отключать монитор для экономии энергии | |
# ./dpms disable -- Запрещает отключать монитор для экономии энергии | |
# Для прочего смотрите xset q, секция DPMS | |
usage="Usage: ./dpms < enable | disable | show | set [standby [suspend [off]]] | reset>" | |
# Reset values | |
standby=600 | |
suspend=600 | |
off=600 | |
if [ -z "$DISPLAY" ] | |
then export DISPLAY=:0.0 | |
fi | |
if [ -z "$1" ] | |
then echo $usage | |
else | |
if [[ "$1" == "enable" ]] | |
then xset +dpms | |
elif [[ "$1" == "disable" ]] | |
then xset -dpms | |
elif [[ "$1" == "show" ]] | |
then xset q | grep -A 1 DPMS | |
elif [[ "$1" == "set" ]] | |
then xset dpms $2 $3 $4 | |
elif [[ "$1" == "reset" ]] | |
then xset dpms $standby $suspend $off | |
else | |
echo $usage | |
fi | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage="Usage: touchscreen <enable> | <disable> | <calibrate>" | |
device="KeeTouch Co. Ltd. KeeTouch USB Touchscreen" | |
param_enable="Device Enabled" | |
enable_size=8 | |
param_calibrate="Evdev Axis Calibration" | |
calibrate_size=32 | |
calibration="1094 315 342 954" | |
if [ -z "$DISPLAY" ] | |
then export DISPLAY=:0.0 | |
fi | |
if [ -z "$1" ] | |
then echo $usage | |
else | |
if [[ "$1" == "enable" ]] | |
then xinput set-int-prop "$device" "$param_enable" $enable_size 1 | |
elif [[ "$1" == "disable" ]] | |
then xinput set-int-prop "$device" "$param_enable" $enable_size 0 | |
elif [[ "$1" == "calibrate" ]] | |
then xinput set-int-prop "$device" "$param_calibrate" $calibrate_size $calibration | |
else echo $usage | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment