Run command as root on user login in gnome

A combination of these two:

https://askubuntu.com/questions/462143/where-are-the-startup-scripts-for-unity-desktop/486304#486304

https://askubuntu.com/questions/37957/how-do-i-manage-applications-on-startup-in-gnome-3

 

#cat /home/stevenlafl/Startup/create_trigger.sh; \
#echo "\n---------------\n"; \
#cat /home/stevenlafl/Startup/run_command.sh

#!/bin/sh
touch /home/stevenlafl/Startup/.trigger

---------------

#!/bin/bash

FILE="/home/stevenlafl/Startup/.trigger"
# don't use $HOME here, since you run it by root

if [ -f $FILE ]; then
   /home/stevenlafl/Desktop/reload-bluetooth-driver.sh
   rm -f $FILE
fi

and the cron setup: 

#sudo crontab -e; \
#echo "\n---------------\n";

---------------

* * * * * /home/stevenlafl/Startup/run_command.sh

 


Leave us a comment!