Quick tip: An OCPD screenshot command

This is the best tip I have for you today.

scrot -q 100 -d 5 `date +%F`-$HOSTNAME-$RANDOM.jpg &

I am one of those unnecessarily persnickety people who likes their screenshots arranged by date, and then by the identity of the machine that took it, and then with some sort of identifier to … identify it. :roll:

You might have noticed that in the file names of screenshots I post here, or you might not. Don’t feel bad if you didn’t. You would be equally persnickety if you did. :roll:

Point is, you can do that rather quickly with scrot and the date command, suffixed by the omnipresent host name variable, plus a random number to separate it from others.

Afterward, I usually change the random number to give me more information. A while back I was using the actual time, down to the second, to arrange them in sequence, but it seemed like overkill.

Jam this into your Openbox right-click menu and you have a point-and-click five-second delay screenshot tool. This is one of those times when ObMenu comes in handy. (Would someone please update that? :shock: )

For IceWM users … well, I’ve never been able to get environment variables working from within the menu or toolbar configuration files, so dump it into a script and trigger the script from your menu.

Unless someone can set me straight on why those don’t seem to work. Cheers if you can. … :|

About these ads

6 Responses to “Quick tip: An OCPD screenshot command”

  1. 1 Kaleb Elwert 2011/01/08 at 8:36 AM

    I threw together a few bug fixes on ObMenu a while ago but it was really glitchy. The problem is that the program itself is quite glitchy and inconsistent…


    If I remember right, it at least works…

    I think on my new linux install, I might get back into Openbox at which point I’d move this over to my bitbucket account. We’ll see. I just need to get this unfortunate XP install working right now.

  2. 2 llewton 2011/01/08 at 9:41 AM

    I won’t be using this in this format as my hostname is “potato” and I’m slightly embarrassed by it.

    But let me say this can be added to the Fluxbox root menu, or bound to key(s). In .fluxbox/menu,

    [exec] (whatever) {scrot -q 100 -d 5 `date +%F`-$HOSTNAME-$RANDOM.jpg &}

    To bind only to the print key this is added to the keys file in .fluxbox

    None Print :ExecCommand scrot -q 100 -d 5 `date +%F`-$HOSTNAME-$RANDOM.jpg &

    The point is it can be bound to a key or keys in Openbox too, and/or added to the xml file that configures OB menu.

    So I could be missing something, but what’s the relevance of Obmenu to this story?

  3. 3 Jeff Bauer 2011/01/11 at 1:11 AM

    I’m a devout ratpoison WM user and have had a similar scrot command in ~/.ratpoisonrc for some time now. No menu to call up and select from, either.

    Tap left Win key, tap z key, done.

  4. 4 HilltopYodeler 2011/01/11 at 9:09 AM

    Nice little scrot command; thanks for sharing. Instead of using a random number, I like to use the UNIX epoch timestamp (date +%s), which keeps my screenshot images listed in order… like this:

    scrot -q 100 -d 5 `date +%F`-$HOSTNAME-`date +%s`.jpg &

  1. 1 Adding the modification time to the beginning of a file name « Motho ke motho ka botho Trackback on 2011/01/27 at 6:49 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Visit the Wiki!

Some recent desktops

May 6, 2011
Musca 0.9.24 on Crux Linux
150Mhz Pentium 96Mb 8Gb CF

May 14, 2011
IceWM 1.2.37 and Arch Linux
L2300 core duo 3Gb 320Gb

Some recent games

Apr. 21, 2011
Oolite on Xubuntu 11.04
L2300 core duo 3Gb 320Gb

Enter your email address to subscribe to this blog and receive notifications of new posts.

Join 405 other followers


This work is licensed under the GNU Free Documentation License. Please see the About page for details.

Blog Stats

  • 3,962,770 hits



Get every new post delivered to your Inbox.

Join 405 other followers

%d bloggers like this: