Clean up example bar

This commit is contained in:
elkowar 2021-08-18 16:21:04 +02:00
parent b8877c5dc0
commit f83ad913be
No known key found for this signature in database
GPG Key ID: E321AD71B1D1F27F
5 changed files with 36 additions and 22 deletions

View File

@ -15,7 +15,7 @@ YUCK IS ALIVE! After months of waiting, the new configuration language has now b
This also means that XML is no longer supported from this point onwards.
If you want to keep using the latest releases of eww, you'll need to migrate your config over to yuck.
The steps to migrate can be found in [the migration guide](YUCK_MIGRATION.md)
The steps to migrate can be found in [the migration guide](YUCK_MIGRATION.md).
Additionally, a couple _amazing_ people have started to work on an
[automatic converter](https://github.com/undefinedDarkness/ewwxml) that can turn your old eww.xml into the new yuck format!

View File

@ -19,7 +19,7 @@ The fields and structure of the `defwindow` block as been adjusted to better ref
the options provided by the displayserver that is being used.
The major changes are:
- The `screen` field is now called `monitor`
- `reserve` and `geometry` are now structured slightly differently
- `reserve` and `geometry` are now structured slightly differently (see [here](./docs/src/configuration.md#creating-your-first-window))
To see how exactly the configuration now looks, check the [respective documentation](./docs/src/configuration.md#creating-your-first-window)

View File

@ -141,7 +141,7 @@ impl SimplExpr {
SimplExpr::Concat(span, elems) => {
let mut output = String::new();
for elem in elems {
let result = dbg!(elem.eval(values))?;
let result = elem.eval(values)?;
output.push_str(&result.0);
}
Ok(DynVal(output, *span))

View File

@ -16,13 +16,13 @@
color: #ffd5cd;
}
.slider-vol scale trough highlight {
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.slider-vol scale trough {
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;
@ -31,13 +31,13 @@
margin-left: 10px;
margin-right: 20px;
}
.slider-ram scale trough highlight {
.metric scale trough highlight {
all: unset;
background-color: #D35D6E;
color: #000000;
border-radius: 10px;
}
.slider-ram scale trough {
.metric scale trough {
all: unset;
background-color: #4e4e4e;
border-radius: 50px;

View File

@ -6,8 +6,15 @@
(defwidget sidestuff []
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(slider-vol)
(slider-ram)
(metric :label "🔊"
:value volume
:onchange "amixer -D pulse sset Master {}%")
(metric :label ""
:value EWW_RAM
:onchange "")
(metric :label "💾"
:value {round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}
:onchange "")
time))
(defwidget workspaces []
@ -27,27 +34,34 @@
(button :onclick "wmctrl -s 8" 9)))
(defwidget music []
(box :class "music" :orientation "h" :space-evenly false :halign "center"
(box :class "music"
:orientation "h"
:space-evenly false
:halign "center"
'🎵${music}'))
(defwidget slider-vol []
(box :class "slider-vol" :orientation "h" :space-evenly "false"
(box :class "label-vol" "🔊"
(scale :min 0 :max 101 :value volume :onchange "amixer -D pulse sset Master {}%"))))
(defwidget slider-ram []
(box :orientation "h" :class "slider-ram" :space-evenly false
(box :class "label-ram" ""
(scale :min 0 :max 101 :active false :value EWW_RAM))))
(defwidget metric [label value onchange]
(box :orientation "h"
:class "metric"
:space-evenly false
(box :class "label" label)
(scale :min 0
:max 101
:active {onchange != ""}
:value value
:onchange onchange)))
(defpoll music :interval "5s"
"playerctl metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s"
"scripts/getvol")
(defpoll music :interval "5s" "playerctl metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s" "scripts/getvol")
(defpoll time :interval "10s" "date '+%H:%M %b %d, %Y'")
(defpoll time :interval "10s"
"date '+%H:%M %b %d, %Y'")
(defwindow bar
:monitor 0