2021-12-28 22:09:22 +00:00
|
|
|
<div align="center">
|
|
|
|
|
2021-12-28 22:10:56 +00:00
|
|
|
# Lemurs 🐒
|
2021-12-28 22:09:22 +00:00
|
|
|
A TUI Display/Login Manager written in Rust
|
|
|
|
|
2021-12-28 21:56:14 +00:00
|
|
|
</div>
|
|
|
|
|
2021-12-31 18:48:24 +00:00
|
|
|
![Cover image](./cover.png)
|
|
|
|
|
2022-07-30 17:41:41 +00:00
|
|
|
> Note: the project is installable and working, but there might still be some
|
|
|
|
> limitations.
|
2021-12-28 21:56:14 +00:00
|
|
|
|
2022-07-30 17:41:41 +00:00
|
|
|
A minimal TUI [Display Manager/Login
|
2021-12-28 21:56:14 +00:00
|
|
|
Manager](https://wiki.archlinux.org/title/Display_manager) written in Rust
|
2021-12-28 22:18:22 +00:00
|
|
|
similar to [Ly](https://github.com/nullgemm/ly).
|
|
|
|
|
|
|
|
## Goal
|
|
|
|
|
2021-12-31 19:05:45 +00:00
|
|
|
The goal of this project is to create a small, robust and yet customizable
|
2022-07-30 17:41:41 +00:00
|
|
|
Login Manager which can serve as the front-end to your graphical GNU/Linux.
|
|
|
|
Lemurs uses Linux PAM as its method of authentication.
|
2021-12-28 22:18:22 +00:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-11-22 15:30:26 +00:00
|
|
|
There are two different ways to install Lemurs. Both require the rust toolchain
|
|
|
|
to be installed. I.e. there is currently no precompiled option.
|
|
|
|
|
|
|
|
### Arch Linux --- AUR
|
|
|
|
|
|
|
|
Lemurs can be installed from the [AUR](https://aur.archlinux.org). This will
|
|
|
|
build the package on your local machine. It will automatically pull in rustup,
|
|
|
|
but you might have to set the default toolchain with `rustup default stable`.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
paru -S lemurs-git # paru can be replaced by any other AUR helper
|
|
|
|
```
|
|
|
|
|
|
|
|
or
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone https://aur.archlinux.org/lemurs-git.git
|
|
|
|
cd lemurs-git
|
|
|
|
makepkg -si
|
|
|
|
```
|
|
|
|
|
|
|
|
### Compiling from source
|
|
|
|
|
2021-12-31 19:02:53 +00:00
|
|
|
The `install.sh` script can be used to compile and setup the display manager on
|
|
|
|
your Unix machine. This will perform multiple steps:
|
|
|
|
|
2022-07-30 17:41:41 +00:00
|
|
|
1. Build the project in release mode (requires Rust's _cargo_)
|
2021-12-31 19:02:53 +00:00
|
|
|
2. Setup the `/etc/lemurs` folder which contains some of the configuration and
|
|
|
|
necessary files such as your selection of window managers.
|
|
|
|
3. Disables the previous Display Manager
|
2022-11-22 15:30:26 +00:00
|
|
|
4. Copies over the _systemd_ service and enables it.
|
2021-12-31 19:05:45 +00:00
|
|
|
|
2021-12-31 19:13:23 +00:00
|
|
|
Although you might first want to set up some window managers (see
|
|
|
|
[Usage](#Usage)), upon rebooting you should now see Lemurs.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-11-22 15:30:26 +00:00
|
|
|
After installation you can add your environments by creating runnable scripts.
|
|
|
|
|
|
|
|
For your Xorg put your [xinitrc](https://wiki.archlinux.org/title/Xinit) scripts
|
|
|
|
in the `/etc/lemurs/wms` directory. For Wayland, put a script that starts your
|
|
|
|
compositor in the `/etc/lemurs/wayland` directory. For both cases, the name of
|
|
|
|
the runnable script file is the name that is shown in the environment switcher
|
|
|
|
within lemurs. Multiple Xorg and Wayland environments can exist at the same time.
|
|
|
|
|
|
|
|
### Example 1: BSPWM
|
|
|
|
|
|
|
|
For the [bspwm](https://github.com/baskerville/bspwm) window manager, you might
|
2021-12-31 19:13:23 +00:00
|
|
|
add the script `/etc/lemurs/wms/bspwm`.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
#! /bin/sh
|
|
|
|
sxhkd &
|
|
|
|
exec bspwm
|
|
|
|
```
|
|
|
|
|
|
|
|
Remember to make this script runnable. This is done with the `chmod +x
|
|
|
|
/etc/lemurs/wms/bspwm` command.
|
|
|
|
|
2022-07-30 17:45:24 +00:00
|
|
|
Upon rebooting your new `bspwm` should show up within Lemurs.
|
2021-12-31 19:13:23 +00:00
|
|
|
|
2022-11-22 15:30:26 +00:00
|
|
|
### Example 2: Sway
|
|
|
|
|
|
|
|
For the [sway](https://swaywm.org/) compositor and window manager, you might
|
|
|
|
add the script `/etc/lemurs/wayland/sway`. Ensure that you have sway installed
|
|
|
|
and added yourself to the `seat` group.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
#! /bin/sh
|
|
|
|
exec sway
|
|
|
|
```
|
|
|
|
|
|
|
|
Remember to make this script runnable. This is done with the `chmod +x
|
|
|
|
/etc/lemurs/wayland/sway` command.
|
|
|
|
|
|
|
|
Upon rebooting your new `sway` should show up within Lemurs.
|
|
|
|
|
2022-01-05 20:07:36 +00:00
|
|
|
## Configuration
|
2022-01-05 18:58:43 +00:00
|
|
|
|
|
|
|
Many parts for the UI can be configured with the `/etc/lemurs/config.toml`
|
2022-07-30 17:41:41 +00:00
|
|
|
file. This file contains all the options and explanations of their purpose.
|
2022-01-05 18:58:43 +00:00
|
|
|
The flag `--config <CONFIG FIlE>` can be used to select another configuration
|
2022-11-22 15:30:26 +00:00
|
|
|
file instead. An example configuration can be found in the `extra` folder in
|
|
|
|
this repository.
|
2021-12-31 19:05:45 +00:00
|
|
|
|
2022-11-22 15:30:26 +00:00
|
|
|
## Preview & Debugging
|
2022-07-30 17:41:41 +00:00
|
|
|
|
|
|
|
Lemurs logs a lot of information of it running to a logging file. This is
|
|
|
|
located by default at `/var/log/lemurs.log`, but can be turned of by running
|
2022-11-22 15:30:26 +00:00
|
|
|
with the `--no-log` flag.
|
2022-07-30 17:41:41 +00:00
|
|
|
|
|
|
|
If you want to test your configuration file you can also run `lemurs
|
|
|
|
--preview`. This will run a preview instance of your configuration. This will
|
|
|
|
automatically create a `lemurs.log` in the working directory.
|
|
|
|
|
2022-11-22 15:30:26 +00:00
|
|
|
## File Structure
|
|
|
|
|
|
|
|
Below is overview of the source files in this project and a short description of
|
|
|
|
each of them and their use. This can be used by people who want to contribute or
|
|
|
|
want to tweak details for their own installation.
|
|
|
|
|
|
|
|
```
|
|
|
|
|- src: Rust Source Code
|
|
|
|
| |- main.rs: CLI argument parsing & main logic
|
|
|
|
| |- auth: Interaction with PAM modules
|
|
|
|
| |- config.rs: Configuration file format and options
|
|
|
|
| |- info_caching.rs: Reading and writing cached login information
|
|
|
|
| |- post_login: All logic after authentication
|
|
|
|
| | |- env_variables.rs: General environment variables settings
|
|
|
|
| | |- x.rs: Logic concerning Xorg
|
|
|
|
| |- ui: TUI code
|
|
|
|
| | |- mod.rs: UI calling logic, separated over 2 threads
|
|
|
|
| | |- input_field.rs: TUI input field used for username and password
|
|
|
|
| | |- power_menu.rs: Shutdown and Reboot options UI
|
|
|
|
| | |- status_message.rs: UI for error and information messages
|
|
|
|
| | |- switcher.rs: UI for environment switcher
|
|
|
|
| | |- chunks.rs: Division of the TUI screen
|
|
|
|
|- extra: Configuration and extra files needed
|
|
|
|
| |- config.toml: The default configuration file
|
|
|
|
| |- xsetup.sh: Script used to setup a Xorg session
|
|
|
|
| |- lemurs.service: The systemd service used to start at boot
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
The project is made available under the MIT and APACHE license. See the
|
|
|
|
`LICENSE-MIT` and `LICENSE-APACHE` files, respectively, for more information.
|
|
|
|
|
2022-07-30 17:41:41 +00:00
|
|
|
## Contributions
|
|
|
|
|
|
|
|
Please report any bugs and possible improvements as an issue within this
|
|
|
|
repository. Pull requests are also welcome.
|