Aylur / ags

A customizable and extensible shell
GNU General Public License v3.0
1.74k stars 95 forks source link

X11 support #19

Open musjj opened 11 months ago

musjj commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 8 months ago

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 commented 4 months ago

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 commented 5 days ago

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