You are not logged in.
Pages: 1
here's a script i made to save my screenshots with a 4 digit number format
instead of having the file called "2011-02-08-185951_1366x768_scrot.png" it will rename it to "0001.png, 0002.png...9999.png"
#! /bin/bash
number=`sed -n "17 p" "$0"`
keep=$number
delay=0$1
if [ $delay -lt 1 ];
then
delay=0
fi
len=${#number}
while [ $len -lt 4 ];
do
number=0$number
len=$(($len+1))
done
scrot $number'.png' -d $delay -e 'mv $f ~/images/ & viewnior ~/images/$f' | sed -i "17s/$keep/$(($keep + 1))/" ~/bin/scripts/scrot-x
exit
1for the script to work you must place it in ~/bin/scripts/scrot-x (or if you change that location make sure to change it in the script as well
after you place the script in ~/bin/scripts/scrot-x make sure you chmod +x it and create a symbolic link to /usr/bin
sudo ln -s ~/bin/scripts/scrot-x /usr/bin/scrot-xnow just run scrot-x to save a screenshot or scrot-x [number] for a delayed screenshot 
to bind it to your keys
<keybind key="Print">
<action name="Execute">
<execute>scrot-x</execute>
</action>
</keybind>
<keybind key="A-Print">
<action name="Execute">
<execute>scrot-x 10</execute>
</action>
</keybind>Last edited by ali (2011-02-09 07:32:35)
Offline
did you try to replace
~/bin/scripts/scrot-xwith (use quotes to handle spaces in the variable)
"$0"inside the script? should work even if you rename or move your script 
Offline
did you try to replace
~/bin/scripts/scrot-xwith (use quotes to handle spaces in the variable)
"$0"inside the script? should work even if you rename or move your script
nice!
it doesn't seam to work on my second expression
Last edited by ali (2011-02-09 07:31:33)
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.