Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Lua for configuration #30

Merged
merged 136 commits into from
Jan 19, 2025
Merged

Use Lua for configuration #30

merged 136 commits into from
Jan 19, 2025

Conversation

ntBre
Copy link
Owner

@ntBre ntBre commented Nov 14, 2024

This PR has been built on/superseded by #42. The description below is still accurate as to the general benefits and why I didn't use a static config language like TOML, but I switched to Lua instead of trying to maintain a custom config language.

Outdated

This PR moves away from the dwm-style config.rs intended to be edited by users and to a custom config language I wrote with a limited form of evaluation to handle stuff like 1 << TAG for tag assignment and ~0 (bitwise negation) for viewing particular tags. The syntax is roughly Rust-like; see the included example.fig file for an example.

This has two major benefits. First, rwm can be packaged as a single binary that can be customized by a separate file instead of each user needing to compile their own. Second, and closely related, is that you don't have to recompile rwm to apply config changes. Simply quitting and restarting rwm will reload the config.

The branch is cluttered a bit by pulling in patches from the main branch to make this version of rwm ready for my daily use. I've been using it as a daily driver for 3 months now. Once I fix a minor issue with window swallowing and possibly apply the stacker patch, this branch will likely become the rwm 2.0 release.

ntBre added 30 commits August 24, 2024 12:47
for dmenucmd, I think I'm just going to drop the dmenumon thing and add that
manually as an argument. I need to go ahead and move spawn to use Rust command
stuff too

I'm going to have to make Arg an enum too, I think. it's just not really clear
how to start passing around termcmd and dmenucmd Args that I get from fig. the
current setup really depends on them being pointers that I can reference in the
key definitions. any Key that takes an Arg.v is potentially a problem, but
hopefully I can handle it by introducing multiple enum variants, one for each
actual type the *void points to
ntBre and others added 24 commits December 6, 2024 13:56
* make rect take &mut Drw

* make invert bool

* use refs

* allow clippy fix when dirty

* more refs

* font_getexts never used h

* clean up some more unused unsafe

* make charexists bool

* utf8decode was only called with clen = UTF_SIZ

* mostly working, but title is always `broken` in xephyr

* initialize client name to avoid precondition violation

* remove size argument to gettextprop

* update screen size in xephyr

* debugging missing emojis in xephyr

* fix emojis by actually setting utf8codepoint

* fix some characters in title

* char::from is a little nicer, then give up for now
ntBre and others added 2 commits December 7, 2024 15:02
* derive deserialize for config, with some intermediates for fn ptrs

* add insta, load a Config from lua

* ok_or

* move CONFIG init to Config::load_home

* allow unused for now

* move config to lib and CONFIG to state

* clippy fix

* lowercase config

* delete fig, use lua, check Key loading

* custom Debug impl for Key for reproducible snapshots

* update dmenucmd and test buttons

* add layouts

* install lua

* ubuntu requires specifying lua5.4

* also install liblua5.4

* rename main_ to core

* start generating tag keys

* finish the default config

* move docs to config.lua

* take defaults entirely from lua

* update config path

* don't load config twice

* use previously-defined scratchpad name

* make way more keys available in the default config

* run clippy with nightly

* fix new operator precedence lint

* include xf86 keys too
@ntBre ntBre changed the title Use custom config language Use Lua for configuration Jan 19, 2025
@ntBre ntBre merged commit d8bd207 into master Jan 19, 2025
6 checks passed
@ntBre ntBre deleted the fig branch January 19, 2025 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant