27 lines
663 B
Plaintext
27 lines
663 B
Plaintext
|
#!/bin/bash
|
||
|
# GPL3
|
||
|
|
||
|
VIDEO="/home/purism/Videos/$(date +%Y-%m-%d-%H%M%S).avi"
|
||
|
yad --title ScreenCapture --text "A simple GUI to record the screen" --button="Start capture:100" --button="Quit:0" --buttons-layout=center
|
||
|
start_window_return=$?
|
||
|
|
||
|
if [[ $start_window_return -eq 100 ]]
|
||
|
then
|
||
|
wf-recorder -a -f $VIDEO --codec=asv1 &
|
||
|
else
|
||
|
exit
|
||
|
fi
|
||
|
|
||
|
yad --title ScreenCapture --text "Screen capture is actively running. \nFile: $VIDEO" --button='Stop capture:100' --buttons-layout=center
|
||
|
exit_window_return=$?
|
||
|
|
||
|
if [[ $exit_window_return -eq 100 ]]
|
||
|
then
|
||
|
killall -2 wf-recorder
|
||
|
fi
|
||
|
|
||
|
if test -f "$VIDEO"
|
||
|
then
|
||
|
notify-send ScreenCapture "Video stored at $VIDEO"
|
||
|
fi
|