From f9523f27f286637950229e300e1b8258d6d05e22 Mon Sep 17 00:00:00 2001 From: desktop Date: Tue, 28 Nov 2023 02:34:58 +0300 Subject: [PATCH] tmp : add tmp. --- .README.md | 6 ++++++ .config/bash/module/tmp.sh | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .config/bash/module/tmp.sh diff --git a/.README.md b/.README.md index 2e4cd81..ced475f 100644 --- a/.README.md +++ b/.README.md @@ -631,6 +631,12 @@ Command|Description ---|--- `tsize`|Prints terminal size. +## Tmp. + +Command|Description +---|--- +`tmp`|CD into host's primary tmp dir. + ## Tmux. Command|Description diff --git a/.config/bash/module/tmp.sh b/.config/bash/module/tmp.sh new file mode 100644 index 0000000..dc42f7a --- /dev/null +++ b/.config/bash/module/tmp.sh @@ -0,0 +1,17 @@ +# CD into host's primary tmp dir. +tmp() +{ + local host="${HOSTNAME}" + local tmp_path + + case "${host}" in + "desktop"|"home") + tmp_path="/var/mnt/storage/hot/tmp" + ;; + *) + tmp_path="${HOME}/tmp" + ;; + esac + + cd "${tmp_path}" +}