summaryrefslogtreecommitdiff
path: root/topics/useful-shell-scripts.gmi
diff options
context:
space:
mode:
authorMunyoki Kilyungi2022-10-06 22:37:37 +0300
committerMunyoki Kilyungi2022-10-06 22:37:37 +0300
commit976fac4142f7b98ebfddda378e3406c9e0755c28 (patch)
treebd18785b360da6d7f29992432ee9d2db33b7e847 /topics/useful-shell-scripts.gmi
parentb61bca421e4e67e8b96a5d77d26ac135178a5988 (diff)
downloadgn-gemtext-976fac4142f7b98ebfddda378e3406c9e0755c28.tar.gz
Create a list of useful shell scripts for day-to-day work
* topics/useful-shell-scripts.gmi: New file
Diffstat (limited to 'topics/useful-shell-scripts.gmi')
-rw-r--r--topics/useful-shell-scripts.gmi32
1 files changed, 20 insertions, 12 deletions
diff --git a/topics/useful-shell-scripts.gmi b/topics/useful-shell-scripts.gmi
index e6f4cac..908928e 100644
--- a/topics/useful-shell-scripts.gmi
+++ b/topics/useful-shell-scripts.gmi
@@ -1,10 +1,16 @@
-* Useful Shell Scripts
+# Useful Shell Scripts
-I make it a habit to put all my user-scripts in =~/bin/= and add that to my =$PATH=. Another useful tip is to prepend all my scripts using a "," - this allows me to quickly take advantage of zsh's autocomplete. For the curious, you could also adopt quiuy as part of the scripts - it has the advantage of adding more semantic meaning to your scripts.
+I make it a habit to put all my user-scripts in `~/bin/' and add that to my `$PATH'. Another useful tip is to prepend all my scripts using a "," - this allows me to quickly take advantage of zsh's autocomplete. For the curious, you could also adopt quiuy as part of the scripts - it has the advantage of adding more semantic meaning to your scripts.
-- Run a script with a directory: ",run-with-dir"
+Most of these scripts were borrowed from:
-#+begin_src sh
+=> https://git.sr.ht/~whereiseveryone/dot/tree/master/item/bin
+
+Here are the scripts that make me more efficient on the terminal:
+
+* Run a script in the context of a directory: ",run-with-dir"
+
+```
#!/bin/sh
set -eo pipefail
@@ -18,13 +24,13 @@ run_within_dir() {
}
run_within_dir $@
-#+end_src
+```
-If you are in =$HOME=, you can do something like: "run-within-dir /tmp"
+If you are in `$HOME', you can do something like: "run-within-dir /tmp"
-- Choose a guix profile on the fly: ",choose-profile":
+* Choose a guix profile on the fly: ",choose-profile":
- #+begin_src sh
+```
#!/bin/env sh
# To run this use source!
@@ -33,12 +39,14 @@ GUIX_PROFILE="$(guix package --list-profiles | fzf --multi)"
export GUIX_PROFILE
. "$GUIX_PROFILE/etc/profile"
- #+end_src
+```
-- Run magit from any terminal: ",magit". You can take of fzf's autocomplete
+* Run magit from any terminal: ",magit". You can take of fzf's autocomplete
- #+begin_src sh
+```
#!/bin/env sh
emacsclient --eval "(projectile-vc \"$PWD/$@\")"
- #+end_src
+```
+
+Should these scripts become too many, a repository will be created and a link added to point there.