Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 21 Dec 2014, 01:39
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
scrot-x
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
alexandrion


Joined: 19 Feb 2011
Posts: 105

PostPosted: Sun 24 Apr 2011, 13:10    Post subject:  scrot-x
Subject description: a fast screenshot tool
 

basically this is a script that uses scrot to create screenshots
the default scrot save names are very long so this script changes the screenshot names to xxxx.png



first create the "images" folder in the root folder
place this script in /usr/bin/scrot-x, don't forget to chmod +x it
scrot-x
Code:
#! /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))/" /usr/bin/scrot-x
exit
1


to bind it to your print screenshot key first check which key matches your Print screenshot button

type this in a terminal
Code:
xev | gawk '/keycode/{if($0!=l)printf "0x%x\n",$4;l=$0;}'

and press Print Screen to see what you get

mine was 0x6f

so now i can add the key bindings to my rc.xml

Print screen for instant screenshot or alt+print screen for screenshot in 5 seconds (you can change to how many seconds you want)
in my case, it was
Code:
    <keybind key="0x6f">
      <action name="Execute">
        <execute>scrot-x</execute>
      </action>
    </keybind>
    <keybind key="A-0x6f">
      <action name="Execute">
        <execute>scrot-x 5</execute>
      </action>
    </keybind>


after you added the new keybindings type in a terminal
Code:
openbox -- reconfigure

and the print screen button should work creating fast screenshots without any messy interface

questions / feedback highly appreciated
scrot_0.8-13_i386.pet
Description 
pet

 Download 
Filename  scrot_0.8-13_i386.pet 
Filesize  16.64 KB 
Downloaded  273 Time(s) 
giblib1_1.2.4-5_i386.pet
Description 
pet

 Download 
Filename  giblib1_1.2.4-5_i386.pet 
Filesize  17.98 KB 
Downloaded  257 Time(s) 
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2386
Location: UK

PostPosted: Tue 24 May 2011, 12:24    Post subject:  

Nice, I like this, simple enough to do what I want and no more... Thanks!
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
alexandrion


Joined: 19 Feb 2011
Posts: 105

PostPosted: Tue 24 May 2011, 23:55    Post subject:  

i'm glad you like it Smile
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Utilities
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0653s ][ Queries: 12 (0.0203s) ][ GZIP on ]