add eww config
This commit is contained in:
260
.config/eww/eww.yuck
Normal file
260
.config/eww/eww.yuck
Normal file
@@ -0,0 +1,260 @@
|
||||
; https://github.com/trapano-monogamo/my_eww_bar/blob/master/eww-bar/eww.yuck
|
||||
; https://github.com/natperron/dotfiles/tree/main/.config/eww
|
||||
; https://github.com/Aylur/dotfiles/tree/eww/.config/eww
|
||||
; https://github.com/gh0stzk/dotfiles/blob/master/config/bspwm/eww/calendar/calendar.yuck
|
||||
|
||||
(defvar output "DP-0")
|
||||
(defvar workspaces "[]")
|
||||
(defpoll datetime
|
||||
:interval "1s"
|
||||
:initial "{\"weekday\": \"\", \"date\": \"\", \"time\": \"\"}"
|
||||
`date +'{\"weekday\": \"%a\", \"date\": \"%d.%b\", \"time\": \"%H:%M\"}'`
|
||||
)
|
||||
(defvar show-date false)
|
||||
(defpoll volume
|
||||
:interval "1s"
|
||||
:initial "0"
|
||||
`~/.config/eww/get-volume`
|
||||
)
|
||||
(defpoll mute
|
||||
:interval "1s"
|
||||
:initial false
|
||||
`~/.config/eww/get-mute`
|
||||
)
|
||||
(defpoll mpd-status
|
||||
:interval "1s"
|
||||
:initial "{}"
|
||||
`~/.config/eww/mpd-status`
|
||||
)
|
||||
(deflisten active-window
|
||||
:initial ""
|
||||
`~/.config/eww/active-window`
|
||||
)
|
||||
(defpoll pulse-sinks
|
||||
:interval "1s"
|
||||
:initial "[]"
|
||||
`~/.config/eww/list-sinks`
|
||||
)
|
||||
(defvar dummy "")
|
||||
|
||||
(defwindow primary
|
||||
:monitor "DP-0"
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
:geometry (geometry :width "100%" :anchor "top center")
|
||||
:reserve (struts :side "top" :distance "10%")
|
||||
(primary_bar)
|
||||
)
|
||||
|
||||
(defwindow secondary
|
||||
:monitor "HDMI-0"
|
||||
:windowtype "dock"
|
||||
:wm-ignore false
|
||||
:geometry (geometry :width "100%" :anchor "top center")
|
||||
:reserve (struts :side "top" :distance "10%")
|
||||
(secondary_bar)
|
||||
)
|
||||
|
||||
(defwidget primary_bar []
|
||||
(centerbox
|
||||
:class "bar bar-primary"
|
||||
:orientation "horizontal"
|
||||
:hexpand false
|
||||
(left :monitor "DP-0")
|
||||
(center)
|
||||
(right :monitor "DP-0")
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget secondary_bar []
|
||||
(centerbox
|
||||
:class "bar bar-secondary"
|
||||
:orientation "horizontal"
|
||||
:hexpand false
|
||||
(left :monitor "HDMI-0")
|
||||
(center)
|
||||
(right :monitor "HDMI-0")
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget left [monitor]
|
||||
(box
|
||||
:spacing 20
|
||||
:space-evenly false
|
||||
(workspaces :monitor monitor)
|
||||
(label :text dummy)
|
||||
; (active-window :monitor monitor)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget workspaces [monitor]
|
||||
(box
|
||||
:class "workspaces"
|
||||
:space-evenly false
|
||||
(for workspace in workspaces
|
||||
(eventbox
|
||||
:cursor "pointer"
|
||||
:visible {workspace.output == monitor}
|
||||
(button
|
||||
:class "${workspace.focused ? "active" : ""} ${workspace.visible ? "visible" : ""}"
|
||||
:onclick "i3-msg workspace ${workspace.name}"
|
||||
"${workspace.name}"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget active-window [monitor]
|
||||
(box
|
||||
:class "active-window"
|
||||
(label :text "${active-window}")
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget center []
|
||||
(box
|
||||
:spacing 20
|
||||
:space-evenly false
|
||||
(player)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget player []
|
||||
(box
|
||||
:visible {mpd-status.status != "[empty]"}
|
||||
:class "player"
|
||||
:spacing 6
|
||||
:space-evenly false
|
||||
(label :text "${mpd-status.song} (${mpd-status.artist})" )
|
||||
(box
|
||||
(button
|
||||
:onclick "mpc prev"
|
||||
""
|
||||
)
|
||||
(button
|
||||
:class "play"
|
||||
:onclick "mpc toggle"
|
||||
"${mpd-status.status == "[playing]" ? "" : ""}"
|
||||
)
|
||||
(button
|
||||
:onclick "mpc next"
|
||||
""
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget metric [class label value tooltip]
|
||||
(box
|
||||
:orientation "h"
|
||||
:class "metric ${class}"
|
||||
:space-evenly false
|
||||
:tooltip tooltip
|
||||
(box :width 16 label)
|
||||
(progress :value value)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget right [monitor]
|
||||
(box
|
||||
:halign "end"
|
||||
:spacing 20
|
||||
:space-evenly false
|
||||
(metric
|
||||
:class "disk"
|
||||
:label ""
|
||||
:value { EWW_DISK["/"].used_perc }
|
||||
:tooltip "${ round(EWW_DISK["/"].free / 1024 / 1024 / 1024, 2) } GiB frei")
|
||||
(metric
|
||||
:class "memory"
|
||||
:label ""
|
||||
:value { EWW_RAM.used_mem_perc }
|
||||
:tooltip "${ round(EWW_RAM.free_mem / 1024 / 1024 / 1024, 2) } GiB frei")
|
||||
(metric
|
||||
:class "cpu"
|
||||
:label ""
|
||||
:value { EWW_CPU.avg }
|
||||
:tooltip "${ round(EWW_CPU.avg, 2) }% benutzt")
|
||||
(sound)
|
||||
(systray
|
||||
:spacing 4
|
||||
:icon-size 20)
|
||||
(time)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget revealer-on-hover [var varname ?class ?duration ?transition]
|
||||
(box :class "${class} revealer-on-hover"
|
||||
:orientation "h"
|
||||
:space-evenly false
|
||||
(eventbox :class "eventbox"
|
||||
:onhover "eww update ${varname}=true"
|
||||
:onhoverlost "eww update ${varname}=false"
|
||||
(box :space-evenly false
|
||||
(children :nth 0)
|
||||
(revealer :reveal var
|
||||
:transition {transition ?: "slideright"}
|
||||
:duration {duration ?: "500ms"}
|
||||
(children :nth 1)
|
||||
)
|
||||
(children :nth 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget sound []
|
||||
(box
|
||||
:class "volume"
|
||||
:space-evenly false
|
||||
:tooltip "${volume}%"
|
||||
(eventbox
|
||||
:onclick "~/.config/eww/mute-volume"
|
||||
:onrightclick "eww open --toggle --arg monitor=${output} sound-control"
|
||||
(label
|
||||
:width 16
|
||||
:text "${mute ? "" : volume <= 33 ? "" : volume <= 66 ? "" : ""}"
|
||||
)
|
||||
)
|
||||
(scale
|
||||
:min 0
|
||||
:max 100
|
||||
:value {volume}
|
||||
:onchange "~/.config/eww/set-volume {}"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget time []
|
||||
(revealer-on-hover
|
||||
:var show-date
|
||||
:varname "show-date"
|
||||
:transition "slideleft"
|
||||
(label :text "${datetime.weekday} ")
|
||||
(label :text "${datetime.date} ")
|
||||
(label :text "${datetime.time}")
|
||||
)
|
||||
)
|
||||
|
||||
(defwindow sound-control [monitor]
|
||||
:monitor monitor
|
||||
:geometry (geometry :x "40%" :y "40" :anchor "center top")
|
||||
:wm-ignore true
|
||||
(box
|
||||
:class "sound-control"
|
||||
:orientation "v"
|
||||
(for sink in pulse-sinks
|
||||
(button
|
||||
:halign "start"
|
||||
:onclick "~/.config/eww/move-sink-inputs ${sink.index}"
|
||||
(box
|
||||
:spacing 10
|
||||
:space-evenly false
|
||||
(label :style "min-width: 16px" :text "${sink.state == "RUNNING" ? "" : ""}")
|
||||
(label :text "${sink.description}")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user