Topic: post your Thunar custom actions

SabreWolfy started ranting about Thunar, and that got some of us talking about custom actions, and that made rhowaldt suggest a thread where people could post their custom actions, and that made dubois convince me to start the thread...

So have you got a cool custom action for Thunar that you can share with the rest of us? I'll start with some simple actions, one suggested by cchhrriiss1212 to display the amount of disk space used by the selected files/folders:

du -h -c %N | grep total | zenity --text-info

and I tweaked it a little to show more details

du -chs %N | zenity --text-info

and I wrote another one to create a backup file in the working folder

cp --backup=t %f %f.backup

(more details in the original thread)

I'm sure other people have others, please share!

Re: post your Thunar custom actions

disclaimer - I did not come up with these on my own, but they're worth sharing. 

echo "paste:" >> paste_link.txt && date >> paste_link.txt &&  echo %f >> paste_link.txt && pastebinit -b http://pastebin.com -i %f -t %f -a%f  >> paste_link.txt  && echo "end paste" >> paste_link.txt && sensible-browser $(cat paste_link.txt|grep "http") && cat paste_link.txt >> ~/.pastehistory && rm paste_link.txt

this will automatically open the file in pastebin in your browser as well as add a .pastehistory file automatically.

the rocky path may just be the best path.

Re: post your Thunar custom actions

I think this is a default in #! but if you lose your defaults when upgrading to wheezy/sid or you're using a different distro they may be useful:

This one will burn a .iso file with xfburn:

xfburn -i %f

Go to the appearance conditions and check the "other files" radio button and put this in the file pattern box:

*.iso

Re: post your Thunar custom actions

There's also the "open terminal here", "open root terminal here" and "open folder as root" actions, these are all similar and should be fairly self explanatory but I'll give one example. If you need the others you can of course just boot up a crunchbang live CD. This one is for the root terminal.

Command:

gksudo 'terminator --working-directory %f'

Check only directories under appearance conditions.

Edit: Awesome thread by the way! Your two examples are extremely useful.

Last edited by mynis01 (2012-01-04 04:38:32)

Re: post your Thunar custom actions

^ thanks for posting those mynis! i found these to be sorely lacking in pcmanfm. glad to be back with Thunar now.

Re: post your Thunar custom actions

Set Wallpaper
Select Image files under Appearance Conditions.

nitrogen --set-auto %f

And recompile Thunar without the Set Wallpaper option if having the existing one is bothersome.
You could probably wrap it in a shell script when using multiple monitors....

Re: post your Thunar custom actions

Instead of Shift+Delete for bypassing trash I often use

rm -r %F   (select everything in appearance conditions)

And for distrohoppers and testers something to check md5 sum with

zenity --info --title="Check md5 for %n" --text="$(md5sum %f)"   (file pattern *.iso and select other files)

BTW I really like your "Disk Usage" 2ManyDogs. Perfect thread smile

A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using this link https://spideroak.com/download/referral … 5eb87925eb and get a total of 3 GB to start with.

Re: post your Thunar custom actions

Oh, one more important default I forgot about, search folder with catfish!
Command:

catfish --path=%f

Check only directories under appearance conditions.

Re: post your Thunar custom actions

rm %F           (files)
rm -rf %F       (folders)
easytag %d   (folders,audiofiles)

The number of rm's here are proof how annoying thunar can get, once gvfs is installed.

I'm so meta, even this acronym

Re: post your Thunar custom actions

Hello all
I have a issue and thought it I would ask the question in this thread first. The set wallpaper action that comes standard with #! does not work,I can put it there myself but then I have two. Where would it be so I can change it to the correct command?
Thanks for any input!

Re: post your Thunar custom actions

I think the "Set wallpaper" command in the Thunar menu is designed to work with XFWM4; don't think Openbox is able to understand it.

while ( ! ( succeed = try() ) );

Re: post your Thunar custom actions

Crap! Guess I have to live with it....such is life.
Thanks much

Re: post your Thunar custom actions

barkbombardier wrote:

The set wallpaper action that comes standard with #! does not work,I can put it there myself but then I have two. Where would it be so I can change it to the correct command?
Thanks for any input!

You want to use the program nitrogen.  For instance you could use the custom Thunar command:

nitrogen --set-centered %f

For a list of options (other than setting the image as centered) just type:

nitrogen -h

Re: post your Thunar custom actions

I've already posted this elsewhere, but since this is the custom actions thread here's an "upload to ompload" action.
First, make this script:

#!/bin/bash
# ompload.sh
# upload image to omploader and print out url etc

curl -F file1=@"$1" http://ompldr.org/upload|awk '/Info:|File:|Thumbnail:|BBCode:/{gsub(/<[^>]*>/,"");print $1}'
exit

Then put this as the command of your custom action:

urxvt -hold -e /path/to/ompload.sh %f

The terminal will stay open so you can copy out the BBC code to paste into a forum post. (If you use terminator it's a bit more complicated.) Set the appearance conditions to any file types you like except directories, though omploader is most often used for images.

John
------------------------
( a boring Japan blog , and idle twitterings )
“Good morning sir, which way up would you like your reality today?”  "As it comes, Jeeves, as it comes..."

Re: post your Thunar custom actions

Can somebody do a custom action, which copies a file to the dropbox public folder, and copies the public link to the clipboard? smile
I know there is a similar thing already in thunar, but that copies the public link of files already in Public folder. First I have to copy the file there.

I found something similar here, but it needs some modifications I guess.

Thanks smile

(crunchbang + xfce)

Re: post your Thunar custom actions

Image related custom action examples for inkscape and others:

http://crunchbanglinux.org/forums/topic … tral-grey/

ditto

Re: post your Thunar custom actions

Inspired by a request in another thread:

Secure Delete:

shred -u %f

Select "Appearance Conditions" and select "Other Files"


Even More Secure Delete:

Install the "secure-delete" package, and use

srm %f

Re: post your Thunar custom actions

Can somebody do a custom action, which copies a file to the dropbox public folder, and copies the public link to the clipboard?

source: https://gist.github.com/591513

#!/bin/sh
#
# Simple shell script to copy a file to the Dropbox
# public folder and get its URL.
#
# The URL of the last file copied also stays on the
# X clipboard.
#
# Symlink the script as dropmv to move the file to the
# public folder instead of copying it.
#
# Author: Tamas Nepusz <ntamas at gmail dot com>
#
# This script has been placed in the public domain.

DROPBOX_ROOT=~/.dropbox
DROPBOX_REPO=~/Dropbox

if [ $# -eq 0 ]; then
    echo "Usage: $0 file1 [file2] [file3] ..."
fi

SOCAT=`which socat`
if [ $? != 0 ]; then
    echo "Please install socat if you want to use this script."
    exit 1
fi

XCLIP=`which xclip`
if [ $? != 0 ]; then
    echo "Please install xclip if you want to use this script."
    exit 1
fi

SOCKET="$DROPBOX_ROOT/command_socket"
if [ ! -S $SOCKET ]; then
    echo "Dropbox daemon not running, exiting..."
    exit 2
fi

CP=cp
if [ `basename $0` = dropmv ]; then
    CP=mv
fi

while [ $# -ne 0 ]; do
    echo | $XCLIP -sel clip
    DEST="$DROPBOX_REPO/Public/$1"
    $CP "$1" "$DEST"
    $SOCAT - $SOCKET >/dev/null <<EOF
icon_overlay_context_action
verb    copypublic
paths    $DEST
done
EOF
    URL="`$XCLIP -sel clip -o`"
    if [ "x$URL" = x ]; then
        echo "error while retrieving URL for $DEST" >&2
    else
        echo $URL
    fi
    shift
done

You need socat and xclip for this to work. If your dropbox folder isn't in your home folder, then change the path of DROPBOX_REPO.

command:

/path/to/script.sh %n

appearance conditions: tick all except directories

(crunchbang + xfce)

Re: post your Thunar custom actions

ditto

Last edited by anbclarke (2012-04-24 10:53:20)