kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.34k stars 151 forks source link

[Help wanted] Creating a custom script to use joshuto to control imv. #533

Open notmentaloutlaw opened 2 months ago

notmentaloutlaw commented 2 months ago

I just started using joshuto for the image previews via sixel. However, for some reason its a lot slower than running img2sixel for images. Thats why I wanted to use a program called imv instead and use joshuto as a "remote" to control it. For example I enter a directory that has images. Joshuto then as it navigates through the directory and has images it sends signals to imv to change to the next image and so on.

this is normally done by imv-msg $imv_pid next etc.

However, I am unsure on how to script this that's why I would like some assistance if anyone else has a similar setup or idea.

DLFW commented 1 month ago

Hi! I'm not sure if I fully understood what you're aiming for, but if you want to call some scripts when the cursor in Joshuto moves, you can use the “hook scripts” which are described here. They were used for image previews in general before Joshuto got an inbuilt preview feature. They are still available for example for people who want to use Überzug(++) or other external programs for previewing images. I think you could use these hooks to get your idea working. Be aware that the inbuilt image preview will be disabled automatically when you configure hook scripts. The docs are not very clear here at the mom. I have a pending PR with an updated version of that documentation page.