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

Supporting multiple monitors #162

Closed
wants to merge 3 commits into from

Conversation

EpixMan
Copy link

@EpixMan EpixMan commented Jan 1, 2024

First this is my first JS contribution so I will definitely appreciate any help

This is simple tinkering that should not affect single monitor users, What makes me a little troubled is my unfamiliarity with JS and there are some random errors are thrown (although even #Aylur/dotfiles show them so I supposed that it is normal to see those, either due to errors in my device or that they do not cause any side effects such as ram drainage or freezing)

The real problem I am facing is that indicator's widget is not working, tried to make it work on multiple monitors but without avail. I appreciate any help with that, even so, the problem will only be that the widget will appear in monitor 0 but can be controlled from other monitors

@end-4
Copy link
Owner

end-4 commented Jan 1, 2024

  • the code looks fine to me on first look, but i'd rather find out if we can do anything about the errors first

although even #Aylur/dotfiles show them so I supposed that it is normal to see those

  • it doesn't for me though? his config throws different errors
  • left: aylur's; right: mine with your fixes
    image

@EpixMan
Copy link
Author

EpixMan commented Jan 2, 2024

  • the code looks fine to me on first look, but i'd rather find out if we can do anything about the errors first

although even #Aylur/dotfiles show them so I supposed that it is normal to see those

* it doesn't for me though? his config throws different errors

* left: aylur's; right: mine with your fixes
  ![image](https://private-user-images.githubusercontent.com/97237370/293611775-8633e4c3-995a-4a98-b8a0-bd1d3868b722.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQyMTU3MzgsIm5iZiI6MTcwNDIxNTQzOCwicGF0aCI6Ii85NzIzNzM3MC8yOTM2MTE3NzUtODYzM2U0YzMtOTk1YS00YTk4LWI4YTAtYmQxZDM4NjhiNzIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDAxMDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwMTAyVDE3MTAzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2MzZkY2YxM2I1OTAyZDYxYzgyNGJmNTBmNzk4ZTY2N2UwOWYzZjZhZDMwNDk4M2QzNTIxZGEyYmFiMGU5OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.OvjYReO474yZfCdVRbcQ7vi1NQ2Qco-XW5eIkjp3wBw)

Hey I have updated my system and magically all the bugs disappeared, I am really confused on why and how they did, but it seems to be some backend bugs or so ( I uninstalled swaylock, maybe they are related?)

Anyways, now I am bug free! yay
image

@end-4 end-4 added the tag-so-that-it-doesnt-get-lost highlighter thing label Jan 7, 2024
@quadbyte
Copy link

As a side note I noticed that there are 2 calls to "swww query" which on multi-monitors setup will return one line per monitor. In the end toggling between light and dark will fail.

I patched those 2 calls (in generate_colors_material.py and switchwall.sh) by adding "| tail -n 1" at the end to fix it. It's fine with me because I use the same wallpaper on both monitors.

@end-4
Copy link
Owner

end-4 commented Jan 18, 2024

About this PR

  • My apologies that I actually forgot about this.
  • However, I did try to implement multi-monitor support myself and somehow it just worked without returning any errors
    • Here: 3f0e064 (i made so many changes until i was comfortable to push so it ended up being a big bad syncing push)

Wallpaper

  • I'm currently trying to implement my own service that handles wallpapers (swww is cool, but i wanna add moving animations on workspace change). So I'll add multi-monitor support there.

@end-4
Copy link
Owner

end-4 commented Jan 18, 2024

By "worked" I mean it runs normally on my single-monitor system
I think I'll still have to turn instances into callbacks for this to work properly

@EpixMan
Copy link
Author

EpixMan commented Jan 19, 2024

I think I'll still have to turn instances into callbacks for this to work properly

Thank you for helping multi monitor systems users, and sorry for not responding sooner, for some reason, latest branch works flawlessly in single monitor. But in multiple monitors system, it crashes within a millisecond after starting and gives this error:

 /var/home/first/git/dots-hyprland/.config/ags: > ags -c ./config.js

(com.github.Aylur.ags:80772): Gjs-WARNING **: 00:12:42.717: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
  _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34


Gjs-Console-Message: 00:12:42.782: [LOG] Styles loaded

(com.github.Aylur.ags:80772): Gtk-WARNING **: 00:12:42.839: Attempting to add a widget with type Ags_AgsBox to a container of type Ags_AgsBox, but the widget is already inside a container of type Ags_AgsBox, please remove the widget from its existing container first.

(com.github.Aylur.ags:80772): Gtk-WARNING **: 00:12:42.839: Attempting to add a widget with type Ags_AgsBox to a container of type Ags_AgsBox, but the widget is already inside a container of type Ags_AgsBox, please remove the widget from its existing container first.

(com.github.Aylur.ags:80772): Gtk-WARNING **: 00:12:42.885: Attempting to add a widget with type Ags_AgsBox to a container of type Ags_AgsRevealer, but the widget is already inside a container of type Ags_AgsRevealer, please remove the widget from its existing container first.

(com.github.Aylur.ags:80772): Gtk-WARNING **: 00:12:42.886: Attempting to add a widget with type Ags_AgsBox to a container of type Ags_AgsBox, but the widget is already inside a container of type Ags_AgsBox, please remove the widget from its existing container first.

(com.github.Aylur.ags:80772): Gjs-Console-CRITICAL **: 00:12:43.173: Error: There is already a window nameddesktopbackground
addWindow@resource:///com/github/Aylur/ags/app.js:123:27
_load@resource:///com/github/Aylur/ags/app.js:156:36
async*vfunc_activate@resource:///com/github/Aylur/ags/app.js:70:14
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

I will update what might be the cause but I might need sometime to test every change to debug what is the cause

@EpixMan
Copy link
Author

EpixMan commented Jan 22, 2024

Hey sorry I might have made a mistake and closed it..

anyways here are my points

forMonitors(Indicator), //this is for sorry useless, not working as intended, but I think it is ignorable
forMonitors(Bar), //this needs to be edited to make the bar launch on every screen

Forgive my unfamiliarity, but I really do not think this is necessary at all:

const OptionalWorkspaces = async () => {
    try {
        return (await import('./workspaces_hyprland.js')).default();
    } catch {
        // return (await import('./workspaces_sway.js')).default();
        return null;
    }
};
const optionalWorkspacesInstance = await OptionalWorkspaces();

as it was actually breaking the hyprland workspace widget on the second monitor, is it required to run ags on sway or something like that?

@EpixMan EpixMan reopened this Jan 22, 2024
@end-4
Copy link
Owner

end-4 commented Jan 23, 2024

this is for sorry useless, not working as intended

yea like i said i have to change stuff from instances to callbacks which i haven't

I really do not think this is necessary at all:

i tried to add sway compatibility. with this kind of try-catch, the setup shouldn't crash if ran on sway

@EpixMan
Copy link
Author

EpixMan commented Jan 23, 2024

Ok I finally made a normal PR, can you check it please?
I tried to be creative with the importing stuff but it always fails. I think setting which WM to be set up in install.sh might be a somewhat more logical for me

I really do not think this is necessary at all:

i tried to add sway compatibility. with this kind of try-catch, the setup shouldn't crash if ran on sway

The problem is that it is breaking the hyprland widget in the second monitor, I tried to solve it but couldn't make anything work other than importing at the top

@clsty
Copy link
Collaborator

clsty commented Jan 23, 2024

I tried to be creative with the importing stuff but it always fails. I think setting which WM to be set up in install.sh might be a somewhat more logical for me

I do understand your point, however I also think that 2 WMs together could be a good way to switch between "performance or power-saving mode" (sway) and "nice-GUI mode" (hyprland).

The problem is that it is breaking the hyprland widget in the second monitor, I tried to solve it but couldn't make anything work other than importing at the top

Maybe we could use another minimal and lightweight bar for sway, and at the same time we still use ags for hyprland, with no need to consider its capability for sway.

@end-4
Copy link
Owner

end-4 commented Jan 23, 2024

sway compatibility

  • I'm not going to give this up yet, so I don't want to remove the try-catch
  • But I think we can make the whole widget async so that we can have multiple instances

another bar for sway

Maybe we could use another minimal and lightweight bar for sway

  • I don't wanna use another config, since I want my experience to be consistent.
  • Lightweight-ness
    • 60mb ram isn't a concern to me
    • Power consumption of ags isn't significant (even compared to waybar (at least that's aylur's config))

@clsty
Copy link
Collaborator

clsty commented Jan 23, 2024

  • I don't wanna use another config, since I want my experience to be consistent.

Just in case, have you been using sway? If not, then let me friendly notice you that sway actually does not support animation.
Of course, it's up to you whether animation matters.

And I also wonder why you want two different WMs together then, if not for switchable lightweight-ness.

@end-4
Copy link
Owner

end-4 commented Jan 24, 2024

sway actually does not support animation

  • I'm aware. It's a planned feature of swayfx though

Just in case, have you been using sway?

  • Nope. Somehow vscode just crashes a lot when performing file operations (actually this is with swayfx but I don't think it matters since swayfx is just sway with a different renderer)

I also wonder why you want two different WMs together

  • Dreaming of better power consumption and stability

@clsty
Copy link
Collaborator

clsty commented Feb 17, 2024

Thank you for submitting the PR.

The illogical-impulse branch is merged to main branch, and will be deleted soon, see #262 for more.

Please target this PR to the main branch instead.

Refer to https://stackoverflow.com/questions/24159036/how-to-modify-a-pull-request-on-github-to-change-target-branch-to-merge-into for instruction.

@end-4 end-4 closed this Mar 9, 2024
lil-sussy added a commit to lil-sussy/dots-hyprland that referenced this pull request Sep 12, 2024
…ace navigation

Answering the end-4#162 support for multiple monitors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants