From ed0bc4340570c8ecf5da244b69027c97750ee726 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 14:07:03 +0100 Subject: cleanup --- config/essentials/zsh/functions.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'config/essentials/zsh/functions.zsh') diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 9783794..c64c474 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -270,13 +270,15 @@ fpass() { muttmail() { - log "email set: " - ls $HOME/.config/mutt/configs | + local config + config="$HOME/.config/mutt" + + find "$config"/configs -type f -printf '%f\n' | fzf | tee /dev/stderr | - xargs -I {} ln -sf "$HOME/.config/mutt/configs/{}" $HOME/.config/mutt/muttrc - log 'Press [Enter to login]' - read && mutt + xargs -I {} ln -sf "$config/configs/{}" "$config"/muttrc + log 'Press [Enter] to login.' + head -n 1 && mutt } resize() -- cgit v1.2.3 From 411cc94a9724d9fe96c3410f2e153ebcc8a0fc5a Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 14:07:31 +0100 Subject: changed 'nextdeadline' to a function --- config/essentials/zsh/aliases.sh | 1 - config/essentials/zsh/functions.zsh | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'config/essentials/zsh/functions.zsh') diff --git a/config/essentials/zsh/aliases.sh b/config/essentials/zsh/aliases.sh index 575502c..1ca0cf7 100644 --- a/config/essentials/zsh/aliases.sh +++ b/config/essentials/zsh/aliases.sh @@ -183,7 +183,6 @@ alias tpid='tail -f /dev/null --pid' alias pwdcp='pwd | clipp' alias gw="grep -ri" alias srcsupd='echo ~/src/{installdrier,dotfiles,password-store} | supd' -alias nextdeadline='sed -n "/$(grep '\''^#'\'' ~/docs/filios/deadlines | sort -t '\''/'\'' -k 3 -k 2 -k 1 -n | head -n 1 | sed '\''s@/@.@g'\'')/,/^#\|^$/p" ~/docs/filios/deadlines | head -n -1' alias vbm='vboxmanage' alias vbls='vbm list vms' diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index c64c474..41d57d1 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -294,3 +294,15 @@ edit_in_dir() { [ -f "$file" ] || return 1 $EDITOR "$file" } + +nextddl() +{ + local date + deadlines="$HOME/docs/filios/deadlines" + date="$(grep '^#' "$deadlines" | + sort -t '/' -k 3 -k 2 -k 1 -n | + sed -n "${1:-1}p" | + sed 's@/@.@g')" + sed -n "/$date/,/^#\|^$/p" "$deadlines" | + head -n -1 +} -- cgit v1.2.3 From 638a635034bb653949dd44d26d17f074c9c17764 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 1 Nov 2023 14:16:26 +0100 Subject: exit on no mail --- config/essentials/zsh/functions.zsh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'config/essentials/zsh/functions.zsh') diff --git a/config/essentials/zsh/functions.zsh b/config/essentials/zsh/functions.zsh index 41d57d1..dccede1 100644 --- a/config/essentials/zsh/functions.zsh +++ b/config/essentials/zsh/functions.zsh @@ -271,12 +271,13 @@ fpass() { muttmail() { local config + local mail config="$HOME/.config/mutt" - find "$config"/configs -type f -printf '%f\n' | - fzf | - tee /dev/stderr | - xargs -I {} ln -sf "$config/configs/{}" "$config"/muttrc + mail="$(find "$config"/configs -type f -printf '%f\n' | fzf)" + [ "$mail" ] || return 1 + logn "$mail" + ln -sf "$config/configs/$mail" "$config"/muttrc log 'Press [Enter] to login.' head -n 1 && mutt } -- cgit v1.2.3