mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 03:20:26 +10:00
new file: vifmimg, uberzug script for vifm image previews.
new file: vifmrun, bash script to launch vifm with uberzug image previews.
This commit is contained in:
14
.config/vifm/scripts/vifmimg
Executable file
14
.config/vifm/scripts/vifmimg
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
readonly ID_PREVIEW="preview"
|
||||
|
||||
if [ -e "$FIFO_UEBERZUG" ]; then
|
||||
if [[ "$1" == "draw" ]]; then
|
||||
declare -p -A cmd=([action]=add [identifier]="$ID_PREVIEW"
|
||||
[x]="$2" [y]="$3" [width]="$4" [height]="$5" \
|
||||
[path]="${PWD}/$6") \
|
||||
> "$FIFO_UEBERZUG"
|
||||
else
|
||||
declare -p -A cmd=([action]=remove [identifier]="$ID_PREVIEW") \
|
||||
> "$FIFO_UEBERZUG"
|
||||
fi
|
||||
fi
|
||||
15
.config/vifm/scripts/vifmrun
Executable file
15
.config/vifm/scripts/vifmrun
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
|
||||
|
||||
function cleanup {
|
||||
rm "$FIFO_UEBERZUG" 2>/dev/null
|
||||
pkill -P $$ 2>/dev/null
|
||||
}
|
||||
|
||||
rm "$FIFO_UEBERZUG" 2>/dev/null
|
||||
mkfifo "$FIFO_UEBERZUG"
|
||||
trap cleanup EXIT
|
||||
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash &
|
||||
|
||||
vifm
|
||||
cleanup
|
||||
Reference in New Issue
Block a user