Commit Graph

46 Commits

Author SHA1 Message Date
AnErrupTion aef1dd9c1a
Add more logs when logging into an X11 session
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-10-14 20:09:39 +02:00
AnErrupTion a34a5a97bd
Execute shell in case exec_cmd is null
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-10-14 20:02:55 +02:00
AnErrupTion 145ad5142c
Clean up redundant authentication & session code
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-09-25 08:32:30 +02:00
AnErrupTion 5924db58e1
Use std.mem.span + remove useless dupeZ()
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-30 13:17:19 +02:00
AnErrupTion 36e220e2ff
Remove usage of std.c.stat() for xauth code
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-30 02:09:51 +02:00
AnErrupTion 0a9ceca822
Don't dupeZ() in main
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-30 01:09:12 +02:00
AnErrupTion 230874abd1
Don't forget to flush... :)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-29 22:54:05 +02:00
AnErrupTion 38c3ecd089
Remove unused import
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-29 22:42:34 +02:00
AnErrupTion a7d6b06d21
Add partial logging in authentication process (closes #822)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-29 09:28:29 +02:00
AnErrupTion 7cfb947187
Reduce libc usage & move more stuff to interop
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-28 01:39:19 +02:00
AnErrupTion ff9b6279d3
Update to Zig 0.15.0 (closes #829)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-27 23:44:39 +02:00
djsigmann 73ecac67bf Prevent Ly from zombifying when X.org is terminated (#807) (fixes #787)
If a compositor is running when exiting Xorg, the user is met with an unresponsive black screen without the ability to switch to a different TTY (the usual `Ctrl+Alt+F{1..6}`  chord doesn't do anything).
In addition, ly is displayed as a zombie process under `ps` and cannot be killed (observed by utilizing a preexisting ssh connection to the host).

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/807
Reviewed-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: djsigmann <djsigmann@protonmail.com>
Co-committed-by: djsigmann <djsigmann@protonmail.com>
2025-08-05 21:45:09 +02:00
João Lucas b71789912d Add enable_session_log option to control session logging (#809) (fixes #808)
Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/809
Reviewed-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: João Lucas <jlucaso@hotmail.com>
Co-committed-by: João Lucas <jlucaso@hotmail.com>
2025-08-04 00:00:18 +02:00
AnErrupTion e404d5bdb3
Clean-up: std.posix.kill() returns nothing
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-03 14:55:50 +02:00
AnErrupTion c05c32c5be
Fix possible overflow with 5-digit+ UIDs (c.f. #684)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-08-02 00:57:22 +02:00
AnErrupTion 04920e1b1b
Implement custom session support (fixes #757)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-07-08 22:39:14 +02:00
AnErrupTion 41f4378bfe
Fix XDG_RUNTIME_DIR not being set properly (fixes #781)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-07-06 09:25:06 +02:00
AnErrupTion 86ea38f460
Split session crawling from TUI component
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-16 00:24:56 +01:00
AnErrupTion 4dcef65b1c
Fix X11 session logout
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-06 23:32:23 +01:00
AnErrupTion 932c751ac2
Stop redirecting X11 output to session log (closes #693, #688)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-06 21:46:40 +01:00
AnErrupTion 9168266cca
Don't shutdown termbox2 if authentication fails
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-06 15:29:56 +01:00
AnErrupTion 55abc4d7f1
Decouple TerminalBuffer and auth from Config
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-06 14:32:05 +01:00
AnErrupTion f54657432a
Don't set XDG_CURRENT_DESKTOP and XDG_SESSION_DESKTOP if they're empty (closes #702)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-05 22:50:09 +01:00
AnErrupTion bebccf4d5a
Support Zig 0.14.0 only (with 1 downstream dependency fork)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2025-03-05 19:42:00 +01:00
AnErrupTion b80c276dad
Redirect X11 output to file via shell
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-11 18:27:58 +02:00
AnErrupTion 028cb9496a
Fix session logging for X11 (somewhat)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-07 17:06:14 +02:00
AnErrupTion 767bdaf166
Add session logging support
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-07 12:03:34 +02:00
AnErrupTion b5b3317dd8
Add login & logout script support
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-06 11:06:20 +02:00
AnErrupTion 5e85618730
Conditionally import login_cap.h with pwd.h
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-05 15:16:58 +02:00
AnErrupTion 1075c923ef
Make shell login use setup script
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-05 01:03:11 +02:00
AnErrupTion 6fbbb4eff0
Consolidate xsetup.sh & wsetup.sh into one file
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-05 00:58:29 +02:00
AnErrupTion c7f70ac78f
Handle termbox2 outside of authentication
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-04 20:42:00 +02:00
AnErrupTion 7b9f03176d
FreeBSD fixes
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-04 11:04:23 +02:00
AnErrupTion b73c78d2fb
Remove tput dependency & use termbox2 instead
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-03 21:48:38 +02:00
AnErrupTion 0bbe9c78dd
Reduce heap allocations a bit
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-03 15:17:02 +02:00
AnErrupTion d40ec873a7
Retrieve gettimeofday() from sys/time.h
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-01 14:23:52 +02:00
AnErrupTion 61f3fadfbf
Make code more portable + remove mcookie usage
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-08-01 13:15:54 +02:00
AnErrupTion 961018e753
Add generic cyclable label & base session component off it
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-31 13:21:54 +02:00
AnErrupTion 3fedb59fdb
Make setting numlock work on BSD + less homebrew interop
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-30 18:38:21 +02:00
AnErrupTion 2dd83b41e8
Incorporate some FreeBSD authentication patches
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-28 13:15:49 +02:00
AnErrupTion 2bc12549a1
Switch to utmpx
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-27 23:39:09 +02:00
AnErrupTion 1df890b238
Set PAM_TTY (fixes #248)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-27 22:31:56 +02:00
AnErrupTion 8c69472065
Allow building without X11 support
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-27 18:35:58 +02:00
AnErrupTion e775827c8b
Fix possible overflow with TTY ID
Co-authored-by: Kevin Morris <kevr@0cost.org>
Signed-off-by: AnErrupTion <anerruption@disroot.org>
2024-07-27 15:20:42 +02:00
アシュ 291e0d836b
Various bug fixes and small features (#606)
* Fix stray cursor, integer overflows and other bugs

* check for getenvlist error, shorten code

* fix cascade, set info_line before auth, make code clearer and a bug fix

* Add option to turn on numlock at startup

* Fix setting numlock

* Update build.zig

* Custom info text

* Shift+Tab for previous input

* update changelog and res/config

* Some fixes

* update build.zig

* update build.zig again

* Fix xauth command for some shells and fix building in ReleaseSafe

* Use git describe to get dev version str

* revert change to getLockState (it broke the doom animation)

* add new ly error messages. Only try to make path for pam/exe during install when dest_directory is defined + print warning on error.

* add warning message for workaround
2024-07-02 10:52:38 +02:00
ShiningLea d8d2d5a8bf
Nobody expects the Ziguanas (#517)
* Add build.zig, remove makefile, add .idea directory to .gitignore

* Remove submodules, add projects directly

* Remove submodules

* Add projects

* Rename sub/ to dep/, remove makefiles

* Rewrite main.c

* Remove Argoat dependency

* Remove unused dependencies

* Rewrite config.c

* Add files

* Change default fg to 8 in config.ini

* Partially rewrite utils.c

* Use Zig package manager

* Rewrite INPUTS enum in Zig

* Commit unfinished full rewrite (Zig 0.11.0)
What needs to be dealt with:
- Matrix animation
- Authentication part
- Testing on actual TTY (not just virtual console)

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Implement more (untested) authentication code

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Fix some bugs (hopefully)

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Try to fix some more bugs

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Oops, forgot to allocate hehe

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Changes in the Zig rewrite (#596)

* Everything

* make matrix.zig a bit cleaner

* make long lines shorter and add changelog

* vi mode

* update changelog

* get errors from child process and (hopefully) fix some other things

* fix utmp entry

* run authentication in a child process

* update changelog

* small code improvements

* change that

* clear terminal on SIGTERM

* Remove LogFile

* moved ini to a lib, fixed alternative langs

* fix logging out

* oops

* code improvements

* consistency

* clearing the env isn't needed anymore (afaik)

* replace vi_mode with a bool

* type aliases, avoiding zeroes(), breaking a long line

* lowercase insert/normal, merge conditionals, code improvements

* Add experimental save file migrator + bug fixes + add "-dev" version suffix

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Resolve conflicts

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Clean up when SIGTERM is received (#597)

* clean up child processes on SIGTERM

* small code improvement

* consistency.. i guess?

* Properly set XDG_CURRENT_DESKTOP

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Zig 0.12.0 and more! (#599)

* less alloc, update migrator, get DesktopNames from .desktop

* small cleanup

* Update zigini to improve compatibility with old config

* Code improvements

* Update to zig version 0.12.0

* Some fixes

* tiny changes

* remove useless comment

* migrator changes, and small things

* set XDG env vars differently

* free memory on error when appending environments

* Fix out of bounds issue when using the Delete key

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Update zig-ini to fix configuration issue (#603)

* Mention display-manager-init for Gentoo/OpenRC in readme.md

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Tidy up readme.md

Signed-off-by: AnErrupTion <anerruption@disroot.org>

* Fix authentication in a few edge cases (#604)

* fix loginConv and auth

* fix potential mem leak with configs

* BIG changes

---------

Signed-off-by: AnErrupTion <anerruption@disroot.org>
Co-authored-by: アシュ <120780645+Kawaii-Ash@users.noreply.github.com>
2024-05-09 15:30:12 +02:00