Wednesday, November 21, 2012

[HOW TO] Add Thunar Custom Actions

Thunar allows the user to add custom actions the the file and folder context menu (right-click).

Thunar Custom Actions

Add custom action

The easiest way is to learn by example:

  1. Open Thunar, then Edit > Configure custom actions....
  2. Enter this data:

    • Name: Add to Playlist
    • Command: gmusicbrowser -cmd AddFilesToPlaylist %F
    • File pattern: *
    • Appears if selection contains: Audio files

This will show a menu item when audio files are selected that adds them to gmusicbrowser's playlist.

Thunar's custom actions are added to the XML file: ~/.config/Thunar/uca.xml.

Check the references for more examples. In the meanwhile I'll post some of my own.

References

Custom actions

16 comments:

  1. Is it the same command for clementine?

    ReplyDelete
    Replies
    1. For Clementine you can use: clementine -a %F

      This will append to the current playlist.

      If you'd rather replace the current playlist use the "-l" option instead.

      Delete
  2. I found this one very usefull: gksu leafpad %f
    To edit a file as root.
    Btw, can you tell me what's your theme and icons name please? it looks wonderful!

    ReplyDelete
    Replies
    1. Awoken: http://goo.gl/b3jQQ

      The theme is amazing. It's very customizable.

      Delete
  3. What is the command for DeadBeef player?

    ReplyDelete
    Replies
    1. It's not working... Any idea?

      Delete
    2. Run alacarte and see what's the command for running DeadBeef. I installed DeadBeef via deb file and the command I wrote runs it successfully.

      Delete
  4. Replies
    1. On that screenshot I was using Zukitwo-Illustrious for Gtk theme and Zukitwo-Colors for xfwm4. Here's the theme: http://goo.gl/ubyz6

      Delete
  5. Do you know how to run custom actions in a directory located at afc://...?

    I am running Xubuntu 14.04. I have an iPhone 5 with iOS 7.1

    I can mount the phone and see my photos and videos. I can drag the photos and videos to another directory in home and then manipulate them.

    I'd rather be able to choose a custom action to manipulate the photos and videos then copy or move them to home. (It would be ok to use a custom action to move them and then manipulate them.)

    The problem is that I do not know how to run a script or perform a custom thunar action on a directory that is located at:

    afc://6a244e0b3a6637cff9cf954d83a2fbf1faa0c2aa/DCIM/103APPLE/

    In earlier versions of Ubuntu I was able to use the .gvfs location in a script, but that no longer seems to be available in 14.04

    ReplyDelete
  6. Thanks man, I just did this one for VLC player, always bothered me that linux file managers don't offer this option.
    In VLC preferences enable "Single instance mode" and check the enqueue items into playlist in one instance mode box right next to it.
    then, do all of the above with parameters
    Name: add to vlc
    Command : vlc --playlist-enqueue %F

    Check the association boxes and you are good to go.
    Works like a charm.

    ReplyDelete
    Replies
    1. Great, just what I needed. The more friendlier distributions should really think about adding these little things in for migrating Windows users (but hey you learn something this way I suppose).

      Delete