diff --git a/modules/terminal-life/default.nix b/modules/terminal-life/default.nix index 522160e6..4e0046ce 100644 --- a/modules/terminal-life/default.nix +++ b/modules/terminal-life/default.nix @@ -33,6 +33,7 @@ in glow mdbook-multilang nnn + notes powerline python-wiki-fetch silver-searcher diff --git a/pkgs/default.nix b/pkgs/default.nix index 5b7daf33..176108f6 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,6 +9,7 @@ with final; { mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final); mopidy-jellyfin = import ./mopidy-jellyfin.nix final; mu = writeShellScriptBin "mu" (import ./mu.nix final); + notes = writeShellScriptBin "notes" (import ./notes.nix final); psos = writeShellScriptBin "psos" (import ./psos.nix final); s = writeShellScriptBin "s" (import ./s.nix final); sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); diff --git a/pkgs/notes.nix b/pkgs/notes.nix new file mode 100644 index 00000000..2932c648 --- /dev/null +++ b/pkgs/notes.nix @@ -0,0 +1,19 @@ +self: with self; '' + # + # ack recursively through notes + # + # uses ack: https://beyondgrep.com + + NOTESDIR=~/pub.solar-nc/Notes + ACK_PREFIX="ack --files-with-matches" + cd $NOTESDIR || exit + file="$( + FZF_DEFAULT_COMMAND="$ACK_PREFIX '$1'" \ + fzf --sort --preview="[[ ! -z {} ]] && ack --colour --context 5 {q} {}" \ + --phony -q "$1" \ + --bind "change:reload:$ACK_PREFIX {q}" \ + --preview-window="70%:wrap" + )" && + echo "opening $file" && + bat --theme=TwoDark "$file" +''