ElEscalador
Posts: 861
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?
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

ElEscalador
Posts: 861
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.
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

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: 1447
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: 861
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?
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

ElEscalador
Posts: 861
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
Robotics tips, hacks, book extras https://youtube.com/practicalrobotics

ptamike
Posts: 17
Joined: Fri Nov 29, 2013 10:29 am

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

Fri Jun 19, 2020 10:18 pm

Although this is an old question, it keeps appearing in the searches but doesn't include the solution.I thought I'd correct that.

To remove the prompt when launching an executable file, do the following:
  • Open File Manager
    Select Edit - Preferences - General
    Tick the option "Don't ask options on launch executable file"
It's a simple as that!

Mike

Heater
Posts: 16870
Joined: Tue Jul 17, 2012 3:02 pm

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

Sat Jun 20, 2020 3:46 am

ptamike wrote:
Fri Jun 19, 2020 10:18 pm
It's a simple as that!
Which was already described a few posts and a few years back here.

Except that none of the Windowing systems I have on any computer have what you describe.
Memory in C++ is a leaky abstraction .

stubright
Posts: 123
Joined: Sat Dec 24, 2011 11:12 pm

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

Sat Jun 20, 2020 9:15 am

Heater wrote:
Sat Jun 20, 2020 3:46 am
ptamike wrote:
Fri Jun 19, 2020 10:18 pm
It's a simple as that!
Which was already described a few posts and a few years back here.

Except that none of the Windowing systems I have on any computer have what you describe.
Except where it is, exactly as described by Mike in pcmanfm.
Image
Attachments
Screenshot_2020-06-20_10-02-01.jpg
Screenshot_2020-06-20_10-02-01.jpg (85.95 KiB) Viewed 1547 times

Flan_man
Posts: 3
Joined: Sat May 16, 2020 6:03 pm
Location: England

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

Thu Aug 27, 2020 12:55 pm

ptamike wrote:
Fri Jun 19, 2020 10:18 pm
Although this is an old question, it keeps appearing in the searches but doesn't include the solution.I thought I'd correct that.

To remove the prompt when launching an executable file, do the following:
  • Open File Manager
    Select Edit - Preferences - General
    Tick the option "Don't ask options on launch executable file"
It's a simple as that!

Mike
Lifesaver! So easy and sorted for me now :-)

Return to “General discussion”