You are not logged in.
Pages: 1
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-infoand I tweaked it a little to show more details
du -chs %N | zenity --text-infoand 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!
Be eggsalad to each other.
Offline
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.txtthis will automatically open the file in pastebin in your browser as well as add a .pastehistory file automatically.
Offline
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 %fGo to the appearance conditions and check the "other files" radio button and put this in the file pattern box:
*.isoOffline
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)
Offline
^ thanks for posting those mynis! i found these to be sorely lacking in pcmanfm. glad to be back with Thunar now.
Offline
Set Wallpaper
Select Image files under Appearance Conditions.
nitrogen --set-auto %fAnd 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....
Offline
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 
A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.
Offline
Oh, one more important default I forgot about, search folder with catfish!
Command:
catfish --path=%fCheck only directories under appearance conditions.
Offline
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
Offline
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!
Offline
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() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Online
Crap! Guess I have to live with it....such is life.
Thanks much
Offline
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 %fFor a list of options (other than setting the image as centered) just type:
nitrogen -hOffline
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}'
exitThen put this as the command of your custom action:
urxvt -hold -e /path/to/ompload.sh %fThe 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 )
Offline
Can somebody do a custom action, which copies a file to the dropbox public folder, and copies the public link to the clipboard?
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 
(crunchbang + xfce)
Offline
Image related custom action examples for inkscape and others:
ditto
Offline
Inspired by a request in another thread:
Secure Delete:
shred -u %fSelect "Appearance Conditions" and select "Other Files"
Even More Secure Delete:
Install the "secure-delete" package, and use
srm %fBe eggsalad to each other.
Offline
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
doneYou 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 %nappearance conditions: tick all except directories
(crunchbang + xfce)
Offline
ditto
Last edited by anbclarke (2012-04-24 10:53:20)
ditto
Offline
is it possible to create a thunar custom action that deletes the files in the trash securely? i can tell from looking around at the forums that the trash is spread somewhat over various directories, but surely if thunar can find the files and display them, a script could also, calling shred or whatever. i have searched for the answer in vain. anyone?
Offline
ok. i got to this thread after trying to find a way to securely erase the trash. so i created a custom Thunar action called "shred" with this command:
zenity --question --title="shred file(s)" --text="Shred Files(s)? "%F;if [$? = 0];then shred -fuz %F;fi
i have shred installed and it works fine when tested from the terminal, but when Thunar tries to do it
i get:
ecryptfs_do_create: Failure to create dentry in lower fs; rc = [-17]
ecryptfs_create: Failed to create file inlower filesystem
any ideas? i am going to try secure-delete next i guess.
d.
Last edited by damionhh (2012-11-09 16:22:56)
Offline
ok. so i created a bash script called del.sh (copied from an Ubuntu Forums post):
#!/bin/bash
if dialog=`zenity --window-icon=warning --question --title="Secure Delete" --no-wrap --text="Are you sure you want to securely delete:\n\n $1\n\nand any other files and folders selected? File data will be overwritten and cannot be recovered."`
then /usr/bin/shred -fuz "$@"| zenity --progress --pulsate --text="File deletion in progress..." --title="Secure Delete" --auto-close
fi
and if i call that from Thunar custom actions:
del.sh %F
it works. so something about the way Thunar is calling the command. hmmm. permissions? anybody who
could help me figure out how to bypass the shell script and go directly from Thunar would be awesome.
Offline
Thunar & mplayer (screen width in percents)
Is there a smart "duplicate this file" script somewhere?
Last edited by brontosaurusrex (2012-11-09 19:36:51)
Offline
Thunar movie thumbnailer (I use this for preparing thumbnails for wdtv)
#!/bin/bash
# put me in ~/bin (or somewhere on the path)
# I need mtn (http://moviethumbnail.sourceforge.net/)
# put that into ~/bin as well
# and image magick installed
# should work on files and paths with spaces in them
while [ $# -gt 0 ]; do
file="$1"
filename="${file%.*}"
extension="${file##*.}"
# mtn 1st try
mtn -i -c 1 -r 1 -t -P -o .${extension%.*}.jpg "$1"
if [ ! -s "$1.jpg" ]
then
mtn -i -c 1 -r 1 -t -P -Z -o .${extension%.*}.jpg "$1"
fi
#convert (image magick)
convert "$1.jpg" -gravity Center -scale 180^ -extent 120x180 "$1_thumb.jpg"
#remove mtn snap and rename the thumb
mv "$1_thumb.jpg" "$filename.jpg"
rm "$file.jpg"
shift
donein thunar add action makethumb %F (apperance conditions = video files)
Last edited by brontosaurusrex (2012-11-27 09:51:16)
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.