added the workspace widget

This commit is contained in:
2025-03-06 21:40:36 +01:00
parent 3b000cf544
commit 22bb8db705
5 changed files with 52 additions and 16 deletions

View File

@@ -1,9 +1,33 @@
* {
all: unset;
}
/* Widgets */ /* Widgets */
.lorem-text { .lorem-text {
background: darkgrey; background: darkgrey;
color: black; color: black;
} }
.workspace{
background: #ffffff;
color: #000000;
&--activ{
background: #000000;
color: #ffffff;
}
}
.activewindow{
background: #98C379;
color: #ffffff;
&--xwayland{
background: red;
color: black;
}
}
.music { .music {
background: transparent; background: transparent;
color: transparent; color: transparent;

View File

@@ -1,6 +1,7 @@
(include "./widgets/music.yuck") (include "./widgets/media.yuck")
(include "./widgets/lorem.yuck") (include "./widgets/lorem.yuck")
(include "./widgets/hypr_activewindow.yuck") (include "./widgets/hypr_activewindow.yuck")
(include "./widgets/hypr_workspaces.yuck")
(defwindow topbar_0 (defwindow topbar_0
:monitor 1 :monitor 1
@@ -27,7 +28,7 @@
:space-evenly true :space-evenly true
:spacing 5 :spacing 5
:halign 'start' :halign 'start'
(active_window))) (hypr_workspaces)(hypr_active_window)))
(defwidget center [] (defwidget center []

View File

@@ -1,4 +1,4 @@
(deflisten activewindow :initial "..." "hyprman -f activewindow") (deflisten activewindow :initial "..." "hyprman -a")
(defvar windowIcons (defvar windowIcons
`{ `{
@@ -17,18 +17,20 @@
(image (image
:limit-width 10 :limit-width 10
:icon-size: 12 :icon-size: 12
:icon {activewindow.data.window_class})) :icon {activewindow.class}))
(defwidget windowTitle [] (defwidget windowTitle []
(label (label
:class "windowIcon" :class "windowTitle"
:limit-width 10 :limit-width 25
:text {activewindow.data.window_title})) :unindent true
:text "${activewindow.title}"))
(defwidget active_window [] (defwidget hypr_active_window []
(box (box
:class "activewindow" :class "activewindow${activewindow.xwayland == true ? '--xwayland' : ''}"
:halign "center" :halign "left"
:valign "center" :valign "center"
:spacing 1 :spacing 1
(windowIcon) (windowTitle))) :tooltip {activewindow.class}
(windowTitle)))

View File

@@ -1,5 +1,4 @@
(deflisten events :initial "" (deflisten workspaces :initial "" "hyprman -w")
../scripts/hyprman)
(defvar workspaceIcons '{ (defvar workspaceIcons '{
"empty": "", "empty": "",
@@ -7,6 +6,16 @@
"focused": "󱓻" "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}")))))