From c2292de2bc5075765f92d00c9ce6f15325168cf1 Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Fri, 3 Mar 2023 15:06:20 -0800 Subject: [PATCH] home: modify killall for wrapped apps, clean bashrcExtra --- hosts/home.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/hosts/home.nix b/hosts/home.nix index c28ea77..63d1d1c 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -102,13 +102,21 @@ in rm = "trash-put"; emacs = "emacsclient -nw"; }; - # Change to directory when exiting ranger with Q - # https://github.com/ranger/ranger/issues/1554#issuecomment-491650123 bashrcExtra = '' + # Modify killall for wrapped applications, e.g. firefox + # killall firefox -> killall firefox || killall .firefox-wrapped + function killall { + `which killall` $1 || `which killall` .''${1}-wrapped + } + + # pandoc macro + # pandoc document.md -> pandoc document.md -o document.pdf ... function pdf { - pandoc "$1" -o "''${1%.*}.pdf" -V colorlinks=true -V linkcolor=blue + pandoc $1 -o ''${1%.*}.pdf -V colorlinks=true -V linkcolor=blue } + # Change to directory when exiting ranger with Q + # https://github.com/ranger/ranger/issues/1554#issuecomment-491650123 function ranger { local IFS=$'\t\n' local tempfile="$(mktemp -t tmp.XXXXXX)"