This document is generated by README.typ
using
pandoc.
-
Install zig programming language (version: master branch)
-
Clone this repo using command
git clone --single-branch -b main --depth=1 'https://git.sr.ht/~meow_king/raygreet'
-
Clone raylib as
./lib/raylib
, you can run the following command
cd ./raygreet
rm ./lib/raylib # remove the original symbol link in this repo
git clone --single-branch -b master --depth=1 'https://github.com/raysan5/raylib.git' ./lib/raylib
If you have just installed, then run
command just install
. Or you need to run the following command:
sudo zig build -Doptimize=ReleaseSafe -Dplatform_drm
sudo cp ./zig-out/bin/raygreet /usr/bin/raygreet
sudo chmod a+s /usr/bin/raygreet
Check the file permission by ls -l /usr/bin/raygreet
, if you see
-rwsr-sr-x 1 root root 1052768 Feb 14 10:36 /usr/bin/raygreet
and s
is the fourth character and the file is owned by root
, then we
installed it successfully.
s
means this file is always executed as the file owner (in this case,
root
), so we are in input
group and can access /dev/input/event*
files, which is required by Raylib. However, instead of
sudo chmod a+s /usr/bin/raygreet
You can also make greeter
user in input
group using the following
command
sudo usermod greeter -a -G input
- You need fakegreet, which can built with the following command
git clone --single-branch -b master --depth=1 'https://git.sr.ht/~kennylevinsen/greetd'
cd ./greetd
cargo build # use `--release` to build in release mode
cp ./target/debug/fakegreet ~/.local/bin/
-
Change to
TTY<number>
using keyCtrl + Alt + F<number>
-
then run
just run-drm
or
zig build -Dplatform_drm
sudo fakegreet "./zig-out/bin/raygreet"
- Only officially support US keyboards. Other keyboards may have wrong mappings for some keys.
It is due to that Raylib currently uses a US keymap to map
scancode to key code. See
raylib
source.
You can test it in TTY to see if it works correctly.
Here is the discussion.
Developer notes:\
-
evdev key code: /usr/share/X11/xkb/keycodes/evdev
-
scancode: /usr/include/linux/input-event-codes.h