feat: eww notifications center

This commit is contained in:
hesam-init 2024-07-02 20:11:26 +03:30
parent 66c17b4ac5
commit 41309f96a1
18 changed files with 90 additions and 134 deletions

View file

@ -56,6 +56,7 @@
(defvar revealOsd false) (defvar revealOsd false)
; Sidebar ; Sidebar
(defvar revealWifiEssid false)
(defvar revealVolume false) (defvar revealVolume false)
(defvar revealMicrophone false) (defvar revealMicrophone false)
(defvar revealBrightness false) (defvar revealBrightness false)

View file

@ -34,6 +34,18 @@
:monitor 0 :monitor 0
(Dashboard)) (Dashboard))
(defwindow notifications
:geometry (geometry
:x 0
:y 0
:width 480
:height 0
:anchor "top center")
:stacking "overlay"
:monitor 0
(NotficationsCenter)
)
(defwindow osd (defwindow osd
:monitor 0 :monitor 0
:stacking "overlay" :stacking "overlay"

View file

@ -8,7 +8,7 @@
} }
.separator { .separator {
padding: 4px 6px; padding: get-token(padding, small);
.dot { .dot {
padding: 3px; padding: 3px;

View file

@ -8,7 +8,7 @@
.language { .language {
@extend .widget; @extend .widget;
font-size: get-token(font-sizes); font-size: get-token(font-sizes, small);
font-weight: bolder; font-weight: bolder;
} }

View file

@ -0,0 +1,35 @@
.notifbox {
background-color: $surface1;
border-radius: 5px;
padding: 5px;
margin: 5px;
}
.notiftitle {
font-size: 18px;
color: $white0;
}
.notifbody {
font-size: 15px;
color: $white0;
}
.notifclose {
font-family: "Symbols Nerd Font";
font-size: 25px;
min-width: 1em;
min-height: 1em;
color: $red;
}
.notiflabel {
font-size: 18px;
margin-bottom: 5px;
}
.notifactions {
font-size: 15px;
margin: 5px;
color: $white0;
}

View file

@ -9,10 +9,9 @@
@import "./assets/scss/windows/vertical-bar"; @import "./assets/scss/windows/vertical-bar";
@import "./assets/scss/windows/dashboard"; @import "./assets/scss/windows/dashboard";
@import "./assets/scss/windows/osd"; @import "./assets/scss/windows/osd";
@import "./assets/scss/windows/notifications";
@import "./src/dock/styles.scss"; @import "./src/dock/styles.scss";
@import "./src/desktop/styles.scss";
@import "./src/notification/styles.scss";
* { * {
all: unset; all: unset;

View file

@ -11,6 +11,7 @@
(include "./src/-modules/_logo.yuck") (include "./src/-modules/_logo.yuck")
(include "./src/-modules/_media.yuck") (include "./src/-modules/_media.yuck")
(include "./src/windows/_notifications.yuck")
(include "./src/windows/_vertical-bar.yuck") (include "./src/windows/_vertical-bar.yuck")
(include "./src/windows/_control-panel.yuck") (include "./src/windows/_control-panel.yuck")
(include "./src/windows/_dashboard.yuck") (include "./src/windows/_dashboard.yuck")
@ -20,5 +21,3 @@
(include "./src/wallpapers/main.yuck") (include "./src/wallpapers/main.yuck")
(include "./src/dock/main.yuck") (include "./src/dock/main.yuck")
(include "./src/desktop/main.yuck")
(include "./src/notification/main.yuck")

View file

@ -9,10 +9,11 @@
:transition "slideleft" :transition "slideleft"
(children :nth 1)))) (children :nth 1))))
(defwidget RevealOnHover [var varname ?icon ?class ?duration ?transition] (defwidget RevealOnHover [var varname ?icon ?class ?duration ?transition ?visible]
(eventbox (eventbox
:onhover `${EWW_CMD} update ${varname}=true` :onhover `${EWW_CMD} update ${varname}=true`
:onhoverlost `${EWW_CMD} update ${varname}=false` :onhoverlost `${EWW_CMD} update ${varname}=false`
:visible {visible}
(box (box
:space-evenly false :space-evenly false

View file

@ -4,16 +4,16 @@
:valign "center" :valign "center"
:halign "center" :halign "center"
:class "${class}" :class "${class}"
(revealer (revealer
:reveal revealSystray :reveal revealSystray
:transition "slideup" :transition "slideup"
(systray (systray
:orientation orientation :orientation orientation
:icon-size 20 :icon-size 18
:spacing spacing-default :spacing spacing-default
)
) )
))
)
))

View file

@ -1,43 +0,0 @@
(defwindow desktopicons
:geometry (geometry
:x 20
:y 20
:width 100
:height 600
:anchor "top right")
:stacking "bottom"
:monitor 0
(box
:orientation "v"
:space-evenly "false"
:spacing 10
(eventbox
:dragtype "file"
:class "desktopbox"
:onclick "thunar ${homedir}/.local/share/Trash/files"
:ondropped "notify-send {}"
(box
:orientation "v"
:space-evenly false
:height 100
:valign "end"
(image :width 100 :height 100 :image-width 80 :image-height 80 :path trashcanPath)
(label :class "desktoptext" :text "Trash")))
(for i in '["amogus"]'
(imagesicon :name i))))
(defwidget imagesicon [name]
(eventbox
:onclick "feh ./assets/image/desktop/${name}.png"
:class "desktopbox"
(box
:orientation "v"
:space-evenly false
:height 100
:valign "end"
(image :width 100 :height 100 :image-width 80 :image-height 80 :path "./assets/image/desktop/${name}.png")
(label :class "desktoptext" :text "${name}.png"))))

View file

@ -1,11 +0,0 @@
.desktoptext {
font-size: 18px;
color: $white0;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.desktopbox:hover {
border: solid 2px;
border-color: $surface2;
}

View file

@ -1,36 +0,0 @@
.notifbox {
background-color: $surface1;
border-radius: 5px;
padding: 5px;
margin: 5px;
}
.notiftitle {
font-size: 18px;
color: $white0;
}
.notifbody {
font-size: 15px;
color: $white0;
}
.notifclose {
font-family: "Symbols Nerd Font";
font-size: 25px;
min-width: 1em;
min-height: 1em;
color: $red;
}
.notiflabel {
font-size: 18px;
margin-bottom: 5px;
}
.notifactions {
font-size: 15px;
margin: 5px;
color: $white0;
}

View file

@ -1,24 +1,16 @@
(defwindow notifypopup (defwidget NotficationsCenter []
:geometry (geometry
:x 0
:y 0
:width 480
:height 0
:anchor "top right")
:stacking "overlay"
:monitor 0
(revealer (revealer
:reveal { arraylength(notifications.popups) > 0 } :reveal { arraylength(notifications.popups) > 0 }
:transition "slidedown" :transition "slidedown"
(box (box
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false
:spacing 5 :spacing spacing-default
(for noti in {notifications.popups} (for noti in {notifications.popups}
(singlenotif :noti noti :initial true))))) (SingleNotification :noti noti :initial true)))))
(defwidget singlenotif [noti initial] (defwidget SingleNotification [noti initial]
(box (box
:orientation "v" :orientation "v"
:class "${initial ? 'popup' : 'notifbox'}" :class "${initial ? 'popup' : 'notifbox'}"

View file

@ -29,7 +29,13 @@
(Logo) (Logo)
(Workspaces) (Workspaces)
(Shortcuts) ; (Shortcuts)
(RevealOnClick
:var revealSystray
:varname "revealSystray"
:direction "down"
(Systemtray :orientation "v")
)
)) ))
(defwidget BarMiddle [] (defwidget BarMiddle []
@ -51,15 +57,9 @@
:space-evenly false :space-evenly false
:valign "end" :valign "end"
(RevealOnClick
:var revealSystray
:varname "revealSystray"
:direction "up"
(Systemtray :orientation "v")
)
;; (Language)
(Sliders) (Sliders)
;; (Clock) (Language)
)) ))
(defwidget Shortcuts [] (defwidget Shortcuts []
@ -88,29 +88,36 @@
:spacing spacing-default :spacing spacing-default
:valign "end" :valign "end"
(button :onclick "alacritty -e nmtui" :tooltip wifi_essid (RevealOnHover
(label :class "icon" :text wifi_icon)) :var {revealWifiEssid}
:varname "revealWifiEssid"
:icon {wifi_icon}
(label
:angle 90
:text wifi_essid)
)
(RevealOnHover (RevealOnHover
:var revealVolume :var {revealVolume}
:varname "revealVolume" :varname "revealVolume"
:icon {volumemute == 'false' ? "󰕾" : "󰖁"} :icon {volumemute == 'false' ? "󰕾" : "󰖁"}
(VerticalBarSlider :var volume :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%") (VerticalBarSlider :var {volume} :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%")
) )
(RevealOnHover (RevealOnHover
:var revealMicrophone :var {revealMicrophone}
:varname "revealMicrophone" :varname "revealMicrophone"
:icon {volumemute == 'false' ? "" : "󰖁"} :icon {volumemute == 'false' ? "" : "󰖁"}
(VerticalBarSlider :var mic_volume :onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%") (VerticalBarSlider :var {mic_volume} :onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%")
) )
(RevealOnHover (RevealOnHover
:var revealBrightness :var {revealBrightness}
:varname "revealBrightness" :varname "revealBrightness"
:icon "󰃞" :icon "󰃞"
(VerticalBarSlider :var brightness :onchange "brightnessctl set {}%")) (VerticalBarSlider :var {brightness} :onchange "brightnessctl set {}%"))
)) ))