local/bin: Update scripts

This commit is contained in:
xerus2000 2020-09-04 12:16:46 +02:00
parent 9eb1e304b0
commit 1011a0f584
4 changed files with 29 additions and 14 deletions

4
.local/bin/launch Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
#ps aux | grep -v $0 | grep -m 1 $1
echo -n "$1: "
pgrep ${2:-$1} -a | grep --color=never -m 1 . || ( echo Launching && ($1 >/dev/null 2>&1 &) )

10
.local/bin/log Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
local date_args=${LOG_TIME_DEFAULT:-d}
case $1 in
(y)
(m)
(d)
(h)
(t)
esac

14
.local/bin/note Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
p=$PWD
cd $HOME/daten/Dropbox/dokumente/notes
case $1 in
log) shift; file=life/${1:-general}; date +%F >>$file;;
idea) shift; file=ideas/${1:-general}.md;;
write) shift; file=writings/$1.md;;
msg) shift; file=archive/messages/$1.md;;
*) file=${1:-README}.md;;
esac
comment=$(test -f $file && echo Edit || echo Create)
test "$3" && echo $3 >>$file || $EDITOR + $file
git add $file && git commit -m "$comment $file" && git push
cd $p

View File

@ -1,15 +1,2 @@
#!/bin/sh
p=$PWD
cd $HOME/daten/Dropbox/dokumente/notes
case $1 in
log) file=life/${2:-general};;
idea) file=idea/$2.md;;
write) file=writings/$2.md;;
*) file=$2.md;;
esac
comment=$(test -d $file && echo Edit || echo Create)
test "$3" && echo $3 >>$file || $EDITOR $file
git add $file
git commit -m "$comment $file"
git push
cd $p
note write "$@"