Yaxg
capture and record your screen with callbacks
Install / Use
/learn @DanielFGray/YaxgREADME
yaxg
Yet Another X Grabber script
Dependencies
- slop - for selecting regions and windows
- maim - for saving screenshots
- ffmpeg - for recording videos
- byzanz - for recording gifs (soon to be replaced with ffmpeg)
- libnotify / notify-send - for notifications
Usage
yaxg [OPTIONS] [FILE]
Options
-d specify duration to record for (only works for webms)
-D specify delay
-F overwrite file if it exists
-s select a region or window
-S pass a arguments directly to slop
-e execute a script in the config dir or a callback string with the current $SHELL
-g save as gif (will be overridden by file extension)
-p save as png (will be overridden by file extension)
-w save as webm (will be overridden by file extension)
this is the default behavior when -g or -p is not present and the filename doesn't end in png or gif
press Ctrl+C to stop recording or run `yaxg stop`
-v increase verbosity (can be stacked)
first level will show errors parsing config file, consecutive levels will be passed to ffmpeg
-h print this help
Special Strings
Similar to scrot, the callback and filename parameters can take format specifiers that are expanded when encountered. Characters preceded by
% are interpreted directly by the date commmand. See man strftime for examples. Characters preceded by $ are parsed by yaxg and expanded as such:
$f quoted image path/filename (only available in callback)
$w image width
$h image height
Configuration
A configuration file can saved to ~/.config/yaxg/conf
If a line begins with # it is treated as a comment and ignored.
The config file accepts the following values:
callback
a callback string to execute
if callback is a script in the config dir, the the quoted filename will automatically be passed to the script
filename
a default filename to use when none is provided (must not include extension)
defaults to %FT%R:%S:%:z_$wx$h
format
default format to use, must be either 'png', 'webm', or 'gif'
slop
arguments to be passed to slop
Examples
- Example CLI usage:
yaxg '%s-$w-$h'
yaxg '%s-$w-$h' -e 'mv $f ~/images/$f'
yaxg -s -S '-l -c 0.3,0.4,0.6,0.4' -e 'mv $f ~/images/$f && firefox ~/images/$f'
printf '#!/usr/bin/env bash\n\n[[ "$1" =~ png$ ]] && optipng "$1"\n' > ~/.config/yaxg/myScript && chmod +x !#:3 && yaxg -e 'myScript'
- Example config file:
filename %c - $wx$h
format png
slop -l -c 0.3,0.4,0.6,0.4
callback myScript
The wiki has some example callback scripts.
Installation
Arch Linux users can install from the AUR as yaxg-git via their favorite AUR helper.
If you're on another distro, I would suggest cloning the repo and symlink'ing the script into ~/.local/bin and adding that to your PATH.
See also
- tekup - upload files to https://teknik.io via
yaxg -e 'tekup $f'
Legal
Copyright (C) 2016 Daniel F Gray DanielFGray@gmail.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
