Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Post Your Thunar Custom Actions Here
Post Your Thunar Custom Actions Here
Thunar seems to some people to be a very simple file manager, in fact I've seen this asserted quite a few times in various places such as reviews, blogs, vitriolic trolling complaints and so on. It's not actually true but it does look quite limited if you don't care to scratch the surface, read a doc or even just click around with your mouse and see what lurks in the menu. But in fact it's far more versatile than first appearances suggest because it supports custom actions (user created context menu entries) in a very neat way, making it possible to create even quite complex actions very easily and take advantage of the applications and utilities on your system, all from within the file manager. Post your favourites here!
A couple of simple ones:
Slideshow
This requires feh
This will take the images in the directories and/or files you select and display them in a fullscreen slideshow, 3 seconds per image. Use the keyboard h to pause the show and v to show the images actual (1:1) size.
Thunar is missing one facility found in most other file managers, the ability to highlight several directories and/or files and have the total size displayed. So I made a custom action:
How Big?
So I highlight some files and directories and use the 'How Big?' right click entry:
and get this:
I'll post a few more later, just wanted to get things started for now.
So please post your Thunar custom actions, simple or complex. Explain what they do, which applications they use, and if they call a custom script please post that as well. Ideally post screenshots as well but please keep the size reasonable and the text legible. I find scaling the dialogue boxes to 80% satisfies this, and posting a clickable thumb is better if you need to show a substantial part of the desktop.
A couple of simple ones:
Slideshow
This requires feh
This will take the images in the directories and/or files you select and display them in a fullscreen slideshow, 3 seconds per image. Use the keyboard h to pause the show and v to show the images actual (1:1) size.
Thunar is missing one facility found in most other file managers, the ability to highlight several directories and/or files and have the total size displayed. So I made a custom action:
How Big?
So I highlight some files and directories and use the 'How Big?' right click entry:
and get this:
I'll post a few more later, just wanted to get things started for now.
So please post your Thunar custom actions, simple or complex. Explain what they do, which applications they use, and if they call a custom script please post that as well. Ideally post screenshots as well but please keep the size reasonable and the text legible. I find scaling the dialogue boxes to 80% satisfies this, and posting a clickable thumb is better if you need to show a substantial part of the desktop.
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
Well, its the only I use and since nobody else replied:
To open what ever terminal you want with whatever dimensions you need in the folder you are browsing use:
This is for xfce4-terminal but you could use xterm etc.
To open what ever terminal you want with whatever dimensions you need in the folder you are browsing use:
Code: Select all
xfce4-terminal --geometry=70x12
Re: Post Your Thunar Custom Actions Here
Patience!
OK so maybe nobody is interested except you and me, but anyway I'll just keep adding...
Make Playlist:
This one works on directories of audio files, flac/ape/wv/mp3/aac/ogg/oga/wma/mpc/m4a, and creates a simple m3u playlist (no paths, not extended) and changes the line endings to dos format so the playlist works in portable players. The playlist will be named with the directory name i.e. "The Beatles - Abbey Road.m3u". Requires the package tofrodos.
OK so maybe nobody is interested except you and me, but anyway I'll just keep adding...
Make Playlist:
This one works on directories of audio files, flac/ape/wv/mp3/aac/ogg/oga/wma/mpc/m4a, and creates a simple m3u playlist (no paths, not extended) and changes the line endings to dos format so the playlist works in portable players. The playlist will be named with the directory name i.e. "The Beatles - Abbey Road.m3u". Requires the package tofrodos.
Code: Select all
ls -w 1 -R %n/ |egrep *.'[fF][lL][aA][cC]|[aA][pP][eE]|[wW][vV]|[wW][aA][vV]|[mM][pP][3]|[aA][aA][cC]|[oO][gG][gG]|[oO][gG][aA]|[wW][mM][aA]|[mM][pP][cC]|[mM][4][aA]' >%n/%n.m3u && todos %n/%n.m3u
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
Convert any and all selected audio files to Ogg Vorbis -q 7 while retaining all tags including cover art and replay gain. Filenames including spaces and bad characters such as ( or . are allowed.
edit: this and the following script requires gstreamer0.10-plugins-base & gstreamer0.10-plugins-good and the mp3 script requires gstreamer0.10-plugins-bad. For those of you who have a morbid fear of the letter g: don't worry. Gstreamer is not GTK or Gnome, has no dependencies on them and doesn't require any graphical desktop. It's a multimedia framework written in C.
This requires the following script to be in your path and in this custom action it's called ogggst.sh but name it to whatever you prefer:
edit: this and the following script requires gstreamer0.10-plugins-base & gstreamer0.10-plugins-good and the mp3 script requires gstreamer0.10-plugins-bad. For those of you who have a morbid fear of the letter g: don't worry. Gstreamer is not GTK or Gnome, has no dependencies on them and doesn't require any graphical desktop. It's a multimedia framework written in C.
This requires the following script to be in your path and in this custom action it's called ogggst.sh but name it to whatever you prefer:
Code: Select all
#!/bin/bash
for TRACK in "$@" ; do
# allow filenames containing dots such as "an artist feat. some_other_artist"
OGGOUT=$(ls "$TRACK" |sed 's/\(.*\)\..*/\1/')
gst-launch filesrc location="$1" ! decodebin ! audioconvert ! \
vorbisenc name=enc quality=0.7 ! oggmux ! filesink location="$OGGOUT.ogg"
done
Last edited by julian67 on 2010-02-16 21:34, edited 1 time in total.
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
Convert any and all selected audio files to mp3 VBR (using Lame quality V 4) while retaining all tags including cover art (but not replay gain). This writes the tags with ID3v2.3 but doesn't write ID3v1.1 or 2.4. This makes the tags readable by any software or hardware audio player or tagging tools which aren't desperately bad or unmaintained for years. Filenames including spaces and bad characters such as ( or . are allowed.
The appearance conditions have to be slightly different than for the ogg script. Of course they need to exclude already existing mp3s, but also these days Debian sees .ogg as Video and .oga as Audio, so the condition allows Video files but the list of allowed extensions includes only likely audio types. This is my list: *.ogg;*.flac;*.wv;*.wav;*.mpc;*.ape;*.shn
This requires the following script to be in your path and in this custom action it's called mp3gst.sh but name it to whatever you prefer:
The appearance conditions have to be slightly different than for the ogg script. Of course they need to exclude already existing mp3s, but also these days Debian sees .ogg as Video and .oga as Audio, so the condition allows Video files but the list of allowed extensions includes only likely audio types. This is my list: *.ogg;*.flac;*.wv;*.wav;*.mpc;*.ape;*.shn
This requires the following script to be in your path and in this custom action it's called mp3gst.sh but name it to whatever you prefer:
Code: Select all
#!/bin/bash
for TRACK in "$@" ; do
# allow filenames containing dots such as "an artist feat. some_other_artist"
MP3OUT=$(ls "$TRACK" |sed 's/\(.*\)\..*/\1/')
gst-launch filesrc location="$TRACK" ! decodebin! audioconvert ! \
lame name=enc mode=4 vbr=4 vbr-quality=4 ! xingmux ! id3mux ! \
filesink location="$MP3OUT.mp3"
done
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
So basically you could point thunar to whatever script you like. Cool
Re: Post Your Thunar Custom Actions Here
You definitely can. And you can exploit Thunar's ability to use a simple script in less simple ways. For example:bodiless wrote:So basically you could point thunar to whatever script you like. Cool
I always rip CDs to lossless, the files being written to ~/temp/flacin/$artist - $album/$tracknumber - $tracktitle. An m3u playlist is automatically created when ripping. After ripping I scan the covers/booklet and make a 300x300 pixel cover image for media player cover art, and this is always named as folder.jpg. I also correct the audio files' tags if necessary and then embed the folder.jpg in the tags. Not every application can use embedded art so I retain folder.jpg.
My music directory is ~/Music. I prefer to use Ogg Vorbis for my music directory.
I also have a Nokia device which works better with mp3 so I have another directory ~/temp/nokiatemp for stuff converted to mp3.
I don't want all my music in both vorbis and mp3, it's a very small proportion of it which I ever want as mp3.
When I'm ready to convert the flacs to ogg or mp3 I want it completely automated, so I want the tracks converted, a new directory created in ~/Music or ~/temp/nokiatemp, the encoded tracks and folder.jpg and m3u playlist all copied across and the m3u playlist corrected to show the new file extension. I also want replaygain applied in album mode.
So still using the same scripts as in the examples above:
Directory to Oggs:
Code: Select all
find %f -regex ".*\(flac\|mp3\|ape\|wv\|mpc\)$" -execdir ogggst.sh {} \+ && mkdir ~/Music/%n && mv %n/*.ogg ~/Music/%n/ && cp %n/*.m3u %n/folder.jpg ~/Music/%n/ && sed -i 's/\(mp3\)\|\(flac\)\|\(ape\)\|\(mpc\)\|\(wv\)/ogg/g' ~/Music/%n/*.m3u && xterm -e vorbisgain -a ~/Music/%n/*.ogg
Code: Select all
find %f -regex ".*\(ogg\|flac\|mpc\|ape\|wv\)$" -execdir mp3gst.sh {} \+ && mkdir ~/temp/nokiatemp/%n && mv %n/*.mp3 ~/temp/nokiatemp/%n/ && cp %n/*.m3u %n/folder.jpg ~/temp/nokiatemp/%n/ && sed -i 's/\(ogg\)\|\(flac\)\|\(ape\)\|\(mpc\)\|\(wv\)/mp3/g' ~/temp/nokiatemp/%n/*.m3u && xterm -e mp3gain -a -k ~/temp/nokiatemp/%n/*.mp3
There are applications can do some or most of this but none can do all. dir2ogg is pretty good as it can create the destination directory but it doesn't retain cover art or copy the folder.jpg or playlist. Many of the mp3 batch tools still use ID3v1.1 which is beyond hopeless (it's worse than useless because it truncates long names and discards data), and none of them can handle embedded images or anything much at all except basic encoding. SoundJuicer can do quite a lot but is very limited in user set options with reference to encoding quality, ID3 tag version, and destination directory (only really works with directories if every track has the same artist). Foobar2000 can run in wine and is very capable but discards all embedded images on encoding and seems unreliable with UNIX style paths (encoding fails).
So eventually I'll have a few directories of lossless music in ~/temp/flacin and I'd like to archive them. There's no point in using compression (they are already losslessly compressed) so I prefer a .tar archive....time for another custom action:
This requires atool to be installed
Code: Select all
apack -e -F tar %N
Last edited by julian67 on 2010-02-19 00:02, edited 1 time in total.
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
To remove selected files rather than merely send them to the "trash":
To set the wallpaper with feh:
To open a file in a new tab in Kate:
Code: Select all
rm -fr %F
Code: Select all
feh --bg-scale %f
feh --bg-center %f
Code: Select all
kate -u %f
Re: Post Your Thunar Custom Actions Here
Mount and unmount ISO, BIN, IMG, MDF disk images:
This requires fuseiso and that the user is a member of the fuse group.
Mount:
command:
appearance conditions:
Unmount:
command:
appearance conditions:
This requires fuseiso and that the user is a member of the fuse group.
Mount:
command:
Code: Select all
fuseiso -n -p %f %f.mount
Code: Select all
*.iso;*.ISO;*.bin;*.BIN;*.nrg;*.NRG;*.mdf;*.MDF
command:
Code: Select all
fusermount -u %f
Code: Select all
*.mount
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
I'm interested. I'll definitely steal a few of your actions when I've got a day off. Unfortunately, for now, I've got nothing to add myself as I've never gotten around to making my own custom actions.julian67 wrote:Patience!
OK so maybe nobody is interested except you and me, but anyway I'll just keep adding...
"Mankind is advanced technically. Man can build space stations, can assemble them in space, and ponders about landing on Mars, but the development of mankind itself seems to stagnate on stone age level." - Sigmund Jähn
Re: Post Your Thunar Custom Actions Here
Enqueue and Play in MPlayer
Only the GUI version of mplayer supports -enqueue, but fortunately the non-gui version will load a playlist so it's possible to have a custom action which creates a playlist of all selected files and then opens mplayer and plays them in sequence. This works fine for one file or many:
command:
MPlayer opens with window decoration but not the gmplayer controls so you can move the mplayer window around and resize it in the normal way (and it keeps aspect ratio on resize unlike gmplayer) and control it with the usual keyboard commands or OSD menu.
MPlayer play 30 second sample of each file:
same as above, using a different playlist name and with a start position of 120 seconds (opening credits/titles are not very interesting, don't let you check subtitles and alternative audio streams and anyway those FBI warnings are way too scary). Plays for 30 seconds and then moves to next item in playlist.
Only the GUI version of mplayer supports -enqueue, but fortunately the non-gui version will load a playlist so it's possible to have a custom action which creates a playlist of all selected files and then opens mplayer and plays them in sequence. This works fine for one file or many:
command:
Code: Select all
ls -w 1 %F >/tmp/mplist && mplayer -playlist /tmp/mplist
MPlayer play 30 second sample of each file:
same as above, using a different playlist name and with a start position of 120 seconds (opening credits/titles are not very interesting, don't let you check subtitles and alternative audio streams and anyway those FBI warnings are way too scary). Plays for 30 seconds and then moves to next item in playlist.
Code: Select all
ls -w 1 %F >/tmp/mpvlist && mplayer -ss 120 -endpos 30 -playlist /tmp/mpvlist
Last edited by julian67 on 2010-02-21 00:17, edited 1 time in total.
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
I use this one to TeX files to PDF because pdftex doesn't handle my figures correctly:
The TEXMFHOME assignment should be changed or removed, of course. Running in xterm allows me to edit in a terminal window if there is an error.
Also, I use this for converting my scans to Djvu format:
I use for loops to do actions on several files when a command only works on one file at a time.
Code: Select all
xterm -e 'TEXMFHOME=~/.local/share/texmf tex `basename %N .tex` && dvipdf `basename %N .tex` && rm -f `basename %N .tex`.log `basename %N .tex`.dvi'
Also, I use this for converting my scans to Djvu format:
Code: Select all
for i in %F; do c44 $i; done
- ComputerBob
- Posts: 1181
- Joined: 2007-11-30 04:49
- Location: The Mountains of the Sunshine State
- Been thanked: 1 time
Re: Post Your Thunar Custom Actions Here
ComputerBob - Making Geek-Speak Chic (TM)
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters
ComputerBob.com - Nearly 6,000 Posts and 23 Million Views
My Massive Stroke
Help! (off-topic)
_________________
Your Life Matters
Re: Post Your Thunar Custom Actions Here
I use this ugly hack for encryption. Any suggestions for improvement? (Requires zenity)
Code: Select all
xterm -e 'zenity --text "Enter Passphrase:" --entry --hide-text| gpg --passphrase-fd 0 -c %f'
Re: Post Your Thunar Custom Actions Here
@julian67: I registered just to say thanks for the Mount/Unmount images custom action. This is by far the easiest way to mount/unmount ISO images that I have found. What I especially like is that the image is mounted in the same location of the image file itself. Likewise, you are able to directly unmount the image from the same folder. This far and away beats using an app like FuriusISO or other custom actions that mount the image in /media. Thanks julian67julian67 wrote:Mount and unmount ISO, BIN, IMG, MDF disk images:
This requires fuseiso and that the user is a member of the fuse group.
Re: Post Your Thunar Custom Actions Here
The mplayer one is a great idea, I have been struggling for a week to get it to repeat playlists and now it works. Also I was using PCmanFM , and I only wish thunar had tabs...oh well, maybe soon
thanks Julian
thanks Julian
Re: Post Your Thunar Custom Actions Here
I knew about Furius ISO Mount but it's completely Gnome dependent, and who really wants a big chunk of another desktop environment and yet another GUI application for a task that can be accomplished with two short commands? I'd seen someone else post somewhere about a fuseiso Thunar action but his action didn't allow mounting images outside of ~/ such as on external media (USB/SATA). So I Read The Fine Manual and realised it's actually very simple. One of the things I like a lot about Thunar is that its simplicity (which some people confuse with lack of ability) lets the user take great advantage of all those hundreds (thousands?) of command line utilities, all from within the file manager itself and in a completely customisable way. The magic is in the man pagesnabilalk wrote:@julian67: I registered just to say thanks for the Mount/Unmount images custom action. This is by far the easiest way to mount/unmount ISO images that I have found. What I especially like is that the image is mounted in the same location of the image file itself. Likewise, you are able to directly unmount the image from the same folder. This far and away beats using an app like FuriusISO or other custom actions that mount the image in /media. Thanks julian67
You're welcome, that's what this thread is all about. And I'm enjoying the info in everyone's contributions too. I started this thread because apart from the documentation kindly linked by ComputerBob I didn't find anything similar elsewhere that was very useful. There are plenty of posts in various places about one custom action or another but no coherent body of posts, so it seemed a good idea to try to prompt people to contribute and make a good collection that could serve as a useful resource.sir fer wrote:The mplayer one is a great idea, I have been struggling for a week to get it to repeat playlists and now it works. Also I was using PCmanFM , and I only wish thunar had tabs...oh well, maybe soon
thanks Julian
If you can do it on the command line you can probably do it with Thunar so, .....keep reading those man pages!
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
mephjones wrote:I use this ugly hack for encryption. Any suggestions for improvement? (Requires zenity)
Code: Select all
xterm -e 'zenity --text "Enter Passphrase:" --entry --hide-text| gpg --passphrase-fd 0 -c %f'
Try this:
Code: Select all
xfce4-terminal --hide-menubar --hide-toolbars --geometry=70x10 -x gpg -c %f
Wisdom from my inbox: "do not mock at your pottenocy"
Re: Post Your Thunar Custom Actions Here
For mounting/unmounting images I use a modified method, adapted from a nautilus action I was running (my desktop is out of commission due to hardware problems (either power supply or motherboard) so I'm now on a laptop that isn't completely configured yet, but I'm close. Using xfce on this setup)
Instead of calling fuseiso directly I call a bash script. This enables me to mount (and unmount) multiple images in 1 shot. When mounting the last iso mounted gets opened in your file manager (thunar by default).
Mountpoints are on your desktop, but you can easily change that. I store the scripts in ~/bin/
mountiso script
umountiso script
the "actions" definition uses %F rather than %f so:
to mount: ~/bin/mountiso %F
to unmount: ~/bin/umountiso %F
Appearance conditions match Julian's
Instead of calling fuseiso directly I call a bash script. This enables me to mount (and unmount) multiple images in 1 shot. When mounting the last iso mounted gets opened in your file manager (thunar by default).
Mountpoints are on your desktop, but you can easily change that. I store the scripts in ~/bin/
mountiso script
Code: Select all
#!/bin/bash
while [ $1 ]; do
ISONAME=${1##*/}
mkdir ~/Desktop/"$ISONAME".mount
fuseiso "$1" ~/Desktop/"$ISONAME".mount|| rmdir ~/Desktop/"$ISONAME".mount
sleep 1
shift
done
[ -d ~/Desktop/"$ISONAME".mount ] && exo-open ~/Desktop/"$ISONAME".mount >/dev/null
exit
Code: Select all
#!/bin/bash
while [ $1 ]; do
fusermount -uz "$1"
rmdir "$1"
shift
done
exit
to mount: ~/bin/mountiso %F
to unmount: ~/bin/umountiso %F
Appearance conditions match Julian's
Re: Post Your Thunar Custom Actions Here
Looks good. I'd not considered mounting multiple images (quiet life I lead) but I'm wondering if much the same (less the automatic file manager open) can be accomplished by using the same action I posted but with %F instead of %f, or do you need the sleep 1 to keep it reliable?
Wisdom from my inbox: "do not mock at your pottenocy"