mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-10-09 19:11:15 +02:00
bin structure and vifm preview
This commit is contained in:
20
.local/bin/tools/vifm/vifmrun
Executable file
20
.local/bin/tools/vifm/vifmrun
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
export FIFO_UEBERZUG="/tmp/vifm-ueberzug-${PPID}"
|
||||
|
||||
if [ ! -f "/usr/bin/ueberzug" ]; then
|
||||
vifm
|
||||
exit
|
||||
fi
|
||||
|
||||
function cleanup {
|
||||
rm "$FIFO_UEBERZUG" 2>/dev/null
|
||||
pkill -P $$ 2>/dev/null
|
||||
}
|
||||
pkill -P $$ 2>/dev/null
|
||||
rm "$FIFO_UEBERZUG" 2>/dev/null
|
||||
mkfifo "$FIFO_UEBERZUG" >/dev/null
|
||||
trap cleanup EXIT 2>/dev/null
|
||||
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser bash 2>&1 >/dev/null &
|
||||
|
||||
vifm "$@"
|
||||
cleanup
|
Reference in New Issue
Block a user