Simplified Leftwm workspace yuck code
This commit is contained in:
parent
0adeca79a5
commit
5699e52919
@ -1,13 +1,13 @@
|
||||
(include "yuck/panel/panel_workspaces/panel_workspaces.yuck")
|
||||
(include "yuck/panel/panel_workspaces/leftwm_ws.yuck") ; For LeftWM
|
||||
|
||||
(defwidget panel_cen [h]
|
||||
(box
|
||||
:class "panel_side panel_cen"
|
||||
:halign "center"
|
||||
:height 28
|
||||
:height "${h}"
|
||||
:width 300
|
||||
:active true
|
||||
|
||||
(panel_workspaces :h "${h}")
|
||||
(panel_ws_leftwm :h "${h}") ; LeftWM workspaces
|
||||
)
|
||||
)
|
32
yuck/panel/panel_workspaces/leftwm_ws.yuck
Normal file
32
yuck/panel/panel_workspaces/leftwm_ws.yuck
Normal file
@ -0,0 +1,32 @@
|
||||
;This widget and code only works for LeftWM
|
||||
|
||||
(defwidget panel_leftwm_ws_ico [h tag]
|
||||
(button
|
||||
:halign "center"
|
||||
:valign "center"
|
||||
:height "${h}"
|
||||
:width "${h}"
|
||||
:active true
|
||||
:class "panel_ws_ico ${tag.mine ? 'panel_ws_ico_cur' : 'panel_ws_ico_notcur'} ${tag.busy ? 'panel_ws_ico_act' : 'panel_ws_ico_inact'}"
|
||||
:onclick "leftwm-command \"SendWorkspaceToTag 0 ${tag.index}\""
|
||||
:timeout "1s"
|
||||
{tag.mine ? '' : tag.busy ? '' : ''}
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget panel_ws_leftwm [h]
|
||||
(box
|
||||
:class "panel_workspaces_widg"
|
||||
:halign "center"
|
||||
:valign "center"
|
||||
:height "${h}"
|
||||
:active true
|
||||
|
||||
(for tag in '${leftwm_state.workspaces[0].tags}'
|
||||
(panel_leftwm_ws_ico
|
||||
:h "${h}"
|
||||
:tag {tag}
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@ -1,20 +0,0 @@
|
||||
(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}"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@ -1,14 +0,0 @@
|
||||
(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' ? '' : ''}
|
||||
)
|
||||
)
|
@ -42,7 +42,6 @@
|
||||
|
||||
;WIndow managers
|
||||
(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`
|
||||
)
|
Loading…
Reference in New Issue
Block a user