...
...
Ubuntu Forum DO's and DON'T's
DON'T
8 Bump your posts too often (around once every 24 hours is recommended)
http://ubuntuforums.org/showthread.php?t=885580
how about putting it before/after -window root switch/value combo, inside ()?
command line tools usually go like this
what is available: import --helpCode:command_name -option1 value1 -option2 value2 ... file(s)/folder(s)
Last edited by Vaphell; May 14th, 2012 at 04:56 PM.
I can't understand how to put it.
Are you able to fix the script I wrote just in the previous post ? That will be easier.
If not, explain further.
Thanks.
Code:import -window root -quality N $screenshot_dir/screenshot-$(date +%M_%k_%d_%m_%Y|sed -e 's/^ *//').png
just save this wherever you want to run it from. it will store your images in $HOME/Pictures/Screenshots/<date>/<time>.png
Code:#!/bin/bash # declare variables delay=20 # seconds to delay basefolder=$HOME/Pictures/Screenshots # our main screenshot folder # create our basefolder if it doesn't exist if [ ! -d $basefolder ]; then mkdir $basefolder fi # move into it cd $basefolder # meat n pooptatoes while : do currentdate="$(date +%x)" if [ ! "$reference" = "$currentdate" ]; then mkdir $currentdate reference="$currentdate" shotfolder="$basefolder/$currentdate" if [ ! -d "$shotfolder" ]; then mkdir $shotfolder fi fi currenttime="$(date +%X)" import -quality 5 -window root $shotfolder/$currenttime.png sleep $delay done
Well, HilmTye, I'm sorry to tell you that the script you've written didn't work, it has just created a "Screenshot" folder within the Pictures folder, containing three sub-folders, the first one having the date day, the second named as the current month, and the last folder named "2012". That's fine, but add to it that no screen-shots were being token.
I'm sorry for that, hope I didn't waste much of your time.
After re-reading my script, I understood how Vaphell has put the script, and here's how my script looks like now and it's working as expected:
screenshot_dir='screens'
seconds='30';
if [ ! -d "$screenshot_dir" ]; then
mkdir $screenshot_dir;
fi
while [ 1 ]; do
sleep $seconds;
(import -window root -quality 3 $screenshot_dir/screenshot-$(date +%S_%M_%k_%d_%m_%Y|sed -e 's/^ *//').jpg) &
done
Thanks to everyone who helped be going through my issue.
sorry about that, I didn't actually test it and as a result, neglected quotes in the filename. if you're interested in it, here is the script, fixed:
the advantage to this script is that each day will have its' own folder (and is automagically created by the script on a new day) with the filenames simply being the time and the extensionCode:#!/bin/bash # declare variables delay=20 # seconds to delay basefolder=$HOME/Pictures/Screenshots # our main screenshot folder extension=.png # the extension we want to use quality=5 # image quality # create our basefolder if it doesn't exist if [ ! -d $basefolder ]; then mkdir $basefolder fi # move into it cd $basefolder # meat n pooptatoes while : do currentdate="$(date +%x)" if [ ! "$reference" = "$currentdate" ]; then reference="$currentdate" shotfolder="$basefolder/$currentdate" if [ ! -d "$shotfolder" ]; then mkdir $shotfolder fi fi currenttime="$(date +%X)" import -quality $quality -window root "$shotfolder/$currenttime$extension" sleep $delay done
as you can see, it works:
Screenshot at 2012-05-15 05:35:58.jpg
if you would like it edited so that, for instance, they are separated by hour into separate folders or whatever, just let me know. right now if you leave it running from midnight to midnight you will end up with a folder that has 4320 images inside it (with a 20 second interval)
Last edited by HiImTye; May 15th, 2012 at 01:43 PM.
Oh, lucky I came back to this thread.
Thanks for the script, I just saved it and I will use it whenever I find it necessary !
Hey guys, sorry for having to Up this topic, but it's not as old and I need to add something to it:
Can I modify the screen-shot file name to the focused window ? I can't explain much so here's a photo to make things clearer:
Last edited by UAdnan; May 28th, 2012 at 09:26 AM. Reason: Modified issue.
Bookmarks