#!/bin/bash

#Hide the mouse cursor
unclutter -idle 0.05 -root &

#Rotate the screen and disable screensaver
xset -dpms
xset s off
xset s noblank
xrandr -o right


#Change permissions 
sudo chmod a+rw /dev/i2c-4
sudo chmod a+rw /dev/ttyO0
sudo chmod a+rw /dev/ttyO2
sudo chmod a+rw /sys/class/gpio/gpio0/value 
sudo chmod a+rw /sys/class/gpio/gpio2/value
sudo chmod a+rw /sys/class/gpio/gpio3/value
sudo chmod a+rw /sys/class/gpio/gpio69/value
sudo chmod a+rw /sys/class/gpio/gpio75/value
sudo chmod a+rw /sys/class/gpio/gpio82/value
sudo chmod a+rw /sys/class/gpio/gpio112/value
sudo chmod a+rw /sys/class/gpio/gpio114/value
sudo chmod a+rw /sys/class/gpio/gpio123/value
sudo chmod a+rw /sys/class/gpio/gpio124/value
sudo chmod a+rw /sys/class/gpio/gpio125/value
sudo chmod a+rw /sys/class/gpio/gpio126/value
sudo chmod a+rw /sys/class/gpio/gpio141/value
sudo chmod a+rw /sys/class/gpio/gpio142/value
sudo chmod a+rw /sys/class/gpio/gpio172/value
sudo chmod a+rw /sys/class/gpio/gpio173/value

#Add ability to bind to ports less than 1024 - Moved to respawn.sh
#sudo setcap cap_net_bind_service=+ep ~/g4dev/project/bin/debug/project.exe

#Script to monitor and respawn project, SOM_mon, and chromium
~/g4dev/project/scripts/rspawn-proc.sh > /dev/null &

#Enable networking without app
#sudo ifdown eth0
#sudo ifup eth0
#sudo ifdown usb0
#sudo ifup usb0

#Disable keyboard and mouse
#xinput set-int-prop 8 "Device Enabled" 8 0
#xinput set-int-prop 3 "Device Enabled" 8 0

