88 lines
3.2 KiB
Plaintext
88 lines
3.2 KiB
Plaintext
|
|
(defwidget profile[]
|
|
(box :orientation 'h' :space-evenly false :class "profile" :spacing 20
|
|
(image :hexpand true :halign "start" :image-width 50 :path pfp)
|
|
(box :orientation 'v' :valign 'center' :space-evenly false :halign "end" :spacing 3
|
|
(box :class "profiletime" :halign "end" "${username}@${hostname}")
|
|
(box :class "profiletime" :halign "end" "${uptime}")
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwidget music[]
|
|
(box :orientation "h" :space-evenly false :spacing 15
|
|
(overlay :hexpand true
|
|
(box :orientation 'v' :space-evenly false :class "music" :style "background-image: url('${cover_art}');"
|
|
)
|
|
(box :class "music-g")
|
|
(box :orientation 'v' :space-evenly false
|
|
(box :orientation 'v' :space-evenly false :vexpand true :class "musicinfo"
|
|
(box :orientation "v" :halign 'start' :space-evenly false :spacing 3
|
|
(box :halign 'start' :class "musicname" song)
|
|
(box :halign 'start' :class "musicartist" song_artist)
|
|
)
|
|
)
|
|
(scale :onchange "mpc seek {}%" :class "scale music-scale" :value current_status )
|
|
)
|
|
)
|
|
(box :orientation 'v' :class "musicbuttons"
|
|
(button :onclick "~/.config/eww/scripts/ms.sh --prev":valign 'center' :class "musicbutton" "")
|
|
(button :onclick "~/.config/eww/scripts/ms.sh --toggle" :valign 'center' :class "musicbutton" "${song_status}")
|
|
(button :onclick "~/.config/eww/scripts/ms.sh --next" :valign 'center' :class "musicbutton" "")
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwidget setbtn[?icon active func label]
|
|
(button :halign 'center' :class "${active == 'active' ? 'active' : ''} setbtn" :onclick "${func}"
|
|
(box :hexpand true :halign "start" "${icon}" )
|
|
)
|
|
)
|
|
|
|
(defwidget slider[value icon function class]
|
|
(box :orientation "h" :hexpand true :space-evenly false :spacing 20
|
|
(box :class "scaleicon" icon)
|
|
(box :class "${class}" :hexpand true
|
|
(scale :class "scale ${class}"
|
|
:min 0
|
|
:max 100
|
|
:orientation "h"
|
|
:value value
|
|
:onchange function
|
|
:active true
|
|
:valign 'center')
|
|
)
|
|
)
|
|
)
|
|
|
|
(defwidget buttons[]
|
|
(box :orientation 'h' :class "buttons" :spacing 5
|
|
(setbtn :icon "" :func "~/.config/eww/scripts/wifi.sh --toggle" :label "wifi" :active wifiactive)
|
|
(setbtn :icon "" :func "~/.config/eww/scripts/bl.sh --toggle" :label "bluetooth" :active btactive)
|
|
(setbtn :icon "" :func "~/.config/eww/scripts/dnd.sh --toggle" :label "silent" :active dndactive)
|
|
(setbtn :icon "" :func "~/.config/eww/scripts/ap.sh --toggle" :label "airplane" :active apactive)
|
|
))
|
|
|
|
|
|
(defwidget control[]
|
|
(box :orientation "v" :class "control" :space-evenly false :spacing 15
|
|
(profile)
|
|
(box :orientation "v" :class "sliders" :space-evenly false :spacing 25
|
|
(slider :class "brightscale" :icon "" :value brightness :function "brightnessctl s {}%")
|
|
(slider :class "volscale" :icon "" :value volume :round-digits 0 :function "pamixer --set-volume {}")
|
|
)
|
|
(music)
|
|
(buttons)
|
|
)
|
|
)
|
|
|
|
(defwindow control
|
|
:monitor 0
|
|
:geometry (geometry :x "290px"
|
|
:y "20px"
|
|
:width "450px"
|
|
:height "580px"
|
|
:anchor "top right")
|
|
:stacking "fg"
|
|
:exclusive true
|
|
(control)) |