💥 eww(bar/workspaces): fix workspace indicator with a literal script
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
|
||||
(deflisten json_audio :initial `{ "output": 35, "source": 80 }`
|
||||
`sh ./scripts/get-volume-watch.sh`)
|
||||
|
||||
(defwidget audio []
|
||||
(eventbox :onclick "eww open --toggle audio-popup"
|
||||
:class "audio-eventbox"
|
||||
(box :class "audio"
|
||||
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-`
|
||||
(label :text "${ json_audio.output != 0 ? '' : '' } ${json_audio.output}%"))
|
||||
(label :text "${ json_volume.output != 0 ? '' : '' } ${json_volume.output}%"))
|
||||
(eventbox :onscroll `[ {} == "up" ] && wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%+ || wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 5%-`
|
||||
(label :text "${ json_audio.source != 0 ? '' : '' } ${json_audio.source}%"))
|
||||
(label :text "${ json_volume.source != 0 ? '' : '' } ${json_volume.source}%"))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
(defwidget control-center-toggle []
|
||||
(defwidget cc-toggle []
|
||||
(box :class "control-center-toggle"
|
||||
(button :onclick "eww open --toggle control-center"
|
||||
" ")
|
||||
@@ -1,10 +1,6 @@
|
||||
|
||||
(defpoll datetime :interval "10s"
|
||||
`date +"%A %d, %H:%M"`)
|
||||
|
||||
(defwidget clock []
|
||||
(box :class "clock"
|
||||
(button :onclick "eww open calendar-window --toggle"
|
||||
"${datetime}")
|
||||
"${day-name} ${day}, ${time}")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,19 +1,6 @@
|
||||
|
||||
(deflisten json_workspaces :initial '[{"id": "1"},{"id": "2"}]'
|
||||
`sh ./scripts/workspaces.sh`)
|
||||
|
||||
(deflisten json_active_workspace :initial '{ "id": 1 }'
|
||||
`sh ./scripts/active-workspace.sh`)
|
||||
|
||||
(defwidget workspaces []
|
||||
(eventbox :onscroll "[[ {} == up ]] && hyprctl dispatch workspace e+1 >> /dev/null || hyprctl dispatch workspace e-1 >> /dev/null"
|
||||
(box :class "workspaces"
|
||||
:space-evenly false
|
||||
(for workspace in json_workspaces
|
||||
(button :onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
:class "${ json_active_workspace.id == workspace.id ? "active" : "default" }"
|
||||
"")
|
||||
)
|
||||
)
|
||||
(literal :content literal_workspaces)
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user