Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

Shell script to adjust screen mode

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
Comment

PREVIOUS NEXT
Code Example
Shell :: -bash: sdk: command not found 
Shell :: exec format error heroku docker file M1 chip 
Shell :: install eb cli mac - Install pip with the script that the Python Packaging Authority provides. 
Shell :: Bulk user add with passwords bash script 
Shell :: quit ionic 
Shell :: shows current time (12hrs), date, month by instance 
Shell :: print each filename in a newline in ls 
Shell :: app not installed app appears to br corrupt in android studio 
Shell :: docker unpause 
Shell :: docker Redirecting Both stdout and stderr file 
Shell :: image to docker file online 
Shell :: install postgresql and phppgadmin client 
Shell :: git init create new version-controlled projects 
Shell :: bind mac to AD via JAMF with policy* 
Shell :: linux verify package install on remote system script 
Shell :: KDE Connect Command PC turn off 
Shell :: fish function to change php version devilbox .env 
Shell :: install smui top-app-bar 
Shell :: disable wget messages 
Shell :: save and close cron after modification 
Shell :: unix find files with specific year 
Shell :: git commit allow empty to trigger ci 
Shell :: ring Change the current directory 
Shell :: install brave browser for kali linux 
Shell :: short cut: select all matches 
Shell :: https://physionet.org/files/chf2db/1.0. 
Shell :: add executable in pth 
Shell :: --name-status flag for git command 
Shell :: adding file system to a volume 
Shell :: install telnet mint 9 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =