diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-03-26 20:50:48 +0100 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-03-26 20:50:48 +0100 |
| commit | d842d7f125cf055d24cdb2e4b0d94c3885c93d72 (patch) | |
| tree | 3fc7e2c7f1642a56546816c348cc4ef9c400a56f /.local/share/bin/lf | |
| parent | 7d782c4af6a369ec5a802eeededf18e5f355088b (diff) | |
Diffstat (limited to '.local/share/bin/lf')
| -rwxr-xr-x | .local/share/bin/lf | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.local/share/bin/lf b/.local/share/bin/lf new file mode 100755 index 0000000..430ae0b --- /dev/null +++ b/.local/share/bin/lf @@ -0,0 +1,23 @@ +#!/bin/sh +lf=/usr/bin/lf + +UB_PID=0 +UB_SOCKET="" +UB_PID_FILE="$(mktemp)" + +cleanup() { + exec 3>&- + ueberzugpp cmd -s "$UB_SOCKET" -a exit +} + +# don't try to use ueberzug over ssh +[ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && exec $lf "$@" + +ueberzugpp layer --silent --no-stdin --use-escape-codes --pid-file "$UB_PID_FILE" >/dev/null +UB_PID="$(cat "$UB_PID_FILE")" +rm -f "$UB_PID_FILE" +UB_SOCKET="/tmp/ueberzugpp-$UB_PID.socket" +export UB_PID UB_SOCKET +trap cleanup HUP INT QUIT TERM EXIT +$lf "$@" 3>&- + |