Shell Script To Adjust Screen Mode

[Solved] Shell Script To Adjust Screen Mode | Solidity - Code Explorer | yomemimo.com
Question : Shell script to adjust screen mode

Answered by : sunny-wjtd41mv2ggk

TouchscreenDevice="$(xrandr |grep eDP|cut -d" " -f1)"
if [ "$1" = "--help" ] || [ "$1" = "-h" ] ; then
echo 'Usage: rotate-screen.sh [OPTION]'
echo
echo 'This script rotates the screen and touchscreen input 90 degrees each time it is called,'
echo
echo Usage:
echo ' -h --help display this help'
echo ' -r turn orientation 90° right'
echo ' -l turn orientation 90° left'
echo ' -i turn orientation 180°'
echo ' -n (or no options) rotates the screen back to normal'
exit 0
fi
if [ "$1" == "-i" ]; then
echo "Upside down"
xrandr --output "$TouchscreenDevice" --rotate inverted
elif [ "$1" == "-l" ]; then
echo "90° to the left"
xrandr --output "$TouchscreenDevice" --rotate left
elif [ "$1" == "-r" ]; then
echo "90° to the right"
xrandr --output "$TouchscreenDevice" --rotate right
else
echo "Back to normal"
xrandr --output "$TouchscreenDevice" --rotate normal
fi

Source : | Last Update : Wed, 13 Jul 22

Answers related to shell script to adjust screen mode

Code Explorer Popular Question For Solidity