SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-01-04 02:59:51

2ManyDogs
dv#!
From: elsewhere
Registered: 2011-11-22
Posts: 1,346

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!


Be eggsalad to each other.

Offline

Be excellent to each other!

#2 2012-01-04 04:12:38

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 716

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.


grill it | the rocky path may just be the best path

Offline

#3 2012-01-04 04:22:06

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,939

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

Offline

#4 2012-01-04 04:37:02

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,939

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)

Offline

#5 2012-01-04 08:42:09

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

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.

Offline

#6 2012-01-04 09:32:08

jelloir
#! CrunchBanger
From: Outside the garden wall
Registered: 2009-08-21
Posts: 212

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....

Offline

#7 2012-01-04 19:56:05

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

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 my referral and get a total of 3 GB to start with.

Offline

#8 2012-01-06 17:44:43

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 1,939

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.

Offline

#9 2012-01-06 20:24:57

Awebb
The Singularity
Registered: 2009-07-23
Posts: 2,812

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

Offline

#10 2012-01-14 16:44:37

barkbombardier
#! Member
Registered: 2011-09-07
Posts: 77

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!

Offline

#11 2012-01-14 17:11:35

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 11,511

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.


Yes; as a matter of fact, I am a cop.  Why do you ask? cool
I'm a moderator here.  How are we doing?  Feedback is encouraged.

Online

#12 2012-01-14 17:46:01

barkbombardier
#! Member
Registered: 2011-09-07
Posts: 77

Re: post your Thunar custom actions

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

Offline

#13 2012-01-15 17:05:42

punk_physicist
#! CrunchBanger
From: ~/
Registered: 2011-05-02
Posts: 160

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

Offline

#14 2012-01-17 18:04:13

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,706
Website

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 , idle twitterings  and GitStuff )
#! forum moderator

Offline

#15 2012-02-10 11:39:38

zierka
Member
Registered: 2011-02-22
Posts: 27

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)

Offline

#16 2012-02-13 08:34:14

bigbox37
Member
From: ditto
Registered: 2012-01-20
Posts: 12

Re: post your Thunar custom actions

Image related custom action examples for inkscape and others:

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


ditto

Offline

#17 2012-02-15 04:06:13

2ManyDogs
dv#!
From: elsewhere
Registered: 2011-11-22
Posts: 1,346

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

Be eggsalad to each other.

Offline

#18 2012-02-16 13:49:34

zierka
Member
Registered: 2011-02-22
Posts: 27

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)

Offline

#19 2012-04-20 15:25:02

anbclarke
New Member
From: ditto
Registered: 2012-04-20
Posts: 9

Re: post your Thunar custom actions

ditto

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


ditto

Offline

#20 2012-11-07 21:28:14

damionhh
Member
Registered: 2012-10-11
Posts: 21

Re: post your Thunar custom actions

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

#21 2012-11-09 16:22:25

damionhh
Member
Registered: 2012-10-11
Posts: 21

Re: post your Thunar custom actions

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

#22 2012-11-09 16:44:15

damionhh
Member
Registered: 2012-10-11
Posts: 21

Re: post your Thunar custom actions

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

#23 2012-11-09 19:34:25

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,014

Re: post your Thunar custom actions

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

#24 2012-11-27 09:47:47

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,014

Re: post your Thunar custom actions

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
done

in thunar add action makethumb %F (apperance conditions = video files)

Last edited by brontosaurusrex (2012-11-27 09:51:16)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo