add journal

This commit is contained in:
nemo 2024-09-18 16:05:25 +02:00
parent 6630de6553
commit 60040a8912
2 changed files with 27 additions and 0 deletions

1
bashrc
View File

@ -150,6 +150,7 @@ alias shrek="firefox https://www.youtube.com/watch?v=_S7WEVLbQ-Y"
alias ssh-save='eval $(ssh-agent) && ssh-add'
alias raylib="cd /usr/local/include && v raylib.h"
alias d="dev"
alias packtoday="grep ' install ' /var/log/dpkg.log"
# alias avec parametre
emoji(){ grep -i $1 $OPT_PATH/emoji; }

26
journal Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
pat="/home/$USER/opt/journal"
ane=$(date +%Y)
auj=$(date +%d-%b | tr '[:upper:]' '[:lower:]')
if [[ $2 != "" ]]; then
nvim $pat/$2/$1
exit
fi;
if [[ $1 == "save" ]]; then
cd $pat
git add .
git commit -am "$auj"
git push
exit
fi;
if [[ $1 != "" ]]; then
nvim $pat/$ane/$1
exit
fi;
mkdir -p $pat/$ane
nvim $pat/$ane/$auj