The Technology Magazine.

Full width home advertisement

Android

Linux

Post Page Advertisement [Top]

How to configure Double click to execute shell script on Centos / Ubuntu GUI

 To do this:

  • Configure dconf-editor (sudo yum install dconf-editor)
  • Open dconf-editor, and navigate to the /org/gnome/nautilus/preferences menu.
  • Under "executable-text-activation", change "Use default value" to OFF, and "Custom value" to 'launch'. (See the image)
  • exit dconf-editor.


Now, double-clicking on a script, or a symbolic link to a script, will execute it, rather than opening up the file with gedit.

Option 2: Excecute the below command in a terminal:

gsettings set org.gnome.nautilus.preferences executable-text-activation launch 


After changing the above preference, To create a shortcut to your script:

$ cd $HOME/Desktop

$ ln -s $HOME/bin/myscript.sh MyScript

To apply the settings system-wide for all users:

[root]# cd /etc/dconf/db/local.d/

[root]# ls

locks

[root]# vi 01-executable-text-activation

# dconf path

[org/gnome/nautilus/preferences]

# GSettings key names and their corresponding values

executable-text-activation='launch'

  1. Update the system databases:

    # dconf update


No comments:

Post a Comment

Dear visitor,
Please do not post spam. All comments will be moderated before approval.

Bottom Ad [Post Page]

| Designed by Techeia.com