-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
* 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
* 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 like1 << TAG
for tag assignment and~0
(bitwise negation) for viewing particular tags. The syntax is roughly Rust-like; see the includedexample.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.