I have written a python script and would like that to run for a specific user log in. The script has two images, one with the Windows logo and the other for Linux.

When the Windows logo is clicked it runs the rdesktop program and logs into the Windows box.

I have been looking for an example or help for the Linux image when clicked loads the Ubuntu desktop for that user.

Also where and how to run this script for a specific user? And if I can get this script to run on login for this user, will the image buttons be the only thing displayed until one of them is clicked?


Either use the "Startup applications" or create a .desktop file in the directory


..where user is the name of the user for which this script is supposed to run.

example /home/user.config/autostart/custom.desktop file would contain the following lines

[Desktop Entry]
Name=Custom script
Comment=Custom Script
  • add the following lines to Your .desktop file (change it accordingly) [Desktop Entry] Type=Application Exec=/home/user/script.sh Name=Custom script Comment=Custom Script – Manula Waidyanatha Aug 21 '12 at 6:42
  • I do not have the /.config/autostart. I have found a autostart directory under /usr/share/gdm would that be that same as mentioned above – user84627 Aug 21 '12 at 22:10
  • @user84627: if there is not yet an autostart directory in .config create one to make it work. – Takkat Aug 27 '12 at 10:55

We may not want the Unity desktop to be loaded on login in the case we only access a remote Windows desktop.

Then we may want to consider creating a custom XSession that may then call our python script to determine the environment to load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.