6

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?

2 Answers 2

3

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

/home/user/.config/autostart/

..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]
Type=Application
Exec=/home/user/script.sh
Name=Custom script
Comment=Custom Script
3
  • 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 Aug 21, 2012 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, 2012 at 22:10
  • @user84627: if there is not yet an autostart directory in .config create one to make it work.
    – Takkat
    Aug 27, 2012 at 10:55
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .