Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Couldn't run Python Games from new user

Sat Dec 29, 2012 4:57 pm

I changed my username and password and got all owners changed on the Destop and python_games directories. I could do "startx" and run things like Midori and NetSurf, but when I tried to run Python Games I got an error because it couldn't execute child process "/home/pi/python_games/launcher.sh". Turns out that the file Desktop/python-games.desktop needs to be edited to point to the new user directory for python_games (it's hardcoded for the pi user). I had deleted the pi user and hadn't seen this editting requirement anywhere when searching for instructions on creating a new user. As far as I can tell, python-games.desktop is the only file requiring this update.

KenT
Posts: 758
Joined: Tue Jan 24, 2012 9:30 am
Location: Hertfordshire, UK
Contact: Website

Re: Couldn't run Python Games from new user

Sat Dec 29, 2012 5:16 pm

I keep the master of the python-games launcher here https://github.com/KenT2/python-games. PM me if this needs changing.

The desktop launcher is kept by asb here:

https://github.com/asb/spindle/blob/mas ... 4-lxde-edu

Can you raise an issue on Github? If not PM me and I will raise the issue. The correct code would be useful.

Ken
Pi Presents - A toolkit to produce multi-media interactive display applications for museums, visitor centres, and more
Download from http://pipresents.wordpress.com

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Couldn't run Python Games from new user

Sat Dec 29, 2012 9:41 pm

KenT wrote:I keep the master of the python-games launcher here https://github.com/KenT2/python-games. PM me if this needs changing.

The desktop launcher is kept by asb here:

https://github.com/asb/spindle/blob/mas ... 4-lxde-edu

Can you raise an issue on Github? If not PM me and I will raise the issue. The correct code would be useful.

Ken
I sent you a PM - hopefully you will get it. I'm new to Linux so my help level is minimum at this point. I suggested that the only resolution might be to move the python_games folder to a system folder instead of the user folder. One other thing I thought of: Would it be possible to have the link set to use a system defined variable that gets set at login to the username?

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Couldn't run Python Games from new user

Tue Jan 01, 2013 6:13 pm

After a lot of scrabbling around, I found a fix. Maybe this can get implemented in an upcoming revision of Debian Wheezy. Unfortunately, environment variables like $HOME are not parsed in ".desktop" files so you have to create an external file and call that from the ".desktop" file. In this case, the line in Desktop/python-games.desktop will become:

Exec=sh py_games_exec_wrapper

Create new file "py_games_exec_wrapper" in your home directory and insert this line:

$HOME/python_games/launcher.sh

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: Couldn't run Python Games from new user

Wed Jan 02, 2013 2:26 pm

Someone in another thread showed that I could use the shell command to call the launcher file directly using $HOME. I had tried that but I guess the key is to use the "-c" after the shell command. So now the dekstop file line looks like this:

Exec=sh -c $HOME/python_games/launcher.sh

Return to “Beginners”