3 Commits

Author SHA1 Message Date
qbe
04d4447273 Escape TTY in systemd service (closes #889) (#890)
## What are the changes about?

* fix templated systemd dependencies: %I -> %i
* amend systemd-specific documentation in readme with section specific to systemd-logind / autovt

## What existing issue does this resolve?

[issue #889](https://codeberg.org/fairyglade/ly/issues/889)

## Pre-requisites

- [x] I have tested & confirmed the changes work locally

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/890
Reviewed-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: qbe <public.github.c@hannen.at>
Co-committed-by: qbe <public.github.c@hannen.at>
2025-12-18 12:17:00 +01:00
AnErrupTion
ced8f9bee3 Fix session not being saved correctly
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-12-17 17:32:16 +01:00
AnErrupTion
c6446db3e2 Start Ly v1.4.0 development cycle
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-12-06 15:58:39 +01:00
5 changed files with 22 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ comptime {
}
}
const ly_version = std.SemanticVersion{ .major = 1, .minor = 3, .patch = 0 };
const ly_version = std.SemanticVersion{ .major = 1, .minor = 4, .patch = 0 };
var dest_directory: []const u8 = undefined;
var config_directory: []const u8 = undefined;

View File

@@ -1,6 +1,6 @@
.{
.name = .ly,
.version = "1.3.0",
.version = "1.4.0",
.fingerprint = 0xa148ffcc5dc2cb59,
.minimum_zig_version = "0.15.0",
.dependencies = .{

View File

@@ -121,9 +121,15 @@ that Ly will run on, otherwise bad things will happen. For example, to disable `
# systemctl disable getty@tty2.service
```
You can change the TTY Ly will run on by editing the corresponding
service file for your platform, or on systemd, by enabling the service on
different TTYs, as is done above.
On platforms that use systemd-logind to dynamically start `autovt@.service` instances when the switch to a new tty occurs, any ly instances for ttys *except the default tty* need to be enabled using a different mechanism: To autostart ly on switch to `tty2`, do not enable any `ly` unit directly, instead symlink `autovt@tty2.service` to `ly@tty2.service` within `/usr/lib/systemd/system/` (analogous for every other tty you want to enable ly on).
The target of the symlink, `ly@ttyN.service`, does not actually exist, but systemd nevertheless recognizes that the instanciation of `autovt@.service` with `%I` equal to `ttyN` now points to an instanciation of `ly@.service` with `%I` set to `ttyN`.
Compare to `man 5 logind.conf`, especially regarding the `NAutoVTs=` and `ReserveVT=` parameters.
On non-systemd systems, you can change the TTY Ly will run on by editing the corresponding
service file for your platform.
### OpenRC

View File

@@ -1,8 +1,8 @@
[Unit]
Description=TUI display manager
After=systemd-user-sessions.service plymouth-quit-wait.service
After=getty@%I.service
Conflicts=getty@%I.service
After=getty@%i.service
Conflicts=getty@%i.service
[Service]
Type=idle

View File

@@ -41,15 +41,19 @@ pub fn addEnvironment(self: *Session, environment: Environment) !void {
const env = Env{ .environment = environment, .index = self.label.list.items.len };
try self.label.addItem(env);
sessionChanged(env, self.user_list);
addedSession(env, self.user_list);
}
fn addedSession(env: Env, user_list: *UserList) void {
const user = user_list.label.list.items[user_list.label.current];
if (!user.first_run) return;
user.session_index.* = env.index;
}
fn sessionChanged(env: Env, maybe_user_list: ?*UserList) void {
if (maybe_user_list) |user_list| {
const user = user_list.label.list.items[user_list.label.current];
if (!user.first_run) return;
user.session_index.* = env.index;
user_list.label.list.items[user_list.label.current].session_index.* = env.index;
}
}