mako
mako copied to clipboard
Allow including config files
In order to change a lot of values in mako config files we have to write them one by one each time, a better way would be to have multiple config files and import them inside the main config file, so we just have to change one line. This would be the same behavior as the include keyword of sway.
Why do you want to change many config options at once? Maybe modes are a better solution to your use-case.
Let's take the example of Sway, to theme it, I have two files:
- lightTheme
- darkTheme
So with a script I change the include lightTheme
line to include darkTheme
to change to dark mode at night, with mako I have to change every color individually like this.
I think with modes I'll have to do something like this:
# light theme
[mode=light]
background-color=#f5f5f5
text-color=#242424
progress-color=#85b2f9
border-color=#242424
# dark theme
[mode=dark]
background-color=#353535
text-color=#eeeeec
progress-color=#15539e
border-color=#eeeeec
And use makoctl set-mode light/dark
when running the script, the issue is if I restart mako it will switch back to the default one, and I'll have to use makoctl again, while with Sway (and other like fuzzel, bemenu, ...) I don't have to do this since it will use the include command.
You can look at my theming script here.
I'm having a similar issue in regards to light/dark theme.
I wonder if mako could save its current mode(s) to a file and restore them on startup. Though I guess people might want to make only some modes permanent and the rest transient.
I'd rather not save anything to a file, I'd prefer to let the user do this and use makoctl
to restore modes on startup if they want to.
I can try and write a tiny, simple, service that does this, but it would be good if fr.emersion.Mako
had a signal (ModeSet
) which signals when modes change so I can keep track of them.
The helper service could keep track of modes (and persist them), and re-set them after mako starts.
A signal sounds like a reasonable thing to add.
Dealing with services is annoying with dark/light mode scripts, as you have to write a specific section for each application to communicate with their respective services. Allow to include external config files is far easier as you just have to specify the path to your script, look at my themer script config for reference.
An include function would have another advantage. With this it could be possible to read the colors out of a file shared with other applications. So an easy theming across multiple programs from one file would be possible
Yeah @Leaced that's what I pointed out above.
I'd also like this functionality. However, my use case is different: I have multiple machines with the same config file layout, and host specific configuration is always in ~/.config/host/...
. I could keep my main config file the same if it was possible to simply include ~/.config/host/mako/config
.