HOWTO: make shell scripts run on double-click in Xfce

Here is where you can post tips and tricks to share with other users of MX. Do not ask for help in this Forum.
Post Reply
Message
Author
User avatar
JayM
Qualified MX Guide
Posts: 6793
Joined: Tue Jan 08, 2019 4:47 am

HOWTO: make shell scripts run on double-click in Xfce

#1 Post by JayM »

Problem: Double-clicking a shell script opens it in the Featherpad editor by default instead of running the script. This is by design as a security measure to prevent accidentally running scripts when you didn't intend to, but it's not the behavior that many users expect or want.

Solution: Go to Settings/Mime Type Editor in the "start" menu and search for x-shell
Image

Double-click on application/x-shellscript
Image

Click on Use a custom command and type in bash then click Open
Image

he result will look like this
Image

Afterward all shell scripts will run by double-clicking on them as long as they're executable.
Last edited by JayM on Wed Dec 02, 2020 7:16 am, edited 5 times in total.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Captain Brillo
Posts: 106
Joined: Mon Jan 07, 2019 12:29 am

Re: Shell scripts don't run upon double-clicking

#2 Post by Captain Brillo »

Thanks, JayM, that's really handy - it was bugging me too.
GAFA-free zone

PaulM47
Posts: 2
Joined: Thu Jun 24, 2021 12:29 pm

Re: HOWTO: make shell scripts run on double-click in Xfce

#3 Post by PaulM47 »

Is it possible to make bash scripts 'Run in Terminal' (as offered in Ubuntu) by default instead of just running ??

PaulM

User avatar
ceeslans
Posts: 689
Joined: Sun Apr 14, 2019 3:48 am

Re: HOWTO: make shell scripts run on double-click in Xfce

#4 Post by ceeslans »

Double-clicking a script In PCManFM will invoke a choice to a) open - or b) execute - or c) execute in terminal.
Have no idea whether this would be possible in Thunar.
This is one of the reasons why I switched to PCManFM (the qt version) as default file manager in Fluxbox
You do not have the required permissions to view the files attached to this post.
Sony Vaio VPCF23P (2010), Intel Core i7-2670, 6gb RAM, 240GB SSD, MX23 based Fluxbox 1.3.7+

LionelZaylan
Posts: 97
Joined: Sat May 22, 2021 12:37 am

Re: HOWTO: make shell scripts run on double-click in Xfce

#5 Post by LionelZaylan »

JayM wrote: Fri Feb 22, 2019 2:05 am Problem: Double-clicking a shell script opens it in the Featherpad editor by default instead of running the script. This is by design as a security measure to prevent accidentally running scripts when you didn't intend to, but it's not the behavior that many users expect or want.

Solution: Go to Settings/Mime Type Editor in the "start" menu and search for x-shell
Image

Double-click on application/x-shellscript
Image

Click on Use a custom command and type in bash then click Open
Image

he result will look like this
Image

Afterward all shell scripts will run by double-clicking on them as long as they're executable.
That is OK for advanced users who know what they are doing, but removes an extra layer of security.

Note for newbies: Please don't do that if you don't know what you are doing. You take full responsibility for what you do.

PaulM47
Posts: 2
Joined: Thu Jun 24, 2021 12:29 pm

Re: HOWTO: make shell scripts run on double-click in Xfce

#6 Post by PaulM47 »

Thanks ceesians, install 'pcmanfm-qt' in Mx Linux 19.4 and make sure the scripts have the correct 'shebang' as the first line (#!/bin/bash) and it does indeed offer the 'run' and 'run in terminal' options as I wanted. If the script does not have the correct first line it doesn't work.

Post Reply

Return to “Tips & Tricks by users”