Add screen recording
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.home.hyprland;
|
cfg = config.home.hyprland;
|
||||||
|
toggleRecorder = import ./scripts/toggle-recorder.nix { inherit pkgs; };
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.home.hyprland.monitors = lib.mkOption {
|
options.home.hyprland.monitors = lib.mkOption {
|
||||||
type = lib.types.listOf (lib.types.submodule {
|
type = lib.types.listOf (lib.types.submodule {
|
||||||
@@ -37,8 +37,8 @@ in
|
|||||||
hyprlock
|
hyprlock
|
||||||
playerctl
|
playerctl
|
||||||
speedcrunch
|
speedcrunch
|
||||||
|
toggleRecorder
|
||||||
];
|
];
|
||||||
|
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configType = "lua";
|
configType = "lua";
|
||||||
@@ -131,6 +131,7 @@ in
|
|||||||
(bind "${mod} + B" (dsp.exec_cmd "bzmenu --launcher rofi") { })
|
(bind "${mod} + B" (dsp.exec_cmd "bzmenu --launcher rofi") { })
|
||||||
(bind "${mod} + F" (dsp.window.fullscreen) { })
|
(bind "${mod} + F" (dsp.window.fullscreen) { })
|
||||||
(bind "${mod} + Z" (dsp.exec_cmd "hyprshot -m region") { })
|
(bind "${mod} + Z" (dsp.exec_cmd "hyprshot -m region") { })
|
||||||
|
(bind "${mod} + SHIFT + Z" (dsp.exec_cmd "toggle-recorder") { })
|
||||||
(bind "${mod} + M" (dsp.exit) { })
|
(bind "${mod} + M" (dsp.exit) { })
|
||||||
(bind "${mod} + SPACE" (dsp.exec_cmd "firefox") { })
|
(bind "${mod} + SPACE" (dsp.exec_cmd "firefox") { })
|
||||||
(bind "${mod} + RETURN" (dsp.exec_cmd "kitty") { })
|
(bind "${mod} + RETURN" (dsp.exec_cmd "kitty") { })
|
||||||
|
|||||||
22
systems/modules/home/wm/scripts/toggle-recorder.nix
Normal file
22
systems/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
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -21,12 +21,23 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
modules-right = [
|
modules-right = [
|
||||||
|
"custom/recording"
|
||||||
"pulseaudio"
|
"pulseaudio"
|
||||||
"cpu"
|
"cpu"
|
||||||
"tray"
|
"tray"
|
||||||
"clock"
|
"clock"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
"custom/recording" = {
|
||||||
|
exec = ''
|
||||||
|
if pgrep -x wf-recorder >/dev/null; then
|
||||||
|
echo "🔴 REC"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
interval = 1;
|
||||||
|
tooltip = false;
|
||||||
|
};
|
||||||
|
|
||||||
pulseaudio = {
|
pulseaudio = {
|
||||||
format = "{icon} {volume}%";
|
format = "{icon} {volume}%";
|
||||||
format-muted = " muted";
|
format-muted = " muted";
|
||||||
|
|||||||
Reference in New Issue
Block a user