Thanks. Yes, I use this every day in different situations. Lately I've been scraping a lot of different sites (ex. https://github.com/dongKenny/artveeScraper/issues/4 ) and using `lb du $site.db -D$depth` to view folder sizes at different depths and choosing what to download.
I also use it to sort through videos quickly. For example, to watch four videos at once:
Very cool project, I've been procrastinating for months on making something like this (overengineering everything in my brain) to replace a filesystem based, Bash solution I cooked up years ago.
This is way nicer than what I'm currently doing.
While I'm at it, forgive me for treating this like a support thread, but I set up an idle mpv window with a socket, and expected that the `--mpv-socket` option would allow me to send videos to the player instance tied to that socket, but that's not how it's working. (It opens a new window instead.) Is this as expected? Is there a way to set up what I'm trying to do some other way? Videos come in all shapes and sizes, and with Wayland not able to remember previous window positions, it's currently completely unworkable to play videos and do work at the same time.
> expected that the `--mpv-socket` option would allow me to send videos to the player instance tied to that socket
Ahh that's interesting. I experimented with a setup almost like that before[0]. It increased the complexity quite a bit more than I expected when refactoring some of the features so I decided against it but I recommend checking out the python_mpv_jsonipc library. I still use it in with --auto-seek and -4dtv (interdimensional cable mode)
BUT if you wanted a setup like this I think it wouldn't be too difficult to use something like `lb wt -l120 -pf` and then pipe to a program that will send the files to mpv one at a time. or maybe something like:
mpv --playlist=<(lb wt vids.db -l120 -pf)
> Wayland
I recommend checking to see if your window manager can solve this for you [1]
I use KDE/KWin so in Window Rules I set mpv to skip taskbar and set Focus stealing prevention to Force extreme so that new mpv windows don't steal focus. But for mpv specifically, you might have luck with an mpv config like this:
I think the reason I don't set this in KWin directly is because I want to override the geometry depending on if mpv closed fullscreen [2] or if I'm using lb wt with multiple-playback
you can add `w` to `-p` (ie. `-p fw`) and that will mark the videos as watched when you pipe it so next time it won't play those videos again until you've watched everything at least once
Awesome, thanks for getting back to me and the helpful snippets. They put me on the path to solving the issue, and finally actually exploring kwin's window rules which I've been procrastinating on diving into.
I have one remaining issue though, and it appears to be with mpv, but maybe you have dealt with it before. No matter how much focus stealing protection I place on the mpv window in kwin, nor using the `--focus-on=never` argument with mpv, stops mpv from stealing focus when it launches. Any ideas? Otherwise I might try your idea about piping a playlist to mpv.
I don't use Wayland yet personally but I imagine that the mpv ontop mechanism might be conflicting with the focus stealing prevention. Do you use ontop? Does it work if you disable ontop? If so, this should probably be considered a bug in mpv on Wayland.
edit: I just verified it is working fine on X11 (wanted to make sure I wasn't mis-remembering--but it is very obvious when something steals focus because I use the Dim Inactive desktop effect with a very high setting). I'm using ontop=yes as mentioned before. On Fedora 39 with my setup mpv does not steal focus when launching/switching videos. I did notice some weird behavior with nomachine before but after setting Focus Protection to Force High for nxplayer.bin I haven't noticed it again.
KWin version: 5.27.11
If this isn't working in Wayland surely this should be considered a Wayland/mpv bug?--just one more reason for me to delay trying Wayland
Awesome, thanks. Can confirm I'm not using `--ontop`, so at a bit of a loss. The issue is probably with mpv or Wayland because I get the same problem just launching mpv directly, without library. Although focus stealing protection in kwin seems to use some rubric around whether it thinks the window was spawned directly by the user or not to determine how the levels of protection are applied. I would have thought the highest level (extreme) would just prevent focus stealing entirely based on its description.
I'll see what I can do to debug the issue, but otherwise, thanks for your help, I might try your playlist idea in the meantime, it's arguably closer to my desired behaviour anyway.
13 comments
[ 1.5 ms ] story [ 40.8 ms ] threadI also use it to sort through videos quickly. For example, to watch four videos at once:
But from your feedback I will also add how I use it to the bottom of what already exists!
You can also track open directories:
edit: hmmm this specific site causes the script to essentially loop forever (it keeps adding more and more '/' at the end). weird! I'll fix thatThis is way nicer than what I'm currently doing.
While I'm at it, forgive me for treating this like a support thread, but I set up an idle mpv window with a socket, and expected that the `--mpv-socket` option would allow me to send videos to the player instance tied to that socket, but that's not how it's working. (It opens a new window instead.) Is this as expected? Is there a way to set up what I'm trying to do some other way? Videos come in all shapes and sizes, and with Wayland not able to remember previous window positions, it's currently completely unworkable to play videos and do work at the same time.
Ahh that's interesting. I experimented with a setup almost like that before[0]. It increased the complexity quite a bit more than I expected when refactoring some of the features so I decided against it but I recommend checking out the python_mpv_jsonipc library. I still use it in with --auto-seek and -4dtv (interdimensional cable mode)
BUT if you wanted a setup like this I think it wouldn't be too difficult to use something like `lb wt -l120 -pf` and then pipe to a program that will send the files to mpv one at a time. or maybe something like:
> WaylandI recommend checking to see if your window manager can solve this for you [1]
I use KDE/KWin so in Window Rules I set mpv to skip taskbar and set Focus stealing prevention to Force extreme so that new mpv windows don't steal focus. But for mpv specifically, you might have luck with an mpv config like this:
I think the reason I don't set this in KWin directly is because I want to override the geometry depending on if mpv closed fullscreen [2] or if I'm using lb wt with multiple-playback[0]. https://github.com/chapmanjacobd/library/commit/ba5bf174f21a...
[1]. https://mastodon.social/@tusooa@kazv.moe/110669435048449340
[2]. https://github.com/chapmanjacobd/computer/blob/main/.config/...
Maybe there is something else in my mpv config that will help. Feel free to browse it: https://github.com/chapmanjacobd/computer/blob/main/.config/...
I have one remaining issue though, and it appears to be with mpv, but maybe you have dealt with it before. No matter how much focus stealing protection I place on the mpv window in kwin, nor using the `--focus-on=never` argument with mpv, stops mpv from stealing focus when it launches. Any ideas? Otherwise I might try your idea about piping a playlist to mpv.
hmm maybe not: https://github.com/mpv-player/mpv/issues/9064
edit: I just verified it is working fine on X11 (wanted to make sure I wasn't mis-remembering--but it is very obvious when something steals focus because I use the Dim Inactive desktop effect with a very high setting). I'm using ontop=yes as mentioned before. On Fedora 39 with my setup mpv does not steal focus when launching/switching videos. I did notice some weird behavior with nomachine before but after setting Focus Protection to Force High for nxplayer.bin I haven't noticed it again.
If this isn't working in Wayland surely this should be considered a Wayland/mpv bug?--just one more reason for me to delay trying WaylandI'll see what I can do to debug the issue, but otherwise, thanks for your help, I might try your playlist idea in the meantime, it's arguably closer to my desired behaviour anyway.