summaryrefslogtreecommitdiff
path: root/.local/bin/vifmrun
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-03 19:27:15 -0400
commite371d9edd474bcf89cf5d462eaccb8638900b390 (patch)
treeed07118f5c514a55f23a779a1507640e46fd9ed2 /.local/bin/vifmrun
Initial commit
Diffstat (limited to '.local/bin/vifmrun')
-rwxr-xr-x.local/bin/vifmrun16
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/vifmrun b/.local/bin/vifmrun
new file mode 100755
index 0000000..69f2d22
--- /dev/null
+++ b/.local/bin/vifmrun
@@ -0,0 +1,16 @@
+#!/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