Skip to content
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

Style support for status bar #410

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ivanmilov
Copy link

With this PR you can make statusbar output looks like e.g. powerline.
Example there: https://i.redd.it/13a2zz2ifjw31.png

New field in config: full_text_pattern
Value of this pattern will be parsed and all values surrounded by '%' will be used as parameter keys.
Values started with '&' - are references on another parameter keys.

Demo config example:

command=~/.config/i3/i3blocksScripts/$BLOCK_NAME
separator_block_width=0
markup=pango
color1=#ffffffa0
color2=#000000a0
background=#000000a0
separator_glyph=
full_text_pattern=<span foreground='%gfg%' background='%gbg%'>%separator_glyph%</span><span foreground='%fg%' background='%bg%'>%full_text%</span>
gbg=&fg
gfg=&bg

[foo]
command=echo foo
bg=&color1
fg=&color2
interval=once

[bar]
command=echo bar
bg=&color2
fg=&color1
interval=once

i3 config:

bar {
    position top
    i3bar_command i3bar -t 0.1
    colors{
        background #000000a0
    }

    status_command i3blocks -c demo.conf
}

With this PR you can make statusbar output looks like e.g. powerline.
Example there: https://i.redd.it/13a2zz2ifjw31.png

New field in config: full_text_pattern
Value of this pattern will be parsed and all values surrounded by '%' will be used as parameter keys.
Values started with '&' - are references on another parameter keys.

Demo config example:
```
command=~/.config/i3/i3blocksScripts/$BLOCK_NAME
separator_block_width=0
markup=pango
color1=#ffffffa0
color2=#000000a0
background=#000000a0
separator_glyph=
full_text_pattern=<span foreground='%gfg%' background='%gbg%'>%separator_glyph%</span><span foreground='%fg%' background='%bg%'>%full_text%</span>
gbg=&fg
gfg=&bg

[foo]
command=echo foo
bg=&color1
fg=&color2
interval=once

[bar]
command=echo bar
bg=&color2
fg=&color1
interval=once
```

i3 config:
```
bar {
    position top
    i3bar_command i3bar -t 0.1
    colors{
        background #000000a0
    }

    status_command i3blocks -c demo.conf
}
```
@ivanmilov ivanmilov requested a review from vivien January 25, 2020 11:04
dllud pushed a commit to dllud/i3blocks that referenced this pull request Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant