Tip: OpenBox and scrot

A place to share tips, guides, application configurations and scripts about all elements of ArchLabs

Moderator: Founder

Tip: OpenBox and scrot

PostPosted by Sector11 » Mon May 08, 2017 8:06 am

I noticed that the default screenshot feature in the ARCHLabs is a little wanting (IMHO). Obviously some like it.
ARCHLabs default only does one image at a time: ARCHLabs.png or for the selection: ARCHLabs-Selection.png
Code: Select all
<item label="Screenshot">
            <action name="Execute">
               <command>scrot</command>
            </action>
         </item>
         <menu id="screenshot" label="Screenshooter">
            <item label="Screenshot in 5">
               <action name="Execute">
                  <command>scrot -d 5 'ARCHLabs.png' -e  'mv $f ~/Pictures/ ; gpicview ~/Pictures/$f'</command>
               </action>
            </item>
            <item label="Screenshot in 10">
               <action name="Execute">
                  <command>scrot -d 10 'ARCHLabs.png' -e  'mv $f ~/Pictures/ ; gpicview ~/Pictures/$f'</command>
               </action>
            </item>
            <item label="Screenshot With Selection">
               <action name="Execute">
                  <execute>scrot -s 'ARCHLabs-Selection.png' -e 'mv $f ~/Pictures/ ; gpicview ~/Pictures/$f'</execute>
               </action>
            </item>

I've tweaked my "screenshot" section over the years and want to share what I have.
Image
In the old #! style the images are named according to the "time" on your system - plus some tweaks.

My section of OB.xml that does this:
Code: Select all
      <menu id="root-menu-683319" label="Mission Photos">
         <item label="&gt;&gt; View">
            <action name="Execute">
               <command>mirage ~/images</command>
            </action>
         </item>
         <item label="now.png">
            <action name="Execute">
               <command>scrot '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <item label="[ png ]">
            <action name="Execute">
               <command>scrot -s '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <item label="[png]+B">
            <action name="Execute">
               <command>scrot -s -b '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <menu id="root-menu-683319-931251" label="PNGs in">
            <item label="01">
               <action name="Execute">
                  <command>scrot -d 1 '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="05">
               <action name="Execute">
                  <command>scrot -d 5 '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="10">
               <action name="Execute">
                  <command>scrot -d 10 '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="15">
               <action name="Execute">
                  <command>scrot -d 15 '%F_%T_Scrot11.png' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
         </menu>
         <separator/>
         <item label="now.jpg">
            <action name="Execute">
               <command>scrot '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <item label="[ jpg ]">
            <action name="Execute">
               <command>scrot -s '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <item label="[jpg]+B">
            <action name="Execute">
               <command>scrot -sb '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
            </action>
         </item>
         <menu id="root-menu-683319-41134" label="JPGs in">
            <item label="01">
               <action name="Execute">
                  <command>scrot -d 1 '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="05">
               <action name="Execute">
                  <command>scrot -d 5 '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="10">
               <action name="Execute">
                  <command>scrot -d 10 '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
            <item label="15">
               <action name="Execute">
                  <command>scrot -d 15 '%F_%T_Scrot11.jpg' -e 'mv $f ~/images/ ; mirage ~/images/$f'</command>
               </action>
            </item>
         </menu>
         <separator/>
         <item label="Wallpapers">
            <action name="Execute">
               <command>mirage /media/5/Wallpapers</command>
            </action>
         </item>
         <item label="--&gt; Wannbe">
            <action name="Execute">
               <command>mirage /media/5/Walls-dnld</command>
            </action>
         </item>
         <item label="--&gt; Play">
            <action name="Execute">
               <command>mirage /media/5/Walls-Play</command>
            </action>
         </item>
         <item label="My images">
            <action name="Execute">
               <command>mirage /media/5/My_Images</command>
            </action>
         </item>
         <item label="Camera">
            <action name="Execute">
               <command>mirage /media/5/Camera</command>
            </action>
         </item>
         <item label="Conky Image">
            <action name="Execute">
               <command>mirage /media/5/Conky/images</command>
            </action>
         </item>
         <item label="Conky/3d">
            <action name="Execute">
               <command>mirage /media/5/Conky/images/3d</command>
            </action>
         </item>
      </menu>


Currently:
Code: Select all
/home/sector11/images/2017-05-07_15:47:42_Scrot11.png
/home/sector11/images/2017-05-07_15:47:57_Scrot11.png
/home/sector11/images/2017-05-07_15:48:58_Scrot11.png
/home/sector11/images/2017-05-07_15:49:20_Scrot11.png
/home/sector11/images/2017-05-07_16:50:10_Scrot11.png


Also did you know that taking a scrot of a "selection" doesn't mean you have to 'drag the mouse' if you want a specifit window, just click on that window.

Here's selecting Thunar without ( [png] ) and with ( [png]+B ) the border.
Image Image
I'm a member of Conky Anonymous, a One Step Program
The CA One Step:
1. We admitted we were powerless over conky - and LOVE IT!
User avatar
Sector11
 
Posts: 79
Joined: Sat May 06, 2017 5:45 am

Re: Tip: OpenBox and scrot

PostPosted by Dobbie03 » Mon May 08, 2017 6:24 pm

Thanks for this, testing now.
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: Tip: OpenBox and scrot

PostPosted by Dobbie03 » Mon May 08, 2017 6:54 pm

Very nice additions S11, I am using at the moment with a few changes. Thanks for sharing.
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: Tip: OpenBox and scrot

PostPosted by Sector11 » Tue May 09, 2017 4:15 am

Dobbie03 wrote:Very nice additions S11, I am using at the moment with a few changes. Thanks for sharing.

That makes the post worthwhile, glad you found something useful in it.
I'm a member of Conky Anonymous, a One Step Program
The CA One Step:
1. We admitted we were powerless over conky - and LOVE IT!
User avatar
Sector11
 
Posts: 79
Joined: Sat May 06, 2017 5:45 am

Re: Tip: OpenBox and scrot

PostPosted by Dobbie03 » Tue May 09, 2017 5:35 pm

Sector11 wrote:
Dobbie03 wrote:Very nice additions S11, I am using at the moment with a few changes. Thanks for sharing.

That makes the post worthwhile, glad you found something useful in it.

This sort of thing makes me love Openbox even more.
I like my Metal like my coffee.......black
User avatar
Dobbie03
Founder
Founder
 
Posts: 549
Joined: Sat Feb 18, 2017 2:51 pm
Location: New Zealand
Running Release: DobbieBang

Re: Tip: OpenBox and scrot

PostPosted by Sector11 » Wed May 10, 2017 1:42 am

Dobbie03 wrote:
Sector11 wrote:
Dobbie03 wrote:Very nice additions S11, I am using at the moment with a few changes. Thanks for sharing.

That makes the post worthwhile, glad you found something useful in it.

This sort of thing makes me love Openbox even more.


And running terminator bash scripts from an OB Menu:
This script goes online and gets currency exchange rates.
Code: Select all
terminator --geometry=300x350+80+80 -b -x eagle

Code: Select all
         1 CAD = 11.2776 ARS
         1 CAD = 0.7280 USD
         1 USD = 15.4903 ARS

     1100 ARS = 97.5700 CAD
     1600 ARS = 141.9200 CAD
     2100 ARS = 186.2700 CAD
     4200 ARS = 372.5400 CAD
 Si queres: calc ARS/2100
 
 09 May 17 @ 10:39:50 ~
  $

Not sure if termite can do that. (on Bunsen at the moment)
I'm a member of Conky Anonymous, a One Step Program
The CA One Step:
1. We admitted we were powerless over conky - and LOVE IT!
User avatar
Sector11
 
Posts: 79
Joined: Sat May 06, 2017 5:45 am


Return to Configs, Scripts, Tutorials and Tips

Who is online

Users browsing this forum: No registered users and 0 guests

cron