You are not logged in.
Pages: 1
I have fresh install of imv, which gives me imv and imv dir i defaulted to imv dir which allows me to use arrow keys to go left and right on the pictures it works perfectly except that when my pictures folder that has all pictures numerically sorted my pictures are named from 1 to 584 imv dir doesn't follow the order numerically but goes from picture 1 to picture 10
when i press d on the first picture it shows [1/584] which is correct but when i press right arrow to go to the next picture it goes to picture actually named 10 but when i press d on imv dir the overlay shows [2/584] so its following a random order,
i created a config file in imv .config folder but dont know what im supposed to write to fix it i went on the issues in github but everything people say i should put doesn't work for me
i ideally wanna use this with yazi file manager which i changed to sort numerically which now matches my dolphin file manager. the only one that has a weird order is imv-dir which hopefully someone can help me change it
Thanks in advance!
Offline
For those who didn't know like me, the problem seems to be that imv dir isn't sorting files numerically, but rather lexicographically. Apparently you can create a script or something to make it work but seems rather complicated.
I've been told to use Feh image viewer or something else but to me it looks way worse in it's stock settings than IMV. I wish IMV just had numerical sorting sigh...
Offline
It's not a random order, it's the order defined by your locale settings. The files are sorted not directly by imv but the underlying system calls, and they are sorted "alphabetically", not by the numerical value. With this the resulting sorting of numbers is 1, 10, 11 ... 19, 2, 20, 21 ...
If you want a different sorting order you could try to set LC_COLLATE or you could just `sort -n` the input first:
imv -n "$1" $(ls "$(dirname "$1")" | sort -n)EDIT: too slow ... but it's not hard to do, imv-dir is already just a tiny script, make your own version.
Last edited by Trilby (2024-05-17 16:07:24)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Thanks for the reply I tried to add that code into the config file but when I do, imv just doesn't open so im guessing that is probably used in a script or something which seems difficult for someone like me who is starting out.
Offline
You could just put that in a shell function (e.g., in your ~/.bashrc):
my-imv() {
imv -n "$1" $(ls "$(dirname "$1")" | sort -n)
}"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I added
my-imv() {
imv -n "$1" $(ls "$(dirname "$1")" | sort -n)
}
.to my .zshrc in my home folder and used chatgpt to guide me a bit which said to also add the following in my ~/.config/yazi/config.toml
[[custom_commands]]
name = "Open with my-imv"
command = "my-imv %f" and says This setup ensures that imv always opens images in numerical order, no matter which directory you are in.
Yeah for some reason still doesn't work, nothing changed
Offline
I figured it out by myself thanks to you @Trillby!!!, when you said imv-dir is just a tiny script I remembered how i saw a video that said programs were located in the /bin folder i searched for imv-dir inside the folder and edited the file to include
imv -n "$1" $(ls "$(dirname "$1")" | sort -n) saved and now its works!!!
thanks again Trilby!
Offline
Pages: 1