toolkit


Logs | Files | LICENSE | GitLab


1
commit e3b5c0dca2102b5e492a6be628dab8b3d965b969
2
Author: Connor Etherington <[email protected]>
3
Date:   Mon Nov 28 01:55:15 2022 +0200
4
5
    Auto-Commit Update - 20221128
6
---
7
 PKGBUILD                 |  1 +
8
 usr/bin/td               |  9 +--------
9
 usr/share/toolkit/lib/td | 15 +++++++++++++++
10
 3 files changed, 17 insertions(+), 8 deletions(-)
11
12
diff --git a/PKGBUILD b/PKGBUILD
13
index e0229dc..a8149af 100644
14
--- a/PKGBUILD
15
+++ b/PKGBUILD
16
@@ -27,4 +27,5 @@ validpgpkeys=('9A1F3F41DDA55A60331CB8DD3714CB0967D15980')
17
 package() {
18
     install -Dm644 usr/share/licenses/${pkgname}/LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
19
     install -Dm755 usr/bin/* -t "${pkgdir}/usr/bin"
20
+    install -Dm755 usr/share/${pkgname}/lib/* -t "${pkgdir}/usr/share/${pkgname}/lib"
21
 }
22
diff --git a/usr/bin/td b/usr/bin/td
23
index a7c05a5..93640bf 100755
24
--- a/usr/bin/td
25
+++ b/usr/bin/td
26
@@ -1,11 +1,4 @@
27
 #!/usr/bin/env bash
28
 
29
-[[ ! -d $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}" ]] && mkdir -p $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}"
30
-
31
-cd $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}"
32
-
33
-
34
-[ $(realpath ${SHELL}) = '/usr/bin/zsh' ] && $SHELL --auto-cd || echo -e "  \ncd $HOME/DATADIR/`date +%d.%m.%Y`/${1:-$(date +%H.%M)}\n\nChange Shell to ZSH to use auto cd"
35
-
36
-
37
+source /usr/share/toolkit/lib/td && tdcd ${@}
38
 
39
diff --git a/usr/share/toolkit/lib/td b/usr/share/toolkit/lib/td
40
new file mode 100755
41
index 0000000..5d7178a
42
--- /dev/null
43
+++ b/usr/share/toolkit/lib/td
44
@@ -0,0 +1,15 @@
45
+#!/usr/bin/env bash
46
+
47
+tdcd(){
48
+
49
+  [[ ! -d $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}" ]] && mkdir -p $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}"
50
+
51
+  cd $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}"
52
+
53
+  cd $HOME/DATADIR/"`date +%d.%m.%Y`"/"${1:-$(date +%H.%M)}"
54
+
55
+}
56
+
57
+
58
+
59
+