0

How can I automatically run a .sh file right after I login with my regular credentials, and my root password. Thanks

Noah
  • 255

1 Answers1

0

ou can do that with a .desktop file placed in ~/.config/autostart. To create such a file simply do:

cat > ~/.config/autostart/myscript.desktop << "EOF"
[Desktop Entry]
Name=myscript.sh
GenericName=my script for foo-fu
Comment=does bar the foo or fu foos the bar
Exec=sh ~/scripts/myscript.sh
Terminal=true
Type=Script
Icon= 
Categories=Tools;
StartupNotify=true
EOF

Up to that make sure you have done a chmod 755 on that script by:

chmod 755 myscript.sh

and set it aswell to execute in nautilus like on the following example picture:

enter image description here

Videonauth
  • 33,815