From 0326c34b4e14962dd6be8b167874229fceed02f6 Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Fri, 29 Jul 2022 09:57:50 +0200 Subject: [PATCH] Add shortcut for emacs to sway --- home-manager/modules/emacs/default.nix | 7 +++++++ home-manager/modules/sway/default.nix | 2 ++ 2 files changed, 9 insertions(+) diff --git a/home-manager/modules/emacs/default.nix b/home-manager/modules/emacs/default.nix index 2108d1d..c139f0f 100644 --- a/home-manager/modules/emacs/default.nix +++ b/home-manager/modules/emacs/default.nix @@ -32,6 +32,13 @@ in { options.eboskma.programs.emacs = { enable = mkEnableOption "activate emacs"; + + package = mkOption { + description = "The emacs package to install"; + type = types.package; + default = emacs; + }; + daemon = mkOption { description = "Whether to enable emacs daemon"; type = types.bool; diff --git a/home-manager/modules/sway/default.nix b/home-manager/modules/sway/default.nix index c33f7bc..3193217 100644 --- a/home-manager/modules/sway/default.nix +++ b/home-manager/modules/sway/default.nix @@ -188,6 +188,8 @@ in "${mod}+l" = "exec ${swaylockcmd}"; "${mod}+p" = "mode resize"; + "${mod}+c" = mkIf (config.eboskma.programs.emacs.enable) "exec ${config.eboskma.programs.emacs.package}/bin/emacsclient -c"; + "${mod}+Print" = "exec ${pkgs.grim}/bin/grim -o $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jq}/bin/jq -r '.[] | select(.focused) | .name')"; "${mod}+Shift+Print" = "exec ${pkgs.grim}/bin/grim -o $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${pkgs.jq}/bin/jq -r '.[] | select(.focused) | .name') - | ${pkgs.wl-clipboard}/bin/wl-copy -t \"image/png\" -f"; "${mod}+Shift+Ctrl+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t \"image/png\" -f";