From be4b3879a7857271443a35bb7912e97cdae1b114 Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Sat, 19 Sep 2020 09:36:45 +0200 Subject: [PATCH] local/bin: Update note & music playing scripts --- .config/shell/functions | 4 +++- .local/bin/focus | 3 +-- .local/bin/note | 12 +++++++----- .local/bin/vp | 2 ++ 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100755 .local/bin/vp diff --git a/.config/shell/functions b/.config/shell/functions index 1a22675..216515f 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -36,7 +36,9 @@ edshell() { } edbin() { - $EDITOR "$( (command which $1 || find $HOME/.local/bin -name "$1*" | grep . -m 1 || echo "$HOME/.local/bin/$1") | tail -1 )" + file="$( (command which $1 || find $HOME/.local/bin -name "$1*" | grep . -m 1 || echo "$HOME/.local/bin/$1") | tail -1 )" + $EDITOR "$file" + yadm add "$file" } alias -g ___='"$(eval "$(fc -ln -1)" | tail -n 1)"' diff --git a/.local/bin/focus b/.local/bin/focus index e784323..8514265 100755 --- a/.local/bin/focus +++ b/.local/bin/focus @@ -2,5 +2,4 @@ MUSIC="$HOME/daten/music" playlistPath="$MUSIC/Playlists" result="$(test "$1" && (find $playlistPath -iname "focus-$1.m3u8" | grep . || find $playlistPath -iname "$1.m3u*" | grep . || find $MUSIC -iname "*$1*") || echo "$playlistPath/focus.m3u8" )" -killall -q vlc; sleep 1; vlc --qt-start-minimized --loop --random "$result" >/dev/null 2>&1 & - +vp "$result" diff --git a/.local/bin/note b/.local/bin/note index 59bae88..11f637f 100755 --- a/.local/bin/note +++ b/.local/bin/note @@ -1,14 +1,16 @@ #!/bin/sh p=$PWD cd $HOME/daten/Dropbox/dokumente/notes +loc=$1 case $1 in - log) shift; file=life/${1:-general}; date +%F >>$file;; - idea) shift; file=ideas/${1:-general}.md;; + log|life) shift; file=journal/${1:-general}.txt; date +%F >>$file;; + idea) shift; file=ideas/${1:-README}.md;; + box) shift; file=box/$1.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 +comment=$(test -f $file && echo Update || echo Create) +test "$2" && echo "$2" >>$file || $EDITOR + $file +git add $file && git commit -m "$(test "$(dirname $file)" != "." && echo "${loc%%/*}: ")$comment $(basename $file)" && git push cd $p diff --git a/.local/bin/vp b/.local/bin/vp new file mode 100755 index 0000000..fed3114 --- /dev/null +++ b/.local/bin/vp @@ -0,0 +1,2 @@ +#!/bin/sh +killall -q vlc; sleep 1; vlc --qt-start-minimized --loop --random "$@" >/dev/null 2>&1 &