ElEscalador
Posts: 676
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Run Program/Script from GUI desktop without the 2nd step?

Sun Mar 12, 2017 4:15 pm

When I click on my executable script icons, I then have to choose in a popup window whether to execute, execute in terminal, open, or open with.
Is there a way to set the default to execute in terminal so I don't have to choose?
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

ElEscalador
Posts: 676
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Elescalador

Mon Mar 13, 2017 12:29 am

Man...either this is impossible or I'm really Google handicapped today and find the right query.
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Run Program/Script from GUI desktop without the 2nd step

Mon Mar 13, 2017 2:09 am

It is possible. I am not sure how to do so as I launch all my programs from bash (the shell) even when running in the GUI.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Run Program/Script from GUI desktop without the 2nd step

Mon Mar 13, 2017 2:25 am

Hmmm...

PCManFM > Preferences > General > Don't ask options on launch executable file?

That should prevent it from prompting you, but I don't know if it will work how you want.

Edit: I guess you could make a .desktop file for it. Still not sure if that would do what you want.
script.desktop:

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Run script in terminal      
Comment=Run script in terminal
Exec=/home/pi/scripts/shell/script.sh
StartupNotify=true
Terminal=true

321
Posts: 94
Joined: Mon Feb 13, 2017 7:26 pm

Re: Run Program/Script from GUI desktop without the 2nd step

Mon Mar 13, 2017 7:18 am

A different approach.

Do you have an icon which calls the terminal and displays the behaviour you want?

Perhaps locating the Terminal icon might be a start?

treeHouse
Posts: 29
Joined: Sat Aug 06, 2016 2:35 am

Re: Run Program/Script from GUI desktop without the 2nd step

Mon Mar 13, 2017 1:42 pm

I used the .desktop file approach, which allows you to get the script off the desktop (maybe put it in a local executables folder) and become a lxmenu item.

Here is how I launch an appimage of the latest musescore (debian stable repos have very old version). Without this, it would always ask me how I wanted this to launch.

Code: Select all

[Desktop Entry]
Keywords=Music Notation
Name=MuseScore
Comment=Music notion editor
Exec=/home/pi/LocalApps/MuseScore-2.0.3-armhf.AppImage %F
Icon=MuseScore
Terminal=false
Type=Application
MimeType=text/plain
Categories=Education;AudioVideo;Music
This file is stored in

Code: Select all

/home/pi/.local/share/applications
Obiously, substitute your username for pi if you created a new user.
Also, in the Exec line, the %F is an argument for saying that you can double open multiple documents of this type at a time. If this is not relevent to your script, you may omit this.

The icon line refers to a .png file named MuseScore.png which is stored in

Code: Select all

/home/pi/.local/share/icons
Once again, substitute your user name for pi if you have created a new user account.

Hope this helps

ElEscalador
Posts: 676
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Elescalador

Mon Mar 13, 2017 3:56 pm

321 wrote:A different approach.

Do you have an icon which calls the terminal and displays the behaviour you want?

Perhaps locating the Terminal icon might be a start?
I guess I don't know how to make a terminal icon that also launches a behavior?
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

ElEscalador
Posts: 676
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA
Contact: Website

Elescalador

Mon Mar 13, 2017 4:01 pm

treeHouse wrote:I used the .desktop file approach, which allows you to get the script off the desktop (maybe put it in a local executables folder) and become a lxmenu item.

Here is how I launch an appimage of the latest musescore (debian stable repos have very old version). Without this, it would always ask me how I wanted this to launch.

Code: Select all

[Desktop Entry]
Keywords=Music Notation
Name=MuseScore
Comment=Music notion editor
Exec=/home/pi/LocalApps/MuseScore-2.0.3-armhf.AppImage %F
Icon=MuseScore
Terminal=false
Type=Application
MimeType=text/plain
Categories=Education;AudioVideo;Music
This file is stored in

Code: Select all

/home/pi/.local/share/applications
Obiously, substitute your username for pi if you created a new user.
Also, in the Exec line, the %F is an argument for saying that you can double open multiple documents of this type at a time. If this is not relevent to your script, you may omit this.

The icon line refers to a .png file named MuseScore.png which is stored in

Code: Select all

/home/pi/.local/share/icons
Once again, substitute your user name for pi if you have created a new user account.

Hope this helps
I don't know what most of this means but I'll seen if I can make it work! Thanks
My Autonomous Robot Project and a few of my other projects below.

https://lloydbrombach.wordpress.com/

Return to “General discussion”