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

Support for Multiple TTYs #623

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mookums
Copy link
Contributor

@mookums mookums commented Jun 19, 2024

This allows for Ly to run on multiple ttys concurrently. It utilizes systemd templates to support multiple instances. It also will dynamically change the tty, allowing for the desktop environment to start up correctly.

Not sure if this is exactly what we being looked for in #532 but it is a solution that is fairly simple.

Comment on lines -17 to +18
Alias=display-manager.service
WantedBy=multi-user.target
# Alias=display-manager.service
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the alias to display-manager.service removed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after looking at #608 and a bit of systemd documentation online, it looks like WantedBy=multi-user.target is required for it to have an installation config. (It's apparently sort of like a preset?) However, the Alias=display-manager.service should still be needed, so I'm not sure why you've removed that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you keep it, it doesn't let you enable the service. (Probably because you can enable the template instance multiple times). You can try it out with sudo systemctl enable ly@tty2 and it'll throw this error:
Failed to enable unit: Cannot alias [email protected] as display-manager.service.

It isn't needed for Ly though, been running it on tty2 and tty9 since I created this pull request. I think sddm and gdm are the only ones that create a display-manager alias.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't needed for Ly though, been running it on tty2 and tty9 since I created this pull request. I think sddm and gdm are the only ones that create a display-manager alias.

I think the main reason to have it is to prevent Ly and any other display manager (e.g. SDDM or GDM) from colliding with each other at startup.

Comment on lines +9 to +12
pub const vt = @cImport({
@cInclude("linux/vt.h");
});

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other header file that can be included instead of a Linux-specific one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look this week.

Comment on lines +529 to +532
// This will set the current active VT as our TTY.
var vtstat: interop.vt.vt_stat = undefined;
_ = std.c.ioctl(std.c.STDIN_FILENO, interop.VT_GETSTATE, &vtstat);
config.tty = @intCast(vtstat.v_active);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note, this would completely override the TTY option and thus make it useless. I think a better idea would be to make the default value 0, and if it is, get the TTY number from the current active VT.

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

Successfully merging this pull request may close these issues.

2 participants