cleanup example

This commit is contained in:
elkowar 2021-08-17 12:02:29 +02:00
parent 7abf38cbfc
commit 1e1c0fcce3
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
2 changed files with 10 additions and 22 deletions

View file

@ -3,13 +3,13 @@
} }
//Global Styles //Global Styles
window { .bar {
background-color: #3a3a3a; background-color: #3a3a3a;
color: #b0b4bc; color: #b0b4bc;
font-family: CascadiaCode; padding: 10px;
} }
// Styles on classes (see eww.xml for more information) // Styles on classes (see eww.yuck for more information)
.sidestuff slider { .sidestuff slider {
all: unset; all: unset;
@ -49,11 +49,7 @@ window {
.label-ram { .label-ram {
font-size: large; font-size: large;
} }
.time {
padding-right: 10px;
}
.workspaces button:hover { .workspaces button:hover {
color: #D35D6E; color: #D35D6E;
} }

View file

@ -1,5 +1,5 @@
(defwidget bar [] (defwidget bar []
(box :orientation "h" :hexpand true (centerbox :orientation "h"
(workspaces) (workspaces)
(music) (music)
(sidestuff))) (sidestuff)))
@ -8,13 +8,14 @@
(box :class "sidestuff" :orientation "h" :space-evenly false :halign "end" (box :class "sidestuff" :orientation "h" :space-evenly false :halign "end"
(slider-vol) (slider-vol)
(slider-ram) (slider-ram)
(time))) time))
(defwidget workspaces [] (defwidget workspaces []
(box :class "workspaces" (box :class "workspaces"
:orientation "h" :orientation "h"
:space-evenly true :space-evenly true
:halign "start" :halign "start"
:spacing 10
(button :onclick "wmctrl -s 0" 1) (button :onclick "wmctrl -s 0" 1)
(button :onclick "wmctrl -s 1" 2) (button :onclick "wmctrl -s 1" 2)
(button :onclick "wmctrl -s 2" 3) (button :onclick "wmctrl -s 2" 3)
@ -27,12 +28,12 @@
(defwidget music [] (defwidget music []
(box :class "music" :orientation "h" :space-evenly false :halign "center" (box :class "music" :orientation "h" :space-evenly false :halign "center"
'${music}')) '🎵${music}'))
(defwidget slider-vol [] (defwidget slider-vol []
(box :class "slider-vol" :orientation "h" :space-evenly "false" (box :class "slider-vol" :orientation "h" :space-evenly "false"
(box :class "label-vol" "" (box :class "label-vol" "🔊"
(scale :min 0 :max 101 :value volume :onchange "amixer -D pulse sset Master \{}%")))) (scale :min 0 :max 101 :value volume :onchange "amixer -D pulse sset Master {}%"))))
(defwidget slider-ram [] (defwidget slider-ram []
(box :orientation "h" :class "slider-ram" :space-evenly false (box :orientation "h" :class "slider-ram" :space-evenly false
@ -41,21 +42,12 @@
(defwidget time []
(box :class "time"
"${hour}:${min} ${month} ${number_day}, ${year_full}"))
(defpoll music :interval "5s" "playerctl metadata --format '{{ artist }} - {{ title }}' || true") (defpoll music :interval "5s" "playerctl metadata --format '{{ artist }} - {{ title }}' || true")
(defpoll volume :interval "1s" "scripts/getvol") (defpoll volume :interval "1s" "scripts/getvol")
(defpoll number_day :interval "5h" "date '+%d'") (defpoll time :interval "10s" "date '+%H:%M %b %d, %Y'")
(defpoll month :interval "10h" "date '+%b'")
(defpoll min :interval "10s" "date '+%M'")
(defpoll hour :interval "1m" "date '+%H'")
(defpoll year_full :interval "15h" "date '+%Y'")
(deflisten battery-remaining "tail -f /sys/class/power_supply/BAT0/capacity")
(defwindow bar (defwindow bar
:monitor 0 :monitor 0