ifreund changed the topic of #river to: river - a dynamic tiling wayland compositor || https://github.com/riverwm/river || channel logs: https://libera.irclog.whitequark.org/river/
talismanick has joined #river
<talismanick> Going to make the jump from bspwm to river tonight
<talismanick> install waybar, mako, and foot first, right?
<talismanick> So far have moved the example init to Emacs keys and swapped in brightnessctl for light
<talismanick> wofi, grimshot... what else?
waleee has quit [Ping timeout: 240 seconds]
Guest82 has joined #river
<Guest82> how do i get xwayland in river
Guest82 has quit [Client Quit]
<tleydxdy[m]> build with -Dxwayland
<tleydxdy[m]> lol
<talismanick> Also, is there an equivalent to --exit-with-x11 when dbus-launch'ing wayland?
<tleydxdy[m]> maybe use riverctl spawn?
Guest82 has joined #river
Guest82 has quit [Client Quit]
Guest82 has joined #river
Guest82 has quit [Client Quit]
notzmv has joined #river
notzmv has quit [Remote host closed the connection]
snakedye has quit [Ping timeout: 272 seconds]
notzmv has joined #river
vaivis has quit [Read error: Connection reset by peer]
vaivis has joined #river
talismanick has quit [Read error: Connection reset by peer]
pkap has joined #river
vaivis has quit [Read error: Connection reset by peer]
lxsameer has joined #river
<mizzunet> yambar is cool
<novakane> well yeah everything from dnkl is great :D
NickH has quit [Quit: leaving]
NickH has joined #river
snakedye has joined #river
vaivis has joined #river
notzmv has quit [Read error: Connection reset by peer]
<mizzunet> yep
<mizzunet> How do you inhibit idle while playing audio?
vaivis has quit [Ping timeout: 250 seconds]
vaivis has joined #river
<leon-p> mizzunet: ideally, a media player implements the necessary protocol
<leon-p> if it doesn't, you most likely have to fall back to heuristics. You could probably write a simple program that listens for MPRIS players and inhibts idling when it finds one.
londoed_ has quit [Read error: Connection reset by peer]
londoed_ has joined #river
londoed_ has quit [Read error: Connection reset by peer]
londoed_ has joined #river
<dnkl> I just managed to hang river, by crashing foot... had to switch to a tty and kill river.
<dnkl> no idea what happened, and can't reproduce it :/
<dnkl> only thing i can think of is some kind of race when all windows suddenly should be unmapped
<dnkl> (all toplevels where footclient instances, belonging to the foot server that crashed)
<dnkl> last rendered frame still had all the windows showing
<ifreund> hmm, interesting
<ifreund> `river -log-level debug` output of that happening would probably be helpful, sounds like I'm not that lucky though
<dnkl> unfortunately not... which is why I thought I'd just mention it here, rather than opening an issue. Can still do that, if you'd like, but don't have any more info than what I've already mentioned
<ifreund> dnkl: yeah, I can't really do anything about it without more to go on so an issue wouldn't really help :/
<ifreund> with luck it will resolve itself during a future refactoring
waleee has joined #river
pkap has quit [Ping timeout: 252 seconds]
vaivis has quit [Read error: Connection reset by peer]
vaivis has joined #river
snakedye has quit [Ping timeout: 246 seconds]
snakedye has joined #river
<novakane> hey I just thought with the rewrite of waylock in zig I'll finally have a zig Wayland client to look at your code ifreund :D
<ifreund> novakane: indeed, it will probably serve as a nice example client as well as a nice lock screen :)
<ifreund> integrating libwayland with poll is such a pain :/
<ifreund> also realized I didn't even finish binding the necessary functions in zig-wayland...
<novakane> that's cool, I was feeling a bit lonely in the zig wayland world :P
<novakane> oh yeah it is, you could have a look at what I made but that far from perfect yet
<novakane> wich one?
lxsameer has quit [Ping timeout: 246 seconds]
<leon-p> what's the issue with poll? the fd should be exposed fairly easiely.
<ifreund> wl_display_prepare_read()/wl_display_prepare_read_queue()/wl_display_cancel_read()/wl_display_read_events()
<leon-p> huh, never used those...
<ifreund> just asked in #wayland and apparently even single threaded clients should use them
<leon-p> oops :O
<novakane> oh
<ifreund> I'm sure y'all aren't alone, this API sucks
<leon-p> Well, I have read a lot of Wayland clients and I can't remember /ever/ seeing those used, so...
<novakane> ifreund: I'd say that my better version of it https://git.sr.ht/~novakane/zelbar/tree/main/item/src/Loop.zig
<ifreund> you don't need them unless integrating with poll() or some other external event loop
<novakane> I think some of dnkl projects use it iiirc
<ifreund> in that case you can just dispatch and flush if your program is single threaded
* leon-p always uses poll
<leon-p> (most of the time at least, because signals)
<ifreund> anyhow, see the documentation for wl_display_prepare_read_queue() for the recommended control flow
<novakane> and here I was hoping to never touch this part of code again :P
<novakane> also curious to see how you gonna implement your buffers
<leon-p> probably single pixel buffers and viewporter, if I had to take a guess
<ifreund> eventually yes, right now they are lazy and inefficient
<novakane> ah lazy and inefficient, that I can already do it :P
<novakane> oh I see you use a SinglyLinkedList for outputs and seats instead of TailQueue
<novakane> make sense since there is no need to iterate in reverse, is that more efficient to use?
<leon-p> less pointers
<novakane> ah yeah of course
<novakane> that's for thing like that I was waiting for a client by ifreund :P
pkap has joined #river
<novakane> ah damn, I don't have the same result with musl and valgrind now, I used to know exactly what wayland/fcft would always be still reachable with glibc
pkap15 has joined #river
pkap has quit [Ping timeout: 252 seconds]
<ifreund> god errno is such a bad way to handle errors
<ifreund> this is really making me want to rewrite libwayland
<wrl> libwayland uses errno??
<wrl> or does it just pass through errno from the underlying OS
<ifreund> wrl: it does both
<ifreund> at the same time
<ifreund> it also stashes errno in its own global and returns that from other calls sometimes
<ifreund> it's a huge mess
<leon-p> if you do end up rewriting libwayland, it would be cool if the object map would be optional. Sometimes I feel like I could improve some logic a bit if I had a chance to do the ID<->(object in allocated memors) myself.
snakedye has quit [Ping timeout: 240 seconds]
snakedye has joined #river
snakedye has quit [Ping timeout: 240 seconds]
snakedye has joined #river
pkap15 has quit [Ping timeout: 252 seconds]
snakedye has quit [Ping timeout: 250 seconds]
snakedye has joined #river
pkap has joined #river
snakedye has quit [Ping timeout: 272 seconds]
snakedye has joined #river
<pkap> In `map.zig` there are three functions: `mappingExists`, `switchMappingExists` and `pointerMappingExists`. I wanted to try the zig meta programming features so I made this a generic function. https://github.com/pmkap/river/blob/04a84572071baa78f545d88bc359dfd81e8aa42c/river/command/map.zig#L238 . Is this something to include in river or to
<pkap> over-engineered?
<ifreund> pkap: I'm going to vote over engineered, I find the separate functions more readable
<ifreund> My rule of thumb for stuff like this is to think about which version is easier to maintain
<ifreund> metaprogramming has its place, but I don't think it's worth the cost here
lxsameer has joined #river
<pkap> Yeah I thought so :D
snakedye has quit [Ping timeout: 250 seconds]
<pkap> But meta programming fun in zig. I enjoyed figuring out how to do this.
snakedye has joined #river
<ifreund> indeed, it is quite fun :)
<ifreund> pkap: you might enjoy this bit of code, it's kinda like the core of zig-wayland: https://github.com/ifreund/zig-wayland/blob/75802aa74ae7afcc99700bfd752df2ef5272137a/src/common_core.zig#L73-L113
<ifreund> and why we don't need libffi like the C bindings do
<ifreund> it will be a nicer once we have `inline switch` implemented, probably a bit better codegen too
<ifreund> for some context, this is the code that takes the raw wayland types from the socket (the Argument union above) and turns them into the correct Request or Event tagged union value
talismanick has joined #river
<pkap> ifreund: I see, this is actually cool! Sometimes I am amazed how readable zig can be compared to C
<pkap> Need to go, good night guys. Thanks for the insights, ifreund!
<ifreund> pkap: goodnight!
pkap has quit [Ping timeout: 252 seconds]
snakedye has quit [Ping timeout: 240 seconds]
snakedye has joined #river
<ifreund> Should be fully functional now if you don't mind not having any UX
<ifreund> I also need to decide what to do about the return type of these libwayland functions. I ended up reverting them to plain c_ints in zig-wayland for this and am considering pushing that change to master
<ifreund> feedback welcome
<snakedye> Can a lock surface have a popup?
<ifreund> snakedye: nope, but you can use subsurfaces
<snakedye> Fair