For many years my way of taking screenshots was pretty trivial. I would execute something like sleep 5 && import -window root screenshot.png, switch over to the virtual desktop I want to screenshot and get this png file. If I need to have only some part of it, I'd cut it in GIMP.
A couple of years back when I've started using macOS at work, I googled up it screenshotting shortcuts. They seemed pretty weird, e.g. Command-Control-Shift-3, where 3 means entire screen and 4 means a user-selected region. While I don't know if there's some logic in choosing 3 and 4 for that (why not any other numbers?), I found that it's extremely convenient to take a screenshot of part of the screen and save it to a clipboard. Moreover, I found that I use this feature almost every day to capture parts of terminal window, highlighting some interesting bits from websites for posting on IM and other stuff where image is better than text.
Of course, when I'm running Openbox, using Gimp to achieve the same things starts feeling extremely cumbersome, so I decided to configure Openbox to have similar keybindings for taking screenshots.
First, I wrote a shell script to make things a little easier: screenshot.sh. It uses the import tool from ImageMagick and xclip.
It just accepts two options:
- -r (stands for rootwindow) tells to capture entire screen, otherwise user has to select a region,
- -f (stands for file) tells to save a screenshot to a file (name will be auto-generated and include date), otherwise saves a screenshot into a clipboard.
And, finally, keybindings configuration for ~/.config/openbox/rc.xml:
<keybind key="A-S-3">
<action name="execute">
<execute>~/bin/screenshot.sh -r -f</execute>
</action>
</keybind>
<keybind key="A-S-W-3">
<action name="execute">
<execute>~/bin/screenshot.sh -r</execute>
</action>
</keybind>
<keybind key="A-S-4">
<action name="execute">
<execute>~/bin/screenshot.sh -f</execute>
</action>
</keybind>
<keybind key="A-S-W-4">
<action name="execute">
<execute>~/bin/screenshot.sh</execute>
</action>
</keybind>
Help on Openbox keybindings configuration is here.
> I don't know if there's some logic in choosing 3 and 4 for that (why not any other numbers?)
ReplyDeleteSome random trivia for you. These screenshot shortcuts have been around since around the time of the original Mac. On those machines Command-Shift-1 ejected floppy disk drive one, and you guessed it, Command-Shift-2 ejected floppy disk 2.
This comment has been removed by the author.
ReplyDeleteMua vé tại đại lý vé máy bay Aivivu, tham khảo
ReplyDeletemua ve may bay di my
giá vé máy bay đi sài gòn
giá vé máy bay cần thơ hà nội
vé máy bay khứ hồi nha trang
vé máy bay đi Huế vietnam airline
taxi từ sân bay nội bài về hà nội
combo đà nẵng 3 ngày 2 đêm
Đặt vé tại phòng vé Aivivu, tham khảo
ReplyDeletekinh nghiệm mua vé máy bay đi Mỹ giá rẻ
vé máy bay vinh đi hồ chí minh
vé máy bay hà nội khứ hồi
đi máy bay ra đà lạt
cách mua vé máy bay giá rẻ từ mỹ về việt nam
giá taxi sân bay nội bài
combo quy nhơn flc