-
Notifications
You must be signed in to change notification settings - Fork 6
Configuration overhaul (#30) #104
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
Conversation
|
I wrote a summary in the PR description on what changed from a user perspective. Existing configs should work if 1.) the module declaration is removed from the top, 2.) @xelxebar Hi! Would you mind having a look at this? The diff is quite large, so I don't necessarily expect a full code review, but insights on the design change, maybe a quick check how it works. I left changing the fifo setting as a TODO in the code. Once this gets merged, we can progress further with #101. |
cdc7f52 to
ce8d98d
Compare
|
Solid work! You went deep. I looked through the whole diff and see that removing One thing I just though of, it'd be nice if we could also append to default list values inside the config. Most of my key bindings are default, but I've modified a couple and added a few. It feel unnecessary that I have to set the entire key list in my config. Is there a reason we have list-valued settings at all? Maybe it would be simpler to store all settings as predicates with atomic values and use Anyway, very excellent work. I'm consistently impressed by your commitment to thorough documentation. |
Thank you, I'm glad you like it!
I think, having lists is a tad simpler than making some settings non-deterministic (i.e. have multiple solutions). Also, this: keymap(super + j -> shift_focus(down)).
keymap(super + k -> shift_focus(up)).
keymap(super + shift + j -> move_focused(down)).
keymap(super + shift + k -> move_focused(up)).imo looks a little redundant compared to: keymaps([
super + j -> shift_focus(down),
super + k -> shift_focus(up),
super + shift + j -> move_focused(down),
super + shift + k -> move_focused(up)
]).Though I agree, the first is more Prolog-y:) One practical advantage of the former I see is that the keymap definitions could be broken up, maybe even to separate files consulted from
This is perfectly reasonable. In fact, you can do half of this already on this branch: keep the default keybindings but add custom ones on top. One way to achieve this is to add a start hook like this to your config: hooks([
start -> (
add(keymaps, "AudioRaiseVolume" -> shellcmd("pactl set-sink-volume 0 +5%")),
add(keymaps, "AudioLowerVolume" -> shellcmd("pactl set-sink-volume 0 -5%")),
add(keymaps, "AudioMute" -> shellcmd("pactl set-sink-mute 0 toggle"))
)
]).But indeed there's no way right now to remove or modify singular keymaps from the existing. The good news is that I think, Though I'm not sure what would be a prudent solution for this... If someone defines Or maybe I'd prefer a simpler solution to both, but I don't see any other from the top of my head. I need to ponder on this a little. Thank you for checking this so quickly, and let me know if you have any suggestions! |
5d857dd to
cb5c4c8
Compare
- Settings are no longer compiled in, only loaded during runtime - Settings can be changed dynamically (with set/2 and add/2) - Any setting can be omitted, because everything has a default value - Default settings are installed to /etc/plwm/config.pl - reload_config/0 re-reads config file - dump_settings/1 dumps current setting values to a file - Config files must NOT use module declarations (settings are in the global namespace) - bar_class/2 became bar_classes/1 taking a list (all settings must have arity 1 and be deterministic)
@xelxebar Okay, it turned out much simpler than I originally expected. When registering a keymap, I first remove the previous action mapped to that key combo (if any). So overwriting is possible now. Also, I allow Here I added an example. |
|
@Seeker04 Well, that was simple! I love it. |
Configuration overhaul:
set/2andadd/2)/etc/plwm/config.plreload_config/0re-reads config filedump_settings/1dumps current setting values to a filebar_class/2becamebar_classes/1taking a list (all settings must have arity 1 and be deterministic)Closes #30.