Comments (6)
I'll chime in here.
First, I know that several users (including myself) are running under Wayland, so we don't want to default to reading .Xresources
, especially first. I'd rather have a use_xresources
parameter defaulting to false
in the [theme]
section. Making this opt-in would also be backwards-compatible.
Second, I like the idea of having separate theme files -- which is exactly what supporting .Xresources
amounts to, but with the additional baggage of depending on X. A separate theme file would also allow popular tools like wal
or pywal
to procedurally generate colour schemes for us, something that is currently impossible (because you can't fragment the configuration).
Third, I think that we should keep theme.overrides
, because I think in all three cases (default theme, theme file, and .Xresources
) it would be nice to override very specific elements.
What I am proposing is that we allow three mutually-exclusive top-level directives in the [theme]
section:
name
(which is backwards-compatible and names a built-in theme);file
, the path to a complete theme file, in TOML format; anduse_xresources
, which will read in that file whentrue
.
For example, to use one of the built-in themes,
[theme]
name = "solarized-dark"
# file =
# use_xresources = false
[theme.overrides]
idle_bg = "#123456"
And to use .Xresources
:
[theme]
use_xresources = true
[theme.overrides]
idle_bg = "#123456"
And to use a custom theme file:
[theme]
file = "path/to/theme.toml"
# use_xresources = false
# name = "plain"
[theme.overrides]
idle_bg = "#123456"
As an implementation detail, once we had themes reading from TOML files we could then refactor the current hard-coded themes into separate theme files and include them during the installation (likely somewhere in /etc
). Then the name
parameter would simple read a file from the theme directory, allowing users to "install" additional themes from the community.
All of this is, I believe, backwards-compatible. Does this make sense to others?
from i3status-rust.
Plans to support custom themes directly in the TOML without overriding an internal theme?
currently:
[theme]
name = "solarized-dark"
[theme.overrides]
idle_bg = "#123456"
idle_fg = "#abcdef"
# ...
perhaps something like the following:
[[theme]]
idle_bg = "#123456"
idle_fg = "#afcdef"
# ...
from i3status-rust.
Not really. You can select 'plain' as your base theme, but I mean it doesn't matter if you specify/override all the attributes, you got yourself a new theme. I want to encourage people to publish their themes in a PR, not sure if this does, but at worst it's a semantic oddity without functional impairment.
from i3status-rust.
Just to pitch an idea: the terminal colors from Xresources could be used as a theme. This would enable selecting themes from sites like xcolors.net or similar.
I would be willing to implement this, but I am still in a process of learning Rust. Basically, this should "only" involve parsing the Xresources file and getting all RGBA values needed; not the hardest problem I guess.
Any thoughts on this?
from i3status-rust.
Parsing the Xresources won't be a problem... Converting it into a i3status-rust theme won't be either. Ideally, we want to allow for specifiying a path (to an Xresources file) as the theme parameter. Easiest way to imlement is in the theme.rs file, there is a function mapping a theme name to a theme instance. We simply need to distinguish paths and known theme names and try to generate a theme instance for paths on the fly. Should be quite easy. Just see if there is a theme with the string as name available and, if not, try to treat it as an Xresources file.
from i3status-rust.
I really dislike the idea of having another configuration file just for colors. @hansondr idea sounds great for me. We could utilize the [theme]
section inside the status config for setting colors and everything else.
So, I think we should remove all hardcoded themes except PLAIN
. In my opinion, the following would be a good order for applying styles:
- Read
Xresources
of user - typically at~/.Xresources
- Read the attributes specified under
[theme]
inside the configuration file and override attributes placed by the previous step - Everything else should be taken from the
PLAIN
template
Of course, this is a breaking change.
from i3status-rust.
Related Issues (20)
- Feature request: Weather data using NOAA service HOT 2
- github block, and external sources for secrets HOT 3
- `bad event` when toggle `i3status-rust` for `focused_window` block HOT 1
- gitlab block HOT 5
- Improve time display for time update intervals other than 1 second
- Plain theme never shows colors if theme is not explicitly set in configuration
- Issue setting brightness with scroll in xrandr block with multiple monitors HOT 4
- Tea timer done_cmd not run when using i3's "mode hide" HOT 2
- Help with custom block HOT 2
- Error formatting HOT 1
- Pomodoro: Alternative number format: arabic / decimal HOT 1
- docs.rs build fails HOT 3
- "v4l" driver for Privacy block needs more documentation or a new function to update webcam devices HOT 2
- privacy block ignores webcam HOT 4
- Theme no longer being applied in swaybar after update HOT 4
- new privacy block seems to create some instability when switching on and off display outputs HOT 1
- new privacy block causes i3status-rs to be unstable in some conditions, especially when gamescope and certain games are launched HOT 1
- feature: add `format_alt` and `format_list` to all blocks HOT 3
- Wrong icons in sound block HOT 5
- Upgrading an old configuration to later i3status-rust versions HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i3status-rust.