Lemurs - A lightweight TUI display/login manager written in Rust πŸ’

Related tags

Command-line lemurs
Overview

Lemurs πŸ’

A TUI Display/Login Manager written in Rust

Cover image

WIP: Whilst the project is working and installable, there are still a lot of bugs and limitations.

A minimal lightweight TUI Display Manager/Login Manager written in Rust similar to Ly.

Goal

The goal of this project is to create a small, robust and yet customizable Login Manager which can serve as the front-end to your graphical GNU/Linux or BSD environment. Lemurs uses Linux PAM as its method of authentication.

Installation

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. Copy 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 running the installation script you can add your window managers by creating runnable scripts also known as xinitrcs under the /etc/lemurs/wms folders. The name of the script is used as the name within lemurs. For example, 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 xinitrc should show up within Lemurs.

License

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

Comments
  • Compilation failure (mismatched types)

    Compilation failure (mismatched types)

    It currently doesn't build on Rust 1.65.0

    error[E0308]: mismatched types
      --> src/auth/utmpx.rs:23:21
       |
    23 |         s.ut_user = ut_user;
       |         ---------   ^^^^^^^ expected `u8`, found `i8`
       |         |
       |         expected due to the type of this binding
       |
       = note: expected array `[u8; 32]`
                  found array `[i8; 32]`
    
    error[E0308]: mismatched types
      --> src/auth/utmpx.rs:36:21
       |
    36 |         s.ut_line = ut_line;
       |         ---------   ^^^^^^^ expected `u8`, found `i8`
       |         |
       |         expected due to the type of this binding
       |
       = note: expected array `[u8; 32]`
                  found array `[i8; 32]`
    
    error[E0308]: mismatched types
      --> src/auth/utmpx.rs:40:19
       |
    40 |         s.ut_id = ut_id;
       |         -------   ^^^^^ expected `u8`, found `i8`
       |         |
       |         expected due to the type of this binding
       |
       = note: expected array `[u8; 4]`
                  found array `[i8; 4]`
    
    opened by PaddiM8 8
  • Enable building with stable toolchain

    Enable building with stable toolchain

    I noticed it's relatively easy to switch the nightly groups() call to pre_exec(nix::unistd::setgroups(...)), which is effectively what is done under the hood.

    This allows us to use the stable toolchain while awaiting stabilization.

    Also adjusted some tests that wouldn't compile on stable.

    opened by tranzystorek-io 5
  • Switch arg parsing to clap-derive

    Switch arg parsing to clap-derive

    Hi, I recently discovered this project and would love to have a proper TUI display manager in my leftwm config, so I thought I'd contribute.

    This PR changes the clap API to the derive version, which should eliminate some boilerplate code.

    Notable changes (to be adjusted/reverted at your discretion):

    • switch around some function signatures to use &Path instead of raw &str
    • rename --nolog flag to --no-log
    opened by tranzystorek-io 3
  • logind is not setup correctly when logging in

    logind is not setup correctly when logging in

    Since logind is not considered within it isn't set up properly. This prohibits reboot and shutdown commands from being used and probably has other problems as well.

    bug 
    opened by coastalwhite 1
  • Remove dummy XDG_SESSION_ID

    Remove dummy XDG_SESSION_ID

    I liked this project the moment I saw it, and then replaced sddm with it. However, I found a issue preventing KDE Plasma on Wayland from starting. After several days of debugging, I made it :)

    The env_variables.rs sets the environment variable XDG_SESSION_ID to an constant of 1, which will cause some permission problems. Since the pam_systemd.so will automatically requests an XDG_SESSION_ID for us and then sets this variable to the correct value, would you mind removing this dummy XDG_SESSION_ID ?

    opened by Jiawens 2
  • Start on extraction of a core library

    Start on extraction of a core library

    This PR aims to extract a core set of well documented functions from the TUI frontend. This aims to make the internals more stable, debuggable and reusable. There are many things that still need to happen for this PR to be completed.

    • [ ] Consider the usability of the API
    • [ ] Make internal constants variables accessible from the outside
    • [ ] Better documentation
    • [ ] Better encapsulation and documentation of the unsafe parts
    • [ ] Check root permissions at every public function that needs it
    • [ ] Better Error Handling
    • [ ] Context for Logging In
      • [ ] Do logging
      • [ ] PAM service
    • [ ] More clear environment variable handling
    • [ ] Check Health command - [ ] Index all the used external items
    • [ ] Port over XSetup.sh file - [ ] Find solution for the custom set environment variables
    • [ ] Environment variables / options for different binary locations
    • [ ] Custom PAM conversation
      • [ ] Define cross-distro PAM service
      • [ ] Possible integration with SystemD
    • [ ] Fetching sessions from desktop entries instead of custom directory (#102)
    • [ ] Features
      • [ ] Fetch possible sessions
      • [ ] Logging
      • [ ] Session Environments
        • [ ] Wayland
        • [ ] X11
        • Shell
    opened by coastalwhite 0
  • Starting post-login environment failed (spectrwm)

    Starting post-login environment failed (spectrwm)

    Hi,

    Feel like I'm missing something obvious, but after a trying few different combinations I currently have:

    /etc/lemurs/wms/spectrwm

    #!/bin/sh
    
    exec spectrwm
    

    Nothing at all in ~/.xinitrc if that makes any difference

    When I boot I get the lemurs login prompt with 'spectrwm' at the top, fill in my username and password and it goes to a blank screen. Log appears to show everything running fine up to Run X server, then just says:

    [lemurs::ui][ERROR] Starting post-login environment failed
    

    If I disable the service, reboot, login on tty, put exec spectrwm into my ~/.xinitrc and run startx, spectrwm loads as expected.

    Any ideas please?

    opened by point-4ward 12
  • ubuntu 22.10 not working

    ubuntu 22.10 not working

    ➜ lightdm cd /etc/lemurs ➜ lemurs ls config.toml wayland wms xsetup.sh ➜ lemurs tree . β”œβ”€β”€ config.toml β”œβ”€β”€ wayland β”‚Β Β  β”œβ”€β”€ sway β”‚Β Β  └── ubuntu β”œβ”€β”€ wms └── xsetup.sh

    2 directories, 4 files ➜ lemurs cat wayland/ubuntu #! /bin/sh exec gnome-session --session=gnome-wayland ➜ lemurs ls -al wayland/ubuntu -rwxr-xr-x 1 root root 54 Dec 1 15:50 wayland/ubuntu ➜ lemurs cat /var/log/lemurs.log [2022-12-01][15:19:41][lemurs][INFO] Lemurs logger is running [2022-12-01][15:19:41][lemurs][INFO] Switching to tty 2 [2022-12-01][15:19:41][lemurs][INFO] UI booted up [2022-12-01][15:19:41][lemurs::info_caching][INFO] Attempting to get a cached information from '/var/cache/lemurs' [2022-12-01][15:19:41][lemurs::info_caching][INFO] Read cache file and found environment 'mephisto' and username 'None' [2022-12-01][15:19:41][lemurs::ui][INFO] Loading environment 'mephisto' from cache [2022-12-01][15:19:41][lemurs::ui::switcher][WARN] Failed to find selection with title: 'mephisto' [2022-12-01][15:19:52][lemurs::auth][INFO] Login attempt for 'mephisto' [2022-12-01][15:19:52][lemurs::auth::pam][INFO] Started opening session [2022-12-01][15:19:52][lemurs::auth::pam][INFO] Gotten Authenticator [2022-12-01][15:19:52][lemurs::auth::pam][INFO] Got handler [2022-12-01][15:19:52][lemurs::auth::pam][INFO] Validated account [2022-12-01][15:19:52][lemurs::auth::pam][INFO] Opened session [2022-12-01][15:19:52][lemurs::ui][INFO] Setting cached information [2022-12-01][15:19:52][lemurs::info_caching][INFO] Attempting to set cache [2022-12-01][15:19:52][lemurs::info_caching][INFO] Successfully set username in cache file [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'HOME' to '/home/mephisto' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Successfully changed working directory to /home/mephisto! [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'SHELL' to '/usr/bin/zsh' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'USER' to 'mephisto' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'LOGNAME' to 'mephisto' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'PATH' to '/usr/local/sbin:/usr/local/bin:/usr/bin' [2022-12-01][15:19:52][lemurs::post_login][INFO] Set environment variables. [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_CONFIG_DIR' to '/home/mephisto/.config' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_CACHE_HOME' to '/home/mephisto/.cache' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_DATA_HOME' to '/home/mephisto/.local/share' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_STATE_HOME' to '/home/mephisto/.local/state' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_DATA_DIRS' to '/usr/local/share:/usr/share' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_CONFIG_DIRS' to '/etc/xdg' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_RUNTIME_DIR' to '/run/user/1000' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_SESSION_DIR' to 'user' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_SESSION_ID' to '1' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_SEAT' to 'seat0' [2022-12-01][15:19:52][lemurs::post_login::env_variables][INFO] Set environment variable 'XDG_VTNR' to '2' [2022-12-01][15:19:52][lemurs::post_login][INFO] Set XDG environment variables [2022-12-01][15:19:52][lemurs::post_login][INFO] Starting Wayland Session [2022-12-01][15:19:52][lemurs::post_login][INFO] Entered Wayland compositor [2022-12-01][15:19:52][lemurs::auth::utmpx][INFO] Adding UTMPX record [2022-12-01][15:19:52][lemurs::auth::utmpx][INFO] Added UTMPX record [2022-12-01][15:19:53][lemurs::auth::utmpx][INFO] Removing UTMPX record

    When input username and password, it didn't enter gnome desktop, just stay on greeter page. By the way, this repo is impressive.

    opened by kmephistoh 7
  • MSRV concerns

    MSRV concerns

    let-else statements and similar fresh language syntax features unfortunately inflate the MSRV which makes the project harder to package in most distributions (in my case Void still has Rust 1.64)

    opened by tranzystorek-io 2
Releases(v0.3.0)
  • v0.3.0(Nov 22, 2022)

    Lemurs v0.3.0 adds many of the features that make lemurs more useful to more people. This includes Wayland support, UTMPX support, improved focus behavior, a fallback TTY shell and an AUR package. We also switch away from the nightly toolchain to the stable toolchain thanks to @tranzystorek-io.

    Full changelog

    Features

    • Caching of entered info (#75)
    • Wayland support (#84)
    • UTMPX support (#90)
    • Improved and customizable focus behavior (#74)
    • --tty flag to overwrite default tty (#81)
    • Add fallback TTY shell (#82, #83, #89)
    • Add documentation about the AUR package (#87)

    Improvements

    • Switch to the stable toolchain (#79)

    Any many other small changes and fixes!

    Thanks to @tranzystorek-io for help with the current release.

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jul 30, 2022)

    This release is mainly focused on major refactors. This transforms it from a proof of concept to a more serious project.

    New features:

    • Massively improved stability
    • Automatically remember previously entered username
    • Add an option for a maximum width of input fields
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Jan 2, 2022)

    The release of the first version of Lemurs. This release includes:

    • A basic TUI
    • PAM Authentication
    • Preview flag
    • Selector of different xinitrcs
    • Installation script
    Source code(tar.gz)
    Source code(zip)
Owner
Gijs Burghoorn
CS Student at UniversitΓ© Grenoble Alpes IM2AG and Rusty Security Guy
Gijs Burghoorn
A template for bootstrapping a Rust TUI application with tui-rs & crossterm

rust-tui-template A template for bootstrapping a Rust TUI application with tui-rs & crossterm. tui-rs The library is based on the principle of immedia

Orhun ParmaksΔ±z 72 Dec 31, 2022
Provide free GPT-3.5 API service by reverse engineering the login-free ChatGPT website.

ChatGPT Free API Provide free GPT-3.5 API service by reverse engineering the login-free ChatGPT website. Note: This service requires the IP to be able

null 21 May 5, 2024
A simple TUI password manager made in Rust.

IronKey IronKey is a Terminal User Interface (TUI) based password generator written in Rust. It leverages the power of Rust's performance and safety f

Kekma 3 Feb 23, 2024
A user-friendly, lightweight TUI for disk imaging

Caligula Burning Tool Caligula is a user-friendly, lightweight TUI for imaging disks. $ caligula burn -h Burn an image to a disk Usage: caligula burn

Astrid Yu 25 Mar 26, 2023
Simple file manager to practice using tui-rs

simple-tui-file-manager Simple file manager to practice using tui-rs Keymap Key description j, up move up k, down move down h, Left move parent dir l,

Slug 3 Nov 12, 2022
Super-lightweight git manager

gmg - Super-lightweight git manager The idea The idea is simple: no extra server layer, no extra proxies. Just a pure git and ssh. Setup The setup scr

Altertech 8 Mar 19, 2023
Dreamer is an extensible tool manager and shell for creating small, lightweight, dev environments instantly.

Dreamer ?? Does what you want, not what you say. Dreamer is a universal tool management system for any language, any build system, and any framework.

Luke Davis 4 Oct 23, 2023
A Windows virtual display driver written in Rust (works with VR, etc)

Virtual Display Driver This is a Windows driver made in Rust which creates a virtual desktop. It has many uses, such as: A private virtual desktop for

Cherry 28 Sep 19, 2023
A controller for the display and fan of the Raspberry Pi Waveshare PoE HAT written in Rust πŸ¦€

???? RustBerry-PoE-Monitor RustBerry-PoE-Monitor is a Rust-based monitoring and control tool for the Raspberry Pi, specifically designed for use with

jack 5 Nov 27, 2023
A user-friendly TUI client for Matrix written in Rust!

Konoha A user-friendly TUI client for Matrix written in Rust! Notice: The client is currently not usable and is only hosted on GitHub for version cont

L3af 9 Jan 5, 2022
✨Sleek typing tui written in rust

thokr ✨ sleek typing tui written in rust Installation Cargo $ cargo install thokr Docker $ docker run -it coloradocolby/thokr Arch Linux Install thokr

Colby Thomas 440 Dec 30, 2022
TUI interface for LLMs written in Rust πŸ”₯

Tenere TUI interface for LLMs written in Rust ?? Demo ?? Supported LLMs Only ChatGPT is supported for the moment. But I'm planning to support more mod

BADR 22 Apr 22, 2023
Rust command line utility to quickly display useful secrets in a Kubernetes namespace

kube-secrets This is a command line utility for quickly looking at secrets in a Kubernetes namespace that are typically looked at by humans. It specif

Frank Wiles 8 Feb 10, 2022
Rust crate that allows you to display status & progress information in a terminal

status-line This crate allows you to display status & progress information in a terminal This crate handles the problem of displaying a small amount o

Piotr KoΕ‚aczkowski 20 Dec 27, 2022
CLI app to display list of trending anime, music charts or recommend anime to watch or song to listen to.

Description Anitrendz is a cli app that uses data from the anitiop api to list the top anime and songs or recommend a random anime to watch or song to

Jimmy 9 Jun 11, 2022
Display ZFS datasets' I/O in real time

ztop Display ZFS datasets' I/O in real time Overview ztop is like top, but for ZFS datasets. It displays the real-time activity for datasets. The buil

Alan Somers 40 Nov 23, 2022
Display financial Data on The Terminal

tuinance Tuinance is a performant TUI program to display financial data, written completely in Rust. All data is gathered through the Yahoo Finance AP

Juho 10 May 31, 2022
Display a random Shiba from your terminal whenever you feel the need to. Because why not?

Shiba CLI Command-line interface (CLI) to display a random Shiba Inu whenever needed, by just running shiba on your terminal. How To Use β€’ How Does It

null 17 Sep 25, 2022
Display candlestick chart in your terminal.

cli-candlestick-chart This module allows you to display candle charts directly in your terminal. I did this project mainly to learn Rust, so the code

Julien 178 Dec 18, 2022