video: moved screen key script to video module

This commit is contained in:
Ingolf Wagner 2020-03-28 17:04:00 +08:00
parent a676e87011
commit e6ffb1542c
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 21 additions and 21 deletions

View file

@ -6,6 +6,26 @@ let
cfg = config.programs.custom.video; cfg = config.programs.custom.video;
# show keyboard input on desktop for screencasts
screenKey = pkgs.symlinkJoin {
name = "screen-keys";
paths = let
screenKeyScript = { position ? "bottom", size ? "small", ... }:
pkgs.writeShellScriptBin "screenkeys-${position}-${size}" # sh
''
${pkgs.screenkey}/bin/screenkey \
--no-detach \
--bg-color '#fdf6e3' \
--font-color '#073642' \
-p ${position} \
-s ${size} \
"$@"
'';
in lib.flatten (lib.flip map [ "large" "small" "medium" ] (size:
lib.flip map [ "top" "center" "bottom" ]
(position: screenKeyScript { inherit size position; })));
};
in { in {
options.programs.custom.video.enable = mkEnableOption "enable video tools"; options.programs.custom.video.enable = mkEnableOption "enable video tools";
@ -19,7 +39,7 @@ in {
# to record your screen # to record your screen
# --------------------- # ---------------------
simplescreenrecorder simplescreenrecorder
# todo : the tool to show the keys pressing screenKey
# to transcode video material # to transcode video material
# --------------------------- # ---------------------------

View file

@ -44,25 +44,6 @@ let
"$@" "$@"
''; '';
# show keyboard input on desktop for screencasts
screenKey = pkgs.symlinkJoin {
name = "screen-keys";
paths = let
screenKeyScript = { position ? "bottom", size ? "small", ... }:
pkgs.writeShellScriptBin "screenkeys-${position}-${size}" # sh
''
${pkgs.screenkey}/bin/screenkey \
--no-detach \
--bg-color '#fdf6e3' \
--font-color '#073642' \
-p ${position} \
-s ${size} \
"$@"
'';
in lib.flatten (lib.flip map [ "large" "small" "medium" ] (size:
lib.flip map [ "top" "center" "bottom" ]
(position: screenKeyScript { inherit size position; })));
};
connectToSpeaker = name: id: connectToSpeaker = name: id:
pkgs.writeShellScriptBin "connect-to-speaker-${name}" # sh pkgs.writeShellScriptBin "connect-to-speaker-${name}" # sh
@ -305,7 +286,6 @@ in {
(writeShellScriptBin "music-making" (writeShellScriptBin "music-making"
(fileContents <assets/music-making.sh>)) (fileContents <assets/music-making.sh>))
screenKey
replaceLinks replaceLinks
image-generator image-generator