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'" }