Forum
« Thunar - custom actions »

Welcome Guest. Please Login or Register.
Jun 19, 2013, 8:19pm



Return to or visit the SalineOS webpage

Forum :: General :: Software and Applications :: Thunar - custom actions
Page 1 of 5 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: Thunar - custom actions (Read 4,046 times)
hipsauerkraut
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 35
 Thunar - custom actions
« Thread Started on Jan 28, 2011, 6:30pm »

I thought it would be nice to have a small collection for custom actions in Thunar, especially for newcomers.
So, here are some to start:

1) File Size/Disk Usage Counter:
For a name give for example: Counter
For description give like: Disk usage counter
And this is the key, in the command field put this code:
du -chs --apparent-size %N | zenity --text-info
or
du -h -c %N | grep total | zenity --text-info
set everything on in Appearance conditions.

2) Printing:
lp %f
Appearance conditions text files, image files.

3) MD5SUM Calculation:
zenity --info --title="Check md5 for %n" --text="$(md5sum %f)"
Use the file type 'other files' and the pattern '*.iso; *.usb; *.img'. Zenity is powerful and with the %F option you can feed in multiple files and have the output in columns.

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

Please add some more.
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,343
 Re: Thunar - custom actions
« Reply #1 on Jan 28, 2011, 6:34pm »

I stickied this as the information is useful, but could use some clarification for new users. Such as what custom actions are. If you do not wish to write this I can modify your post for you. Just do not want to step on any toes :)
« Last Edit: Jan 28, 2011, 6:35pm by Anthony Nordquist »Link to Post - Back to Top  IP: Logged
hipsauerkraut
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 35
 Re: Thunar - custom actions
« Reply #2 on Jan 28, 2011, 7:27pm »

No problem at all, English isn't my native language, you may add or modify anything.
The important thing is to share information. :D
Link to Post - Back to Top  IP: Logged
62chevy
Senior Member
****
member is offline

[avatar]

Hard Core!



Joined: Jan 2011
Gender: Male
Posts: 412
Location: West Virginia, USA
 Re: Thunar - custom actions
« Reply #3 on Jan 28, 2011, 11:40pm »

I'm not sure where to put the information, I can take an guess. Open your Home folder click on edit>Configure Custom Actions..... Then place the information in the popup box when done right click in the folder and select what you want. Right? Is Zenity installed by default or do I need to aptitude install?
Link to Post - Back to Top  IP: Logged

Debian 6.0.3 Gnome2
Debian - Sid Caution DE may change on a whim.
SalineOS 1.5

Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,343
 Re: Thunar - custom actions
« Reply #4 on Jan 28, 2011, 11:42pm »

Yeah Chevy thats the correct way to input the custom actions. You have Zenity pre-installed, its the graphical toolkit that remastersys uses :)
Link to Post - Back to Top  IP: Logged
62chevy
Senior Member
****
member is offline

[avatar]

Hard Core!



Joined: Jan 2011
Gender: Male
Posts: 412
Location: West Virginia, USA
 Re: Thunar - custom actions
« Reply #5 on Jan 28, 2011, 11:48pm »


Jan 28, 2011, 11:42pm, Anthony Nordquist wrote:
Yeah Chevy thats the correct way to input the custom actions. You have Zenity pre-installed, its the graphical toolkit that remastersys uses :)


Cool I'll give it a spin tomorrow.
Link to Post - Back to Top  IP: Logged

Debian 6.0.3 Gnome2
Debian - Sid Caution DE may change on a whim.
SalineOS 1.5

Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 607
Location: Venezuela
 Re: Thunar - custom actions
« Reply #6 on Jan 29, 2011, 8:14am »

Be sure to open the Appearance Conditions and check at least Directories or others as needed.
Link to Post - Back to Top  IP: Logged

SalineOS-2.0dev2..Xfce4.8
SolydX.................Xfce4.10
Crunchbang-11.....Xfce4.8
hipsauerkraut
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 35
 Re: Thunar - custom actions
« Reply #7 on Jan 29, 2011, 3:30pm »

I just found that one, very cool and handy ;D

Name: Move files
Description: Move files
Command: mv %F `zenity --file-selection --directory`
File pattern *
+ everything
Link to Post - Back to Top  IP: Logged
hipsauerkraut
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 35
 Re: Thunar - custom actions
« Reply #8 on Feb 8, 2011, 6:07pm »

Converting svg to png:

I was looking for a solution to quickly convert svg-files to png, here's a solution with an entry in Thunar Custom-Actions.

First download the python-script:
wget http://gtk-apps.org/CONTENT/content-files/129688-Convert-Svg-To-Png.py.tar.gz, extract anywhere (p.e. your homefolder) and make executable.
Install librsvg:
#aptitude install librsvg2-bin

Name: Convert SVG to PNG
Description: whatever you like
Command: ~/Convert-Svg-To-Png.py %F
Conditions: image files + *.svg

This converts quick and easily your SVGs (%F for batch), hf ::).
Link to Post - Back to Top  IP: Logged
aicardi
New Member
*
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 31
 Re: Thunar - custom actions
« Reply #9 on Apr 8, 2011, 10:06am »

An image resizing script I use with Thunar Actions.
What the scrip does;
When the script is run on an image file/files it will first create a directory called "Resized" in the current working directory. Then it will resize selected images and put them in the respective folders within the resized directory. It will also append the size of the image to the file name.
Example: image1.jpg
An image resized to 480 will be placed in ./Resized/480/image1_480.jpg

First you need imagemagick installed.

The script. I named mine rsz, but you can name it what you want. Place the code below in your path (e.g. ~/bin, or /usr/local/bin).
Code:
#!/bin/bash
mkdir -p ./Resized/$1
for file
do
if [ ! -e "$file" ]
then
continue
fi
name=$( echo $file | cut -f1 -d.)
convert -geometry $1x$1 -quality 100 $file ./Resized/$1/${name}_$1.jpg
done

Make the file executable.
Code:
chmod 755 rsz

Now we add it to Thunar Actions.
This action will resize the long side of an image to 480. I use 480, 640, 800, and 1024. So you would just repeat the steps with a new action for each size you want.

Edit >> Configure custom actions and click the "+" to add a new custom action.
Basic Settings
Name: Resize 480
Description: Resize images to 480x480
Command: rsz 480 %N
Icon: No icon

Appearance and Conditions
File Pattern: *.jpg;*.JPG;*.jpeg;*.JPEG;*.png;*.PNG

In the "Appears if selection contains:" tick Image files.

Now you can open Thunar, right click an image, or highlight many images and right click.
You will now see "Resize 480". Click it and watch it work.

You can run the script on the command line as well. On the command line you can select any size on the fly.
Example:
Code:
$ rsz 800 image1.jpg

Or for all files in a directory:
Code:
$ rsz 800 *.jpg



Link to Post - Back to Top  IP: Logged
Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 607
Location: Venezuela
 Re: Thunar - custom actions
« Reply #10 on Apr 8, 2011, 10:29am »

These are neat.
I tend to lose mine when I reinstall after some screw-up, mine or machine.
Probably could put mine in /data/bin with all my other data that survives said screw-up.
Thanks for these.
Link to Post - Back to Top  IP: Logged

SalineOS-2.0dev2..Xfce4.8
SolydX.................Xfce4.10
Crunchbang-11.....Xfce4.8
aicardi
New Member
*
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 31
 Re: Thunar - custom actions
« Reply #11 on Apr 8, 2011, 10:37am »


Apr 8, 2011, 10:29am, Richard wrote:
These are neat.
I tend to lose mine when I reinstall after some screw-up, mine or machine.
Probably could put mine in /data/bin with all my other data that survives said screw-up.
Thanks for these.


I keep a backup of my ~/bin
I also keep a backup of my ~/.config/ as well.
/data/bin/ is a good idea.
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,343
 Re: Thunar - custom actions
« Reply #12 on Apr 8, 2011, 11:21am »

If you have a tendency to go messing around with your system an awful lot, it might pay to make some backup ISO's with Remastersys ;)
Link to Post - Back to Top  IP: Logged
Richard
Elder Member
*****
member is offline

[avatar]



Joined: Jan 2011
Gender: Male
Posts: 607
Location: Venezuela
 Re: Thunar - custom actions
« Reply #13 on Apr 8, 2011, 2:16pm »

Good idea. I use fsarchiver. Not as easy but quicker both ways. :)
http://www.fsarchiver.org/Main_Page

It's really a neat tool for moving things around.
I use SysRescueCD or USB for recovery.
Has more capability than I've ever used.
« Last Edit: Apr 9, 2011, 11:29pm by Richard »Link to Post - Back to Top  IP: Logged

SalineOS-2.0dev2..Xfce4.8
SolydX.................Xfce4.10
Crunchbang-11.....Xfce4.8
murdock
Full Member
***
member is offline

[avatar]


[homepage]

Joined: Feb 2011
Gender: Male
Posts: 188
Location: Costa Rica
 Re: Thunar - custom actions
« Reply #14 on Apr 9, 2011, 11:01pm »

Good stuff guys.
Link to Post - Back to Top  IP: Logged

No Artificial Ingredients
www.arenalbotanicalgarden.com
Skype : arenalgarden.
Page 1 of 5 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]



Anthony Nordquist, on behalf of the SalineOS project, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. As such, if you click the above banner and then make any purchase including digital downloads, a small percentage will be paid to the SalineOS project.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile