summarylogtreecommitdiffstats
path: root/auto-rotation-hdaps-git.install
blob: 4bb8ea34bf2d7db6f8407d258548d8cdf53c4f94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
TMPUSER=$(who -u | grep "tty" | awk '{print $1;}')
USERHOME=$(eval echo ~$TMPUSER)
post_install() {
	echo "User:" $TMPUSER
	echo "Home:" $USERHOME
	echo "alias autorotation=auto_rotate.py" >> $USERHOME/.bashrc
	echo "Post_install: 'autorotation' alias added to '~/.bashrc'"
	chmod +x /usr/bin/auto_rotate.py
	echo "Post_install: chmodded auto_rotate.py to be executable"
	echo hdaps > /etc/modules-load.d/hdaps.conf
	echo "Added the hdaps kernal module .conf file to /etc/modules-load.d/
so that module persists after system reboot(very important)"
	echo "==>Instructions: First, reboot your system. Then, invoke 
autorotation on the command line to start the program. 
Once you've made sure the code works with your system, 
run the script at startup by adding it(/usr/bin/auto_rotate.py) to your DE's autostart section, 
or add 'auto_rotate.py &' to your ~/.xinitrc file."
}

post_remove() {
	sed -i "/alias autorotation=auto_rotate.py/d" $USERHOME/.bashrc
	echo "Post_remove: autorotation alias removed from '~/.bashrc'"
}