[Thunar-workers] [Thunar File Manager] page changed: documentation:custom_actions

thunar-workers at xfce.org thunar-workers at xfce.org
Mon Apr 2 19:45:24 CEST 2012


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2012/04/02 19:45
Browser     : Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
IP-Address  : 24.119.36.114,127.0.0.1
Hostname    : 24-119-36-114.cpe.cableone.net,localhost
Old Revision: http://thunar.xfce.org/pwiki/documentation/custom_actions?rev=1324041222
New Revision: http://thunar.xfce.org/pwiki/documentation/custom_actions
Edit Summary: 
User        : rickyrockrat

@@ -229,4 +229,60 @@
      * File pattern: *.avi;*.mp4;*.crdownload;*.srt;*.sub
      * Appears if selection contains: Video Files, Text Files, Other Files
  
  **Note:** You will need ''subrnm'' script. Get it [[http://pastebin.com/DA8jwHz3|here]]. You'll also neeed ''zenity'' package.
+ 
+ ==== Resize and email images ====
+      * Name: **Resize Images then email them**
+      * Description: Select Image files and resize them before sending in email. Leaves originals untouched.
+      * File pattern: *
+      * Appears if selection contains: Image files
+ ** Note:** You will need the script here (which I name thunar-resize-sendto and place in /usr/local/bin), "zenity", and "imagemagick" packages. I used the xfce-newmail icon. Use the following command line:\\
+ /usr/local/bin/thunar-resize-sendto %F\\
+ \\
+ Not sure why this isn't part of Thunar plugins, since it's pretty sweet. Tested on Xubuntu Lucid.\\
+ **NOTE:** This uses /tmp/thunar-pics0 & /tmp/thunar-pics1 as temp directories, and will completely remove anything in these directories.  I doubt there's a conflict, but you've been warned.  You can see the list of files it creates below in /tmp.
+ 
+ <code>
+ #!/bin/bash
+ #input to this is a list of files to send.
+ # depends on thunar, ImageMagick and Zenity
+ TMP=/tmp/thunar-pics
+ LOG=/tmp/thunar-resize-sendto.log
+ MARKER=/tmp/thunar-resize-sendto.marker
+ SENDTO="/usr/lib/thunar/thunar-sendto-email"
+ SIZES="320x200 640x480 800x600 1024x640"
+ DISCMD="zenity --list --text=\"Select Size\" --checklist --column=Select --column=New --hide-header --print-column=ALL"
+ # Find unused tmp dir
+ if [ -e $MARKER ]; then
+   CUR=$(cat $MARKER)
+ else
+   CUR=1
+ fi
+ if [ 1 == $CUR ]; then
+   CUR=0
+ else
+   CUR=1
+ fi
+ echo "$CUR" >$MARKER
+ TEMP="${TMP}$CUR"
+ mkdir -p $TEMP
+ rm -rf $TEMP/*
+ 
+ for s in $SIZES; do
+   if [ -z $COLS ]; then 
+     COLS="$s "
+   else
+     COLS="$COLS 0 $s"
+   fi
+ done
+ SIZE=$($DISCMD $COLS)
+ echo "CUR=$CUR SIZE=$SIZE" >$LOG
+ 
+ for f in "$@"; do
+   n=$(basename "$f") 
+   echo "item '$f'->$TEMP/$n" >>$LOG
+   convert $f -resize $SIZE "$TEMP/$n"
+   FILES="$FILES $TEMP/$n"
+ done
+ $SENDTO $FILES
+ </code>



-- 
This mail was generated by DokuWiki at
http://thunar.xfce.org/pwiki/



More information about the Thunar-workers mailing list