(on x11)
Before installing, make sure you have the following libraries installed (this list is non-exhaustive):
xcb-shape
xcb-xkb
On systems with apt
, you should be able to run:
sh
apt install libxcb-shape0-dev libxcb-xkb-dev
Simply run cargo install hacksaw
to install from crates.io.
Clone this repo, cd
into it, and run cargo install --path .
hacksaw is in the NUR under nexromancers
as nur.repos.nexromancers.pkgs.hacksaw
.
sh
selection=$(hacksaw) # add hacksaw arguments inside as you wish
shotgun -g "$selection" - | xclip -t 'image/png' -selection clipboard
sh
selection=$(hacksaw) # add hacksaw arguments inside as you wish
shotgun -g "$selection" screenshot.png
```sh
#
dir=~/medias/videos/records current=$(date +%F_%H-%M-%S)
mkdir -p "$dir"
hacksaw -n | { IFS=+x read -r w h x y
w=$((w + w % 2))
h=$((h + h % 2))
ffmpeg \
-v 16 \
-r 30 \
-f x11grab \
-s "${w}x${h}" \
-i ":0.0+$x,$y" \
-preset slow \
-c:v h264 \
-pix_fmt yuv420p \
-crf 20 \
"$dir/$current.mp4"
} ```
``` USAGE: hacksaw [FLAGS] [OPTIONS]
FLAGS: -h, --help Prints help information -n, --no-guides Disable fighter pilot guide lines -V, --version Prints version information
OPTIONS:
-f, --format
-r, --remove-decorations <remove-decorations>
Number of (nested) window manager frames to try and remove [default: 0]
-s, --select-thickness <select-thickness> Thickness of selection box lines [default: 1]
```