From e198c49a9696c2f69e0f94f99ce74b58d76b7560 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 5 Sep 2023 00:29:13 +0000 Subject: [PATCH] refactor: sway: make snip_cmd be an actual shell script --- hosts/modules/gui/sway/sway-config.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hosts/modules/gui/sway/sway-config.nix b/hosts/modules/gui/sway/sway-config.nix index 6bd8afa6..3a3aeaa9 100644 --- a/hosts/modules/gui/sway/sway-config.nix +++ b/hosts/modules/gui/sway/sway-config.nix @@ -14,11 +14,12 @@ let screenshot_cmd = "${pkgs.sway-contrib.grimshot}/bin/grimshot copy area"; # "bookmarking"/snippets inspired by Luke Smith: # - - # TODO: snip_cmd is complex enough it should be its own package and not embedded -- pipes and all -- into the sway config - snip_file = ../snippets.txt; - list_snips = "cat ${snip_file} ~/.config/sane-sway/snippets.txt"; - strip_comments = "${sed} 's/ #.*$//'"; - snip_cmd = "${wtype} $(${list_snips} | ${fuzzel} -d -i -w 60 | ${strip_comments})"; + snip_cmd = pkgs.writeShellScript "type_snippet.sh" '' + snippet=$(cat ${../snippets.txt} ~/.config/sane-sway/snippets.txt | \ + ${fuzzel} -d -i -w 60 | \ + ${sed} 's/ #.*$//') + ${wtype} "$snippet" + ''; # TODO: splatmoji release > 1.2.0 should allow `-s none` to disable skin tones emoji_cmd = "${pkgs.splatmoji}/bin/splatmoji -s medium-light type";