docs: several improvements

This commit is contained in:
javalsai 2024-07-27 22:39:53 +02:00
parent df38990d8b
commit a9d3c29ca5
Signed by: javalsai
SSH Key Fingerprint: SHA256:3G83yKhBUWVABVX/vPWH88xnK4+ptMtHkZGCRXD4Mk8

103
README.md
View File

@ -1,22 +1,19 @@
# LiDM # LiDM
LiDM is a really light display manager made in C, highly customizable and held together by hopes and prayers 🙏. LiDM is a really light display manager made in C, highly customizable and held together by hopes and prayers 🙏.
![demo image](assets/media/lidm.gif) ![demo gif](assets/media/lidm.gif)
> *This is shown as in a terminal emulator, actual linux console doesn't support as much color and decorations.* > *shown as in a featured terminal emulator, actual linux console doesn't support as much color and decorations*
> *But all colors and strings are fully customizable.* > *however, all colors and strings are fully customizable*
# Index
(TODO, VSC(odium) does this automatically, I'm on nvim rn 😎).
## Features ## Features
* Builds fast as FUCK. * Builds **FAST** (as of `a32e4a5`).
* 2.830s: laptop, -O3, -j2, `AMD E-450 APU with Radeon(tm) HD Graphics` * `2.830s`: laptop, -O3, -j2, `AMD E-450 APU with Radeon(tm) HD Graphics`
* 0.172s: desktop, -O3, -j12, `AMD Ryzen 5 5600G with Radeon Graphics` * `0.172s`: desktop, -O3, -j12, `AMD Ryzen 5 5600G with Radeon Graphics`
* Works everywhere you can get gcc to compile. * Works everywhere you can get gcc to compile.
* Fast and possibly efficient. * Fast and possibly efficient.
* Fully customizable, from strings, through action keys, to colors (I hope you know ansi escape codes) * Fully customizable, from strings, including action keys, to colors (I hope you know ansi escape codes)
* Automatically detects xorg and wayland sessions, plus allowing to launch the default user shell (If enabled in config) * Automatically detects xorg and wayland sessions, plus allowing to launch the default user shell (if enabled in config)
* Starts with many init systems eg: systemd and dinit. * Starts with many init systems eg: systemd and dinit.
## WIP ## WIP
@ -24,25 +21,38 @@ LiDM is a really light display manager made in C, highly customizable and held t
* Save last selection. * Save last selection.
* Show/hide passwd switch. * Show/hide passwd switch.
* Long sessions, strings, usernames, passwords... they will just overflow or fuck your terminal, I know it and I don't know if I'll fix it. * Long sessions, strings, usernames, passwords... they will just overflow or fuck your terminal, I know it and I don't know if I'll fix it.
* UTF characters or any multi-byte character, not yet supported properly, everything treats characters as a single byte, some chars might work or not depending on the context, but it's not designed to.
## Forget it # Index
* UTF characters, I'm using `strlen()` and treating characters as per byte basis, UTF-8 chars might work or not actually, might fix it by replacing some `strlen()` with a utflen one. - [LiDM](#lidm)
- [Features](#features)
- [WIP](#wip)
- [Index](#index)
- [Ideology](#ideology)
- [Usage](#usage)
- [Arguments](#arguments)
- [Program](#program)
- [Requirements](#requirements)
- [Installation](#installation)
- [Manually](#manually)
- [AUR](#aur)
- [Configuring](#configuring)
- [Contributing](#contributing)
- [Backstory](#backstory)
- [Contributors](#contributors)
# Ideology # Ideology
We all know that the most important thing in a project is the ideology of the author and the movements he wants to support, so [**#stopchatcontrol**](https://stopchatcontrol.eu). We all know that the most important thing in a project is the ideology of the author and the movements he wants to support, so [**#stopchatcontrol**](https://stopchatcontrol.eu).
<!-- doubt markdown will allow me to render this properly -->
[ ![stopchatcontrol](https://stopchatcontrol.eu/wp-content/uploads/2023/09/1-1-1024x1024.png) ](https://stopchatcontrol.eu) [ ![stopchatcontrol](https://stopchatcontrol.eu/wp-content/uploads/2023/09/1-1-1024x1024.png) ](https://stopchatcontrol.eu)
> *there's also a [change.org post](https://www.change.org/p/stoppt-die-chatkontrolle-grundrechte-gelten-auch-im-netz).* > *there's also a [change.org post](https://www.change.org/p/stoppt-die-chatkontrolle-grundrechte-gelten-auch-im-netz).*
# Requirements
* A computer with unix based system.
* That system should have the resources neccessary for this program to make sense (Sessions, users...).
* A compiler (optional, you can compile by hand, but I doubt you want to see the code).
* Make (Also optional, but does things atomatically, make sure `gcc` and `mkdir -p` work as expected).
# Usage # Usage
Regarding arguments: If a single argument is provided (don't even do `--` or standard parsing...), it passes that argument to `chvt` on startup, used (at least) by the dinit service. ### Arguments
If a single argument is provided (don't even do `--` or standard parsing...), it passes that argument to `chvt` on startup, used (at least) by the dinit service.
### Program
On top of pure intuition: On top of pure intuition:
* You can change focus of session/user/passwd with up/down arrows. * You can change focus of session/user/passwd with up/down arrows.
* In case arrow keys do nothing on the focused input (Either is empty text or doesn't have more options), it tries to change session and if there's only one session it changes user. * In case arrow keys do nothing on the focused input (Either is empty text or doesn't have more options), it tries to change session and if there's only one session it changes user.
@ -50,16 +60,22 @@ On top of pure intuition:
* ESC and then left/right arrows will force to change the option of the focused input, useful if you're editing the current input and arrow keys just move. * ESC and then left/right arrows will force to change the option of the focused input, useful if you're editing the current input and arrow keys just move.
* Editing a predefined option on a user or a shell session, will put you in edit mode preserving the original value, other cases start from scratch. * Editing a predefined option on a user or a shell session, will put you in edit mode preserving the original value, other cases start from scratch.
# Building from source # Requirements
* A computer with unix based system.
* That system should have the resources neccessary for this program to make sense (Sessions, users...).
* A compiler (optional, you can compile by hand, but I doubt you want to see the code).
* Make (Also optional, but does things atomatically, make sure `gcc` and `mkdir -p` work as expected).
* PAM, used for user authentication, just what `login` or `su` use internally. Don't worry, it's surely pre-installed.
# Installation
## Manually
* Build the package (you can download automatic builds from the [releases page](https://github.com/javalsai/lidm/releases)):
```sh ```sh
git clone https://github.com/javalsai/lidm.git git clone https://github.com/javalsai/lidm.git
cd lidm cd lidm
make # 👍 make # 👍
``` ```
* Install the files (see [configuration](#configuring) for more themeing info).
# Installation
* You can put the compiled binary anywhere you want tbh, you can even setuid it if you want to run it with any user.
* Prepare the [configuration](#configuring).
```sh ```sh
# place binary in /usr/bin and copy # place binary in /usr/bin and copy
# default theme to /etc # default theme to /etc
@ -71,48 +87,39 @@ make install
# and installs service file (for tty7) # and installs service file (for tty7)
make install-service make install-service
# There's manual scripts too: # or if you don't like autodetection
make install-service-systemd # systemd make install-service-systemd # systemd
make install-service-dinit # dinit make install-service-dinit # dinit
``` ```
> [!NOTE] ## AUR
> You can skip **most** of this with the [AUR packages](https://aur.archlinux.org/packages?K=javalsai&SeB=m) [AUR packages](https://aur.archlinux.org/packages?K=lidm&SeB=n) will automatically install the binary and config. But I recommend reading [installing manually](#manually) to understand the install process.
# Disabling other DM's with systemd > [!CAUTION]
You may want to disable your current Display Manager for instance: > [service files](./assets/pkg/aur#services) have to be manually installed by now.
```sh
sudo systemctl disable sddm # Disables SDDM (KDE's dm)
sudo systemctl disable lightdm # Disables lightDM (popular lightweight DM)
sudo systemctl disable gdm # Disables GDM (Gnomes DM)
sudo systemctl disable ly # Disables LYDM (tui dm)
```
# Configuring # Configuring
Copy any `.ini` file from [`themes/`](./themes/) (`default.ini` will always be updated) to `/etc/lidm.ini` and/or configure it to your liking. Also, don't place empty lines (for now). Copy any `.ini` file from [`themes/`](./themes/) (`default.ini` will always be updated) to `/etc/lidm.ini` and/or configure it to your liking. Also, don't place empty lines (for now).
Also configurable colors are just gonna be put inside `\x1b[...m`, ofc you can add an m to break this and this can f* up really bad or even make some nice UI effect possible, but please don't, you should also be able to embed the `\x1b` byte in the config as I won't parse escape codes, I think that the parser is just gonna grab anything in the config file from the space after the `=` (yes, I'ma enforce that space, get good taste if you don't like it) until the newline, you can put any abomination in there. Configurated colors are just gonna be put inside `\x1b[...m`, ofc you can add an 'm' to break this and this can f\*ck up really bad or even make some nice UI effect possible, you should also be able to embed the `\x1b` byte in the config as I won't parse escape codes, I think that the parser is just gonna grab anything in the config file from the space after the `=` (yes, I'ma enforce that space, get good taste if you don't like it) until the newline, you can put any abomination in there. But please, keep in mind this might break easily.
The default fg style should disable decorators set up in other elements (cursive, underline... it's just adding 20 to the number btw, so if cursive is 4 (iirc), disabling it is 24). The default fg style should disable decorators set up in other elements (cursive, underline... it's just adding 20 to the number btw, so if cursive is 4 (iirc), disabling it is 24).
> [!TIP]
> If you don't like seeing an element, you can change the fg color of it to be the same as the bg, making it invisible.
# Contributing # Contributing
if you want to contribute check the [CONTRIBUTING.md](docs/CONTRIBUTING.md) If you want to contribute check the [CONTRIBUTING.md](docs/CONTRIBUTING.md)
# Backstory # Backstory
I travelling in the summer to visit family with an old laptop that barely supports x86_64, and ly recently added some avx2 instructions I think (I just get invalid op codes), manually building (any previous commit too) didn't work because of something in the `build.zig` file, so out of boredom I decided to craft up my own simple display manager on the only language this thing can handle, ✨C✨ (I hate this and reserve the right for the rust rewrite, actually solid). Summer travelling to visit family with an old laptop that barely supports x86_64, and ly recently added some avx2 instructions I think (invalid op codes), manually building (any previous commit too) didn't work because of something in the `build.zig` file, so out of boredom I decided to craft up my own simple display manager on the only language this thing can handle... **C** (I hate this and reserve the right for the rust rewrite, actually solid).
I spedrun it, basically did in in 3 days on the same couch on [unhelty back positions (even worse)](https://i.redd.it/4bkje8amisu61.png) while touching *some* grass (:o), and I'm bad af in C, so this is spaghetti code on **another** level. I think it doesn't do almost anything unsafe, I mean, I didn't check allocations and it's capable of reallocating memory until your username uses all memory and crashes the system due to a off by 1 error, but pretty consistent otherwise (Probably). I spedrun it in roughly 3 days and I'm bad af in C, so this is spaghetti code on **another** level. I think it doesn't do almost anything unsafe, I mean, I didn't check allocations and it's capable of reallocating memory until your username uses all memory, crashing the system due to a off-by-one error, but pretty consistent otherwise (probably).
The name is just ly but changing "y" with "i", that had a reason but forgot it, (maybe the i in *simple*), so I remembered this sh*tty laptop with a lid, this thing is also a display manager (Dm, ly command is also `ly-dm`), so just did lidm due to all that. The name is just ly but changing "y" with "i", that had a reason but forgot it, (maybe the i in *simple*), so I remembered this sh*tty laptop with a lid, this thing is also a display manager (dm, ly command is also `ly-dm`), so just did lidm due to all that.
![think gif](https://i.giphy.com/media/v1.Y2lkPTc5MGI3NjExcTFzaGVmb3VjN3FnOXV6OG9rMG91a2QwM3c0aDV0NWpoZjFzNDEwayZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/d3mlE7uhX8KFgEmY/giphy.gif) <!--gif's likely broken-->
FYI, this laptop is so bad that I can't even render markdown in reasonable time, I'll just push this and fix render issues live :).
# Contributors # Contributors
Special thanks to:
* Javalsai, Maintainer and everyone's second favourite penguin!!!
* DeaDvey, the most awesomest of all, did some pretty HARDCORE gramer cheking. * DeaDvey, the most awesomest of all, did some pretty HARDCORE gramer cheking.
* KillerTofus, [made the AUR package](https://github.com/javalsai/lidm/pull/2)! Saved me from reading the Arch Wiki 💀. * KillerTofus, [made the AUR package](https://github.com/javalsai/lidm/pull/2)! Saved me from reading the Arch Wiki 💀.
* ChatGPT, in times of slow laptops where pages take ages to load, a single tab connected to a bunch of burning cloud GPUs feeding corporate hype is all you need to get quick answers for your questions, as long as you know how to filter AI crap ofc. * ChatGPT, in times of slow laptops where pages take ages to load, a single tab connected to a bunch of burning cloud GPUs feeding corporate hype is all you need to get quick answers for your questions, as long as you know how to filter AI crap ofc.
* [My lack of gf](https://www.instagram.com/reel/C8sa3Gltmtq/?igsh=NO_ZUCKERBERG__FUCK_OFF_YOUR_FINGERPRINGTING_QUERY__OBVIOUSLY_STANDS_FOR_INSTAGRAM_SHARE_ID_FFS), can't imagine this project being possible if somebody actually cared about me daily. * [My lack of gf](https://www.instagram.com/reel/C8sa3Gltmtq), can't imagine this project being possible if somebody actually cared about me daily.