• Stars
    star
    346
  • Rank 118,530 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A customizable TUI display/login manager written in Rust πŸ’

Lemur Icon by SVGRepo

Lemurs provides a Terminal User Interface (TUI) for a Display/Login Managers in Rust for most GNU/Linux and BSD distributions. It can work both with or without SystemD. Lemurs works on most Unix systems including Linux, FreeBSD and NetBSD.

Goal

This project creates a small, robust and yet customizable Login Manager which can serve as the front-end to your TTY, X11 or Wayland sessions. Lemurs uses Pluggable Authentication Modules (PAM) as its method of authentication.

Screenshot

Cover image

Installation

Packaging status

Installation follows three steps.

  1. Compile the codebase
  2. Copy all files to correct positions
  3. Enable init process to run lemurs

Arch Linux

Lemurs can be installed from the AUR. This will build the package on your local machine.

paru -S lemurs-git # paru can be replaced by any other AUR helper

# Not needed if do don't have a window manager yet
sudo systemctl disable display-manager.service

sudo systemctl enable lemurs.service

Compiling from source

The install.sh script can be used to compile and setup the display manager on your Unix machine. This will perform multiple steps:

  1. Build the project in release mode (requires Rust's cargo)
  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
  4. Copies over the systemd service and enables it.

Although you might first want to set up some window managers (see Usage), upon rebooting you should now see Lemurs.

Usage

After installation you can add your environments by creating runnable scripts.

For your Xorg put your xinitrc 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 window manager, you might add the script /etc/lemurs/wms/bspwm.

#! /bin/sh
sxhkd &
exec bspwm

Remember to make this script runnable. This is done with the chmod +x /etc/lemurs/wms/bspwm command.

Upon rebooting your new bspwm should show up within Lemurs.

Example 2: Sway

For the sway 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.

#! /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.

Configuration

Many parts for the UI can be configured with the /etc/lemurs/config.toml file. This file contains all the options and explanations of their purpose. The flag --config <CONFIG FIlE> can be used to select another configuration file instead. An example configuration can be found in the extra folder in this repository.

Preview & Debugging

Lemurs logs a lot of information of it running to a logging file. There are 3 log files.

  • /var/log/lemurs.log: This is the main log file that contains information about the control flow and is the first place you should look.
  • /var/log/lemurs.client.log: This is the stdout and stderr of your environment. This can help you debug your scripts in the /etc/lemurs/wms or /etc/lemurs/wayland folder.
  • /var/log/lemurs.xorg.log: This is the stdout and stderr of the X server. This is only used when you run a X11 based environment.

You can disable logging with the --no-log flag. This flag can be adding into your service manager script if you want to disable logging globally.

If you want to test the UI generated by 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.

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
|  |- chvt.rs: UNIX calls to change of TTY
|  |- cli.rs: CLI argument parsing
|  |- config.rs: Configuration file format and options
|  |- env_container.rs: Handles resetting and resetting the environment variables
|  |- info_caching.rs: Handling cached username and session environment
|  |- auth: Interaction with PAM modules and UTMPX
|  |  |- mod.rs
|  |  |- pam.rs
|  |  |- utmpx.rs
|  |- post_login: All logic after authentication
|  |  |- mod.rs
|  |  |- env_variables.rs: General environment variables settings
|  |  |- x.rs: Logic concerning Xorg
|  |- ui: TUI code
|  |  |- mod.rs: UI calling logic, separated over 2 threads
|  |  |- chunks.rs: Division of the TUI screen
|  |  |- 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
|- 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
|  |- lemurs.pam: PAM service configuration

Shell Keybindings

Lemurs has support for some basic shell keybindings.

  • Ctrl + A: Go to the beginning of the focused input field
  • Ctrl + E: Go to the end of the focused input field
  • Ctrl + L: Clear the focused input field
  • Ctrl + U: Clear input field text before the cursor
  • Ctrl + K: Clear input field text after the cursor
  • Ctrl + D: Same as Delete
  • Ctrl + H: Same as Backspace
  • Ctrl + B: Same as Left
  • Ctrl + F: Same as Right
  • Ctrl + P: Same as Up
  • Ctrl + N: Same as Down

Platforms

Tested on

  • ArchLinux (Vanilla, ArcoLinux)
  • VoidLinux
  • Ubuntu (make sure to install build-essential and libpam-dev)

MSRV Policy

Lemurs has a Minimum Supported Rust Version policy of N - 2. This means that we only use Rust languages features that have been in Rust as of 2 releases.

License

The icon used at the top of the repository is not a logo and taken as an icon from the SVGRepo. It is marked under CC0 and therefore freely distributable and amendable under a new license.

The project is made available under the MIT and APACHE license. See the LICENSE-MIT and LICENSE-APACHE files, respectively, for more information.

Contributions

Please report any bugs and possible improvements as an issue within this repository. Pull requests are also welcome.

More Repositories

1

wavedrom-rs

Beautiful Digital Timing Diagrams with Rust
Rust
53
star
2

WasmSVGGraphics

A Rust library for rendering SVG Graphics with WASM
Rust
47
star
3

utf8_slice

Slicing for utf8 strings in Rust.
Rust
18
star
4

cobs-rs

A minimal heapless no-std Rust library to do Consistent Overhead Byte Stuffing
Rust
10
star
5

turingmachine-rs

A Turing Machine Simulation Library written in Rust
Rust
5
star
6

intro-power-analysis

An introductory walkthrough into the concepts and workings of Power Analysis using the ChipWhisperer framework
Python
4
star
7

chipwhisperer-nist-lwc

A wrapper repository for porting NIST Lightweight Cryptography Algorithms to the ChipWhisperer
C
4
star
8

simpleserial-c-template

A template repository for ChipWhisperer target source code in C using the SimpleSerial protocol
Makefile
3
star
9

svg_definitions

SVG Definitions
Rust
3
star
10

cw305-cortex-m3-clock-glitching

A collection of dataset gathered from clock glitching the CW305 FPGA embedding a softcore ARM Cortex M3
3
star
11

rustlogic

RustLogic is a crate for parsing and handling simple logical expressings with rust.
Rust
3
star
12

libpam-sys

A `-sys` crate for PAM which supports both LinuxPAM and OpenPAM
Rust
3
star
13

pamela

Readable and simple implementation of Linux-PAM in Rust
Rust
3
star
14

plankton

An image compression library written in pure rust
Rust
2
star
15

ts-svgmanager

A Typescript SVG Manager library
TypeScript
2
star
16

Geom2D

A Rust Library for basic 2D Geometric Definitions
Rust
2
star
17

moore-hodgson-rs

An implementation of the Moore-Hodgson Scheduling algorithm which minimizes late jobs
Rust
2
star
18

array-utils

A no-std heapless set of utility functions for working with const generic arrays
Rust
2
star
19

register-bits

A crate to compile-time verify the size of binary operations on register values
Rust
2
star
20

pulpino-top-level-cw305

The top-level Verilog files for the CW305 to run and communicate with the RISC-V PULPINO core
Verilog
2
star
21

simpleserial-rs

An implementation of the ChipWhisperer SimpleSerial Protocol in Rust (WIP)
C
2
star
22

tiny-big-uint

A minimal, no heap, no_std implementation of arbitrarily sized unsigned integers in Rust.
Rust
2
star
23

zola-tailwind

A template for combining the Zola Static Site Generator with Tailwind CSS
SCSS
2
star
24

cw-rsa-demo

Makefile
1
star
25

chipwhisperer-simple-glitch-target

The simple glitch target from the Chipwhisperer tutorial
Makefile
1
star
26

CSPWS

Traffic Simulation Software
Java
1
star
27

configs

My configuration files
Vim Script
1
star
28

crc8-rs

A heapless no-std Rust library for doing 8-bit cyclic redundancy checks
Rust
1
star
29

cw-rsa

A well documented basic implementation of RSA for ChipWhisperer framework
Makefile
1
star
30

manger

Really fast and easy combinatoric parser for Rust
Rust
1
star
31

ihab-aes-target

A target used to test the effects of a new fault model by Ihab Alshaer
C
1
star
32

chipwhisperer-registers

Send back register values of ChipWhisperer targets without changing them
C
1
star
33

reevesdotnl

Reeves.NL
MDX
1
star
34

cw-thumb-unpredictable-instructions

Utilities to test unpredictable ARM thumb instructions
Makefile
1
star
35

riscv-asm-lang

A Rust crate to supplement Assembly instruction parsing and printing of RISC-V instructions
Rust
1
star
36

riscv-encoding

A Rust crate that contains all the RISCV instructions and procedures to encode / decode them
Rust
1
star
37

gburghoorn.com

The source code for the gburghoorn.com website
HTML
1
star
38

raw-rust-webassembly

Demonstrations of using Rust for WebAssembly without any dependencies
JavaScript
1
star
39

taes

A Demo Rust T-Table implementation of AES
Rust
1
star
40

deentry

Interaction layer between Rust and FreeDesktop Desktop Entry files with a permissive license
Rust
1
star
41

svg-pathdata

An helper class for writing SVG PathData
TypeScript
1
star
42

nix-flake-templates

A set of Nix flake templates I use
Nix
1
star
43

v2d

An implementation of a 2 dimensional vector in Typescript
TypeScript
1
star