Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X11 support #19

Open
musjj opened this issue Jul 31, 2023 · 7 comments
Open

X11 support #19

musjj opened this issue Jul 31, 2023 · 7 comments

Comments

@musjj
Copy link
Contributor

musjj commented Jul 31, 2023

Any possibility of supporting X11? Since it's GTK-based, I'd assume that X11 support shouldn't be impossible.

I've been looking for something better than eww, so I took a cursory glance through the wiki and examples and I'm already loving it (real icons!!!).

I'm stuck on an old machine with a legacy nvidia card, making wayland a non-option, so X11 support would be absolutely wonderful.

@Aylur
Copy link
Owner

Aylur commented Jul 31, 2023

It is possible and I would love to add support, but I have no idea how x11 works and would take me some time to figure it out.

@musjj
Copy link
Contributor Author

musjj commented Aug 1, 2023

I don't have much GUI experience, but I'd be happy to help contribute/test things out.

At a glance, it seems that the only Wayland-specific stuff so far is Hyprland.ts. I'll try to see if I can make one for EWMH, which should support most X11 WMs.

Some projects that might be useful for reference:

@Aylur
Copy link
Owner

Aylur commented Aug 1, 2023

It is using gtk-layer-shell to tell the window manager where to place windows which is for wayland only.
For x11 it has to set hints manually, which is what I am not familiar with. I will look into it.

@Aylur
Copy link
Owner

Aylur commented Oct 27, 2023

I played with x11 a bit, and I have come to the conclusion that I will leave it alone.
For now, this is a not so fulfilling solution I have come up with

// x11window.js
import Widget from 'resource:///com/github/Aylur/ags/widget.js';
import GObjcet from 'gi://GObject';
import Gtk from 'gi://Gtk?version=3.0';
import Gdk from 'gi://Gdk?version=3.0';

class X11Window extends Gtk.Window {
    static { GObjcet.registerClass(this); }

    constructor({ x = 0, y = 0, width = 50, height = 50, ...rest }) {
        super(rest);

        this.set_type_hint(Gdk.WindowTypeHint.DOCK);
        this.show_all();
        this.window.move_resize(x, y, width, height);
    }
}

export default params => Widget({
    type: X11Window,
    ...params,
});
// config.js
import X11Window from './x11window.js';

const win = X11Window({
  name: 'name-of-window',
  x: 0, // x position
  y: 0, // y position
  width: 1920,
  height: 30,
  child: Widget.Box({
    // children
  }),
});

export default {
  windows: [win],
};

This will just place the window at x,y with set size, but won't reserve space for itself, nor will it be interactable, meaning Entry widget won't work, but buttons do. If x or y is more than the size of the monitor, it will render over to the other monitor in that direction, so according to the monitor layout

To be honest, I have no desire to figure these out, but if someone does, PRs are welcome

@yosoof3
Copy link

yosoof3 commented Mar 2, 2024

Any possibility of supporting X11? Since it's GTK-based, I'd assume that X11 support shouldn't be impossible.

I've been looking for something better than eww, so I took a cursory glance through the wiki and examples and I'm already loving it (real icons!!!).

I'm stuck on an old machine with a legacy nvidia card, making wayland a non-option, so X11 support would be absolutely wonderful.

what you could do is probably use nouveau drivers i think because they prioritize older cards, idk but maybe that'll work probably, i have a old card, and nouveau works fine.

@thyeun
Copy link

thyeun commented Jun 27, 2024

I'm using nvidia 1050, nouveau/nvidia still workable on wayland, so dont worry about it.

@mimi0000oo
Copy link

Hello, did someone figure out a way for x11?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants