Add screenshot / screen recording.
This commit is contained in:
parent
9abe43096b
commit
75ac4b91f3
@ -261,6 +261,7 @@ in
|
|||||||
./iso.nix
|
./iso.nix
|
||||||
./rofimoji.nix
|
./rofimoji.nix
|
||||||
./lockscreen.nix
|
./lockscreen.nix
|
||||||
|
./screenshot.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.me.swayIncludes = lib.mkOption {
|
options.me.swayIncludes = lib.mkOption {
|
||||||
|
42
nix/configuration/roles/sway/screenshot.nix
Normal file
42
nix/configuration/roles/sway/screenshot.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
screenshot_sway_config = pkgs.writeTextFile {
|
||||||
|
name = "screenshot.conf";
|
||||||
|
text =
|
||||||
|
builtins.replaceStrings
|
||||||
|
[ "@grim@" "@wl-screenrec@" "@pactl@" "@grep@" "@slurp@" ]
|
||||||
|
[
|
||||||
|
"${pkgs.grim}/bin/grim"
|
||||||
|
"${pkgs.wl-screenrec}/bin/wl-screenrec"
|
||||||
|
"${pkgs.pulseaudio}/bin/pactl"
|
||||||
|
"${pkgs.gnugrep}/bin/grep"
|
||||||
|
"${pkgs.slurp}/bin/slurp"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
# Screenshots
|
||||||
|
#bindsym $mod+print exec @slurp@ | @grim@ -g - $(xdg-user-dir PICTURES)/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')
|
||||||
|
bindsym $mod+print exec @slurp@ | @grim@ -g - "$HOME/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"
|
||||||
|
bindsym print exec @grim@ "$HOME/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')"
|
||||||
|
# Maybe add --audio flag? can optionally specify specific device name from `@pactl@ list sources | @grep@ Name`
|
||||||
|
bindsym $mod+Shift+print exec @wl-screenrec@ -g "$(@slurp@)" --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
|
||||||
|
bindsym Shift+print exec @wl-screenrec@ --codec av1 -f "$HOME/$(date +'screencast_%Y-%m-%d-%H%M%S.mkv')"
|
||||||
|
bindsym $mod+ctrl+Shift+print exec pkill -SIGINT @wl-screenrec@
|
||||||
|
# Need to make a hotkey to end the recording
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ ];
|
||||||
|
|
||||||
|
config = lib.mkIf config.me.graphical {
|
||||||
|
me.swayIncludes = [
|
||||||
|
screenshot_sway_config
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user