Post Your Thunar Custom Actions Here

Here you can discuss every aspect of Debian. Note: not for support requests!

Re: Post Your Thunar Custom Actions Here

Postby julian67 » 2010-03-02 02:08

I just tried your rm-dialog script both from the shell and as a Thunar custom action and it's working fine here. I tried it again with set -x and no unexpected output. I suspect you may have either forgotten to set it executable, or it's executable but not in your path, or you have something in your .bashrc/aliases/functions which is conflicting. Or maybe you're trying to remove files/dirs for which you don't have write permissions.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Post Your Thunar Custom Actions Here

Postby dbbolton » 2010-03-02 02:36

julian67 wrote:I just tried your rm-dialog script both from the shell and as a Thunar custom action and it's working fine here. I tried it again with set -x and no unexpected output. I suspect you may have either forgotten to set it executable, or it's executable but not in your path, or you have something in your .bashrc/aliases/functions which is conflicting. Or maybe you're trying to remove files/dirs for which you don't have write permissions.


Well, I did chmod +x the script file-- twice in fact. It's definitely in my path and running. The zenity box shows up, and I clicked "Ok". I don't have any rm-related aliases for my regular user account.

I created that directory with that regular user account too, but I will check to see whether there are any files therein for which I lack write privileges. Still, I would have suspected "permission denied" or something of the like to show up, since the -v flag was on. Anyhow, thanks for the tips.

Also, if you are willing to add them, I think your custom actions would make a great addition to the wiki. You might be surprised how often a search result leads me thither rather than hither.

P.S. Breaking Bad is great.
GitHub | zsh docs in Letter PDF

Telemachus wrote:Put down the CGI.
User avatar
dbbolton
 
Posts: 2133
Joined: 2007-06-20 08:17
Location: Iapetus

Re: Post Your Thunar Custom Actions Here

Postby sir fer » 2010-03-06 07:10

dbbolton wrote:P.S. Breaking Bad is great.


Yeah it's good eh...Who'd have thought Malcolms dad could be such badazz?
sir fer
 
Posts: 923
Joined: 2008-09-10 18:49
Location: Auckland

Re: Post Your Thunar Custom Actions Here

Postby canci » 2010-03-06 16:02

Thank you all so much for this wonderful post! I've been trying out various file managers over the years and Thunar just seems to be
the best when it comes to being similar to my experience with old pre XP Windows Explorer and being lean and fast enough
for a WM. Shamefully, I have no script to contribute, though I've always wanted to adapt a batch conversion script for Imagemagick.
Stay tuned, maybe I will.

@sir fer: Regarding Thunar's lack of tabs. If you use Fluxbox, you can set its apps file to group every Thunar window, thus, if
clicked on "Open New Window", it will instead tab it with the old one.

See: http://fluxbox-wiki.org/index.php?title ... _apps_file under "Grouping apps via the apps file"

I just wish Openbox could do that. Hmm...
I ken hez kinvulf beck? I ken hez riesnible modereyshn? Kthnxbai!

No need to discuss this topic? Offended by this signature? Remove it:

Mez wrote:You can easily just disable viewing signatures

Click here - and set "Display Signatures" to No
User avatar
canci
 
Posts: 1705
Joined: 2006-09-24 11:28
Location: Bosnia & Herzegovina

Re: Post Your Thunar Custom Actions Here

Postby julian67 » 2010-03-06 16:19

A neat way for batch image conversions as a Thunar Custom Action is to use Phatch. Phatch: PHoto bATCH. It's in Debian main from Lenny onwards. Phatch works on the command line as well as via a GUI, and running an action as a command is really easy. For example I have an action to reduce image size to 70%, mostly used to get fullscreen screenshots down to a reasonable size. I made the action using the GUI and saved it to ~/.local/share/phatch/actionlists/screens.phatch (I believe the older versions of Phatch such as Lenny's use a different save location). So now I have a custom action:

Image

Code: Select all
phatch ~/.local/share/phatch/actionlists/screens.phatch %F


Phatch has a large range of available actions built in:

* Auto Contrast - Maximize image contrast
* Background - Put colour under transparent image
* Border - Variable border to the inside or outside
* Brightness - Adjust brightness from black to white
* Canvas - Crop the image or enlarge canvas without resizing the image
* Color To Alpha - Make a background with fixed color transparent
* Colorize - Colorize grayscale image
* Common - Copies the most common pixel value
* Contour - Draw a contour around image edges
* Contrast - Adjust from grey to black & white
* Convert Mode - Convert the color mode of an image (grayscale, RGB, RGBA or CMYK)
* Copy - Copy image file
* Crop - Crop the image
* Delete Tags - Delete Exif or Iptc Tags
* Desaturate - Fade all colors to grey
* Effect - Blur, Sharpen, Emboss, Smooth, …
* Equalize - Equalize the image histogram
* Fit - Downsize and crop image with fixed ratio
* Geek - Execute external command
* Geotag - Geotag an image file
* Grayscale - Fade all colours to gray
* Highlight - Add a highlight effect
* Imagemagick - Blur, Polaroid, Shadow, Unsharp…
* Invert - Invert the colors of the image (negative)
* Lossless JPEG - Rotate, flip, grayscale and crop
* Maximum - Copies the maximum pixel value
* Mask - Apply a transparency mask
* Median - Copies the median pixel value
* Minimum - Copies the minimum pixel value
* Mirror - Symmetrical tile texture
* Offset - Offset by distance and wrap around
* Perspective - Shear 2d or 3d
* Posterize - Reduce the number of bits of colour channel
* Rank - Copies the rank'th pixel value
* Reflect - Drops a reflection
* Rename - Rename image file
* Rename Tag - Rename an Exif or Iptc Tag
* Rotate - Rotate with random angle
* Round - Round or crossed corners with variable radius and corners
* Saturation - Adjust saturation from grayscale to high
* Save - Save an image with variable compression in different types
* Save Tags - Save only metadata (lossless)
* Scale - Scale an image with different resample filters.
* Shadow - Drop a blurred shadow under a photo with variable position, blur and color
* Sketch - Transform to a grayscale pencil drawing.
* Solarize - Invert all pixel values above threshold
* Tamogen - Tone altering mosaic generator
* Text - Write text at a given position
* Time Shift - Shift Exif time
* Transpose - Flip or rotate an image by 90 degrees
* Watermark - Apply a watermark image with variable placement (offset, scaling, tiling) and opacity
* Write Tag - Write a new value to a metadata tag (exif & iptc)


And you can make your own too http://photobatch.wikidot.com/writing-actions
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Post Your Thunar Custom Actions Here

Postby canci » 2010-03-07 00:06

@Julian: Why, I don't even have to try posting anything in here. Your Thunar is a rich vault of...
well, whatever I might think of! You made my day!

Or actually, I have might one. A simple and fast .doc viewer.

viewtopic.php?f=16&t=24551

Yeah, I hate those files and getting them from friends everywhere like a legitimate replacement
for pdf. But what I hated more back when I used a Pentium 2, was the time it took to load
OpenOffice just to view it.
I ken hez kinvulf beck? I ken hez riesnible modereyshn? Kthnxbai!

No need to discuss this topic? Offended by this signature? Remove it:

Mez wrote:You can easily just disable viewing signatures

Click here - and set "Display Signatures" to No
User avatar
canci
 
Posts: 1705
Joined: 2006-09-24 11:28
Location: Bosnia & Herzegovina

Re: Post Your Thunar Custom Actions Here

Postby julian67 » 2010-03-07 00:41

Thanks I'll have a look at that. A couple of weeks ago I installed OpenOffice again (hadn't used it for ages) because I had encountered a few .doc files that made Abiword puke. If I can have an option to not run OpenOffice I'm interested. I've nothing against OpenOffice but running a testing release means frequent updates and OO.org updates are H U M U N G O U S L Y B I G A N D S C A R Y . Big is undeniable, and scary is because my super crappy slow but thankfully *uncapped* andcheapcheapcheapveryverycheap ISP got taken over by CORPORATEBASTARD.co.uk who immediately imposed a 40GB monthly cap (includes up+down) so finally after years of profligate abandon I have to think about not downloading stuff I never use/watch/listen to. Bastards.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Post Your Thunar Custom Actions Here

Postby canci » 2010-03-07 11:35

Bummer! :( I totally get you! Internet in my country, at least the affordable one, is either helluva slow but flatrate, or moderately fast
(Westerners read: slow - 2 MBit/s) and heavily limited. I chose the first option. No HD Youtube for me, but that's OK.

As for the viewer, well, it's no way near a replacement for OOo. Just a small viewer that opens up, converts to pdf and displays the
pdf for you. Heavily limited by how antiword converts docs. Of course, it's awesome if you just want to read the 99% of docs
computer illiterates send you with no formating what so ever. :(
I ken hez kinvulf beck? I ken hez riesnible modereyshn? Kthnxbai!

No need to discuss this topic? Offended by this signature? Remove it:

Mez wrote:You can easily just disable viewing signatures

Click here - and set "Display Signatures" to No
User avatar
canci
 
Posts: 1705
Joined: 2006-09-24 11:28
Location: Bosnia & Herzegovina

Re: Post Your Thunar Custom Actions Here

Postby dbbolton » 2010-03-19 07:03

Here is a little Perl script I've been using to consolidate my feh actions into one. The module it uses is in the libimage-size-perl package (about 217kb once installed).

Code: Select all
#!/usr/bin/perl
use Image::Size; #libimage-size-perl

(my $x, my $y) = imgsize($ARGV[0]);

if ($x == 1280 && $y == 800) {
    system "feh --bg-center \'$ARGV[0]\'";
}
elsif ($x > 0 && $y > 0) {
    system "feh --bg-scale \'$ARGV[0]\'";
}
GitHub | zsh docs in Letter PDF

Telemachus wrote:Put down the CGI.
User avatar
dbbolton
 
Posts: 2133
Joined: 2007-06-20 08:17
Location: Iapetus

Re: Post Your Thunar Custom Actions Here

Postby dbbolton » 2010-05-04 04:09

A script called "sagi":

Code: Select all
#!/usr/bin/perl
print "Search string: ";
chomp( my $what = <STDIN> );
system "find . -maxdepth 2 -iname \'*$what*\' | less";


Called via:
Code: Select all
xterm -T "find" -e "sagi"
GitHub | zsh docs in Letter PDF

Telemachus wrote:Put down the CGI.
User avatar
dbbolton
 
Posts: 2133
Joined: 2007-06-20 08:17
Location: Iapetus

Re: Post Your Thunar Custom Actions Here

Postby JDFight » 2010-05-24 02:24

Extremely simple but very useful (to me):

Name: Convert to AVI
Description: Uses ffmpeg to convert video to .avi
Command:
Code: Select all
xfce4-terminal -x ffmpeg -i %f -b 798k -ab 128k %f.avi


Since I am running a powerbook g4 (ppc) system, I have no real flash alternative and sometimes have issues playing certain .flv files (green artifacts, etc...). These setting work great on just about any .flv. It fixes all issues with my .flvs and sometimes even seems to improve the video quality :)
Last edited by JDFight on 2010-05-25 01:31, edited 1 time in total.
JDFight
 
Posts: 1
Joined: 2010-05-24 02:13

Re: Post Your Thunar Custom Actions Here

Postby dbbolton » 2010-05-24 18:20

I am trying to avoid the thunar-archive-plugin with this (I don't want to install squeeze or file-roller):
Code: Select all
#!/bin/sh

archive=$1
dir="${archive}-extract"

mkdir $dir
cp $archive $dir
cd $dir && unp $archive && rm $archive


It unpacks the archive in a new directory, and leaves the original archive alone. Through a lot of conditional statements I suppose the last line could be cleaned up a bit, but this seems to work fine (and it's less typing).

Obviously, this script must be called with "%n" rather than "%f":
Code: Select all
archive=/home/daniel/archive.zip
dir=/home/daniel/archive.zip-extract

mkdir /home/daniel/archive.zip-extract
cp /home/daniel/archive.zip /home/daniel/archive.zip-extract
cd /home/daniel/archive.zip-extract && unp /home/daniel/archive.zip !!!WRONG!!! && rm /home/daniel/archive.zip !!!WRONG!!!


It would require some tweaking for use with "%N". I think will write a perl script that will iterate over argv in a for loop.
GitHub | zsh docs in Letter PDF

Telemachus wrote:Put down the CGI.
User avatar
dbbolton
 
Posts: 2133
Joined: 2007-06-20 08:17
Location: Iapetus

Re: Post Your Thunar Custom Actions Here

Postby julian67 » 2010-05-24 19:04

dbbolton wrote:I am trying to avoid the thunar-archive-plugin with this (I don't want to install squeeze or file-roller)


Have a look at aunpack (part of atools). It makes dealing with archives very simple (once you worked your way through the man page). For example `aunpack ~/temp/myarchive.zip` unpacks it to ~/temp/myarchive. edit: No It Doesn't! It unpacks it to whichever directory the command is run from. :oops: Other options include -D
-D, --subdir
When extracting archives, always create a new directory for the archive even if the archive only contains
one file in its root directory.


and
-e, --each
For each argument, execute the specified command. This can be used to quickly extract, list or create multi‐
ple archives (see EXAMPLES below). This option can not be used with the cat command.


so a custom action
Code: Select all
aunpack -e -D %F
will unpack any archive(s) and create a destination directory for each.

If you want to view an archive's contents you can use
Code: Select all
xterm -e less %f
or
Code: Select all
xfce4-terminal -x less %f
so long as your .bashrc contains
Code: Select all
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
which I believe is commented by default.

another edit: thunar-archive-plugin works very well with Xarchiver. You certainly don't need Squeeze or FileRoller.
Last edited by julian67 on 2010-05-24 20:40, edited 1 time in total.
Wisdom from my inbox: "do not mock at your pottenocy"
User avatar
julian67
 
Posts: 4648
Joined: 2007-04-06 14:39
Location: Just hanging around

Re: Post Your Thunar Custom Actions Here

Postby ComputerBob » 2010-05-24 19:21

dbbolton wrote:A script called "sagi":

Code: Select all
#!/usr/bin/perl
print "Search string: ";
chomp( my $what = <STDIN> );
system "find . -maxdepth 2 -iname \'*$what*\' | less";


Called via:
Code: Select all
xterm -T "find" -e "sagi"

It looks like some sort of search tool, but, at the risk of being ridiculed for not understanding the details of your perl script, what exactly does it do?
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 22 Million Views
My Ministry
My Massive Stroke
User avatar
ComputerBob
 
Posts: 1195
Joined: 2007-11-30 04:49
Location: The Beautiful Sunshine State

Re: Post Your Thunar Custom Actions Here

Postby dbbolton » 2010-05-24 20:06

@julian76 - Thanks fir the suggestion. I will have a look. But I also don't use xarchiver-- the only graphic archive manager I use (and very rarely so) is Ark. As far as I know, it doesn't work with the plugin.

@ComputerBob - It doesn't really do much. I just find it annoying having to type
Code: Select all
'*  *'

around a find search string. Calling it from Thunar allows me to search for any files whose names contain the search string (and that's all I have to type) in the current directory or (immediately) in any directories under the current directory (that can be changed by -maxdepth).
GitHub | zsh docs in Letter PDF

Telemachus wrote:Put down the CGI.
User avatar
dbbolton
 
Posts: 2133
Joined: 2007-06-20 08:17
Location: Iapetus

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable