mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
24 lines
392 B
Bash
Executable File
24 lines
392 B
Bash
Executable File
#!/bin/sh
|
|
|
|
FIFO_PATH="$1"
|
|
IMAGE="$2"
|
|
MAINWINDOW="$(xdotool getactivewindow)"
|
|
IMV_PID="$(pgrep nsxiv)"
|
|
|
|
if [ ! "$IMV_PID" ]; then
|
|
nsxiv -aio "$IMAGE" &
|
|
IMV_PID=$!
|
|
fi
|
|
|
|
sleep 0.5
|
|
|
|
xdotool windowactivate "$MAINWINDOW"
|
|
|
|
while read -r path; do
|
|
imv-msg "$IMV_PID" close all
|
|
imv-msg "$IMV_PID" open "$path"
|
|
done <"$FIFO_PATH"
|
|
|
|
imv-msg "$IMV_PID" quit
|
|
[ -e "$FIFO_PATH" ] && rm -f -- "$FIFO_PATH"
|