From 7e86becbb26510d06ed05f72fd6edab73b5901e4 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Tue, 10 Oct 2023 09:55:04 +0200 Subject: [PATCH] sway: Add extraKeybinds option --- home-manager/modules/sway/default.nix | 9 ++++++++- users/erwin/work.nix | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index 21bfe22..269d377 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -63,6 +63,12 @@ in }); default = [ ]; }; + + extraKeybindings = mkOption { + description = "Extra keybindings"; + type = types.attrsOf types.str; + default = { }; + }; }; config = mkIf cfg.enable { @@ -236,7 +242,8 @@ in "${mod}+d" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait"; "${mod}+Shift+d" = "exec ${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait"; - }; + + } // cfg.extraKeybindings; modes = { passthrough = { diff --git a/users/erwin/work.nix b/users/erwin/work.nix index 650a76f..205cc35 100644 --- a/users/erwin/work.nix +++ b/users/erwin/work.nix @@ -172,9 +172,13 @@ in }; startup = [ { command = "${ewwDaemon} --restart open bar-work"; always = true; } - { command = "${pkgs.wayvnc}/bin/wayvnc -g 0.0.0.0"; always = true; } + { command = "${pkgs.wayvnc}/bin/wayvnc 0.0.0.0"; always = true; } ]; workspaceOutputs = workspacePartition; + extraKeybindings = { + "Ctrl+Alt+1" = "exec ${pkgs.wayvnc}/bin/wayvncctl output-set DP-1"; + "Ctrl+Alt+2" = "exec ${pkgs.wayvnc}/bin/wayvncctl output-set DP-3"; + }; }; swaynotificationcenter.enable = true; tmux.enable = true;