mirror of
https://github.com/kmein/niveum
synced 2026-03-21 04:11:07 +01:00
feat: screencap script
This commit is contained in:
16
.bin/screencap.sh
Executable file
16
.bin/screencap.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#! /usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i sh -p coreutils byzanz xorg.xwininfo gnused
|
||||||
|
|
||||||
|
# shellcheck shell=sh
|
||||||
|
# ref https://gist.github.com/aforemny/0994cb7f06ea30d56c8b9681ff5d2054
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
eval "$(xwininfo | \
|
||||||
|
sed -n -e 's/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p' \
|
||||||
|
-e 's/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p' \
|
||||||
|
-e 's/^ \+Width: \+\([0-9]\+\).*/w=\1/p' \
|
||||||
|
-e 's/^ \+Height: \+\([0-9]\+\).*/h=\1/p')"
|
||||||
|
|
||||||
|
trap "pkill -f 'sleep 360d'" INT
|
||||||
|
byzanz-record -e "sleep 360d" -c -x $x -y $y -w $w -h $h "$@"
|
||||||
Reference in New Issue
Block a user