refactor of yuck files

This commit is contained in:
2025-03-06 21:56:38 +01:00
parent 8c4a2bf572
commit 6bab674c4d
4 changed files with 65 additions and 52 deletions

View File

@@ -1,7 +1,9 @@
(include "./widgets.yuck")
(defwindow dp-2 :monitor "DP-2"
:geometry (geometry :x 0
(defwindow dp-2
:monitor "DP-2"
:geometry (geometry
:x 0
:y 0
:width "100%"
:height "20px"
@@ -13,8 +15,10 @@
(top)
)
(defwindow dp-1 :monitor "DP-1"
:geometry (geometry :x 0
(defwindow dp-1
:monitor "DP-1"
:geometry (geometry
:x 0
:y 0
:width "100%"
:height "20px"
@@ -27,7 +31,8 @@
)
(defwidget top []
(centerbox :orientation "h"
(centerbox
:orientation "h"
(left)
(center)
(right)
@@ -35,7 +40,8 @@
)
(defwidget left []
(box :orientation 'h'
(box
:orientation 'h'
:class 'left'
:space-evenly true
:spacing 5
@@ -45,7 +51,8 @@
)
(defwidget center []
(box :orientation 'h'
(box
:orientation 'h'
:class 'center'
:space-evenly false
:spacing 5
@@ -54,7 +61,8 @@
)
(defwidget right []
(box :orientation 'h'
(box
:orientation 'h'
:class 'right'
:space-evenly false
:spacing 5

View File

@@ -1,5 +1,6 @@
(defwidget datetime []
(box :class "datetime"
(box
:class "datetime"
:halign "center"
:valign "center"
{ time == ''
@@ -10,7 +11,8 @@
)
(defvar time-visible false)
(defpoll time :interval "1s"
(defpoll time
:interval "1s"
:initial "initial-value" ; optional, defaults to poll at startup
:run-while time-visible ; optional, defaults to 'true'
`date +"%H:%M - %a, %d %b"` ; https://www.man7.org/linux/man-pages/man1/date.1.html

View File

@@ -1,5 +1,6 @@
(defwidget loremText [text]
(label :text text
(label
:text text
:class 'lorem-text'
)
)

View File

@@ -11,7 +11,8 @@
(defvar ellipsisArtist 20) ; set length for ellipsis on artist
(defvar ellipsisTitle 25) ; set length for ellipsis on title
(defwidget media []
(box :class "media"
(box
:class "media"
:halign "center"
:valign "center"
:class { playerctl == '' || objectlength(playerctl) == 0
@@ -28,6 +29,7 @@
)
)
(deflisten playerctl :initial ""
(deflisten playerctl
:initial ""
`playerctl --follow metadata --format '{"player": "{{ playerName }}", "trackid": "{{ mpris:trackid }}", "length": "{{ duration(mpris:length) }}", "artUrl": "{{ mrpis:artUrl }}", "album": "{{ album }}", "albumArtist": "{{ xesam:albumArtist }}", "artist": "{{ artist }}", "autoRating": "{{ xesam:autoRating }}", "discNumber": "{{ xesam:discNumber }}", "title": "{{ title }}", "trackNumber": "{{ xesam:trackNumber }}", "url": "{{ xesam:url }}", "position": "{{ position }}"}'`
)