diff --git a/yuck/panel/panel_sections/panel_widg_cen.yuck b/yuck/panel/panel_sections/panel_widg_cen.yuck index 8c795dc..1e61346 100644 --- a/yuck/panel/panel_sections/panel_widg_cen.yuck +++ b/yuck/panel/panel_sections/panel_widg_cen.yuck @@ -1,4 +1,4 @@ -(include "yuck/panel/panel_widgs/panel_workspaces.yuck") +(include "yuck/panel/panel_workspaces/panel_workspaces.yuck") (defwidget panel_cen [h] (box diff --git a/yuck/panel/panel_widgs/panel_workspaces.yuck b/yuck/panel/panel_widgs/panel_workspaces.yuck deleted file mode 100644 index 6c07c4a..0000000 --- a/yuck/panel/panel_widgs/panel_workspaces.yuck +++ /dev/null @@ -1,11 +0,0 @@ -(defwidget panel_workspaces [h] - (box - :class "panel_workspaces_widg" - :halign "center" - :valign "center" - :height "${h}" - :active true - - "--panel___cen--" - ) -) \ No newline at end of file diff --git a/yuck/panel/panel_workspaces/panel_workspaces.yuck b/yuck/panel/panel_workspaces/panel_workspaces.yuck new file mode 100644 index 0000000..fb6740a --- /dev/null +++ b/yuck/panel/panel_workspaces/panel_workspaces.yuck @@ -0,0 +1,20 @@ +(include "yuck/panel/panel_workspaces/panel_ws_ico.yuck") + +(defwidget panel_workspaces [h] + (box + :class "panel_workspaces_widg" + :halign "center" + :valign "center" + :height "${h}" + :active true + + (for tag in '${leftwm_state.workspaces[0].tags}' + (panel_ws_ico + :h "${h}" + :c1 {tag.mine ? "panel_ws_ico_cur" : "panel_ws_ico_notcur"} + :c2 {tag.busy ? "panel_ws_ico_act" : "panel_ws_ico_inact"} + :index "${tag.index}" + ) + ) + ) +) \ No newline at end of file diff --git a/yuck/panel/panel_workspaces/panel_ws_ico.yuck b/yuck/panel/panel_workspaces/panel_ws_ico.yuck new file mode 100644 index 0000000..4846744 --- /dev/null +++ b/yuck/panel/panel_workspaces/panel_ws_ico.yuck @@ -0,0 +1,14 @@ +(defwidget panel_ws_ico [h c1 c2 index] + (button + :halign "center" + :valign "center" + :height "${h}" + :width "${h}" + ;active true + :class "panel_ws_ico {c1} {c2}" + ;:label {c1 == 'panel_ws_ico_cur' ? '' : c2 == 'panel_ws_ico_act' ? '' : ''} + :onclick "leftwm-command \"SendWorkspaceToTag 0 ${index}\"" + :timeout "1s" + {c1 == 'panel_ws_ico_cur' ? '' : c2 == 'panel_ws_ico_act' ? '' : ''} + ) +) \ No newline at end of file diff --git a/yuck/vars/vars.yuck b/yuck/vars/vars.yuck index 87a7310..592dcdd 100644 --- a/yuck/vars/vars.yuck +++ b/yuck/vars/vars.yuck @@ -41,7 +41,7 @@ ) ;WIndow managers -(defpoll leftwm_state +(deflisten leftwm_state :interval "300ms" :initial "{\"window_title\":\"None\",\"workspaces\":[{\"id\":1,\"output\":\"VGA-1\",\"h\":0,\"w\":0,\"x\":0,\"y\":0,\"layout\":\"Default\",\"index\":0,\"tags\":[{\"name\":\"1\",\"index\":0,\"mine\":false,\"visible\":false,\"focused\":false,\"urgent\":false,\"busy\":false}]}]}" `leftwm state`