# that can't tolerate any output. So make sure this doesn't display
# anything or bad things will happen !
-export PATH="$PATH:/opt/android-sdk/platform-tools/"
-export PATH="$PATH:~/go/bin:~/.cargo/bin:~/.local/bin:~/Applications/"
+export PATH="$PATH:/opt/android-sdk/platform-tools:$HOME/go/bin:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/Applications"
-export BROWSER='qutebrowser "--untrusted-args %u"'
-export EDITOR="kks edit"
-export VISUAL="kks edit"
+export BROWSER='qutebrowser --untrusted-args "%u"'
+export EDITOR='kks edit'
+export VISUAL='kks edit'
+export PAGER='bat --style auto'
export KKS_DEFAULT_SESSION='default'
export KKS_USE_GITDIR_SESSIONS=1
-export PAGER="bat --style auto"
-export VDPAU_DRIVER="radeonsi"
-export XZ_OPT="--threads=16"
+export VDPAU_DRIVER='radeonsi'
+export XZ_OPT='--threads=16'
alias grep='grep -i'
-alias gg="cd $(git rev-parse --show-toplevel)"
-alias gco="git checkout"
-alias gcp="git cherry-pick"
-alias glo="git log --oneline"
-alias gst="git status"
+alias gg='cd "$(git rev-parse --show-toplevel)"'
+alias gco='git checkout'
+alias gcp='git cherry-pick'
+alias glo='git log --oneline'
+alias gst='git status'
alias nano='nano -_qpT4 '
alias free='free -h --si'
-alias lf=lfimg
+alias lf='lfrun'
alias ls='exa --icons --time-style=iso --group-directories-first'
alias ll='exa --icons --group --time-style=iso --group-directories-first -l'
alias l1='exa --icons --group -1 --grid --time-style=iso --group-directories-first'
alias emergelog='sudo cat /var/log/emerge.log | grep "started\|completed\|exiting"'
-alias K='kcr-fzf-shell'
-alias KK='K --working-directory .'
-
-# Open files _from_ and _to_ a session.
-# $ :f src
-# $ f: mawww/kakoune
-alias :f='kcr fzf files'
-alias f:='KK kcr fzf files'
-alias fm:='K sidetree --working-directory'
-
-alias :g='kcr fzf grep'
-alias g:='KK kcr fzf grep'
+alias k='kks edit'
+alias ka='kks attach'
+alias kcd='cd $(kks get %sh{pwd})'
+alias kkd='kks kill; unset KKS_SESSION KKS_CLIENT'
+alias ks='kks-select'
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
--- /dev/null
+#!/bin/sh
+set -e
+
+BROWSER="$(printf "qutebrowser\n--untrusted-args\n%u")"
+EDITOR="$(printf "kks\nedit")"
+VISUAL="$(printf "kks\nedit")"
+PAGER="$(printf "bat\n--style\nauto")"
+
+if [ -n "$DISPLAY" ]; then
+ export FIFO_UEBERZUG="${TMPDIR:-/tmp}/lf-ueberzug-$$"
+
+ cleanup() {
+ exec 3>&-
+ rm "$FIFO_UEBERZUG"
+ }
+
+ mkfifo "$FIFO_UEBERZUG"
+ ueberzugpp layer -s <"$FIFO_UEBERZUG" &
+ exec 3>"$FIFO_UEBERZUG"
+ trap cleanup EXIT
+
+ if ! [ -d "$HOME/.cache/lf" ]; then
+ mkdir -p "$HOME/.cache/lf"
+ fi
+
+ /usr/bin/lf "$@" 3>&-
+else
+ exec /usr/bin/lf "$@"
+fi
+