You are not logged in.

#1 2018-11-07 12:48:10

thia11
Member
Registered: 2018-11-06
Posts: 21

Executing shell scripts with double click?

Hey guys!

I'm coming to you with a solution, but I have no idea how to approach the implementation. It's Thunar's fault because they thought that shell execution wasn't hidden enough in the preferences, so they literally took it out:
https://bbs.archlinux.org/viewtopic.php?id=194464
https://forums.linuxmint.com/viewtopic.php?t=202303

There is apparently a super secret part commented out in the editor file or something, but I don't know enough about finding that stuff to get to that point.

Please help!

If this is too hard, or requires additional packages, I will settle for a desktop launcher that executes the script. It is a backup script, so it is meant to just be tapped, do its job, and go away when you press enter.

Thank you!

Offline

#2 2018-11-07 13:02:53

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Executing shell scripts with double click?

Could you post your script? (using [ code ] tags)


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2018-11-07 13:14:46

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: Executing shell scripts with double click?

Instead of a Launcher, requiring a .desktop file, have you thought of using an Executor button? At the end of the default Tint2 configs is

# Executor - Panel item = E		Example
execp = new
execp_command =  echo '/usr/share/pixmaps/bunsenlabs-button.svg'
#execp_command =  echo '<span foreground="#7f7">Click</span>'
execp_has_icon = 1
execp_icon_h = 30
execp_cache_icon = 1
execp_interval = 0
execp_centered = 1
execp_font = sans 9
execp_markup = 1
execp_font_color = #aaffaa 100
execp_padding = 2 0
execp_tooltip = I will tell you a secret...
execp_lclick_command = notify-send "$(uname -srn)"
execp_background_id = 2

Edit the execp_tooltip and iconpath if desired, and set the execp_lclick_command to your script path. Then add 'E' to the 'Panel items'


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#4 2018-11-07 14:18:41

thia11
Member
Registered: 2018-11-06
Posts: 21

Re: Executing shell scripts with double click?

damo wrote:

Could you post your script? (using [ code ] tags)


It's the same one as in my other post

#!/bin/bash 

tty -s || xterm -e $0 "$@"
rsync -av ~Desktop/"My Files"/ /media/user/usb/"My Files"/
read -p "Press Enter" reply

I already did all the changes and it works fine if I run it with bash in the terminal, but I wanted to be able to double click it. I already had this problem before and know you have to enable the execution of shell scripts in the file manager. But Thunar took ot that feature for some reason and you have to edit some config file or something to return the feature.

I know about those letters, so i know exactly where to put E, but regarding

execp_lclick_command = notify-send "$(uname -srn)"

Let's say my file was in home/user/myfolder/myscript.sh
How would this line look like?

Tnx!

Offline

#5 2018-11-07 18:46:05

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: Executing shell scripts with double click?

thia11 wrote:

Thunar took ot that feature for some reason

i will take your word for it.
but even thunar will default to executing a .desktop file when double-clicked.
so create a desktop file that executes your script.

Offline

#6 2018-11-07 20:32:28

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,674

Re: Executing shell scripts with double click?

Let's say my file was in home/user/myfolder/myscript.sh
How would this line look like?

execp_lclick_command = /home/user/myfolder/myscript.sh

You must unlearn what you have learned.
    -- yoda

Online

Board footer

Powered by FluxBB