You are not logged in.

#1 2024-01-13 10:54:27

millus
Member
Registered: 2019-07-21
Posts: 206

[SoLvEd] Image viewer controllable from command-line?

Like VLC is controllable from command-line, I'm looking for an image viewer. Tried 8 so far, but weirdly, not a single one is command-line controllable.

Basically:

1) start image viewer
2) from some other terminal, issue a command that makes it load another image instead (at least this basic functionality is needed)

Thanks!

SOLUTION:
from package 'imagemagick" use "display":

display /path/to/maybeporn.jpg
display -window 0x123456 /path/to/okitsporn.jpg # you can query the actual window id w/ eg. xwininfo or wmctrl

Last edited by millus (2024-01-15 22:02:56)

Offline

#2 2024-01-13 14:04:27

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,961

Re: [SoLvEd] Image viewer controllable from command-line?

You have looked at the ones mentioned at https://wiki.archlinux.org/title/List_o … ge_viewers ?

What you describe sounds like it would need a client / server setup , have you looked at image servers ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2024-01-13 20:46:37

millus
Member
Registered: 2019-07-21
Posts: 206

Re: [SoLvEd] Image viewer controllable from command-line?

I'm not looking for a frame-buffer image viewer, thanks. Image "server"? That sounds huge. Is VLC a "video server"? Just like VLC is cmdline controllable, simply.

Last edited by millus (2024-01-13 20:47:18)

Offline

#4 2024-01-13 21:55:38

seth
Member
Registered: 2012-09-03
Posts: 51,671

Re: [SoLvEd] Image viewer controllable from command-line?

feh --start-at /path/to/notporn.jpg
pkill -USR1 feh # next image
pkill -USR2 feh #previous image
display /path/to/maybeporn.jpg
display -window 0x123456 /path/to/okitsporn.jpg # you can query the actual window id w/ eg. xwininfo

w/o knowing what you want to achieve (other than watching porn, that's implied) it's hard to give you more concrete suggestions.

Offline

#5 2024-01-13 23:04:43

xerxes_
Member
Registered: 2018-04-29
Posts: 677

Re: [SoLvEd] Image viewer controllable from command-line?

Did you tried vlc to play images? You may want to change default 10 second time to load next image and you may want to create playlist.

Offline

#6 2024-01-14 14:41:16

millus
Member
Registered: 2019-07-21
Posts: 206

Re: [SoLvEd] Image viewer controllable from command-line?

lmao. Well, the 2nd suggestion with "display" exactly matches the specs provided in 1) and 2), specifically "another image" (rather than "next/prev image") - and that is exactly what I want to achieve, so thanks smile
That pkill syntax though is AWESOME. How does that even work. O_O

So, since u're curious, it's actually not porn :-p
I'm tired of getting stupid matches in Overwatch from the incompetent devs' trash matchmaker, so I wrote a script that takes a screenshot as soon as the match starts, made some python script that uses OCR to extract text from the locations where player names are displayed, and checks if the players are using titles that indicate their level. Then the script auto-cancels the match and requeues me for another match if it doesn't find at least ONE other player on my team whose title matches my own skill (or even higher^^), so I'll not be having a potato team I'm expected to carry solo, luls. When a proper matchup is found it plays a gong sound so I can stop doing whatever it was and go to the PC to enjoy a nice match smile.
And the image, well that was rather for debugging, to make sure the script works 100% I display the part that I'm gonna OCR on a second monitor so I can review manually whether OCR got it right or not just in case, and it's supposed to load the new image every time a new match starts. I could've also killed + redisplayed it, but that would be unelegant as it also has implications on window focus jumping around.
Thanks again big_smile

Last edited by millus (2024-01-14 15:13:02)

Offline

#7 2024-01-14 14:45:10

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SoLvEd] Image viewer controllable from command-line?

millus wrote:

That pkill syntax though is AWESOME. How does that even work

I think seth has cheated and read the man page tongue

https://man.archlinux.org/man/feh.1#SIGNALS

Offline

#8 2024-01-14 14:55:20

seth
Member
Registered: 2012-09-03
Posts: 51,671

Re: [SoLvEd] Image viewer controllable from command-line?

More generally, https://man.archlinux.org/man/core/man- … ignal.2.en - you can do this even in shell scripts w/ trap

Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

Board footer

Powered by FluxBB