Alanarchy
Posts 0
Alanarchy
#1
If you have a directory containing png files that you wish to optimise, first you need to install optipng.

Code: Select all

apt-get install optipng
Then in Spacefm, right click on"tools", and click"new" and type"Optipng_Dir" or whatever else you wish to call it. Then enter

Code: Select all

optipng -o7 *.png %N
in the next box that opens.

You might not want o7, so put o6, or o5, or whatever value fits your requirements and/or processing power.

Now when you go to your png directory, you can just click on the new tool to optimise them all.

(If you're used to Thunar-actions, you can use this same method to create similar Spacefm actions.)
Last edited by Guest on 22 Feb 2014, 16:34, edited 2 times in total.
Alanarchy
Posts 0
Alanarchy
#2
I've now worked out how to invoke shred.

Right-click on SpaceFM tools menu and select"new".

I named it"Shred" but you can choose whatever you like.

Then the script goes thus:

Code: Select all

#!/bin/bash
$fm_import    # import file manager variables (scroll down for info)
#
# Enter your commands here:     ( then save this file )

    eval"`spacefm -g --label"Are you sure?" --button yes --button no`"
    if [["$dialog_pressed" =="button1" ]]; then shred -fuz ${fm_files[@]}
        echo"User pressed Yes - Shredding now!"
    else
        echo"User did NOT press Yes - abort"
    fi

exit $?
This will shred whichever files you selected in SpaceFM, and you can never get them back, so use wisely __{{emoticon}}__
Alanarchy
Posts 0
Alanarchy
#3
This one is called"Slideshow" and runs the selected image files in a fullscreen slideshow using Feh.

Code: Select all

feh -p -F -Z -D 3 %F
Alanarchy
Posts 0
Alanarchy
#4
Resize all jpg files in a directory by 50%, saving the new files as file *b.jpg. This reguires Imagemagick

Code: Select all

apt-get install imagemagick
Right click Tools/New, give it at name like Resize50 and put the following code into the box.

Code: Select all

for i in $( ls *.jpg); do convert -resize 50% $i re_$i; done
Last edited by Guest on 21 Sep 2014, 13:26, edited 1 time in total.
Alanarchy
Posts 0
Alanarchy
#5
photo2mail

I placed photo2mail by William Shotts


========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://linuxcommand.org/lc3_photo2mail.php"
linktext was:"http://linuxcommand.org/lc3_photo2mail.php"
====================================


into my bin folder and chmodded it. I then right-clicked Tools/New/Command/photo2mail and entered

Code: Select all

photo2mail %F
You then click on any photo and it resizes to 1024 for easy emailing.

My thanks to William Shotts for his script.
Alanarchy
Posts 0
Alanarchy
#6
Disk Usage

Install Baobab, and then

Code: Select all

baobab %d
Last edited by Guest on 04 Dec 2014, 18:15, edited 2 times in total.
Alanarchy
Posts 0
Alanarchy
#7
Name: Convert Filename to Lower Case

Code:

Code: Select all

for file in %N; do mv"$file""$(echo"$file" | tr '[:upper:]' '[:lower:]')"; done
Name: Slugify Filename

Code:

Code: Select all

for file in %N; do mv"$file""$(echo"$file" | tr -s ' ' | tr ' A-Z' '-a-z' | tr -s '-' | tr -c '[:alnum:][:cntrl:].' '-')"; done