run script in Porteus 4.0 Xfce

Non release banter
Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

run script in Porteus 4.0 Xfce

Post#1 by Kulle » 26 Jul 2018, 11:08

I use Porteus 4.0 Xfce.
If I double click on a script, the mousepad opens.
But I don't want to edit the script, I want to run it.

I can do it only in a complicated way:
Right mouse button and select "open terminal here"
And then I have to type: ./name_of_the_script.sh

How can I reach: doubleclick = run script

Is there any possibility of setting it somewhere?

Many thanks for the help

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

run script in Porteus 4.0 Xfce

Post#2 by ncmprhnsbl » 26 Jul 2018, 13:03

maybe this:
http://docs.xfce.org/xfce/thunar/hidden-settings
xfce4-settings-editor:
see: /misc-exec-shell-scripts-by-default > set to true
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

run script in Porteus 4.0 Xfce

Post#3 by donald » 26 Jul 2018, 14:58

Or...
create a txt file with following content:

Code: Select all

[Desktop Entry]
Version=1.0
Type=Application
Exec=exo-open --launch TerminalEmulator
Icon=utilities-terminal
StartupNotify=true
Terminal=false
Name=Terminal Emulator
NoDisplay=true
rename the file to exo-terminal-emulator.desktop and copy it into /usr/share/applications/

now open /home/guest/.config/mimeapps.list (use mousepad) and look for a line
[Added Associations]
application/x-shellscript= and add exo-terminal-emulator.desktop; to this line e.g.
application/x-shellscript=mousepad.desktop;exo-terminal-emulator.desktop;

To make it the default action add
[Default Applications]
application/x-shellscript=exo-terminal-emulator.desktop
in the mimeapps.list file

Kulle
Warlord
Warlord
Posts: 594
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

run script in Porteus 4.0 Xfce

Post#4 by Kulle » 26 Jul 2018, 15:19

Many thanks for the quick help.
The solution is (in the terminal):

Code: Select all

xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set true

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

run script in Porteus 4.0 Xfce

Post#5 by francois » 27 Jul 2018, 02:12

Great!

Just as I was going to reply.

Fulalas was supposed to fix that, but it seems not. :(
Prendre son temps, profiter de celui qui passe.

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

run script in Porteus 4.0 Xfce

Post#6 by donald » 27 Jul 2018, 07:12

@ francois

It is much safer to open a script file in a text editor by default
than to execute by default, right?

Think of the "average" user or an inadvertently clicked script file...

rchase
Shogun
Shogun
Posts: 282
Joined: 10 Jan 2016, 17:26
Distribution: Porteus 5.0 rc3 xfce
Location: Denver, Colorado

run script in Porteus 4.0 Xfce

Post#7 by rchase » 27 Jul 2018, 17:00

Donald, your solution seems rather involved; a utility to automate the procedure would be nice. What is required to do this for the root account? It would also be nice if Thunar could be made to offer script execution from the right-click menu (as opposed to becoming the default action for double-clicking).

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

run script in Porteus 4.0 Xfce

Post#8 by donald » 28 Jul 2018, 05:04

Hi rchase
What is required to do this for the root account?
Same as described above but in /root/.config/mimeapps.list
( don't forget to create exo-terminal-emulator.desktop and copy it into /usr/share/applications/ )
It would also be nice if Thunar could be made to offer script execution from the right-click menu
Add in mimeapps.list

Code: Select all

[Added Associations]
application/x-shellscript=mousepad.desktop;exo-terminal-emulator.desktop;

[Default Applications]
application/x-shellscript=mousepad.desktop
You can change the Name=Terminal Emulator in the exo-terminal-emulator.desktop file
Example -- changed to Execute:
(picture shows the script file right-click menu )
Image
Default (double-click) action is open in mousepad but you have the right-click option to execute the file.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

run script in Porteus 4.0 Xfce

Post#9 by francois » 29 Jul 2018, 02:28

I conclude that Porteus is more secure than it has ever been with 4.0.! ;)

I cannot disagree.
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8342
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

run script in Porteus 4.0 Xfce

Post#10 by Ed_P » 29 Jul 2018, 03:42

:%)
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

run script in Porteus 4.0 Xfce

Post#11 by francois » 31 Jul 2018, 23:11

About what are you :%)
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8342
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

run script in Porteus 4.0 Xfce

Post#12 by Ed_P » 31 Jul 2018, 23:22

francois wrote:
29 Jul 2018, 02:28
I cannot disagree.
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

run script in Porteus 4.0 Xfce

Post#13 by francois » 01 Aug 2018, 00:24

No one could be against virtue. Donald is an informed superuser after all. B)
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: run script in Porteus 4.0 Xfce

Post#14 by francois » 14 Dec 2018, 03:39

@donald:
After thinking about it for a few months, I must say I disagree. After all, script activation in thunar with a double click were there since porteus birth (Dec 2010). There has been no major complaints about it.

My advice is that this type of practice is less harmful than smoking pot on a weekly basis. ;)

I will be sending you some if you pm me your address.
Prendre son temps, profiter de celui qui passe.

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: run script in Porteus 4.0 Xfce

Post#15 by donald » 14 Dec 2018, 04:58

I will be sending you some if you pm me your address.
:)

Thanks for the offer, but I'm afraid I have to decline.
It would be discovered with great certainty at the import and my peaceful life
would be massively disturbed if the police stormed into my apartment at 5 a.m. to arrest me.

Post Reply