task(dsl): Replace colons with dashes

Colons break ini syntax highlighters and linters.
This commit is contained in:
Michael Carlberg 2016-05-26 02:14:56 +02:00
parent 3b9dc784ba
commit 2c74cb06de
28 changed files with 1096 additions and 966 deletions

567
README.md
View File

@ -1,3 +1,6 @@
###### Did the bar stop working after your last update? [Read this](https://github.com/jaagr/lemonbuddy/wiki/pre-1.0:-Patching-your-configuration-file) to find out how to patch your config!
---
Lemonbuddy Lemonbuddy
========== ==========
@ -102,16 +105,16 @@ The following code will get you started:
# Launch the bar # Launch the bar
# (where "example" is the name of the bar as defined by [bar/NAME] in the config) # (where "example" is the name of the bar as defined by [bar/NAME] in the config)
$ lemonbuddy_wrapper.sh example $ lemonbuddy_wrapper example
~~~ ~~~
> **NOTE:** If you are running i3 or bspwm and you don't see the workspace icons > **NOTE:** If you are running i3 or bspwm and you don't see the workspace icons
> it probably depends on the font. Install `font-awesome` and relaunch the bar. > it probably depends on the font. Install `font-awesome` and relaunch the bar.
> ...or replace the icons in the config. > ...or replace the icons in the config.
**It is recommended** to always use `lemonbuddy_wrapper.sh` when launching the bars. **It is recommended** to always use `lemonbuddy_wrapper` when launching the bars.
`lemonbuddy_wrapper.sh` is just a simple shell script that takes care `lemonbuddy_wrapper` is just a simple shell script that takes care
of redirecting the in-/output streams between `lemonbuddy` and `lemonbar`. of redirecting the in-/output streams between `lemonbuddy` and `lemonbar`.
If you handle the in-/output stream redirection's manually, the internal command If you handle the in-/output stream redirection's manually, the internal command
@ -119,7 +122,7 @@ handlers (e.g. mpd or volume controls) might stop working. It won't change the
output of the bar but you will miss out on the internal API calls, which is one output of the bar but you will miss out on the internal API calls, which is one
of the main advantages of using the application. of the main advantages of using the application.
The `lemonbuddy_wrapper.sh` will be deprecated once `lemonbar` is integrated The `lemonbuddy_wrapper` will be deprecated once `lemonbar` is integrated
into the project. into the project.
@ -132,11 +135,11 @@ processes gets terminated before before we launch the new ones. For example in
~~~ sh ~~~ sh
# Terminate already running bar instances # Terminate already running bar instances
pgrep -f '(lemonbuddy_wrapper.sh|^lemonb(uddy|ar))' | xargs kill -9 >/dev/null 2>&1 lemonbuddy_terminate noconfirm
# Launch bar1 and bar2 # Launch bar1 and bar2
lemonbuddy_wrapper.sh bar1 & lemonbuddy_wrapper bar1 &
lemonbuddy_wrapper.sh bar2 & lemonbuddy_wrapper bar2 &
echo "Bars launched..." echo "Bars launched..."
~~~ ~~~
@ -144,8 +147,8 @@ processes gets terminated before before we launch the new ones. For example in
## Configuration ## Configuration
The configuration syntax is very much **WIP**. An upcoming change will replace all occurences of colon's with dashes in the parameter names. The configuration syntax is very much **WIP**. If you have any feedback or suggestions on how to improve it,
If you have any feedback or suggestions, please [create an issue ticket](https://github.com/jaagr/lemonbuddy/issues). please [create an issue ticket](https://github.com/jaagr/lemonbuddy/issues), or a pull request.
When working with unicode symbols, remember that fonts render them differently. Changing font When working with unicode symbols, remember that fonts render them differently. Changing font
can change the quality of your generated output drastically. One must-have font can change the quality of your generated output drastically. One must-have font
@ -156,6 +159,52 @@ Also try different icon fonts, such as [Font Awesome](http://fontawesome.io/icon
The values used in the examples below are to be considered placeholder values, and The values used in the examples below are to be considered placeholder values, and
the resulting output might not be award-winning. the resulting output might not be award-winning.
### Syntax and DSL
The configuration syntax is based on the `ini` file format.
~~~ ini
[section/name]
str = My string
; Hint: Quote the value to keep the spaces
str = " My string"
bool = true
bool = on
int = 10
float = 10.0
; Values for a defined bar can be referenced using:
key = ${bar/top.foreground}
; Values for the current bar can be referenced using:
key = ${BAR.foreground}
; Other values can be referenced using:
key = ${section.key}
;format[-NAME] = "<TAGS...>"
;format[-NAME]-spacing = N (unit: whitespaces)
;format[-NAME]-padding = N (unit: whitespaces)
;format[-NAME]-margin = N (unit: whitespaces)
;format[-NAME]-offset = N (unit: pixels)
;format[-NAME]-foreground = #aarrggbb
;format[-NAME]-background = #aarrggbb
;format[-NAME]-underline = #aarrggbb
;format[-NAME]-overline = #aarrggbb
;
;label-NAME[-(foreground|background|(under|over)line|font|padding)] = ?
;icon-NAME[-(foreground|background|(under|over)line|font|padding)] = ?
;ramp-NAME-[0-9]+[-(foreground|background|(under|over)line|font|padding)] = ?
;animation-NAME-[0-9]+[-(foreground|background|(under|over)line|font|padding)] = ?
;
;bar-NAME-width = N (unit: characters)
;bar-NAME-format = (tokens: %fill% %indicator% %empty%)
;bar-NAME-foreground-[0-9]+ = #aarrggbb
;bar-NAME-indicator[-(foreground|background|(under|over)line|font|padding)] =
;bar-NAME-fill[-(foreground|background|(under|over)line|font|padding)] =
;bar-NAME-empty[-(foreground|background|(under|over)line|font|padding)] =
~~~
`🟊 = module is still flagged as work in progress` `🟊 = module is still flagged as work in progress`
@ -211,10 +260,10 @@ the resulting output might not be award-winning.
module_margin_right = 3 module_margin_right = 3
; Fonts are defined using: <FontName>;<Offset> ; Fonts are defined using: <FontName>;<Offset>
font:0 = NotoSans-Regular:size=8;0 font-0 = NotoSans-Regular:size=8;0
font:1 = MaterialIcons:size=10;0 font-1 = MaterialIcons:size=10;0
font:2 = Termsynu:size=8;-1 font-2 = Termsynu:size=8;-1
font:3 = FontAwesome:size=10;0 font-3 = FontAwesome:size=10;0
; The separator will be inserted between the output of each module ; The separator will be inserted between the output of each module
;separator = | ;separator = |
@ -224,16 +273,16 @@ the resulting output might not be award-winning.
clickareas = 30 clickareas = 30
; Value to be used to set the WM_NAME atom ; Value to be used to set the WM_NAME atom
; This defaults to "lemonbuddy-BARNAME_MONITOR" ; This defaults to "lemonbuddy-[BAR]_[MONITOR]"
;wm_name = mybar ;wm_name = mybar
; Locale used to localize module output (for example date) ; Locale used to localize module output (for example date)
;locale = sv_SE.UTF-8 ;locale = sv_SE.UTF-8
; Define what modules to output ; Define what modules to output
modules:left = cpu ram modules-left = cpu ram
modules:center = label modules-center = label
modules:right = clock modules-right = clock
~~~ ~~~
@ -259,16 +308,16 @@ the resulting output might not be award-winning.
; %percentage% (default) ; %percentage% (default)
label = %percentage% label = %percentage%
ramp:0 = 🌕 ramp-0 = 🌕
ramp:1 = 🌔 ramp-1 = 🌔
ramp:2 = 🌓 ramp-2 = 🌓
ramp:3 = 🌒 ramp-3 = 🌒
ramp:4 = 🌑 ramp-4 = 🌑
bar:width = 10 bar-width = 10
bar:indicator = | bar-indicator = |
bar:fill = ─ bar-fill = ─
bar:empty = ─ bar-empty = ─
~~~ ~~~
@ -294,50 +343,50 @@ the resulting output might not be award-winning.
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label:charging> (default) ; <label-charging> (default)
; <bar:capaity> ; <bar-capaity>
; <ramp:capacity> ; <ramp-capacity>
; <animation:charging> ; <animation-charging>
format:charging = <animation:charging> <label:charging> format-charging = <animation-charging> <label-charging>
; Available tags: ; Available tags:
; <label:discharging> (default) ; <label-discharging> (default)
; <bar:capaity> ; <bar-capaity>
; <ramp:capacity> ; <ramp-capacity>
format:discharging = <ramp:capacity> <label:discharging> format-discharging = <ramp-capacity> <label-discharging>
; Available tags: ; Available tags:
; <label:full> (default) ; <label-full> (default)
; <bar:capaity> ; <bar-capaity>
; <ramp:capacity> ; <ramp-capacity>
;format:full = <ramp:capacity> <label:full> ;format-full = <ramp-capacity> <label-full>
; Available tokens: ; Available tokens:
; %percentage% (default) ; %percentage% (default)
label:charging = Charging %percentage% label-charging = Charging %percentage%
; Available tokens: ; Available tokens:
; %percentage% (default) ; %percentage% (default)
label:discharging = Discharging %percentage% label-discharging = Discharging %percentage%
; Available tokens: ; Available tokens:
; %percentage% (default) ; %percentage% (default)
label:full = Fully charged label-full = Fully charged
ramp:capacity:0 =  ramp-capacity-0 = 
ramp:capacity:1 =  ramp-capacity-1 = 
ramp:capacity:2 =  ramp-capacity-2 = 
ramp:capacity:3 =  ramp-capacity-3 = 
ramp:capacity:4 =  ramp-capacity-4 = 
bar:capacity:width = 10 bar-capacity-width = 10
animation:charging:0 =  animation-charging-0 = 
animation:charging:1 =  animation-charging-1 = 
animation:charging:2 =  animation-charging-2 = 
animation:charging:3 =  animation-charging-3 = 
animation:charging:4 =  animation-charging-4 = 
animation:charging:framerate_ms = 750 animation-charging-framerate_ms = 750
~~~ ~~~
@ -349,72 +398,72 @@ the resulting output might not be award-winning.
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; workspace_icon:[0-9]+ = label;icon ; workspace_icon-[0-9]+ = label;icon
workspace_icon:0 = code;♚ workspace_icon-0 = code;♚
workspace_icon:1 = office;♛ workspace_icon-1 = office;♛
workspace_icon:2 = graphics;♜ workspace_icon-2 = graphics;♜
workspace_icon:3 = mail;♝ workspace_icon-3 = mail;♝
workspace_icon:4 = web;♞ workspace_icon-4 = web;♞
workspace_icon:default = ♟ workspace_icon-default = ♟
; Available tags: ; Available tags:
; <label:state> (default) - gets replaced with <label:(active|urgent|occupied|empty)> ; <label-state> (default) - gets replaced with <label-(active|urgent|occupied|empty)>
; <label:mode> - gets replaced with <label:(monocle|tiled|fullscreen|floating|locked|sticky|private)> ; <label-mode> - gets replaced with <label-(monocle|tiled|fullscreen|floating|locked|sticky|private)>
format = <label:state> <label:mode> format = <label-state> <label-mode>
; If any values for label:dimmed:N area defined, the workspace/mode colors will get overridden ; If any values for label-dimmed-N area defined, the workspace/mode colors will get overridden
; with those values if the monitor is out of focus ; with those values if the monitor is out of focus
label:dimmed:foreground = #555 label-dimmed-foreground = #555
label:dimmed:underline = ${BAR.background} label-dimmed-underline = ${BAR.background}
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:active = %icon% label-active = %icon%
label:active:foreground = #ffffff label-active-foreground = #ffffff
label:active:background = #3f3f3f label-active-background = #3f3f3f
label:active:underline = #fba922 label-active-underline = #fba922
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:occupied = %icon% label-occupied = %icon%
label:occupied:underline = #555555 label-occupied-underline = #555555
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:urgent = %icon% label-urgent = %icon%
label:urgent:foreground = #000000 label-urgent-foreground = #000000
label:urgent:background = #bd2c40 label-urgent-background = #bd2c40
label:urgent:underline = #9b0a20 label-urgent-underline = #9b0a20
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:empty = %icon% label-empty = %icon%
label:empty:foreground = #55ffffff label-empty-foreground = #55ffffff
; Available tokens: ; Available tokens:
; None ; None
label:monocle =  label-monocle = 
;label:tiled =  ;label-tiled = 
;label:fullscreen =  ;label-fullscreen = 
;label:floating =  ;label-floating = 
label:locked =  label-locked = 
label:locked:foreground = #bd2c40 label-locked-foreground = #bd2c40
label:sticky =  label-sticky = 
label:sticky:foreground = #fba922 label-sticky-foreground = #fba922
label:private =  label-private = 
label:private:foreground = #bd2c40 label-private-foreground = #bd2c40
~~~ ~~~
@ -431,23 +480,23 @@ the resulting output might not be award-winning.
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label> (default) ; <label> (default)
; <bar:load> ; <bar-load>
; <ramp:load> ; <ramp-load>
; <ramp:load_per_core> ; <ramp-load_per_core>
format = <label> <ramp:load_per_core> format = <label> <ramp-load_per_core>
; Available tokens: ; Available tokens:
; %percentage% (default) - total cpu load ; %percentage% (default) - total cpu load
label = CPU %percentage% label = CPU %percentage%
ramp:load_per_core:0 = ▁ ramp-load_per_core-0 = ▁
ramp:load_per_core:1 = ▂ ramp-load_per_core-1 = ▂
ramp:load_per_core:2 = ▃ ramp-load_per_core-2 = ▃
ramp:load_per_core:3 = ▄ ramp-load_per_core-3 = ▄
ramp:load_per_core:4 = ▅ ramp-load_per_core-4 = ▅
ramp:load_per_core:5 = ▆ ramp-load_per_core-5 = ▆
ramp:load_per_core:6 = ▇ ramp-load_per_core-6 = ▇
ramp:load_per_core:7 = █ ramp-load_per_core-7 = █
~~~ ~~~
@ -464,7 +513,7 @@ the resulting output might not be award-winning.
date = %Y-%m-%d% %H:%M date = %Y-%m-%d% %H:%M
; if date_detailed is defined, clicking the area will toggle between formats ; if date_detailed is defined, clicking the area will toggle between formats
date_detailed = %%{F#888}%A, %d %B %Y% %%{F#fff}%H:%M%%{F#666}:%%{F#fba922}%S%%{F-} date_detailed = %%{F#888}%A, %d %B %Y %%{F#fff}%H:%M%%{F#666}:%%{F#fba922}%S%%{F-}
~~~ ~~~
##### Extra formatting (example) ##### Extra formatting (example)
@ -472,8 +521,8 @@ the resulting output might not be award-winning.
; Available tags: ; Available tags:
; <date> (default) ; <date> (default)
format = 🕓 <date> format = 🕓 <date>
format:background = #55ff3399 format-background = #55ff3399
format:foreground = #fff format-foreground = #fff
~~~ ~~~
@ -485,7 +534,7 @@ see [the dependency section](#user-content-dependencies).
The module is still marked as WIP since it needs more testing. If you notice any The module is still marked as WIP since it needs more testing. If you notice any
anomalies, please [create an issue](https://github.com/jaagr/lemonbuddy/issues). anomalies, please [create an issue](https://github.com/jaagr/lemonbuddy/issues).
See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`. See [the bspwm module](#user-content-dependencies) for details on `label-dimmed`.
~~~ ini ~~~ ini
[module/i3] [module/i3]
@ -494,55 +543,55 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; workspace_icon:[0-9]+ = label;icon ; workspace_icon-[0-9]+ = label;icon
workspace_icon:0 = 1;♚ workspace_icon-0 = 1;♚
workspace_icon:1 = 2;♛ workspace_icon-1 = 2;♛
workspace_icon:2 = 3;♜ workspace_icon-2 = 3;♜
workspace_icon:3 = 4;♝ workspace_icon-3 = 4;♝
workspace_icon:4 = 5;♞ workspace_icon-4 = 5;♞
workspace_icon:default = ♟ workspace_icon-default = ♟
; Available tags: ; Available tags:
; <label:state> (default) - gets replaced with <label:(focused|unfocused|visible|urgent)> ; <label-state> (default) - gets replaced with <label-(focused|unfocused|visible|urgent)>
;format = <label:state> ;format = <label-state>
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:focused = %icon% label-focused = %icon%
label:focused:foreground = #ffffff label-focused-foreground = #ffffff
label:focused:background = #3f3f3f label-focused-background = #3f3f3f
label:focused:underline = #fba922 label-focused-underline = #fba922
label:focused:padding = 4 label-focused-padding = 4
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:unfocused = %icon% label-unfocused = %icon%
label:unfocused:padding = 4 label-unfocused-padding = 4
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:visible = %icon% label-visible = %icon%
label:visible:underline = #555555 label-visible-underline = #555555
label:visible:padding = 4 label-visible-padding = 4
; Available tokens: ; Available tokens:
; %name% ; %name%
; %icon% ; %icon%
; %index% ; %index%
; Default: %icon% %name% ; Default: %icon% %name%
label:urgent = %icon% label-urgent = %icon%
label:urgent:foreground = #000000 label-urgent-foreground = #000000
label:urgent:background = #bd2c40 label-urgent-background = #bd2c40
label:urgent:padding = 4 label-urgent-padding = 4
~~~ ~~~
@ -559,9 +608,9 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label> (default) ; <label> (default)
; <bar:used> ; <bar-used>
; <bar:free> ; <bar-free>
format = <label> <bar:used> format = <label> <bar-used>
; Available tokens: ; Available tokens:
; %percentage_used% (default) ; %percentage_used% (default)
@ -574,14 +623,14 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
; %mb_total% ; %mb_total%
label = RAM %percentage_used% label = RAM %percentage_used%
bar:used:width = 50 bar-used-width = 50
bar:used:foreground:0 = #55aa55 bar-used-foreground-0 = #55aa55
bar:used:foreground:1 = #557755 bar-used-foreground-1 = #557755
bar:used:foreground:2 = #f5a70a bar-used-foreground-2 = #f5a70a
bar:used:foreground:3 = #ff5555 bar-used-foreground-3 = #ff5555
bar:used:fill = ▐ bar-used-fill = ▐
bar:used:empty = ▐ bar-used-empty = ▐
bar:used:empty:foreground = #444444 bar-used-empty-foreground = #444444
~~~ ~~~
@ -601,58 +650,58 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label:song> (default) ; <label-song> (default)
; <label:time> ; <label-time>
; <bar:progress> ; <bar-progress>
; <toggle> - gets replaced with <icon:(pause|play)> ; <toggle> - gets replaced with <icon-(pause|play)>
; <icon:random> ; <icon-random>
; <icon:repeat> ; <icon-repeat>
; <icon:repeatone> ; <icon-repeatone>
; <icon:prev> ; <icon-prev>
; <icon:stop> ; <icon-stop>
; <icon:play> ; <icon-play>
; <icon:pause> ; <icon-pause>
; <icon:next> ; <icon-next>
format:online = <icon:prev> <icon:stop> <toggle> <icon:next> <icon:repeat> <icon:random> <bar:progress> <label:time> <label:song> format-online = <icon-prev> <icon-stop> <toggle> <icon-next> <icon-repeat> <icon-random> <bar-progress> <label-time> <label-song>
; Available tags: ; Available tags:
; <label:offline> ; <label-offline>
;format:offline = <label:offline> ;format-offline = <label-offline>
; Available tokens: ; Available tokens:
; %artist% ; %artist%
; %album% ; %album%
; %title% ; %title%
; Default: %artist% - %title% ; Default: %artist% - %title%
;label:song = 𝄞 %artist% - %title% ;label-song = 𝄞 %artist% - %title%
; Available tokens: ; Available tokens:
; %elapsed% ; %elapsed%
; %total% ; %total%
; Default: %elapsed% / %total% ; Default: %elapsed% / %total%
;label:time = %elapsed% / %total% ;label-time = %elapsed% / %total%
; Available tokens: ; Available tokens:
; None ; None
label:offline = 🎜 mpd is offline label-offline = 🎜 mpd is offline
icon:play = ⏵ icon-play = ⏵
icon:pause = ⏸ icon-pause = ⏸
icon:stop = ⏹ icon-stop = ⏹
icon:prev = ⏮ icon-prev = ⏮
icon:next = ⏭ icon-next = ⏭
icon:random = 🔀 icon-random = 🔀
icon:repeat = 🔁 icon-repeat = 🔁
;icon:repeatone = 🔂 ;icon-repeatone = 🔂
; Used to display the state of random/repeat/repeatone ; Used to display the state of random/repeat/repeatone
toggle_on:foreground = #ff toggle_on-foreground = #ff
toggle_off:foreground = #55 toggle_off-foreground = #55
bar:progress:width = 45 bar-progress-width = 45
bar:progress:indicator = | bar-progress-indicator = |
bar:progress:fill = ─ bar-progress-fill = ─
bar:progress:empty = ─ bar-progress-empty = ─
~~~ ~~~
@ -690,19 +739,19 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label:connected> (default) ; <label-connected> (default)
; <ramp:signal> ; <ramp-signal>
format:connected = <ramp:signal> <label:connected> format-connected = <ramp-signal> <label-connected>
; Available tags: ; Available tags:
; <label:disconnected> (default) ; <label-disconnected> (default)
;format:disconnected = <label:disconnected> ;format-disconnected = <label-disconnected>
; Available tags: ; Available tags:
; <label:connected> (default) ; <label-connected> (default)
; <label:packetloss> ; <label-packetloss>
; <animation:packetloss> ; <animation-packetloss>
format:packetloss = <animation:packetloss> <label:connected> format-packetloss = <animation-packetloss> <label-connected>
; Available tokens: ; Available tokens:
; %ifname% [wireless+wired] ; %ifname% [wireless+wired]
@ -711,14 +760,14 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
; %signal% [wireless] ; %signal% [wireless]
; %linkspeed% [wired] ; %linkspeed% [wired]
; Default: %ifname% %local_ip% ; Default: %ifname% %local_ip%
label:connected = %essid% label-connected = %essid%
label:connected:foreground = #eefafafa label-connected-foreground = #eefafafa
; Available tokens: ; Available tokens:
; %ifname% [wireless+wired] ; %ifname% [wireless+wired]
; Default: (none) ; Default: (none)
;label:disconnected = not connected ;label-disconnected = not connected
;label:disconnected:foreground = #66ffffff ;label-disconnected-foreground = #66ffffff
; Available tokens: ; Available tokens:
; %ifname% [wireless+wired] ; %ifname% [wireless+wired]
@ -727,21 +776,21 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
; %signal% [wireless] ; %signal% [wireless]
; %linkspeed% [wired] ; %linkspeed% [wired]
; Default: (none) ; Default: (none)
;label:packetloss = %essid% ;label-packetloss = %essid%
;label:packetloss:foreground = #eefafafa ;label-packetloss-foreground = #eefafafa
ramp:signal:0 = 😱 ramp-signal-0 = 😱
ramp:signal:1 = 😠 ramp-signal-1 = 😠
ramp:signal:2 = 😒 ramp-signal-2 = 😒
ramp:signal:3 = 😊 ramp-signal-3 = 😊
ramp:signal:4 = 😃 ramp-signal-4 = 😃
ramp:signal:5 = 😈 ramp-signal-5 = 😈
animation:packetloss:0 = ⚠ animation-packetloss-0 = ⚠
animation:packetloss:0:foreground = #ffa64c animation-packetloss-0-foreground = #ffa64c
animation:packetloss:1 = 📶 animation-packetloss-1 = 📶
animation:packetloss:1:foreground = #000000 animation-packetloss-1-foreground = #000000
animation:packetloss:framerate_ms = 500 animation-packetloss-framerate_ms = 500
~~~ ~~~
@ -749,9 +798,7 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
This module is still WIP. This module is still WIP.
Mute and volume changes should affect the appropriate mixers depending on TODO: Add custom format for when the headphones are plugged in.
weather the headphones are plugged in or not. Still need to add separate output formats
to indicate it.
~~~ ini ~~~ ini
[module/volume] [module/volume]
@ -772,30 +819,29 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label:volume> (default) ; <label-volume> (default)
; <ramp:volume> ; <ramp-volume>
; <bar:volume> ; <bar-volume>
format:volume = <ramp:volume> <label:volume> format-volume = <ramp-volume> <label-volume>
; Available tags: ; Available tags:
; <label:muted> (default) ; <label-muted> (default)
; <ramp:volume> ; <ramp-volume>
; <bar:volume> ; <bar-volume>
;format:muted = <label:muted> ;format-muted = <label-muted>
; Available tokens: ; Available tokens:
; %percentage% (default) ; %percentage% (default)
;label:volume = %percentage% ;label-volume = %percentage%
; Available tokens: ; Available tokens:
; %percentage% (default) ; %percentage% (default)
label:muted = 🔇 muted label-muted = 🔇 muted
label:muted:foreground = #66 label-muted-foreground = #66
; Required if <ramp:volume> is used ramp-volume-0 = 🔈
ramp:volume:0 = 🔈 ramp-volume-1 = 🔉
ramp:volume:1 = 🔉 ramp-volume-2 = 🔊
ramp:volume:2 = 🔊
~~~ ~~~
@ -804,45 +850,45 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
[module/menu-apps] [module/menu-apps]
type = custom/menu type = custom/menu
; "menu:LEVEL:N" has the same properties as "label:NAME" with ; "menu-LEVEL-N" has the same properties as "label-NAME" with
; the additional "exec" property ; the additional "exec" property
; ;
; Available exec commands: ; Available exec commands:
; menu_open:LEVEL ; menu_open-LEVEL
; menu_close ; menu_close
; Other commands will be executed using "/usr/bin/env sh -c $COMMAND" ; Other commands will be executed using "/usr/bin/env sh -c $COMMAND"
menu:0:0 = Browsers menu-0-0 = Browsers
menu:0:0:exec = menu_open:1 menu-0-0-exec = menu_open-1
menu:0:0:foreground = #fba922 menu-0-0-foreground = #fba922
menu:0:2 = Multimedia menu-0-2 = Multimedia
menu:0:2:exec = menu_open:3 menu-0-2-exec = menu_open-3
menu:0:2:foreground = #fba922 menu-0-2-foreground = #fba922
menu:1:0 = Firefox menu-1-0 = Firefox
menu:1:0:exec = firefox & menu-1-0-exec = firefox &
menu:1:0:foreground = #fba922 menu-1-0-foreground = #fba922
menu:1:1 = Chromium menu-1-1 = Chromium
menu:1:1:exec = chromium & menu-1-1-exec = chromium &
menu:1:1:foreground = #fba922 menu-1-1-foreground = #fba922
menu:2:0 = Gimp menu-2-0 = Gimp
menu:2:0:foreground = #fba922 menu-2-0-foreground = #fba922
menu:2:0:exec = gimp & menu-2-0-exec = gimp &
menu:2:1 = Scrot menu-2-1 = Scrot
menu:2:1:exec = scrot & menu-2-1-exec = scrot &
menu:2:1:foreground = #fba922 menu-2-1-foreground = #fba922
~~~ ~~~
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; Available tags: ; Available tags:
; <label:toggle> (default) - gets replaced with <label:(open|close)> ; <label-toggle> (default) - gets replaced with <label-(open|close)>
; <menu> (default) ; <menu> (default)
;format = <label:toggle> <menu> ;f-ormat = <label-toggle> <menu>
label:open = Apps label-open = Apps
label:close = x label-close = x
~~~ ~~~
@ -866,28 +912,27 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
; Available tags: ; Available tags:
; <output> (default) ; <output> (default)
;format = <output> ;format = <output>
format:background = #999 format-background = #999
format:foreground = #000 format-foreground = #000
format:padding = 4 format-padding = 4
; Available tokens: ; Available tokens:
; %counter% ; %counter%
; ;
; "click:(left|middle|right)" will be executed using "/usr/bin/env sh -c [command]" ; "click-(left|middle|right)" will be executed using "/usr/bin/env sh -c [command]"
click:left = echo left %counter% click-left = echo left %counter%
click:middle = echo middle %counter% click-middle = echo middle %counter%
click:right = echo right %counter% click-right = echo right %counter%
; Available tokens: ; Available tokens:
; %counter% ; %counter%
; ;
; "scroll:(up|down)" will be executed using "/usr/bin/env sh -c [command]" ; "scroll-(up|down)" will be executed using "/usr/bin/env sh -c [command]"
scroll:up = echo scroll up %counter% scroll-up = echo scroll up %counter%
scroll:down = echo scroll down %counter% scroll-down = echo scroll down %counter%
~~~ ~~~
##### Useful example ##### Useful example
Show title of the currently focused window. Show title of the currently focused window.
~~~ ini ~~~ ini
@ -906,19 +951,19 @@ See [the bspwm module](#user-content-dependencies) for details on `label:dimmed`
##### Extra formatting (example) ##### Extra formatting (example)
~~~ ini ~~~ ini
; "content" has the same properties as "format:NAME" ; "content" has the same properties as "format-NAME"
content:background = #000 content-background = #000
content:foreground = #fff content-foreground = #fff
content:padding = 4 content-padding = 4
; "click:(left|middle|right)" will be executed using "/usr/bin/env sh -c $COMMAND" ; "click-(left|middle|right)" will be executed using "/usr/bin/env sh -c $COMMAND"
click:left = echo left click-left = echo left
click:middle = echo middle click-middle = echo middle
click:right = echo right click-right = echo right
; "scroll:(up|down)" will be executed using "/usr/bin/env sh -c $COMMAND" ; "scroll-(up|down)" will be executed using "/usr/bin/env sh -c $COMMAND"
scroll:up = echo scroll up scroll-up = echo scroll up
scroll:down = echo scroll down scroll-down = echo scroll down
~~~ ~~~

984
config

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,12 @@
;=====================================================
;
; To learn more about how to configure Lemonbuddy
; go to https://github.com/jaagr/lemonbuddy
;
; The README contains alot of information
;
;=====================================================
[settings] [settings]
; Limit the amount of events sent to lemonbar within a set timeframe: ; Limit the amount of events sent to lemonbar within a set timeframe:
; - "Allow <throttle_limit> updates within <throttle_ms> of time" ; - "Allow <throttle_limit> updates within <throttle_ms> of time"
@ -32,43 +41,43 @@ padding_right = 1
module_margin_left = 0 module_margin_left = 0
module_margin_right = 0 module_margin_right = 0
font:0 = sans:size=8;0 font-0 = sans:size=8;0
font:1 = font awesome:size=10:weight=heavy;0 font-1 = font awesome:size=10:weight=heavy;0
modules:left = label modules-left = label
modules:right = volume cpu ram clock modules-right = volume cpu ram clock
[module/label] [module/label]
type = custom/text type = custom/text
content = Lemonbuddy example content = Lemonbuddy example
content:background = #af2031 content-background = #af2031
content:underline = #cf4253 content-underline = #cf4253
content:overline = #cf4253 content-overline = #cf4253
content:padding = 2 content-padding = 2
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
label = CPU: %percentage% label = CPU: %percentage%
format:background = #c42 format-background = #c42
format:underline = #f75 format-underline = #f75
format:overline = #f75 format-overline = #f75
format:padding = 2 format-padding = 2
[module/ram] [module/ram]
type = internal/memory type = internal/memory
label = RAM: %percentage_used% label = RAM: %percentage_used%
format:background = #42c format-background = #42c
format:underline = #75f format-underline = #75f
format:overline = #75f format-overline = #75f
format:padding = 2 format-padding = 2
[module/clock] [module/clock]
type = internal/date type = internal/date
date = %Y-%m-%d %H:%M date = %Y-%m-%d %H:%M
format:background = #493 format-background = #493
format:underline = #7a6 format-underline = #7a6
format:overline = #7a6 format-overline = #7a6
format:padding = 2 format-padding = 2
[module/volume] [module/volume]
type = internal/volume type = internal/volume
@ -76,16 +85,16 @@ type = internal/volume
;headphone_mixer = Headphone ;headphone_mixer = Headphone
;headphone_control_numid = 9 ;headphone_control_numid = 9
format:volume:background = #933484 format-volume-background = #933484
format:volume:underline = #9d6294 format-volume-underline = #9d6294
format:volume:overline = #9d6294 format-volume-overline = #9d6294
format:volume:padding = 2 format-volume-padding = 2
format:muted:background = #933484 format-muted-background = #933484
format:muted:underline = #9d6294 format-muted-underline = #9d6294
format:muted:overline = #9d6294 format-muted-overline = #9d6294
format:muted:padding = 2 format-muted-padding = 2
label:volume = Volume: %percentage% label-volume = Volume: %percentage%
label:muted = Sound is muted label-muted = Sound is muted
; vim:ft=dosini ; vim:ft=dosini

View File

@ -1,3 +1,12 @@
;=====================================================
;
; To learn more about how to configure Lemonbuddy
; go to https://github.com/jaagr/lemonbuddy
;
; The README contains alot of information
;
;=====================================================
[settings] [settings]
; Limit the amount of events sent to lemonbar within a set timeframe: ; Limit the amount of events sent to lemonbar within a set timeframe:
; - "Allow <throttle_limit> updates within <throttle_ms> of time" ; - "Allow <throttle_limit> updates within <throttle_ms> of time"
@ -6,66 +15,96 @@
;throttle_ms = 50 ;throttle_ms = 50
[bar/example] [bar/example]
width = 100% ;monitor = eDP1
height = 25
bottom = true bottom = true
dock = false dock = false
width = 100%
height = 25
;offset_x = 0
;offset_y = 0
background = #00ffffff background = #00ffffff
foreground = #fff foreground = #fff
;linecolor = #ff0000
spacing = 1
lineheight = 1 lineheight = 1
;separator = |
;locale = en_US.UTF-8
padding_left = 1 padding_left = 1
padding_right = 1 padding_right = 1
module_margin_left = 0 module_margin_left = 0
module_margin_right = 0 module_margin_right = 0
font:0 = sans:size=8;0 font-0 = sans:size=8;0
font:1 = fontawesome:size=10:weight=heavy;0 font-1 = font awesome:size=10:weight=heavy;0
modules:left = label modules-left = label
modules:center = bspwm modules-center = bspwm
modules:right = cpu ram clock modules-right = volume cpu ram clock
[module/label] [module/label]
type = custom/text type = custom/text
content = Lemonbuddy example content = Lemonbuddy example
content:background = #af2031 content-background = #af2031
content:underline = #cf4253 content-underline = #cf4253
content:overline = #cf4253 content-overline = #cf4253
content:padding = 2 content-padding = 2
[module/bspwm]
type = internal/bspwm
label:active = 
label:active:padding = 1
label:occupied = 
label:occupied:padding = 1
label:empty = 
label:empty:padding = 1
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
label = CPU: %percentage% label = CPU: %percentage%
format:background = #c42 format-background = #c42
format:underline = #f75 format-underline = #f75
format:overline = #f75 format-overline = #f75
format:padding = 2 format-padding = 2
[module/ram] [module/ram]
type = internal/memory type = internal/memory
label = RAM: %percentage_used% label = RAM: %percentage_used%
format:background = #42c format-background = #42c
format:underline = #75f format-underline = #75f
format:overline = #75f format-overline = #75f
format:padding = 2 format-padding = 2
[module/clock] [module/clock]
type = internal/date type = internal/date
date = %Y-%m-%d %H:%M date = %Y-%m-%d %H:%M
format:background = #493 format-background = #493
format:underline = #7a6 format-underline = #7a6
format:overline = #7a6 format-overline = #7a6
format:padding = 2 format-padding = 2
[module/volume]
type = internal/volume
;speaker_mixer = Speaker
;headphone_mixer = Headphone
;headphone_control_numid = 9
format-volume-background = #933484
format-volume-underline = #9d6294
format-volume-overline = #9d6294
format-volume-padding = 2
format-muted-background = #933484
format-muted-underline = #9d6294
format-muted-overline = #9d6294
format-muted-padding = 2
label-volume = Volume: %percentage%
label-muted = Sound is muted
[module/bspwm]
type = internal/bspwm
label-active = 
label-active-padding = 1
label-occupied = 
label-occupied-padding = 1
label-empty = 
label-empty-padding = 1
; vim:ft=dosini ; vim:ft=dosini

View File

@ -1,3 +1,12 @@
;=====================================================
;
; To learn more about how to configure Lemonbuddy
; go to https://github.com/jaagr/lemonbuddy
;
; The README contains alot of information
;
;=====================================================
[settings] [settings]
; Limit the amount of events sent to lemonbar within a set timeframe: ; Limit the amount of events sent to lemonbar within a set timeframe:
; - "Allow <throttle_limit> updates within <throttle_ms> of time" ; - "Allow <throttle_limit> updates within <throttle_ms> of time"
@ -6,66 +15,96 @@
;throttle_ms = 50 ;throttle_ms = 50
[bar/example] [bar/example]
width = 100% ;monitor = eDP1
height = 25
bottom = true bottom = true
dock = false dock = false
width = 100%
height = 25
;offset_x = 0
;offset_y = 0
background = #00ffffff background = #00ffffff
foreground = #fff foreground = #fff
;linecolor = #ff0000
spacing = 1
lineheight = 1 lineheight = 1
;separator = |
;locale = en_US.UTF-8
padding_left = 1 padding_left = 1
padding_right = 1 padding_right = 1
module_margin_left = 0 module_margin_left = 0
module_margin_right = 0 module_margin_right = 0
font:0 = sans:size=8;0 font-0 = sans:size=8;0
font:1 = fontawesome:size=10:weight=heavy;0 font-1 = font awesome:size=10:weight=heavy;0
modules:left = label modules-left = label
modules:center = i3 modules-center = i3
modules:right = cpu ram clock modules-right = volume cpu ram clock
[module/label] [module/label]
type = custom/text type = custom/text
content = Lemonbuddy example content = Lemonbuddy example
content:background = #af2031 content-background = #af2031
content:underline = #cf4253 content-underline = #cf4253
content:overline = #cf4253 content-overline = #cf4253
content:padding = 2 content-padding = 2
[module/i3]
type = internal/i3
label:focused = 
label:focused:padding = 1
label:unfocused = 
label:unfocused:padding = 1
label:visible = 
label:visible:padding = 1
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
label = CPU: %percentage% label = CPU: %percentage%
format:background = #c42 format-background = #c42
format:underline = #f75 format-underline = #f75
format:overline = #f75 format-overline = #f75
format:padding = 2 format-padding = 2
[module/ram] [module/ram]
type = internal/memory type = internal/memory
label = RAM: %percentage_used% label = RAM: %percentage_used%
format:background = #42c format-background = #42c
format:underline = #75f format-underline = #75f
format:overline = #75f format-overline = #75f
format:padding = 2 format-padding = 2
[module/clock] [module/clock]
type = internal/date type = internal/date
date = %Y-%m-%d %H:%M date = %Y-%m-%d %H:%M
format:background = #493 format-background = #493
format:underline = #7a6 format-underline = #7a6
format:overline = #7a6 format-overline = #7a6
format:padding = 2 format-padding = 2
[module/volume]
type = internal/volume
;speaker_mixer = Speaker
;headphone_mixer = Headphone
;headphone_control_numid = 9
format-volume-background = #933484
format-volume-underline = #9d6294
format-volume-overline = #9d6294
format-volume-padding = 2
format-muted-background = #933484
format-muted-underline = #9d6294
format-muted-overline = #9d6294
format-muted-padding = 2
label-volume = Volume: %percentage%
label-muted = Sound is muted
[module/i3]
type = internal/i3
label-focused = 
label-focused-padding = 1
label-unfocused = 
label-unfocused-padding = 1
label-visible = 
label-visible-padding = 1
; vim:ft=dosini ; vim:ft=dosini

View File

@ -87,14 +87,14 @@ class ModuleFormatter
auto format = std::make_unique<Format>(); auto format = std::make_unique<Format>();
format->value = config::get<std::string>(this->module_name, name, fallback); format->value = config::get<std::string>(this->module_name, name, fallback);
format->fg = config::get<std::string>(this->module_name, name +":foreground", ""); format->fg = config::get<std::string>(this->module_name, name +"-foreground", "");
format->bg = config::get<std::string>(this->module_name, name +":background", ""); format->bg = config::get<std::string>(this->module_name, name +"-background", "");
format->ul = config::get<std::string>(this->module_name, name +":underline", ""); format->ul = config::get<std::string>(this->module_name, name +"-underline", "");
format->ol = config::get<std::string>(this->module_name, name +":overline", ""); format->ol = config::get<std::string>(this->module_name, name +"-overline", "");
format->spacing = config::get<int>(this->module_name, name +":spacing", DEFAULT_SPACING); format->spacing = config::get<int>(this->module_name, name +"-spacing", DEFAULT_SPACING);
format->padding = config::get<int>(this->module_name, name +":padding", 0); format->padding = config::get<int>(this->module_name, name +"-padding", 0);
format->margin = config::get<int>(this->module_name, name +":margin", 0); format->margin = config::get<int>(this->module_name, name +"-margin", 0);
format->offset = config::get<int>(this->module_name, name +":offset", 0); format->offset = config::get<int>(this->module_name, name +"-offset", 0);
format->tags.swap(tags); format->tags.swap(tags);
for (auto &&tag : string::split(format->value, ' ')) { for (auto &&tag : string::split(format->value, ' ')) {

View File

@ -20,16 +20,16 @@ namespace modules
static const int STATE_FULL = 4; static const int STATE_FULL = 4;
protected: protected:
static constexpr auto FORMAT_CHARGING = "format:charging"; static constexpr auto FORMAT_CHARGING = "format-charging";
static constexpr auto FORMAT_DISCHARGING = "format:discharging"; static constexpr auto FORMAT_DISCHARGING = "format-discharging";
static constexpr auto FORMAT_FULL = "format:full"; static constexpr auto FORMAT_FULL = "format-full";
static constexpr auto TAG_ANIMATION_CHARGING = "<animation:charging>"; static constexpr auto TAG_ANIMATION_CHARGING = "<animation-charging>";
static constexpr auto TAG_BAR_CAPACITY = "<bar:capacity>"; static constexpr auto TAG_BAR_CAPACITY = "<bar-capacity>";
static constexpr auto TAG_RAMP_CAPACITY = "<ramp:capacity>"; static constexpr auto TAG_RAMP_CAPACITY = "<ramp-capacity>";
static constexpr auto TAG_LABEL_CHARGING = "<label:charging>"; static constexpr auto TAG_LABEL_CHARGING = "<label-charging>";
static constexpr auto TAG_LABEL_DISCHARGING = "<label:discharging>"; static constexpr auto TAG_LABEL_DISCHARGING = "<label-discharging>";
static constexpr auto TAG_LABEL_FULL = "<label:full>"; static constexpr auto TAG_LABEL_FULL = "<label-full>";
std::unique_ptr<drawtypes::Animation> animation_charging; std::unique_ptr<drawtypes::Animation> animation_charging;
std::unique_ptr<drawtypes::Ramp> ramp_capacity; std::unique_ptr<drawtypes::Ramp> ramp_capacity;

View File

@ -48,8 +48,8 @@ namespace modules
DefineModule(BspwmModule, EventModule) DefineModule(BspwmModule, EventModule)
{ {
static constexpr auto TAG_LABEL_STATE = "<label:state>"; static constexpr auto TAG_LABEL_STATE = "<label-state>";
static constexpr auto TAG_LABEL_MODE = "<label:mode>"; static constexpr auto TAG_LABEL_MODE = "<label-mode>";
static constexpr auto EVENT_CLICK = "bwm"; static constexpr auto EVENT_CLICK = "bwm";

View File

@ -23,9 +23,9 @@ namespace modules
DefineModule(CpuModule, TimerModule) DefineModule(CpuModule, TimerModule)
{ {
static constexpr auto TAG_LABEL = "<label>"; static constexpr auto TAG_LABEL = "<label>";
static constexpr auto TAG_BAR_LOAD = "<bar:load>"; static constexpr auto TAG_BAR_LOAD = "<bar-load>";
static constexpr auto TAG_RAMP_LOAD = "<ramp:load>"; static constexpr auto TAG_RAMP_LOAD = "<ramp-load>";
static constexpr auto TAG_RAMP_LOAD_PER_CORE = "<ramp:load_per_core>"; static constexpr auto TAG_RAMP_LOAD_PER_CORE = "<ramp-load_per_core>";
std::vector<std::unique_ptr<CpuTime>> cpu_times; std::vector<std::unique_ptr<CpuTime>> cpu_times;
std::vector<std::unique_ptr<CpuTime>> prev_cpu_times; std::vector<std::unique_ptr<CpuTime>> prev_cpu_times;

View File

@ -42,7 +42,7 @@ namespace modules
DefineModule(i3Module, EventModule) DefineModule(i3Module, EventModule)
{ {
static constexpr auto TAG_LABEL_STATE = "<label:state>"; static constexpr auto TAG_LABEL_STATE = "<label-state>";
static constexpr auto EVENT_CLICK = "i3"; static constexpr auto EVENT_CLICK = "i3";

View File

@ -12,8 +12,8 @@ namespace modules
DefineModule(MemoryModule, TimerModule) DefineModule(MemoryModule, TimerModule)
{ {
static constexpr auto TAG_LABEL = "<label>"; static constexpr auto TAG_LABEL = "<label>";
static constexpr auto TAG_BAR_USED = "<bar:used>"; static constexpr auto TAG_BAR_USED = "<bar-used>";
static constexpr auto TAG_BAR_FREE = "<bar:free>"; static constexpr auto TAG_BAR_FREE = "<bar-free>";
std::unique_ptr<drawtypes::Bar> bar_used; std::unique_ptr<drawtypes::Bar> bar_used;
std::unique_ptr<drawtypes::Bar> bar_free; std::unique_ptr<drawtypes::Bar> bar_free;

View File

@ -17,10 +17,10 @@ namespace modules
DefineModule(MenuModule, StaticModule) DefineModule(MenuModule, StaticModule)
{ {
static constexpr auto TAG_LABEL_TOGGLE = "<label:toggle>"; static constexpr auto TAG_LABEL_TOGGLE = "<label-toggle>";
static constexpr auto TAG_MENU = "<menu>"; static constexpr auto TAG_MENU = "<menu>";
static constexpr auto EVENT_MENU_OPEN = "menu_open:"; static constexpr auto EVENT_MENU_OPEN = "menu_open-";
static constexpr auto EVENT_MENU_CLOSE = "menu_close"; static constexpr auto EVENT_MENU_CLOSE = "menu_close";
std::mutex output_mtx; std::mutex output_mtx;

View File

@ -17,22 +17,22 @@ namespace modules
static const int PROGRESSBAR_THREAD_SYNC_COUNT = 10; static const int PROGRESSBAR_THREAD_SYNC_COUNT = 10;
const std::chrono::duration<double> PROGRESSBAR_THREAD_INTERVAL = 1s; const std::chrono::duration<double> PROGRESSBAR_THREAD_INTERVAL = 1s;
static constexpr auto FORMAT_ONLINE = "format:online"; static constexpr auto FORMAT_ONLINE = "format-online";
static constexpr auto TAG_BAR_PROGRESS = "<bar:progress>"; static constexpr auto TAG_BAR_PROGRESS = "<bar-progress>";
static constexpr auto TAG_TOGGLE = "<toggle>"; static constexpr auto TAG_TOGGLE = "<toggle>";
static constexpr auto TAG_LABEL_SONG = "<label:song>"; static constexpr auto TAG_LABEL_SONG = "<label-song>";
static constexpr auto TAG_LABEL_TIME = "<label:time>"; static constexpr auto TAG_LABEL_TIME = "<label-time>";
static constexpr auto TAG_ICON_RANDOM = "<icon:random>"; static constexpr auto TAG_ICON_RANDOM = "<icon-random>";
static constexpr auto TAG_ICON_REPEAT = "<icon:repeat>"; static constexpr auto TAG_ICON_REPEAT = "<icon-repeat>";
static constexpr auto TAG_ICON_REPEAT_ONE = "<icon:repeatone>"; static constexpr auto TAG_ICON_REPEAT_ONE = "<icon-repeatone>";
static constexpr auto TAG_ICON_PREV = "<icon:prev>"; static constexpr auto TAG_ICON_PREV = "<icon-prev>";
static constexpr auto TAG_ICON_STOP = "<icon:stop>"; static constexpr auto TAG_ICON_STOP = "<icon-stop>";
static constexpr auto TAG_ICON_PLAY = "<icon:play>"; static constexpr auto TAG_ICON_PLAY = "<icon-play>";
static constexpr auto TAG_ICON_PAUSE = "<icon:pause>"; static constexpr auto TAG_ICON_PAUSE = "<icon-pause>";
static constexpr auto TAG_ICON_NEXT = "<icon:next>"; static constexpr auto TAG_ICON_NEXT = "<icon-next>";
static constexpr auto FORMAT_OFFLINE = "format:offline"; static constexpr auto FORMAT_OFFLINE = "format-offline";
static constexpr auto TAG_LABEL_OFFLINE = "<label:offline>"; static constexpr auto TAG_LABEL_OFFLINE = "<label-offline>";
static constexpr auto EVENT_PLAY = "mpdplay"; static constexpr auto EVENT_PLAY = "mpdplay";
static constexpr auto EVENT_PAUSE = "mpdpause"; static constexpr auto EVENT_PAUSE = "mpdpause";

View File

@ -17,15 +17,15 @@ namespace modules
{ {
DefineModule(NetworkModule, TimerModule) DefineModule(NetworkModule, TimerModule)
{ {
static constexpr auto FORMAT_CONNECTED = "format:connected"; static constexpr auto FORMAT_CONNECTED = "format-connected";
static constexpr auto FORMAT_PACKETLOSS = "format:packetloss"; static constexpr auto FORMAT_PACKETLOSS = "format-packetloss";
static constexpr auto FORMAT_DISCONNECTED = "format:disconnected"; static constexpr auto FORMAT_DISCONNECTED = "format-disconnected";
static constexpr auto TAG_RAMP_SIGNAL = "<ramp:signal>"; static constexpr auto TAG_RAMP_SIGNAL = "<ramp-signal>";
static constexpr auto TAG_LABEL_CONNECTED = "<label:connected>"; static constexpr auto TAG_LABEL_CONNECTED = "<label-connected>";
static constexpr auto TAG_LABEL_DISCONNECTED = "<label:disconnected>"; static constexpr auto TAG_LABEL_DISCONNECTED = "<label-disconnected>";
static constexpr auto TAG_LABEL_PACKETLOSS = "<label:packetloss>"; static constexpr auto TAG_LABEL_PACKETLOSS = "<label-packetloss>";
static constexpr auto TAG_ANIMATION_PACKETLOSS = "<animation:packetloss>"; static constexpr auto TAG_ANIMATION_PACKETLOSS = "<animation-packetloss>";
std::unique_ptr<net::WiredNetwork> wired_network; std::unique_ptr<net::WiredNetwork> wired_network;
std::unique_ptr<net::WirelessNetwork> wireless_network; std::unique_ptr<net::WirelessNetwork> wireless_network;

View File

@ -19,7 +19,7 @@ namespace modules
DefineModule(TorrentModule, InotifyModule) DefineModule(TorrentModule, InotifyModule)
{ {
static constexpr auto TAG_LABEL = "<label>"; static constexpr auto TAG_LABEL = "<label>";
static constexpr auto TAG_BAR_PROGRESS = "<bar:progress>"; static constexpr auto TAG_BAR_PROGRESS = "<bar-progress>";
std::vector<std::unique_ptr<Torrent>> torrents; std::vector<std::unique_ptr<Torrent>> torrents;
std::unique_ptr<drawtypes::Label> label; std::unique_ptr<drawtypes::Label> label;

View File

@ -11,13 +11,13 @@ namespace modules
{ {
DefineModule(VolumeModule, EventModule) DefineModule(VolumeModule, EventModule)
{ {
static constexpr auto FORMAT_VOLUME = "format:volume"; static constexpr auto FORMAT_VOLUME = "format-volume";
static constexpr auto FORMAT_MUTED = "format:muted"; static constexpr auto FORMAT_MUTED = "format-muted";
static constexpr auto TAG_RAMP_VOLUME = "<ramp:volume>"; static constexpr auto TAG_RAMP_VOLUME = "<ramp-volume>";
static constexpr auto TAG_BAR_VOLUME = "<bar:volume>"; static constexpr auto TAG_BAR_VOLUME = "<bar-volume>";
static constexpr auto TAG_LABEL_VOLUME = "<label:volume>"; static constexpr auto TAG_LABEL_VOLUME = "<label-volume>";
static constexpr auto TAG_LABEL_MUTED = "<label:muted>"; static constexpr auto TAG_LABEL_MUTED = "<label-muted>";
static constexpr auto EVENT_PREFIX = "vol"; static constexpr auto EVENT_PREFIX = "vol";
static constexpr auto EVENT_VOLUME_UP = "volup"; static constexpr auto EVENT_VOLUME_UP = "volup";

View File

@ -94,13 +94,13 @@ namespace config
std::vector<T> vec; std::vector<T> vec;
boost::optional<T> value; boost::optional<T> value;
while ((value = get_tree().get_optional<T>(build_path(section, key) + ":"+ std::to_string(vec.size()))) != boost::none) { while ((value = get_tree().get_optional<T>(build_path(section, key) + "-"+ std::to_string(vec.size()))) != boost::none) {
auto str_val = get_tree().get<std::string>(build_path(section, key) + ":"+ std::to_string(vec.size())); auto str_val = get_tree().get<std::string>(build_path(section, key) + "-"+ std::to_string(vec.size()));
vec.emplace_back(dereference_var<T>(section, key, str_val, value.get())); vec.emplace_back(dereference_var<T>(section, key, str_val, value.get()));
} }
if (vec.empty()) if (vec.empty())
throw MissingListValueException("Missing property \""+ key + ":0\" in section ["+ section +"]"); throw MissingListValueException("Missing property \""+ key + "-0\" in section ["+ section +"]");
return vec; return vec;
} }
@ -113,8 +113,8 @@ namespace config
std::vector<T> vec; std::vector<T> vec;
boost::optional<T> value; boost::optional<T> value;
while ((value = get_tree().get_optional<T>(build_path(section, key) + ":"+ std::to_string(vec.size()))) != boost::none) { while ((value = get_tree().get_optional<T>(build_path(section, key) + "-"+ std::to_string(vec.size()))) != boost::none) {
auto str_val = get_tree().get<std::string>(build_path(section, key) + ":"+ std::to_string(vec.size())); auto str_val = get_tree().get<std::string>(build_path(section, key) + "-"+ std::to_string(vec.size()));
vec.emplace_back(dereference_var<T>(section, key, str_val, value.get())); vec.emplace_back(dereference_var<T>(section, key, str_val, value.get()));
} }

View File

@ -189,9 +189,9 @@ void Bar::load()
} }
}; };
add_modules(config::get<std::string>(this->config_path, "modules:left", ""), this->mod_left); add_modules(config::get<std::string>(this->config_path, "modules-left", ""), this->mod_left);
add_modules(config::get<std::string>(this->config_path, "modules:center", ""), this->mod_center); add_modules(config::get<std::string>(this->config_path, "modules-center", ""), this->mod_center);
add_modules(config::get<std::string>(this->config_path, "modules:right", ""), this->mod_right); add_modules(config::get<std::string>(this->config_path, "modules-right", ""), this->mod_right);
if (this->mod_left.empty() && this->mod_center.empty() && this->mod_right.empty()) if (this->mod_left.empty() && this->mod_center.empty() && this->mod_right.empty())
throw ConfigurationError("The bar does not contain any modules..."); throw ConfigurationError("The bar does not contain any modules...");

View File

@ -21,11 +21,11 @@ namespace drawtypes
repeat(n_frames) repeat(n_frames)
{ {
auto anim = animation_name +":"+ std::to_string(repeat_i_rev(n_frames)); auto anim = animation_name +"-"+ std::to_string(repeat_i_rev(n_frames));
vec.emplace_back(std::unique_ptr<Icon> { get_optional_config_icon(config_path, anim, frames[n_frames - repeat_i - 1]) }); vec.emplace_back(std::unique_ptr<Icon> { get_optional_config_icon(config_path, anim, frames[n_frames - repeat_i - 1]) });
} }
auto framerate = config::get<int>(config_path, animation_name +":framerate_ms", 1000); auto framerate = config::get<int>(config_path, animation_name +"-framerate_ms", 1000);
return std::unique_ptr<Animation> { new Animation(std::move(vec), framerate) }; return std::unique_ptr<Animation> { new Animation(std::move(vec), framerate) };
} }

View File

@ -11,19 +11,19 @@ namespace drawtypes
{ {
std::unique_ptr<Bar> bar; std::unique_ptr<Bar> bar;
auto width = config::get<int>(config_path, bar_name +":width"); auto width = config::get<int>(config_path, bar_name +"-width");
auto format = config::get<std::string>(config_path, bar_name +":format", "%fill%%indicator%%empty%"); auto format = config::get<std::string>(config_path, bar_name +"-format", "%fill%%indicator%%empty%");
if (format.empty()) if (format.empty())
bar = std::make_unique<Bar>(width, lazy_builder_closing); bar = std::make_unique<Bar>(width, lazy_builder_closing);
else else
bar = std::make_unique<Bar>(width, format, lazy_builder_closing); bar = std::make_unique<Bar>(width, format, lazy_builder_closing);
bar->set_gradient(config::get<bool>(config_path, bar_name +":gradient", true)); bar->set_gradient(config::get<bool>(config_path, bar_name +"-gradient", true));
bar->set_colors(config::get_list<std::string>(config_path, bar_name +":foreground", {})); bar->set_colors(config::get_list<std::string>(config_path, bar_name +"-foreground", {}));
bar->set_indicator(get_config_icon(config_path, bar_name +":indicator", format.find("%indicator%") != std::string::npos, "")); bar->set_indicator(get_config_icon(config_path, bar_name +"-indicator", format.find("%indicator%") != std::string::npos, ""));
bar->set_fill(get_config_icon(config_path, bar_name +":fill", format.find("%fill%") != std::string::npos, "")); bar->set_fill(get_config_icon(config_path, bar_name +"-fill", format.find("%fill%") != std::string::npos, ""));
bar->set_empty(get_config_icon(config_path, bar_name +":empty", format.find("%empty%") != std::string::npos, "")); bar->set_empty(get_config_icon(config_path, bar_name +"-empty", format.find("%empty%") != std::string::npos, ""));
return bar; return bar;
} }

View File

@ -31,13 +31,13 @@ namespace drawtypes
label = config::get<std::string>(config_path, label_name, def); label = config::get<std::string>(config_path, label_name, def);
return std::unique_ptr<Label> { new Label(label, return std::unique_ptr<Label> { new Label(label,
config::get<std::string>(config_path, label_name +":foreground", ""), config::get<std::string>(config_path, label_name +"-foreground", ""),
config::get<std::string>(config_path, label_name +":background", ""), config::get<std::string>(config_path, label_name +"-background", ""),
config::get<std::string>(config_path, label_name +":underline", ""), config::get<std::string>(config_path, label_name +"-underline", ""),
config::get<std::string>(config_path, label_name +":overline", ""), config::get<std::string>(config_path, label_name +"-overline", ""),
config::get<int>(config_path, label_name +":font", 0), config::get<int>(config_path, label_name +"-font", 0),
config::get<int>(config_path, label_name +":padding", 0), config::get<int>(config_path, label_name +"-padding", 0),
config::get<int>(config_path, label_name +":margin", 0)) }; config::get<int>(config_path, label_name +"-margin", 0)) };
} }
std::unique_ptr<Label> get_optional_config_label(const std::string& config_path, const std::string& label_name, const std::string& def) { std::unique_ptr<Label> get_optional_config_label(const std::string& config_path, const std::string& label_name, const std::string& def) {

View File

@ -17,7 +17,7 @@ namespace drawtypes
auto n_icons = icons.size(); auto n_icons = icons.size();
repeat(n_icons) repeat(n_icons)
{ {
auto ramp = ramp_name +":"+ std::to_string(repeat_i_rev(n_icons)); auto ramp = ramp_name +"-"+ std::to_string(repeat_i_rev(n_icons));
vec.emplace_back(std::unique_ptr<Icon> { get_optional_config_icon(config_path, ramp, icons[repeat_i_rev(n_icons)]) }); vec.emplace_back(std::unique_ptr<Icon> { get_optional_config_icon(config_path, ramp, icons[repeat_i_rev(n_icons)]) });
} }

View File

@ -14,7 +14,7 @@
using namespace modules; using namespace modules;
using namespace Bspwm; using namespace Bspwm;
#define DEFAULT_WS_ICON "workspace_icon:default" #define DEFAULT_WS_ICON "workspace_icon-default"
#define DEFAULT_WS_LABEL "%icon% %name%" #define DEFAULT_WS_LABEL "%icon% %name%"
BspwmModule::BspwmModule(const std::string& name_, const std::string& monitor) BspwmModule::BspwmModule(const std::string& name_, const std::string& monitor)
@ -23,21 +23,21 @@ BspwmModule::BspwmModule(const std::string& name_, const std::string& monitor)
this->formatter->add(DEFAULT_FORMAT, TAG_LABEL_STATE, { TAG_LABEL_STATE }, { TAG_LABEL_MODE }); this->formatter->add(DEFAULT_FORMAT, TAG_LABEL_STATE, { TAG_LABEL_STATE }, { TAG_LABEL_MODE });
if (this->formatter->has(TAG_LABEL_STATE)) { if (this->formatter->has(TAG_LABEL_STATE)) {
this->state_labels.insert(std::make_pair(WORKSPACE_ACTIVE, drawtypes::get_optional_config_label(name(), "label:active", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(WORKSPACE_ACTIVE, drawtypes::get_optional_config_label(name(), "label-active", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(WORKSPACE_OCCUPIED, drawtypes::get_optional_config_label(name(), "label:occupied", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(WORKSPACE_OCCUPIED, drawtypes::get_optional_config_label(name(), "label-occupied", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(WORKSPACE_URGENT, drawtypes::get_optional_config_label(name(), "label:urgent", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(WORKSPACE_URGENT, drawtypes::get_optional_config_label(name(), "label-urgent", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(WORKSPACE_EMPTY, drawtypes::get_optional_config_label(name(), "label:empty", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(WORKSPACE_EMPTY, drawtypes::get_optional_config_label(name(), "label-empty", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(WORKSPACE_DIMMED, drawtypes::get_optional_config_label(name(), "label:dimmed"))); this->state_labels.insert(std::make_pair(WORKSPACE_DIMMED, drawtypes::get_optional_config_label(name(), "label-dimmed")));
} }
if (this->formatter->has(TAG_LABEL_MODE)) { if (this->formatter->has(TAG_LABEL_MODE)) {
this->mode_labels.insert(std::make_pair(MODE_LAYOUT_MONOCLE, drawtypes::get_optional_config_label(name(), "label:monocle"))); this->mode_labels.insert(std::make_pair(MODE_LAYOUT_MONOCLE, drawtypes::get_optional_config_label(name(), "label-monocle")));
this->mode_labels.insert(std::make_pair(MODE_LAYOUT_TILED, drawtypes::get_optional_config_label(name(), "label:tiled"))); this->mode_labels.insert(std::make_pair(MODE_LAYOUT_TILED, drawtypes::get_optional_config_label(name(), "label-tiled")));
this->mode_labels.insert(std::make_pair(MODE_STATE_FULLSCREEN, drawtypes::get_optional_config_label(name(), "label:fullscreen"))); this->mode_labels.insert(std::make_pair(MODE_STATE_FULLSCREEN, drawtypes::get_optional_config_label(name(), "label-fullscreen")));
this->mode_labels.insert(std::make_pair(MODE_STATE_FLOATING, drawtypes::get_optional_config_label(name(), "label:floating"))); this->mode_labels.insert(std::make_pair(MODE_STATE_FLOATING, drawtypes::get_optional_config_label(name(), "label-floating")));
this->mode_labels.insert(std::make_pair(MODE_NODE_LOCKED, drawtypes::get_optional_config_label(name(), "label:locked"))); this->mode_labels.insert(std::make_pair(MODE_NODE_LOCKED, drawtypes::get_optional_config_label(name(), "label-locked")));
this->mode_labels.insert(std::make_pair(MODE_NODE_STICKY, drawtypes::get_optional_config_label(name(), "label:sticky"))); this->mode_labels.insert(std::make_pair(MODE_NODE_STICKY, drawtypes::get_optional_config_label(name(), "label-sticky")));
this->mode_labels.insert(std::make_pair(MODE_NODE_PRIVATE, drawtypes::get_optional_config_label(name(), "label:private"))); this->mode_labels.insert(std::make_pair(MODE_NODE_PRIVATE, drawtypes::get_optional_config_label(name(), "label-private")));
} }
this->icons = std::make_unique<drawtypes::IconMap>(); this->icons = std::make_unique<drawtypes::IconMap>();

View File

@ -16,7 +16,7 @@
using namespace modules; using namespace modules;
#define DEFAULT_WS_ICON "workspace_icon:default" #define DEFAULT_WS_ICON "workspace_icon-default"
#define DEFAULT_WS_LABEL "%icon% %name%" #define DEFAULT_WS_LABEL "%icon% %name%"
// TODO: Needs more testing // TODO: Needs more testing
@ -40,11 +40,11 @@ i3Module::i3Module(const std::string& name_, const std::string& monitor) : Event
this->formatter->add(DEFAULT_FORMAT, TAG_LABEL_STATE, { TAG_LABEL_STATE }); this->formatter->add(DEFAULT_FORMAT, TAG_LABEL_STATE, { TAG_LABEL_STATE });
if (this->formatter->has(TAG_LABEL_STATE)) { if (this->formatter->has(TAG_LABEL_STATE)) {
this->state_labels.insert(std::make_pair(i3::WORKSPACE_FOCUSED, drawtypes::get_optional_config_label(name(), "label:focused", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(i3::WORKSPACE_FOCUSED, drawtypes::get_optional_config_label(name(), "label-focused", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(i3::WORKSPACE_UNFOCUSED, drawtypes::get_optional_config_label(name(), "label:unfocused", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(i3::WORKSPACE_UNFOCUSED, drawtypes::get_optional_config_label(name(), "label-unfocused", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(i3::WORKSPACE_VISIBLE, drawtypes::get_optional_config_label(name(), "label:visible", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(i3::WORKSPACE_VISIBLE, drawtypes::get_optional_config_label(name(), "label-visible", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(i3::WORKSPACE_URGENT, drawtypes::get_optional_config_label(name(), "label:urgent", DEFAULT_WS_LABEL))); this->state_labels.insert(std::make_pair(i3::WORKSPACE_URGENT, drawtypes::get_optional_config_label(name(), "label-urgent", DEFAULT_WS_LABEL)));
this->state_labels.insert(std::make_pair(i3::WORKSPACE_DIMMED, drawtypes::get_optional_config_label(name(), "label:dimmed"))); this->state_labels.insert(std::make_pair(i3::WORKSPACE_DIMMED, drawtypes::get_optional_config_label(name(), "label-dimmed")));
} }
this->icons = std::make_unique<drawtypes::IconMap>(); this->icons = std::make_unique<drawtypes::IconMap>();

View File

@ -12,17 +12,17 @@ MenuModule::MenuModule(const std::string& name_) : StaticModule(name_)
this->formatter->add(DEFAULT_FORMAT, default_format_string, { TAG_LABEL_TOGGLE, TAG_MENU }); this->formatter->add(DEFAULT_FORMAT, default_format_string, { TAG_LABEL_TOGGLE, TAG_MENU });
if (this->formatter->has(TAG_LABEL_TOGGLE)) { if (this->formatter->has(TAG_LABEL_TOGGLE)) {
this->label_open = drawtypes::get_config_label(name(), "label:open"); this->label_open = drawtypes::get_config_label(name(), "label-open");
this->label_close = drawtypes::get_optional_config_label(name(), "label:close", "x"); this->label_close = drawtypes::get_optional_config_label(name(), "label-close", "x");
} }
if (this->formatter->has(TAG_MENU)) { if (this->formatter->has(TAG_MENU)) {
int level_n = 0; int level_n = 0;
while (true) { while (true) {
auto level_path = "menu:"+ std::to_string(level_n); auto level_path = "menu-"+ std::to_string(level_n);
if (config::get<std::string>(name(), level_path +":0", "") == "") if (config::get<std::string>(name(), level_path +"-0", "") == "")
break; break;
this->levels.emplace_back(std::make_unique<MenuTree>()); this->levels.emplace_back(std::make_unique<MenuTree>());
@ -30,7 +30,7 @@ MenuModule::MenuModule(const std::string& name_) : StaticModule(name_)
int item_n = 0; int item_n = 0;
while (true) { while (true) {
auto item_path = level_path +":"+ std::to_string(item_n); auto item_path = level_path +"-"+ std::to_string(item_n);
if (config::get<std::string>(name(), item_path, "") == "") if (config::get<std::string>(name(), item_path, "") == "")
break; break;
@ -38,7 +38,7 @@ MenuModule::MenuModule(const std::string& name_) : StaticModule(name_)
auto item = std::make_unique<MenuTreeItem>(); auto item = std::make_unique<MenuTreeItem>();
item->label = drawtypes::get_config_label(name(), item_path); item->label = drawtypes::get_config_label(name(), item_path);
item->exec = config::get<std::string>(name(), item_path +":exec", EVENT_MENU_CLOSE); item->exec = config::get<std::string>(name(), item_path +"-exec", EVENT_MENU_CLOSE);
this->levels.back()->items.emplace_back(std::move(item)); this->levels.back()->items.emplace_back(std::move(item));

View File

@ -52,8 +52,8 @@ MpdModule::MpdModule(const std::string& name_)
this->label_time_tokenized = this->label_time->clone(); this->label_time_tokenized = this->label_time->clone();
} }
if (this->formatter->has(TAG_ICON_RANDOM) || this->formatter->has(TAG_ICON_REPEAT) || this->formatter->has(TAG_ICON_REPEAT_ONE)) { if (this->formatter->has(TAG_ICON_RANDOM) || this->formatter->has(TAG_ICON_REPEAT) || this->formatter->has(TAG_ICON_REPEAT_ONE)) {
this->toggle_on_color = config::get<std::string>(name(), "toggle_on:foreground", ""); this->toggle_on_color = config::get<std::string>(name(), "toggle_on-foreground", "");
this->toggle_off_color = config::get<std::string>(name(), "toggle_off:foreground", ""); this->toggle_off_color = config::get<std::string>(name(), "toggle_off-foreground", "");
} }
if (this->formatter->has(TAG_LABEL_OFFLINE, FORMAT_OFFLINE)) if (this->formatter->has(TAG_LABEL_OFFLINE, FORMAT_OFFLINE))
this->label_offline = drawtypes::get_config_label(name(), get_tag_name(TAG_LABEL_OFFLINE)); this->label_offline = drawtypes::get_config_label(name(), get_tag_name(TAG_LABEL_OFFLINE));

View File

@ -14,12 +14,12 @@ ScriptModule::ScriptModule(const std::string& name_)
this->interval = std::chrono::duration<double>( this->interval = std::chrono::duration<double>(
config::get<float>(name(), "interval", 1)); config::get<float>(name(), "interval", 1));
this->click_left = config::get<std::string>(name(), "click:left", ""); this->click_left = config::get<std::string>(name(), "click-left", "");
this->click_middle = config::get<std::string>(name(), "click:middle", ""); this->click_middle = config::get<std::string>(name(), "click-middle", "");
this->click_right = config::get<std::string>(name(), "click:right", ""); this->click_right = config::get<std::string>(name(), "click-right", "");
this->scroll_up = config::get<std::string>(name(), "scroll:up", ""); this->scroll_up = config::get<std::string>(name(), "scroll-up", "");
this->scroll_down = config::get<std::string>(name(), "scroll:down", ""); this->scroll_down = config::get<std::string>(name(), "scroll-down", "");
this->formatter->add(DEFAULT_FORMAT, TAG_OUTPUT, { TAG_OUTPUT }); this->formatter->add(DEFAULT_FORMAT, TAG_OUTPUT, { TAG_OUTPUT });
} }

View File

@ -17,12 +17,12 @@ std::string TextModule::get_format() {
std::string TextModule::get_output() std::string TextModule::get_output()
{ {
auto click_left = config::get<std::string>(name(), "click:left", ""); auto click_left = config::get<std::string>(name(), "click-left", "");
auto click_middle = config::get<std::string>(name(), "click:middle", ""); auto click_middle = config::get<std::string>(name(), "click-middle", "");
auto click_right = config::get<std::string>(name(), "click:right", ""); auto click_right = config::get<std::string>(name(), "click-right", "");
auto scroll_up = config::get<std::string>(name(), "scroll:up", ""); auto scroll_up = config::get<std::string>(name(), "scroll-up", "");
auto scroll_down = config::get<std::string>(name(), "scroll:down", ""); auto scroll_down = config::get<std::string>(name(), "scroll-down", "");
if (!click_left.empty()) if (!click_left.empty())
this->builder->cmd(Cmd::LEFT_CLICK, click_left); this->builder->cmd(Cmd::LEFT_CLICK, click_left);