From 2d2ef253056c0c71d63cf99aeb6d471d339a6459 Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Fri, 18 Oct 2024 22:32:03 -0400 Subject: [PATCH] Use space at the end of aliases to be able to chain them Finally this can make % with-power-save pomodoro work correctly --- zshrc.org | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/zshrc.org b/zshrc.org index fa68077..31ac6c4 100644 --- a/zshrc.org +++ b/zshrc.org @@ -55,10 +55,13 @@ defined in the previous section. now, the em-world is an alias that only exists in the version of zshrc that I use for root. How do I want to proceed? -*** TODO replace pomodoro aliases with actual scripts - *** TODO have a look at this idea: - Instead of defining a lot of functions in your `.zshrc', all of which you may not use, it is often better to use the autoload builtin. The idea is, you create a directory where function definitions are stored, declare the names in your `.zshrc', and tell the shell where to look for them. Whenever you reference a function, the shell will automatically load it into memory. + Instead of defining a lot of functions in your `.zshrc', all of + which you may not use, it is often better to use the autoload + builtin. The idea is, you create a directory where function + definitions are stored, declare the names in your `.zshrc', and + tell the shell where to look for them. Whenever you reference a + function, the shell will automatically load it into memory. % mkdir /tmp/funs % cat >/tmp/funs/yp @@ -544,11 +547,22 @@ This needs to be diff'd among the versions #+end_src *** dnd management :daily: #+begin_src sh - alias with-dnd=~/scripts/dnd-wrapper.py + alias with-dnd="~/scripts/dnd-wrapper.py " #+end_src This silences the fan: - #+qbegin_src sh - alias with-power-save="powerprofilesctl launch -p power-saver -r 'quiet operations'" + #+begin_src sh + alias with-power-save="powerprofilesctl launch -p power-saver -r 'quiet operations' " + #+end_src +*** with-mpc :daily: + #+begin_src sh + function with-mpc-fade () { + ~/scripts/mpc-fade + $@ + ~/scripts/mpc-fade + } + # Define an alias with a space at the end so that we can chain with + # other non-global aliases () + alias with-mpc-fade='with-mpc-fade ' #+end_src *** Pomodoro aliases :pi:android: