added a widget for swaync and added keybinds for swaync

This commit is contained in:
mpuchstein
2025-03-08 05:13:39 +01:00
parent afb21bc4c7
commit dd65eb32ae
9 changed files with 58 additions and 10 deletions

View File

@@ -46,4 +46,5 @@
:halign 'end'
(hyprsunset)
(datetime)
(stray)))
(stray)
(swaync)))

View File

@@ -6,3 +6,4 @@
@import 'widgets/hypr_activewindow.scss';
@import 'widgets/hypr_workspaces.scss';
@import 'widgets/sysmon.scss';
@import 'widgets/swaync.scss';

View File

@@ -6,3 +6,4 @@
(include "widgets/hypr_workspaces.yuck")
(include "widgets/hypr_activewindow.yuck")
(include "widgets/sysmon.yuck")
(include "widgets/swaync.yuck")

13
eww/widgets/swaync.scss Normal file
View File

@@ -0,0 +1,13 @@
.swaync{
background: aqua;
color: black;
&--dnd{
background: rosybrown;
color: black;
}
&--inhib{
background: indianred;
color: black;
}
}

19
eww/widgets/swaync.yuck Normal file
View File

@@ -0,0 +1,19 @@
(deflisten notification :initial '{ "count": 0, "dnd": false, "visible": false, "inhibited": false }' "swaync-client -s")
(defvar swaync_icon_act "󰀠")
(defvar swaync_icon_inh "󰚎")
(defvar swaync_icon_dnd "󰀣")
(defwidget swaync []
(eventbox
:class "swaync${notification.dnd == true ? " swaync--dnd" : ""}${notification.inhibited == true ? " swaync--inhib" : ""}"
:cursor "pointer"
:onclick "swaync-client -t"
:onmiddleclick "swaync-client -d"
:onrightclick "swaync-client -C"
(box
:orientation "horizontal"
:spacing 3
:space-evenly false
(label :text "${notification.dnd == true ? swaync_icon_dnd : notification.inhibited == true ? swaync_icon_inh : swaync_icon_act}")
(label :text "${notification.count}"))))

View File

@@ -6,14 +6,14 @@
color: red
}
.ram{
background: yellow;
background: tan;
}
.disk{
background: lightblue;
background: mediumturquoise;
}
.cpu{
background: green;
background: lightgreen;
}
.net{
background: purple;
background: plum;
}