aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.config/vifm/scripts/vifmrun
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles/.config/vifm/scripts/vifmrun')
-rwxr-xr-xdotfiles/.config/vifm/scripts/vifmrun15
1 files changed, 15 insertions, 0 deletions
diff --git a/dotfiles/.config/vifm/scripts/vifmrun b/dotfiles/.config/vifm/scripts/vifmrun
new file mode 100755
index 0000000..9eda32a
--- /dev/null
+++ b/dotfiles/.config/vifm/scripts/vifmrun
@@ -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