Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Thunar: Cool custom actions

  1. #1
    Join Date
    Jun 2005
    Location
    the belly of a snake
    Beans
    Hidden!

    Thunar: Cool custom actions

    The information in this thread has been moved to https://help.ubuntu.com/community/ThunarCustomActions

    A thread for discussion of the wiki page only can be found here http://ubuntuforums.org/showthread.php?t=2012432

    Thread closed.


    If you like thunar, you will probably love custom actions. These are user-defined commands that act upon selected files in thunar. Either on its own, or combined with a simple dialog app such as Zenity, these can be very powerful and useful indeed.

    Thunar > Edit > Configure custom actions will take you to the dialog for creating and organising your custom actions. However, because this is GUI-oriented, the easiest way to install someone else's custom action is through a bash command.


    Remove...
    Command: rm -r
    Description: Removes the selected file(s) from the disk, bypassing any local Recycle bin. Useful when in samba shares. Requires confirmation for reasons of safety.
    Requires: zenity
    Installation:
    Code:
    CONTENT='<action><icon>stock_delete</icon><name>Remove...</name><command>zenity --question --title=&quot;Remove...&quot; --window-icon=&quot;/usr/share/icons/Tango/16x16/actions/edit-delete.png&quot; --text=&quot;Do you wish to permanently\nremove the selected file(s)?&quot; ; if [ $? = 0 ] ; then rm -r %F ; fi</command><description>Permanently remove the selected file(s)</description><patterns>*</patterns><directories/><audio-files/><image-files/><other-files/><text-files/><video-files/></action>'
    cat $HOME/.config/Thunar/uca.xml >> newtmp
    sed 's/<\/actions>//' <newtmp >newfile
    echo $CONTENT >> newfile
    mv $HOME/.config/Thunar/uca.xml $HOME/.config/Thunar/uca.xml.bak
    mv newfile $HOME/.config/Thunar/uca.xml
    rm newtmp
    Create Symlink
    Command: ln -s
    Description: Creates an absolute symbolic link to the selected file in the same folder, which can then be moved or renamed as desired. `man ln` for more info
    Requires:
    Installation:
    Code:
    CONTENT='<action><icon>emblem-symbolic-link</icon><name>Create Symlink</name><command>ln -s %f %n.symlink</command><description>Creates a symbolic link to the selected object</description><patterns>*</patterns><directories/><audio-files/><image-files/><other-files/><text-files/><video-files/></action>'
    cat $HOME/.config/Thunar/uca.xml >> newtmp
    sed 's/<\/actions>//' <newtmp >newfile
    echo $CONTENT >> newfile
    mv $HOME/.config/Thunar/uca.xml $HOME/.config/Thunar/uca.xml.bak
    mv newfile $HOME/.config/Thunar/uca.xml
    rm newtmp
    The above, and other custom actions can be found at http://thunar.xfce.org/pwiki/documen...custom_actions , but it is by no means an exhaustive list.

    If you have any custom actions of your own, please check out '~/config/Thunar/uca.xml' and post them here! Similar format appreciated
    Last edited by Elfy; June 29th, 2012 at 09:46 AM.

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Beans
    1,805

    Re: Thunar: Cool custom actions

    I will contribute to this old thread with a few of my own custom actions. The first one is a variant of the Remove... action above but uses Xdialog instead of Zenity (to avoid gnome dependencies).

    Name: Permanently remove...
    Description: Permanently remove selected files
    Command: Xdialog --title "Remove..." --yesno "Do you wish to permanently remove \n %N?" 10 45 && rm -r %F
    File pattern: *
    Appears if selection contains: any files
    Requires: Xdialog
    PHP Code:
    <action><icon></icon><name>Permanently remove...</name><command>Xdialog --title &quot;Remove...&quot; --yesno &quot;Do you wish to permanently remove \%N?&quot10 45 &amp;&amprm -%F</command><description>Permanently remove selected files</description><patterns>*</patterns><directories/><audio-files/><image-files/><other-files/><text-files/><video-files/></action
    Name: Join
    Description: Join selected text files
    Command: cat %F > joined.txt
    File pattern: *
    Appears if selection contains: text files
    PHP Code:
    <action><icon></icon><name>Join</name><command>cat %&gtjoined.txt</command><description>Join selected text files</description><patterns>*</patterns><text-files/></action
    Name: View
    Description: View selected images in a slideshow
    Command: feh %F
    File pattern: *
    Appears if selection contains: image files
    Requires: feh
    PHP Code:
    <action><icon></icon><name>View</name><command>feh %F</command><description>View selected images in a slideshow</description><patterns>*</patterns><image-files/></action
    Name: Play 15 seconds
    Description: Play a 15 seconds clip of a media file
    Command: mplayer %f -really-quiet -endpos 15
    File pattern: *
    Appears if selection contains: audio files, video files
    Requires: mplayer
    PHP Code:
    <action><icon></icon><name>Play 15 seconds</name><command>mplayer %-really-quiet -endpos 15</command><description>Play a 15 seconds clip of a media file</description><patterns>*</patterns><audio-files/><video-files/></action
    Last edited by mali2297; April 24th, 2008 at 10:53 PM.
    ...

  3. #3
    Join Date
    Nov 2008
    Location
    San Gabriel Valley
    Beans
    263
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Thunar: Cool custom actions

    Copy Current Path [using xclip]
    Code:
    echo -n %f | xclip -selection "clipboard"
    Open Terminal Here [using urxvt client]
    Code:
    urxvtc -cd %f
    Extract Archive Here [using Squeeze]
    Code:
    squeeze -x . %N
    Extract Passworded Archive [using Xarchiver]
    Code:
    xarchiver -e %N
    Estimate Space Usage [using zenity, including grand total]
    Code:
    du -chs --apparent-size %N | zenity --text-info
    Create Archive Here [using Squeeze]
    Code:
    squeeze -n %N
    Sign Using GnuPG [terminal password entry]
    Code:
    terminal -e "gpg -a -u [user] -b %f"
    Encrypt Using GnuPG
    Code:
    terminal -e "gpg -e -r [recipient] %f"
    Decrypt GnuPG File [appending .decrypted to the decrypted filename]
    Code:
    terminal -e "gpg -o %n.decrypted -d %f"
    Shred & Delete File(s) [using zenity]
    Code:
    zenity --question;if [$? = 0];then shred -fuz %F;fi
    Last edited by adamlau; February 13th, 2009 at 04:44 AM.

  4. #4
    Join Date
    Jul 2006
    Location
    Germany
    Beans
    1,805

    Re: Thunar: Cool custom actions

    Name: Add to Ipod
    Description: Add songs to Ipod
    Command: gnupod_addsong.pl %F | Xdialog --title "GNUpod - Add song" --no-cancel --tailbox - 24 64
    File pattern: *.mp3;*.m4a;*.mp4
    Appears if selection contains: audio files, video files
    Requires: gnupod, Xdialog
    PHP Code:
    <action><icon></icon><name>Add to Ipod</name><command>gnupod_addsong.pl %Xdialog --title &quot;GNUpod Add song&quot; --no-cancel --tailbox 24 64</command><description>Add songs to Ipod</description><patterns>*.mp3;*.m4a;*.mp4</patterns><audio-files/><video-files/></action
    ...

  5. #5
    Join Date
    Dec 2008
    Beans
    54
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Thunar: Cool custom actions

    Here are some useful custom actions that I have come across in my Ubuntu travels, enjoy

    Name: Open Folder as Root
    Description: Opens the current folder with root permissions
    Command: gksu thunar %f
    File pattern: *
    Appears if selection contains: Directories
    *Caution with the root access

    Name: Open Text as Root
    Description: Opens selected text file with root permissions
    Command: gksu gedit %f
    File pattern: *
    Appears if selection contains: Text Files
    *I use gedit as my text editor, but you can substitute gedit for any text editor you wish.
    *Caution with the root access

    Name: Search including hidden files/folders
    Description: Searches entire file system
    Command: catfish --fileman=thunar --hidden --path=%f
    File pattern: *
    Appears if selection contains: Check all
    *I use catfish as my search app, but you can substitute catfish for any search app that you like.

    - first two courtesy of Tayfun Duran:
    http://www.pubbs.net/ubuntu/200911/6921/
    Last edited by nabilalk; January 29th, 2010 at 11:48 AM.

  6. #6
    Join Date
    Sep 2009
    Beans
    1

    Re: Thunar: Cool custom actions

    here are mine

    Open as root (in your default program)
    command: gksudo exo-open %F
    patterns: * | all

    Mount iso
    command: gksudo mount -o loop -t iso9660 %f /mnt
    patterns: *.iso | other files

    Copy Dropbox public link (appears everywhere but works only in your Dropbox public folder :/ is there any way to make it visible only in Dropbox folder ?)
    command: echo -n %f | sed 's/\/home\/you\/Dropbox\/Public/http:\/\/dl\.dropbox\.com\/u\/123456/' | xclip -selection clipboard you'll need to replace "you" and "123456", of course
    patterns: * | all except folders
    Last edited by silverkeeper; January 29th, 2010 at 04:01 PM.

  7. #7
    Join Date
    Dec 2008
    Beans
    54
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Thunar: Cool custom actions

    Quote Originally Posted by silverkeeper View Post

    Copy Dropbox public link (appears everywhere but works only in your Dropbox public folder :/ is there any way to make it visible only in Dropbox folder ?)
    command: echo -n %f | sed 's/\/home\/you\/Dropbox\/Public/http:\/\/dl\.dropbox\.com\/u\/123456/' | xclip -selection clipboard you'll need to replace "you" and "123456", of course
    patterns: * | all except folders
    What do you replace "123456" with? And is u your username?

  8. #8
    Join Date
    Apr 2007
    Beans
    3

    Re: Thunar: Cool custom actions

    Just installed XFCE on my powerbook g4 debian system today - Now it's my default session and I will never go back!

    Anyway - Here's my first thunar custom action -

    I can't live without this!

    Name: Convert to AVI
    Description: ffmpeg Conversion
    Command: xfce4-terminal -x ffmpeg -i %f -b 798k -ab 128k %f.avi
    Pattern: All Video Files

    Since I am a ppc linux user with no real flash alternative, .flv video files sometimes playback with ugly green artifacts or choppy framerate - using this action to convert to .avi with ffmpeg fixes these issues!

  9. #9
    Join Date
    Mar 2006
    Beans
    Hidden!

    Re: Thunar: Cool custom actions

    This is more of a beautification than anything else. I copy files around a lot. my basic custom action didn't show me any progress, and zenity progress doesn't pick up cp and mv commands to show progress. Finally figured out how to at least get a pulsating progress bar going whilst the file/s are being copied or moved:


    The main command
    (for I in $(seq 2); do echo $I; sleep 1; done; cp %F "/destination/folder") | zenity --progress --pulsate --auto-close
    Choose your file types accordingly
    No longer participating......

  10. #10
    Join Date
    Aug 2006
    Location
    in a house :)
    Beans
    30

    Re: Thunar: Cool custom actions

    Quote Originally Posted by Jose Catre-Vandis View Post
    This is more of a beautification than anything else. I copy files around a lot. my basic custom action didn't show me any progress, and zenity progress doesn't pick up cp and mv commands to show progress. Finally figured out how to at least get a pulsating progress bar going whilst the file/s are being copied or moved:


    The main command


    Choose your file types accordingly
    I just tried and it didn't let me copy but showed a progress bar

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •