Reorganize modules
This commit is contained in:
22
modules/home/wm/scripts/toggle-recorder.nix
Normal file
22
modules/home/wm/scripts/toggle-recorder.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ pkgs }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "toggle-recorder";
|
||||
|
||||
runtimeInputs = with pkgs; [
|
||||
wf-recorder
|
||||
slurp
|
||||
procps
|
||||
coreutils
|
||||
];
|
||||
|
||||
text = ''
|
||||
if pgrep -x wf-recorder >/dev/null; then
|
||||
pkill -INT wf-recorder
|
||||
else
|
||||
wf-recorder \
|
||||
-g "$(slurp)" \
|
||||
-f "$HOME/Videos/recording-$(date +%F-%H%M%S).mp4"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user