added the workspace widget
This commit is contained in:
26
eww/eww.scss
26
eww/eww.scss
@@ -1,9 +1,33 @@
|
||||
/* Widgets */
|
||||
* {
|
||||
all: unset;
|
||||
}
|
||||
|
||||
/* Widgets */
|
||||
.lorem-text {
|
||||
background: darkgrey;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.workspace{
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
|
||||
&--activ{
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.activewindow{
|
||||
background: #98C379;
|
||||
color: #ffffff;
|
||||
|
||||
&--xwayland{
|
||||
background: red;
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
|
||||
.music {
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
(include "./widgets/music.yuck")
|
||||
(include "./widgets/media.yuck")
|
||||
(include "./widgets/lorem.yuck")
|
||||
(include "./widgets/hypr_activewindow.yuck")
|
||||
(include "./widgets/hypr_workspaces.yuck")
|
||||
|
||||
(defwindow topbar_0
|
||||
:monitor 1
|
||||
@@ -27,7 +28,7 @@
|
||||
:space-evenly true
|
||||
:spacing 5
|
||||
:halign 'start'
|
||||
(active_window)))
|
||||
(hypr_workspaces)(hypr_active_window)))
|
||||
|
||||
|
||||
(defwidget center []
|
||||
|
@@ -1,4 +1,4 @@
|
||||
(deflisten activewindow :initial "..." "hyprman -f activewindow")
|
||||
(deflisten activewindow :initial "..." "hyprman -a")
|
||||
|
||||
(defvar windowIcons
|
||||
`{
|
||||
@@ -17,18 +17,20 @@
|
||||
(image
|
||||
:limit-width 10
|
||||
:icon-size: 12
|
||||
:icon {activewindow.data.window_class}))
|
||||
:icon {activewindow.class}))
|
||||
|
||||
(defwidget windowTitle []
|
||||
(label
|
||||
:class "windowIcon"
|
||||
:limit-width 10
|
||||
:text {activewindow.data.window_title}))
|
||||
:class "windowTitle"
|
||||
:limit-width 25
|
||||
:unindent true
|
||||
:text "${activewindow.title}"))
|
||||
|
||||
(defwidget active_window []
|
||||
(defwidget hypr_active_window []
|
||||
(box
|
||||
:class "activewindow"
|
||||
:halign "center"
|
||||
:class "activewindow${activewindow.xwayland == true ? '--xwayland' : ''}"
|
||||
:halign "left"
|
||||
:valign "center"
|
||||
:spacing 1
|
||||
(windowIcon) (windowTitle)))
|
||||
:tooltip {activewindow.class}
|
||||
(windowTitle)))
|
||||
|
@@ -1,5 +1,4 @@
|
||||
(deflisten events :initial ""
|
||||
../scripts/hyprman)
|
||||
(deflisten workspaces :initial "" "hyprman -w")
|
||||
|
||||
(defvar workspaceIcons '{
|
||||
"empty": "",
|
||||
@@ -7,6 +6,16 @@
|
||||
"focused": ""
|
||||
}')
|
||||
|
||||
(defvar seperator " ")
|
||||
(defwidget hypr_workspaces []
|
||||
(box
|
||||
:space-evenly true
|
||||
(for workspace in workspaces
|
||||
(eventbox
|
||||
:onclick "hyprctl dispatch workspace ${workspace.id}"
|
||||
:tooltip "current: ${workspace.name}"
|
||||
(label
|
||||
:class "workspace${workspace.active == true ? '--activ' : ''}"
|
||||
:text "${workspace.windows > 0 ? workspaceIcons.full : workspaceIcons.empty}")))))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user