Nautilus actions, right click execute script

From WickyWiki
Revision as of 07:26, 5 July 2013 by Admin (talk | contribs) (5 revisions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Install Nautilus Actions

Install nautilus Actions GUI to customize Nautilus right click menu:

sudo apt-get install nautilus-actions

You can export/import your custom items to backup/restore them.

Nautilus action 'Execute script'

Start Nautilus Actions and:

  1. Define a new action
  2. Tab Action: Context label: 'Execute script...'
  3. Tab Command:
    • Path: 'gnome-terminal'
    • Parameters: '-x sh -c "%f"'
  4. Tab Basenames: '*', Must match
  5. Tab Mimetypes: 'application/x-shellscript', Must match

Tip:

In Nautilus when opening an executable text file you will have the choice to execute or edit. However, on a NTFS partition each text file is wrongly recognized as executable. You can now disable this choice in Nautilus and still easily execute your scripts with the 'Execute script' action.

To disable, in the Nautilus menu go to 'Edit' -> 'Preferences' -> tab 'Behavior', under heading 'Executable Text Files' select 'View as text file when opened'.


Export for 'Execute script' action:

<?xml version="1.0" encoding="UTF-8"?>
<gconfentryfile>
  <entrylist base="/apps/nautilus-actions/configurations/343d5295-2162-4850-bd3e-24b683f223d7">
    <entry>
      <key>type</key><value><string>Action</string></value>
    </entry>
    <entry>
      <key>iversion</key><value><int>3</int></value>
    </entry>
    <entry>
      <key>items</key><value><list type="string"><value>
        <string>profile-zero</string></value></list></value>
    </entry>
    <entry>
      <key>label</key><value><string>Execute script...</string></value>
    </entry>
    <entry>
      <key>tooltip</key><value><string>Execute script in terminal</string></value>
    </entry>
    <entry>
      <key>toolbar-label</key><value><string>Execute script...</string></value>
    </entry>
    <entry>
      <key>profile-zero/desc-name</key><value><string>Default profile</string></value>
    </entry>
    <entry>
      <key>profile-zero/path</key><value><string>gnome-terminal</string></value>
    </entry>
    <entry>
      <key>profile-zero/parameters</key><value><string> -x sh -c "%f"</string></value>
    </entry>
    <entry>
      <key>profile-zero/mimetypes</key><value><list type="string"><value>
        <string>application/x-shellscript</string></value></list></value>
    </entry>
  </entrylist>
</gconfentryfile>