Take Screenshots on Arch Linux with Scrot
#arch linux
#scrot
#screenshot
#cli
#productivity
Why use GUI tools when the terminal can do it faster?
sudo pacman -S scrot # Installation
mkdir ~/Pictures/
scrot ~/Pictures/screenshot_%Y-%m-%d_$wx$h.png
Basic Usage Cheat Sheet
Command | Action |
---|---|
scrot | Full screen → YYYY-MM-DD-HHMMSS.png |
scrot -s | Interactive region selection |
scrot -d 5 | 5-second delay |
scrot -u | Current focused window |
scrot ~/Pictures/%Y-%m-%d_$wx$h.png | Custom filename pattern |
Advanced Capture Techniques
Thumbnail Generation
scrot -t 50 # 50% size thumbnail
Post-Processing Pipeline
Screenshot Post-Processing
# Quick install for image tools
sudo pacman -S imagemagick
Watermark
scrot -e \
'mogrify -pointsize 24 -fill "rgba(255,255,255,0.5)" \
-draw "text 20,30 Watermark" \
-gravity southeast $f'
pointsize 24
: Text sizefill rgba(255,255,255,0.5)
: Semi-transparent whitedraw text
: Draw text at positiongravity southeast
: Text position
OCR Capture: From Screenshot to Clipboard
scrot -s /tmp/ocr-area.png && \
tesseract /tmp/ocr-area.png - | xclip -selection clipboard
Components:
tesseract
: OCR engine extracting text from images.- Install with:
sudo pacman -S tesseract tesseract-data-eng # English language data
xclip
: Clipboard management tool- Installation requirement:
sudo pacman -S xclip
Window Manager Integration
Qtile Keybindings
# ~/.config/qtile/config.py
Key([], "Print", lazy.spawn("scrot -e 'mv $f ~/Pictures/'")),
System-Wide Shortcuts
# Using sxhkd (~/.config/sxhkd/sxhkdrc)
Print
scrot -e 'mv $f ~/Pictures/'