From b8d085f2b550d0ee1f9e7df3120011c6fb0a5c06 Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Fri, 31 Mar 2023 20:28:24 +1030 Subject: [PATCH] lf has images again! --- .config/lf/cleaner | 4 ---- .config/lf/lfrc | 21 ++++----------------- .config/shell/aliasrc | 1 - .local/bin/lfub | 24 ------------------------ 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100755 .config/lf/cleaner delete mode 100755 .local/bin/lfub diff --git a/.config/lf/cleaner b/.config/lf/cleaner deleted file mode 100755 index a184d84..0000000 --- a/.config/lf/cleaner +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -if [ -n "$FIFO_UEBERZUG" ]; then - printf '{"action": "remove", "identifier": "PREVIEW"}\n' > "$FIFO_UEBERZUG" -fi diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 5a56a42..2c93027 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -2,21 +2,6 @@ # Luke's lf settings - -# Note on Image Previews -# For those wanting image previews, like this system, there are four steps to -# set it up. These are done automatically for LARBS users, but I will state -# them here for others doing it manually. -# -# 1. ueberzug must be installed. -# 2. The scope file (~/.config/lf/scope for me), must have a command similar to -# mine to generate ueberzug images. -# 3. A `set cleaner` line as below is a cleaner script. -# 4. lf should be started through a wrapper script (I have this installed through my scripts) -# that creates the environment for ueberzug. This command can be be aliased -# in your shellrc (`alias lf="lfub") or if set to a binding, should be -# called directly instead of normal lf. - # Basic vars set shellopts '-eu' set ifs "\n" @@ -25,8 +10,10 @@ set icons set ignorecase set period 1 set hiddenfiles ".*:*.aux:*.log:*.bbl:*.bcf:*.blg:*.run.xml" -set cleaner '~/.config/lf/cleaner' -set previewer '~/.config/lf/scope' +set previewer ctpv +set cleaner ctpvclear +&ctpv -s $id +&ctpvquit $id # cmds/functions cmd open ${{ diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 3c2de13..57d412d 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -39,7 +39,6 @@ alias \ z="zathura" alias \ - lf="lfub" \ magit="nvim -c MagitOnly" \ ref="shortcuts >/dev/null; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc ; source ${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshnameddirrc" \ diff --git a/.local/bin/lfub b/.local/bin/lfub deleted file mode 100755 index 9012f50..0000000 --- a/.local/bin/lfub +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -# This is a wrapper script for lb that allows it to create image previews with -# ueberzug. This works in concert with the lf configuration file and the -# lf-cleaner script. - -set -e - -cleanup() { - exec 3>&- - rm "$FIFO_UEBERZUG" -} - -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - lf "$@" -else - [ ! -d "$HOME/.cache/lf" ] && mkdir -p "$HOME/.cache/lf" - export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$" - mkfifo "$FIFO_UEBERZUG" - ueberzug layer -s <"$FIFO_UEBERZUG" -p json & - exec 3>"$FIFO_UEBERZUG" - trap cleanup HUP INT QUIT TERM PWR EXIT - lf "$@" 3>&- -fi