Removed absolute lf path
This commit is contained in:
parent
24e98fd47e
commit
c66efc268c
2 changed files with 6 additions and 7 deletions
|
|
@ -43,8 +43,7 @@ alias ip='ip --color=auto'
|
||||||
# Use lf to switch directories and bind it to ctrl-o
|
# Use lf to switch directories and bind it to ctrl-o
|
||||||
lfcd () {
|
lfcd () {
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
# `command` is needed in case `lfcd` is aliased to `lf`
|
command lfub -last-dir-path="$tmp" "$@"
|
||||||
command lf -last-dir-path="$tmp" "$@"
|
|
||||||
if [ -f "$tmp" ]; then
|
if [ -f "$tmp" ]; then
|
||||||
dir="$(cat "$tmp")"
|
dir="$(cat "$tmp")"
|
||||||
rm -f "$tmp"
|
rm -f "$tmp"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/usr/bin/env sh
|
||||||
# Ueberzugpp script for lf file explorer
|
# Ueberzugpp script for lf file explorer
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -13,20 +13,20 @@ esac
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
ueberzugpp cmd -s "$UB_SOCKET" -a exit
|
ueberzug cmd -s "$UB_SOCKET" -a exit
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||||
/usr/bin/lf "$@"
|
command lf "$@"
|
||||||
else
|
else
|
||||||
[ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf"
|
[ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf"
|
||||||
UB_PID_FILE="$UEBERZUG_TMP_DIR/.$(uuidgen)"
|
UB_PID_FILE="$UEBERZUG_TMP_DIR/.$(uuidgen)"
|
||||||
ueberzugpp layer --silent --no-stdin --use-escape-codes --pid-file "$UB_PID_FILE"
|
ueberzug layer --silent --no-stdin --use-escape-codes --pid-file "$UB_PID_FILE"
|
||||||
UB_PID=$(cat "$UB_PID_FILE")
|
UB_PID=$(cat "$UB_PID_FILE")
|
||||||
rm "$UB_PID_FILE"
|
rm "$UB_PID_FILE"
|
||||||
UB_SOCKET="$UEBERZUG_TMP_DIR/ueberzugpp-${UB_PID}.socket"
|
UB_SOCKET="$UEBERZUG_TMP_DIR/ueberzugpp-${UB_PID}.socket"
|
||||||
export UB_PID UB_SOCKET
|
export UB_PID UB_SOCKET
|
||||||
trap cleanup HUP INT QUIT TERM EXIT
|
trap cleanup HUP INT QUIT TERM EXIT
|
||||||
/usr/bin/lf "$@" 3>&-
|
command lf "$@" 3>&-
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue