Added screencasting scripts
This commit is contained in:
parent
407c93c90d
commit
d4273a1609
21
sway/take_screencast.sh
Executable file
21
sway/take_screencast.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
MODE=$1
|
||||
FILENAME=$(xdg-user-dir VIDEOS)/$(date +%F_%T_wf-recorder.mp4)
|
||||
TEMP_FILENAME=$(mktemp).mp4
|
||||
#PARAMS='-c libvpx-vp9'
|
||||
PARAMS='--audio -o DP-2'
|
||||
|
||||
WF_RECORDERS=$(ps -Al | rg 'wf-recorder' | wc -l)
|
||||
|
||||
if [ $WF_RECORDERS -gt 0 ]; then
|
||||
killall -2 wf-recorder
|
||||
exit 0
|
||||
fi
|
||||
|
||||
case $MODE in
|
||||
"stop") killall -2 wf-recorder;;
|
||||
"region-copy") wf-recorder -g "$(slurp)" $PARAMS -f $TEMP_FILENAME && wl-copy --type text/uri-list file://$TEMP_FILENAME;;
|
||||
"region") wf-recorder -g "$(slurp)" $PARAMS -f $FILENAME && notify-send -i "$FILENAME" "Screencast saved";;
|
||||
*) wf-recorder $PARAMS -f $FILENAME && notify-send -i "$FILENAME" "Screencast saved";;
|
||||
esac
|
|
@ -3,7 +3,8 @@
|
|||
MODE=$1
|
||||
FILENAME=$(xdg-user-dir PICTURES)/$(date +%F_%T_grim.png)
|
||||
|
||||
case $MODE in "region-copy") grim -g "$(slurp)" - | wl-copy;;
|
||||
case $MODE in
|
||||
"region-copy") grim -g "$(slurp)" - | wl-copy;;
|
||||
"region") grim -g "$(slurp)" $FILENAME && notify-send -i "$FILENAME" "Screenshot saved";;
|
||||
*) grim $FILENAME && notify-send -i "$FILENAME" "Screenshot saved";;
|
||||
esac
|
||||
|
|
Loading…
Reference in New Issue
Block a user