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 # Installationmkdir ~/Pictures/scrot ~/Pictures/screenshot_%Y-%m-%d_$wx$h.pngBasic 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 thumbnailPost-Processing Pipeline
Screenshot Post-Processing
# Quick install for image toolssudo pacman -S imagemagickWatermark
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 clipboardComponents:
tesseract: OCR engine extracting text from images.- Install with:
Terminal window sudo pacman -S tesseract tesseract-data-eng # English language dataxclip: Clipboard management tool- Installation requirement:
Terminal window sudo pacman -S xclip
Window Manager Integration
Qtile Keybindings
Key([], "Print", lazy.spawn("scrot -e 'mv $f ~/Pictures/'")),System-Wide Shortcuts
# Using sxhkd (~/.config/sxhkd/sxhkdrc)Print scrot -e 'mv $f ~/Pictures/'