config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 9461b2deec07e90cfac5acc861927cc24b23e658
parent 3758183b7ca8301dbd2ec96ce4e0c30948c052b1
Author: jacobsGit <JacobDoesLinux@protonmail.com>
Date:   Mon,  3 Feb 2020 15:48:20 -0800

daily function rewrite (might move to bin)

Diffstat:
Mzsh/.zshrc | 26++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/zsh/.zshrc b/zsh/.zshrc @@ -134,7 +134,7 @@ if [ $(uname | tail -c 4 ) != 'BSD' ]; then alias mv='mv --no-clobber' alias cp='cp --no-clobber' alias tmux='tmux -u' - alias suspend="$HOME/bin/suspend" + alias suspend='systemctl suspend' alias hibernate='systemctl hibernate' # Program Extentions @@ -170,18 +170,28 @@ if [ $(uname | tail -c 4 ) != 'BSD' ]; then function daily(){ time="$(date +%H%M)" - # accounting for my poor sleep scedual + # accounting for my poor sleep patterns if [[ "$time" -gt 0 ]] && [[ "$time" -lt 600 ]]; then - date="$(date +%Y/%m)/$( expr "$(date +%d)" - 1 )" + date="$(date +%Y/%m)/" + day="$( expr "$(date +%d)" - 1 )" + + if [ "$day" -lt 10 ]; then + date="$date/0$day" + else + date="$date/$day" + fi - # I don't trust the script yet - printf "\n\n$( date '+%R' )" >> "$HOME/.notes/daily/$date" - note "daily/$date" else date="$( date +%Y/%m/%d)" - printf "\n\n$( date '+%R' )" >> "$HOME/.notes/daily/$date" - note "daily/$date" fi + + if [ ! -e "$HOME/.notes/daily/$date" ]; then + printf "$( date +%d/%m/%Y)\n\n$( date '+%R' )" >> "$HOME/.notes/daily/$date" + else + printf "\n\n$( date '+%R' )" >> "$HOME/.notes/daily/$date" + fi + + note "daily/$date" } #}}}