Différences entre versions de « Journal.sh »
Sauter à la navigation
Sauter à la recherche
m |
m |
||
(3 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
− | {{DISPLAYTITLE: | + | {{DISPLAYTITLE:journal.sh}} |
A simple bash script to force me to journal everytime I switch on my trusty laptop. | A simple bash script to force me to journal everytime I switch on my trusty laptop. | ||
+ | '''process:''' | ||
# at startup | # at startup | ||
# prompt to write in the console | # prompt to write in the console | ||
# save the text (with the date) on a text file | # save the text (with the date) on a text file | ||
# send it to my server ? | # send it to my server ? | ||
+ | |||
+ | == bash script == | ||
+ | <nowiki>#!/bin/bash | ||
+ | |||
+ | now=$(date) | ||
+ | entry="" | ||
+ | |||
+ | echo "$now" | ||
+ | echo " " | ||
+ | echo "👋 hello martin, how are you feeling today ?" | ||
+ | echo " " | ||
+ | read -r input | ||
+ | echo "you wrote :" | ||
+ | entry="$now $input" | ||
+ | echo "$entry" | ||
+ | echo " " >> ~/w0rk/journal.sh/log.txt | ||
+ | echo "$entry" >> ~/w0rk/journal.sh/log.txt | ||
+ | </nowiki> | ||
+ | |||
+ | == i3 config == | ||
+ | <nowiki>exec i3-msg 'workspace 1; exec st -e "$HOME/w0rk/journal.sh/journal.sh";fullscreen enable'</nowiki> |
Version actuelle datée du 17 mai 2021 à 11:40
A simple bash script to force me to journal everytime I switch on my trusty laptop.
process:
- at startup
- prompt to write in the console
- save the text (with the date) on a text file
- send it to my server ?
bash script
#!/bin/bash now=$(date) entry="" echo "$now" echo " " echo "👋 hello martin, how are you feeling today ?" echo " " read -r input echo "you wrote :" entry="$now $input" echo "$entry" echo " " >> ~/w0rk/journal.sh/log.txt echo "$entry" >> ~/w0rk/journal.sh/log.txt
i3 config
exec i3-msg 'workspace 1; exec st -e "$HOME/w0rk/journal.sh/journal.sh";fullscreen enable'