|
| 1 | +(deflisten river-focused-view :initial "{}" |
| 2 | + "riverql 'subscription { events { ... on SeatFocusedView { title }}}'") |
| 3 | + |
| 4 | +;; DP-1 |
| 5 | +(deflisten river-view-tags-1 :initial "[]" |
| 6 | + `riverql 'subscription { eventsForOutput(outputName: "DP-1", tagList: true) { ... on OutputViewTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 7 | + |
| 8 | +(deflisten river-focused-tags-1 :initial "[]" |
| 9 | + `riverql 'subscription { eventsForOutput(outputName: "DP-1", tagList: true) { ... on OutputFocusedTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 10 | + |
| 11 | +(deflisten river-urgent-tags-1 :initial "[]" |
| 12 | + `riverql 'subscription { eventsForOutput(outputName: "DP-1", tagList: true) { ... on OutputUrgentTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 13 | + |
| 14 | +;; DP-2 |
| 15 | +(deflisten river-view-tags-2 :initial "[]" |
| 16 | + `riverql 'subscription { eventsForOutput(outputName: "DP-2", tagList: true) { ... on OutputViewTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 17 | + |
| 18 | +(deflisten river-focused-tags-2 :initial "[]" |
| 19 | + `riverql 'subscription { eventsForOutput(outputName: "DP-2", tagList: true) { ... on OutputFocusedTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 20 | + |
| 21 | +(deflisten river-urgent-tags-2 :initial "[]" |
| 22 | + `riverql 'subscription { eventsForOutput(outputName: "DP-2", tagList: true) { ... on OutputUrgentTags { tagsList }}}' | jq --unbuffered -c '[range(0;10) as $i | any(.data.eventsForOutput.tagsList[]; . == $i)]'`) |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +(defwidget focused-view [] |
| 27 | + (label :text `${river-focused-view.data.events.title ?: ""}` :halign "start" :hexpand true :class "focused_view")) |
| 28 | + |
| 29 | +(defwidget river-tags [focused-tags urgent-tags view-tags] |
| 30 | + (box :orientation "h" :spacing 10 :halign "start" :class "taglist" |
| 31 | + (for i in `[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` |
| 32 | + (tag :index i |
| 33 | + :focused-tags focused-tags |
| 34 | + :urgent-tags urgent-tags |
| 35 | + :view-tags view-tags)))) |
| 36 | + |
| 37 | +(defwidget tag [index focused-tags urgent-tags view-tags] |
| 38 | + (box :class `${urgent-tags[index] ? "urgent" : focused-tags[index] ? "focused" : ""}` |
| 39 | + (overlay |
| 40 | + (box :width 32 :height 18) |
| 41 | + (literal :content `${view-tags[index] ? |
| 42 | + '(box :halign "start" :valign "start" |
| 43 | + (box :class "occupied" :width 7 :height 7))' : ""}`) |
| 44 | + (label :text `${index == 9 ? "0" : index + 1}` :class "tag-text")))) |
| 45 | + |
| 46 | +(defwidget bar-left [focused-tags urgent-tags view-tags] |
| 47 | + (box :orientation "h" :halign "start" :hexpand true :space-evenly false |
| 48 | + (label :text "" :class "arch-logo") |
| 49 | + (river-tags :focused-tags focused-tags :urgent-tags urgent-tags :view-tags view-tags) |
| 50 | + (focused-view))) |
| 51 | + |
| 52 | +(defwidget bar-right [] |
| 53 | + (box :orientation "h" :halign "end" :class "bar-right" |
| 54 | + (systray :icon-size 16))) |
| 55 | + |
| 56 | +(defwidget bar [focused-tags urgent-tags view-tags] |
| 57 | + (box :orientation "h" :space-evenly false :class "bar" :width: "100%" |
| 58 | + (bar-left :focused-tags focused-tags :urgent-tags urgent-tags :view-tags view-tags) |
| 59 | + (bar-right))) |
| 60 | + |
| 61 | +(defwindow bar-window-1 |
| 62 | + :monitor 0 |
| 63 | + :geometry (geometry :x "0" |
| 64 | + :y "0" |
| 65 | + :width "100%" |
| 66 | + :height "32px" |
| 67 | + :anchor "top center") |
| 68 | + :stacking "fg" |
| 69 | + :exclusive true |
| 70 | + :focusable false |
| 71 | + (bar :focused-tags river-focused-tags-1 |
| 72 | + :urgent-tags river-urgent-tags-1 |
| 73 | + :view-tags river-view-tags-1)) |
| 74 | + |
| 75 | +(defwindow bar-window-2 |
| 76 | + :monitor 1 |
| 77 | + :geometry (geometry :x "0" |
| 78 | + :y "0" |
| 79 | + :width "100%" |
| 80 | + :height "32px" |
| 81 | + :anchor "top center") |
| 82 | + :stacking "fg" |
| 83 | + :exclusive true |
| 84 | + :focusable false |
| 85 | + (bar :focused-tags river-focused-tags-2 |
| 86 | + :urgent-tags river-urgent-tags-2 |
| 87 | + :view-tags river-view-tags-2)) |
0 commit comments