Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run .sh file by double clicking in XFCE?

I am trying to make a script file. Everything works fine, but it only starts from the terminal.

I already made it executable using chmod +x filename.sh, but it won't run.

I saw a solution:

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

But even this doesn't work.

like image 760
Seymour B Avatar asked Oct 16 '22 14:10

Seymour B


1 Answers

Ran into the same problem tonight, took a lot of digging but I got it! (on mobile so formatting might be wack)

  1. make sure you have the proper #!/bin/bash/ shebang

  2. right click file-> permissions-> check "allow to run as program"

  3. in terminal run: xfconf-query --channel thunar --property /misc-exec-shell-scripts-by-default --create --type bool --set true

this last step is what makes the difference in xfce. Thunar (The xfce file manager) doesn't by default have this setting so you need to add it yourself.

If you are more comfortable in a gui: do steps 1-2 above, then:

1)get into xfce4-settings-editor (You can find it by searching with alt+F2)

2)click thunar on the menu in the right

3)hit "new", set the type to boolean set to true and the property to /misc-exec-shell-scripts-by-default

either way make sure you don't have a file manager/thunar window open

If you want to read more about these "Hidden settings" in thunar, check out the docs! https://docs.xfce.org/xfce/thunar/hidden-settings

like image 184
Spatrico Avatar answered Oct 18 '22 05:10

Spatrico