mirror of
https://github.com/kristoferssolo/solorice.git
synced 2026-02-04 06:32:03 +00:00
Use dotter
This commit is contained in:
23
local/bin/imv-open
Executable file
23
local/bin/imv-open
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user