41 lines
852 B
Markdown
41 lines
852 B
Markdown
# keydisplay
|
|
note: you will need to add yourself to the input group or run as root if you intend to use wayland
|
|
|
|
you can do it like this
|
|
|
|
`doas usermod -aG input $USER`
|
|
|
|
## config.rs
|
|
- use serde with a config struct
|
|
|
|
- impl with defaults and read function
|
|
|
|
### read:
|
|
- get the current users config folder
|
|
|
|
- make a folder if the "keydisplay" folder doesnt exist
|
|
|
|
- make a keydisplay/config.toml if it doesnt exist
|
|
|
|
- give it 600 permissions
|
|
|
|
config:
|
|
- theme = {catppuccin_mocha, grey, night, day}
|
|
- [listen]
|
|
- - keys = "z, x"
|
|
- - mouse = "m1, m2"
|
|
- [display]
|
|
- - mouse = "key"
|
|
|
|
## listen.rs
|
|
- use inputbot to listen for inputs https://github.com/obv-mikhail/InputBot
|
|
|
|
- keys you can use are here https://docs.rs/inputbot/latest/src/inputbot/public.rs.html#300-352
|
|
|
|
## main.rs
|
|
- read config
|
|
|
|
- start listener on keys from config
|
|
|
|
- load gui using theme
|