From 90512f8dafc9b9b799c43dda7682ff1b751211c3 Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Thu, 30 Jan 2020 12:33:19 +0100 Subject: [PATCH] Better presentation of the additional paths in $PATH --- org/config-website/fish.org | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/org/config-website/fish.org b/org/config-website/fish.org index 4a4d30c..7d5a27d 100644 --- a/org/config-website/fish.org +++ b/org/config-website/fish.org @@ -1,3 +1,4 @@ +# -*- org-confirm-babel-evaluate: nil -*- #+TITLE: Phundrak’s fish config #+INCLUDE: headers.org #+OPTIONS: auto-id:t @@ -5,7 +6,7 @@ #+HTML_HEAD_EXTRA: #+HTML_HEAD_EXTRA: #+PROPERTY: header-args:fish :tangle ~/.config/fish/config.fish :exports code -#+PROPERTY: header-args :exports code +#+PROPERTY: header-args :exports code :tangle no * Table of Contents :TOC:noexport: :PROPERTIES: @@ -112,10 +113,29 @@ is for example the case with my =PATH= variable in which I add Rust’s Cargo’s binaries, Go’s binaries and my own executables. And of course, don’t forget to add the already existing =PATH=. - #+BEGIN_SRC fish - set -gx PATH \ - $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin \ - $HOME/.gem/ruby/2.6.0/bin $PATH + + #+NAME: extra-paths + | additional path | what it leads to | + |---------------------------+--------------------------------------| + | $HOME/.pub-cache/bin | Dart binaries and executables | + | $HOME/.local/bin | Custom executables, see [[file:bin.org]] | + | $HOME/go/bin | Go binaries and executables | + | $HOME/.cargo/bin | Rust binaries and executables | + | $HOME/.gem/ruby/2.6.0/bin | Ruby binaries and executables | + + #+NAME: generate-extra-paths + #+BEGIN_SRC python :var paths=extra-paths :exports none :cache yes + results = '' + for path in paths: + results += "{0} ".format(path[0]) + return results.strip() + #+END_SRC + + #+RESULTS[36e9cabf867423f29b621d8dac765fad154bd2b1]: generate-extra-paths + : $HOME/.pub-cache/bin $HOME/.local/bin $HOME/go/bin $HOME/.cargo/bin $HOME/.gem/ruby/2.6.0/bin + + #+BEGIN_SRC fish :noweb yes + set -gx PATH <> $PATH #+END_SRC Sometimes, software will rely on =SUDO_ASKPASS= to get a GUI from which it