Running bash script in gnome by double clicking on it

General support questions
Post Reply
mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Running bash script in gnome by double clicking on it

Post by mahmood » 2018/11/19 11:28:04

0
down vote
favorite

I want to tell Gnome in Centos-7 to run a bash script when I double click on it. Following the method described here, I have the following files and contents

Code: Select all

[mahmood@rocks7 ab]# cd Desktop/
[mahmood@rocks7 Desktop]# ls -la
total 28
drwxr-xr-x  2 ab ab  4096 Nov 19 14:11 .
drwx------ 18 ab ab  4096 Nov 19 14:10 ..
-rwxrwxr-x  1 ab ab    97 Nov 19 14:07 connect
-rwxrwxr-x  1 ab ab    89 Nov 19 14:11 .desktop
-rwxr--r--  1 ab ab 10410 Aug  9  2017 org.gnome.Terminal.desktop
[mahmood@rocks7 Desktop]# cat connect
#!/bin/bash
xfreerdp --plugin rdpsnd --plugin rdpdr --data disk:home/home/ab -- -u ab 10.1.1.197
[mahmood@rocks7 Desktop]# cat .desktop
[Desktop Entry]
Name=connect
Exec[$e]='/home/ab/connect'
Terminal=false
Type=Application
[mahmood@rocks7 Desktop]#
Still when I double click on "connect", I see that it is opened by emacs! What should I do?

mahmood
Posts: 122
Joined: 2017/06/04 12:21:09

Re: Running bash script in gnome by double clicking on it

Post by mahmood » 2018/11/19 16:51:59

I found the solution as explained in [1]. Trick is to modify nautilus to ask for what to do!

Code: Select all

gsettings set org.gnome.nautilus.preferences executable-text-activation 'ask'

[1] https://forums.fedoraforum.org/showthre ... ost1711533

Post Reply