You are not logged in.

#1 2015-03-05 12:09:35

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

[SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

Until recently, I could double-click a script (or link to a script) in Thunar or on the XFCE desktop, and it would execute

Now, however, when I double-click a script, it opens in Leafpad (my text editor).  I've browsed the wiki and searched the forum and web, but can't find any clues as to what has changed or why this is happening.

I can right-click in Thunar and use the "Open With>" option to set the script to open with another application, but there's no obvious option to run a script.  Opening with a terminal emulator results in a brief hourglass, then nothing.

The script I'm testing with (the Tor Browser Bundle startup script) is in my /home/myname directory, has -rwx------ permissions (with me as the owner), and the file type in Thunar shows "shell script".  It runs fine if I execute it in a terminal with "sh /path/to/script" -- just not via Thunar or the XFCE desktop.

Can anyone suggest anything I could check?

Last edited by esuhl (2015-03-08 09:49:52)

Offline

#2 2015-03-05 12:58:34

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

This is an intended change in Thunar 1.6.5: https://bugzilla.xfce.org/show_bug.cgi?id=7596#c15

Thunar 1.6.6 has a hidden option to restore the old behavior: http://git.xfce.org/xfce/thunar/commit/?id=b385bcf

The option is called misc-exec-shell-scripts-by-default and can be set using xfce4-settings-editor or by following the instructions here:

http://docs.xfce.org/xfce/thunar/hidden-settings

Offline

#3 2015-03-05 19:00:47

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Re: [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

At least I'm not the only one.  I noticed the same thing with Tor.  I was able to create a launcher on the desktop pointing to the script and that works fine so I can launch Tor without opening a terminal.

Offline

#4 2015-03-07 18:55:50

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

Re: [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

foutrelis wrote:

This is an intended change in Thunar 1.6.5: https://bugzilla.xfce.org/show_bug.cgi?id=7596#c15

Thunar 1.6.6 has a hidden option to restore the old behavior: http://git.xfce.org/xfce/thunar/commit/?id=b385bcf

The option is called misc-exec-shell-scripts-by-default and can be set using xfce4-settings-editor or by following the instructions here:

http://docs.xfce.org/xfce/thunar/hidden-settings

Thanks so much for the explanation!

I tried creating "misc-exec-shell-scripts-by-default" in the Settings Editor, set to true, but it didn't seem to have any effect.  So I tried this in a terminal, also to no effect:

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

If I right-click on a script, the top item on the menu is still "Open with Leafpad".  Do I somehow need to change the default behaviour to "execute script"...?  I've searched but I can't seem to find any further information.

I guess it's not a big deal, but it would be nice to restore the default behaviour.

Offline

#5 2015-03-07 19:11:49

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

esuhl wrote:

I tried creating "misc-exec-shell-scripts-by-default" in the Settings Editor, set to true, but it didn't seem to have any effect.

You need Thunar 1.6.6 for that setting to have any effect; it's still in [testing] as part of Xfce 4.12 (which I'll probably move to the stable repos soon).

Offline

#6 2015-03-08 09:47:05

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 140

Re: [SOLVED] Can't execute scripts with Thunar/XFCE. (Runs OK in terminal)

Oh, I should've realised!

I just updated to Thunar 1.6.6 (now in stable repos) and the setting works exactly as it should.

Thanks again. :-)

Last edited by esuhl (2015-03-08 09:47:20)

Offline

Board footer

Powered by FluxBB