<Shinyzenith[m]>
Hi, I generally write wayland clients in rust, today I decided to give zig a try and I'm honestly quite dumbstruck as to how I'm supposed to instantiate the screencopy manager
<Shinyzenith[m]>
I was able to use the scanprotocol step to scan the xml header
<Shinyzenith[m]>
Any help would be appreciated
<Shinyzenith[m]>
note : I looked to ltoplevels by isaac and it used some wl.client.zwlr which didn't seem to work
<Shinyzenith[m]>
from reading the commit message what I understood is that I need to manually generate everything that includes screencopy frame and manager right?
<Shinyzenith[m]>
or is it just the frame
<Shinyzenith[m]>
s/frame/manager?/
<ifreund>
Shinyzenith[m]: only global interfaces
<ifreund>
so in this case just zwlr_screencopy_manager_v1
<Shinyzenith[m]>
is this a possible bug in zig-wayland?
<ifreund>
Shinyzenith[m]: possibly, yes. This code is fairly new
<ifreund>
I'll haev a look in a minute
<Shinyzenith[m]>
Thank you. I'll see if I can try my hands at debugging this.
<ifreund>
Shinyzenith[m]: ah, there are two separate requests that create the screen copy frame object. My current code doesn't handle that
<ifreund>
the fix is pretty easy though, just a minute
<Shinyzenith[m]>
ifreund: yeah capture output and capture output region iirc
<Shinyzenith[m]>
ifreund: Alright
<Shinyzenith[m]>
thanks for the quick response ❤️
<ifreund>
Shinyzenith[m]: also if you're still wondering why we require the generate("wl_foo", 42) calls in build.zig, see the commit I just pushed
<Shinyzenith[m]>
Omw
<ifreund>
the bug described in the commit message is still very possible with wayland-rs unfortunately, and I have infact written that bug with wayland-rs before :/
<Shinyzenith[m]>
ifreund: after reading your commit I realized that I have done this in all of my tools
<Shinyzenith[m]>
I just slapped on the max version I saw in the xml file :/
<ifreund>
you're certainly not alone :/
<Shinyzenith[m]>
I'll bring this up with wayland-rs devs and see if we can get a safer abstraction there too!
snakedye has joined #river
<ifreund>
Shinyzenith[m]: fixed that bug, I love zig's std.ArrayHashMap :)
<Shinyzenith[m]>
woah that was fast
<Shinyzenith[m]>
😆
<novakane>
at one point zig-wayland gonna become the official way to use a scanner, so much improvement :P
notzmv has quit [Ping timeout: 260 seconds]
snakedye has quit [Ping timeout: 272 seconds]
snakedye has joined #river
<dnkl>
thanks for the key bind fix! works perfectly again 🙂
hill has quit [Remote host closed the connection]
<ifreund>
nice! you mostly have pmkap to thank for that one :)
notzmv has joined #river
snakedye has quit [Ping timeout: 272 seconds]
snakedye has joined #river
pkap has joined #river
<pkap>
Is anybody using river on Ubuntu 22.04? How well does it work?
<ifreund>
i would expect any issues if it has an up to date enough wlroots version
<ifreund>
s/would/wouldn't/
<ifreund>
I would in general recommend debian over ubuntu though
<pkap>
Hm yeah it is up to date for now.
<pkap>
I started a new job and I got an Ubuntu 22.04 workstation.
<ifreund>
ah, nice!
<pkap>
Yeah now I'm thinking how to best make it run with river. Wlroots is up to date now but probably not for long...
<ifreund>
you can always run whatever the default thing work suggests on tty1 and river on tty2
<ifreund>
hmm, yeah I'm hoping we can get wlroots released sooner rather than later, it's the only real thing blocking river 0.2.0
<ifreund>
wlroots itself also tends to depend on quite recent libwayland versions, potentially recent mesa versions as well
<pkap>
Ah nice :)
<ifreund>
mesa is the only one that's not trivial to package yourself though
<ifreund>
for zig you can just use the static tarball from the website though
mannerism has quit [Ping timeout: 248 seconds]
<pkap>
Yeah the static zig download is great!
<ifreund>
hopefully I'll figure out how to make that a thing for river too someday
<pkap>
That'd be awesome :D
<ifreund>
that's a extreemly long term goal though, don't get your hopes up :D
<pkap>
:D I'm thinking to give nix a shot for building river
<ifreund>
ah, yeah that'd probably work well
<ifreund>
If you can stand the nix language that is :/
<pkap>
Never tried it so far. Always wanted to but never did.
<pkap>
But I really want to get river this ubuntu 22.04 workstation and also in a few month with the next wlroots release.
<ifreund>
I've had moderate success using nix for similar things before, the tech is there but the docs sucks and the language is horrible IMO
<ifreund>
if you can figure out how to use it well enough I'm sure it can do what you want
<Shinyzenith[m]>
https://wayland.app/protocols/wayland#wl_output:event:name Sooo I got wl_output global from the registry and I set a listener to read it's events and I don't see wl_output::name anywhere.. geometry and the others show up
<Shinyzenith[m]>
IIRC when I wrote the same app in rust, wayland-rs warmed me that you need xdg-output-unstable in your environment to receive wl_output::name and wl_output::description
<Shinyzenith[m]>
I assume I need to do the same in zig? and since I don't see any "environment" concept like in wayland-rs here, what do I do?
<Shinyzenith[m]>
* https://wayland.app/protocols/wayland#wl\_output:event:name So I got wl\_output global from the registry and I set a listener to read it's events and I don't see wl\_output::name anywhere.. geometry and the others show up
<Shinyzenith[m]>
IIRC when I wrote the same app in rust, wayland-rs warmed me that you need xdg-output-unstable in your environment to receive wl\_output::name and wl\_output::description
<Shinyzenith[m]>
I assume I need to do the same in zig? and since I don't see any "environment" concept like in wayland-rs here, what do I do?
<ifreund>
Shinyzenith[m]: wl_output.name is only available since wl_output version 4, what version did you bind?
<ifreund>
xdg_output is not related here
<Shinyzenith[m]>
version 3
<Shinyzenith[m]>
I'm pretty certain xdg-output- had something to do with it
<ifreund>
so yeah, you need to bind version 4 to get the name event
<Shinyzenith[m]>
bound to v4 and still no name event
<ifreund>
could you paste the WAYLAND_DEBUG=1 log somewhere?
<mizzunet>
That is, the empty space and overlapping windows
amnesiacsardine has joined #river
<leon-p>
mizzunet: that is caused by certain windows not being resizable. perfectly normal.
<leon-p>
basically the layout does not care whether a window is actually resizable or not
amnesiacsardine has quit [Quit: Lost terminal]
<mizzunet>
can I make it to behave normally?
<leon-p>
it is behaving normally
<leon-p>
if you are asking whether the layout generator can respect the min/max size of windows, then no
<leon-p>
the layout in river isn't really a hard set in stone thing. It's more like a suggestion, especially wrt window size
snakedye has quit [Read error: Connection reset by peer]
snakedye has joined #river
waleee has joined #river
adamcstephens has quit [Remote host closed the connection]
spiralbundle has joined #river
<spiralbundle>
I am trying to run river on Void linux. I am having a lot of difficulty simply getting it to run properly. When I run `river` I get a permission denied error. But I have the necessary permissions to run the init file, I've checked. The info states it's initializing a server with an x11 backend.
<spiralbundle>
Why is it using x11 as a backend when river is a wayland compositor?
<spiralbundle>
I'm new to wayland so and haven't worked much with the x11 system so I would appreciate help understanding how the river compositor works. Documentation is sparse as far as I can find
snakedye has quit [Ping timeout: 260 seconds]
snakedye has joined #river
<ifreund>
spiralbundle: could you paste the error you are getting somewhere?
<ifreund>
to confirm, are you running the river command from a tty?
<ifreund>
spiralbundle: that log suggests you aren't running it from a tty but rather from inside an X11 session
<ifreund>
DISPLAY is set, so river tries to start as an X11 client
<spiralbundle>
okay, I may be misunderstanding. I am using kitty from kde atm
<spiralbundle>
is opening up a tty application inside a de just running an x11 client?
<ifreund>
tty in this context means a raw linux tty, that is not inside any graphical session
<ifreund>
you can use ctrl+alt+f1 to switch between ttys on linux
<ifreund>
before you run river there though, make your init file executable
<spiralbundle>
okay, I see. I have typically always run ttys inside a graphical session. If I were to run e.g. kitty in a wayland session would that also work? Or starting out should I try and run river from a raw linux tty?
<ifreund>
spiralbundle: if you run river inside of an existing graphical session, it will start nested in that session as a normalish window
<ifreund>
if that's what you want, feel free to run river that way, but you probably want to run it as the only graphical session
spiralbundle has quit [Ping timeout: 244 seconds]
spiralbundle has joined #river
<spiralbundle>
ifreund I tried running it from a raw tty
<spiralbundle>
very basic question, but for future reference is there a way to kill a river compositor session in the same way that ctrl+alt+backspace can kill an x11 session?
<ifreund>
spiralbundle: you can switch to a different tty (ctrl+alt+f2 or whatever f key) and then run killall river
<ifreund>
if river's crashed or something's gone wrong and switching ttys doesn't work, your last result is to use sysrq r to put the keyboard into "raw" mode, taking control away from river
<ifreund>
with the keyboard in raw mode switching ttys will work as it's then handled by the kernel
<ifreund>
s/result/resort/
<spiralbundle>
okay, ty. I got stuck in a river session and had to restart xD
<spiralbundle>
so the server is starting, but I'm getting an error regarding the modifier keys. But I have tried different namings, from super to logo to Mod4, and even 'Alt' is returning invalid