tobi-wan-kenobi / bumblebee-status

bumblebee-status is a modular, theme-able status line generator for the i3 window manager.
https://bumblebee-status.readthedocs.io/en/main/
MIT License
1.2k stars 228 forks source link

srcery theme #881

Closed anarcat closed 2 years ago

anarcat commented 2 years ago

Feature Request

I see bumblebee already has a lot of fine themes, but my favorite one (srcery) isn't featured. Anyone aware of an existing one? How easy is it making a theme?

SamTebbs33 commented 2 years ago

It's pretty easy to make a new theme. I found it simple to copy a similar-looking one and adjust the colours used. Here's an example of my fairly minimal attempt. The docs can be found here.

anarcat commented 2 years ago

so i got this so far:

{
    "icons": [ ],
    "colors": [
        {
            "white": "#D0BFA1",
            "bright_white": "#FCE8C3",
            "black": "#1C1B19",
            "black_l": "#918175",
            "red": "#EF2F27",
            "green_d": "#519F50",
            "green_l": "#98BC37",
            "yellow_d": "#FBB829",
            "yellow_l": "#FED06E",
            "blue_d": "#2C78BF",
            "blue_l": "#68A8E4",
            "magenta_d": "#E02C6D",
            "magenta_l": "#FF5C8F",
            "cyan_d": "#0AAEB3",
            "cyan_l": "#53FDE9",
            "orange": "#D75F00",
            "bright_orange": "#FF8700",
            "xgray1": "#262626",
            "xgray2": "#303030",
            "xgray3": "#3A3A3A",
            "xgray4": "#444444",
            "xgray5": "#4E4E4E",
            "hard_black": "#121212"
        }
    ],
    "defaults": {
        "fg": "white",
        "bg": "black",
        "warning": {
            "bg": "orange",
            "fg": "hard_black"
        },
        "critical": {
            "bg": "red",
            "fg": "hard_black"
        }
    }
}

i'd love to add the awesome icons in there, but somehow they don't seem to load properly here, even if i have the fonts-awesome package installed in debian... does that ring a bell?

anyways, it feels like the two could be used seperately, no? like you pick the icons, the theme, separately?

anarcat commented 2 years ago

anyways, it feels like the two could be used seperately, no? like you pick the icons, the theme, separately?

nevermind that, debian has font awesome 5, which this seems incompatible with. sigh.

SamTebbs33 commented 2 years ago

Have you tried adding "awesome-fonts" to the icons array?

benthetechguy commented 2 years ago

debian has font awesome 5, which this seems incompatible with

From what I can see, Debian is on Font Awesome 4.7.0.

tobi-wan-kenobi commented 2 years ago

Some of the icons should still work, even with version 5. I think that indeed, the "iconset" setting is missing.

anarcat commented 2 years ago

Have you tried adding "awesome-fonts" to the icons array?

yes, of course, that's how i found it "didn't work". :) here's a screenshot with the modified theme:

snap-20220608T094443

From what I can see, Debian is on Font Awesome 4.7.0.

yeah my bad, it seems it was rolled back to fix precisely those kind of issues. i'm not sure what's going on then.

Some of the icons should still work, even with version 5. I think that indeed, the "iconset" setting is missing.

what is this refering to? the icons part of the theme? because it works without that (ie. i don't get garbled icons, but i don't get awesome icons either, there's just no icon).

i have also tried this:

    status_command bumblebee-status -m title pasink pasource cpu memory battery --iconset "awesome-fonts"

and that doesn't work either... it does show a little more icons though, it looks like this:

snap-20220608T094536

so it looks like the default theme has separators that work correctly... but somehow they differ from what i get with my theme and --iconset ascii because I get bars, not arrows:

snap-20220608T094639

not sure what i am doing wrong. :)

i also noticed the default theme has urgent: true... that's not documented anywhere I could find, what does it do? it seems important... if not urgent! ;)

thanks for all the replies!

tobi-wan-kenobi commented 2 years ago

Yes, with iconset, I meant the "icons" array in the theme JSON.

Note that the font you're using in the i3bar config also needs to have the required glyphs - which font are you using?

(sorry if that is an obvious question, but font config is a MAJOR pain, like 80% of all questions)

anarcat commented 2 years ago

On 2022-06-08 06:52:30, tobi-wan-kenobi wrote:

Yes, with iconset, I meant the "icons" array in the theme JSON.

right, how does that interact with the --iconset parameter? can i keep the "icons" blank and just let the user pick the icons they choose?

Note that the font you're using in the i3bar config also needs to have the required glyphs - which font are you using?

oh. it looks like i had:

font pango:DejaVu Sans Mono 10

but that's not actually what i wanted! So i set it to:

font pango:Fira mono 10

... my goto UI font these days. ;)

it still doesn't fix the problem. should i add awesome in there?

i also tried the following, from the example in the README:

bar {
    font pango:Inconsolata 10
    position top
    [...]

that doesn't work either... it changes the font, but the icons are still garbled.

(sorry if that is an obvious question, but font config is a MAJOR pain, like 80% of all questions)

not at all, it's super hard, and not obvious to me anyways. :)

happy to do any further debugging you need here, and this seems to me like stuff that could be added to a troubleshooting section eventually :)

-- La publicité est la dictature invisible de notre société.

tobi-wan-kenobi commented 2 years ago

Yes, adding font awesome as backup font should help (or only font awesome, for troubleshooting). The Inconsolata font only works if it is patches correctly, I think. It essentially boils down to the question "are the right glyphs in the font" and that - oh fun - differs from distro to distro. I have started just installing the powerline fonts from their girhub repo, si that fonts behave more predictably.

The iconset parameter on the cli overrides the theme setting, iirc.

Yeah, this should def. make it in a troubleshooting section.

Thanks a lot for your patience!

anarcat commented 2 years ago

Okay, so i tried switching to:

font pango:Fira Mono, FontAwesome

... and it works!

snap-20220608T105556

perrty! :)

so i guess the takeaway for me here is:

  1. you do need to change the font section in the i3 config to match the --iconset or icons parameter in the them
  2. you can add mutliple fonts, separated by comma
  3. pango-list can help you find the actual font name
  4. you can either add the font to the theme or specifying it on the commandline
  5. you need font awesome 4, 5 has removed some glyphs (but that's already in the readme)

i guess the next step is to make a PR, would you accept it? :)

also, i'm still looking for an answer on this:

i also noticed the default theme has urgent: true... that's not documented anywhere I could find, what does it do? it seems important... if not urgent! ;)

thanks again!