From 256df9cf716eafbb1d4999085abf7361d9572b54 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 18 Jul 2022 12:09:29 +0200 Subject: [PATCH] config/shell: little improvements and todos --- .config/shell/browse | 3 ++- .config/shell/functions | 5 ++++- .config/shell/graphical | 1 + .local/bin/scripts/disktest | 2 +- .local/bin/scripts/emacstty | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.config/shell/browse b/.config/shell/browse index 51582f8..ccbc472 100644 --- a/.config/shell/browse +++ b/.config/shell/browse @@ -53,7 +53,8 @@ cd() { # LOCATE {{{1 # TODO no double heading with bat -alias fselect='fzf -0 -1 --reverse --height=40% | while read f; do test -d "$f" && cd "$f" || { highlight "$f" && print -s "b \"$f\"" && b "$f"; }; done'; +alias fselect='fzf -0 -1 --reverse --height=40% --keep-right | + while read f; do test -d "$f" && cd "$f" || { highlight "$f" && print -s b \"$f\" && b "$f"; }; done'; loci() { locate --all --ignore-case --basename --existing "$@" | command grep --extended-regexp --ignore-case --color=always $(echo "$|${@:$#}" | sed 's/ /|/g') | diff --git a/.config/shell/functions b/.config/shell/functions index 7a89ba3..89dd972 100644 --- a/.config/shell/functions +++ b/.config/shell/functions @@ -113,6 +113,7 @@ edshell() { # Edit a file in the PATH edbin() { + # TODO resolve simple alias if f="$(which $1 2>/dev/null)" && test -f "$f" then edit "$f" else edshell -f "$1" @@ -218,7 +219,9 @@ u() { if which topgrade >/dev/null then topgrade - builtin cd $XDG_CONFIG_HOME/emacs && git pull --rebase && doom sync -u + test -d "$XDG_CONFIG_HOME/emacs" && + builtin cd $XDG_CONFIG_HOME/emacs && + git pull --rebase && doom sync -u # TODO autodetect failure in emacs and rebuild it completely else yadm l sudo apt update && sudo apt upgrade diff --git a/.config/shell/graphical b/.config/shell/graphical index 06acdf4..a72f7d6 100644 --- a/.config/shell/graphical +++ b/.config/shell/graphical @@ -16,6 +16,7 @@ if which jrnl >/dev/null; then compdef jn=jrnl alias jnc='jn -contains' alias jne='jrnl --edit' + # TODO jump to end fi test "$DISPLAY" || return 0 diff --git a/.local/bin/scripts/disktest b/.local/bin/scripts/disktest index d361f8b..71da71c 100755 --- a/.local/bin/scripts/disktest +++ b/.local/bin/scripts/disktest @@ -4,7 +4,7 @@ test "$1" = "-w" && write=true && shift disk="${1:-$(df --output=source . | tail -1)}" if test "$write" -then exec &> >(tee "disktest-$(date +"%y%m%d")") +then exec &> >(tee "disktest-$(date +%F)") fi # Needs sudo for read test sudo hdparm -MWAgt "$disk" diff --git a/.local/bin/scripts/emacstty b/.local/bin/scripts/emacstty index e248348..79d784a 100755 --- a/.local/bin/scripts/emacstty +++ b/.local/bin/scripts/emacstty @@ -1,3 +1,4 @@ #!/bin/sh -e # Emacs in the terminal +# TODO timeout start because first does not open file emacsclient --tty --alternate-editor="" "$@"