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)
; Sidebar
(defvar revealWifiEssid false)
(defvar revealVolume false)
(defvar revealMicrophone false)
(defvar revealBrightness false)

View file

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

View file

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

View file

@ -8,7 +8,7 @@
.language {
@extend .widget;
font-size: get-token(font-sizes);
font-size: get-token(font-sizes, small);
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/dashboard";
@import "./assets/scss/windows/osd";
@import "./assets/scss/windows/notifications";
@import "./src/dock/styles.scss";
@import "./src/desktop/styles.scss";
@import "./src/notification/styles.scss";
* {
all: unset;

View file

@ -11,6 +11,7 @@
(include "./src/-modules/_logo.yuck")
(include "./src/-modules/_media.yuck")
(include "./src/windows/_notifications.yuck")
(include "./src/windows/_vertical-bar.yuck")
(include "./src/windows/_control-panel.yuck")
(include "./src/windows/_dashboard.yuck")
@ -20,5 +21,3 @@
(include "./src/wallpapers/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"
(children :nth 1))))
(defwidget RevealOnHover [var varname ?icon ?class ?duration ?transition]
(defwidget RevealOnHover [var varname ?icon ?class ?duration ?transition ?visible]
(eventbox
:onhover `${EWW_CMD} update ${varname}=true`
:onhoverlost `${EWW_CMD} update ${varname}=false`
:visible {visible}
(box
:space-evenly false

View file

@ -9,9 +9,9 @@
:reveal revealSystray
:transition "slideup"
(systray
(systray
:orientation orientation
:icon-size 20
:icon-size 18
: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
:geometry (geometry
:x 0
:y 0
:width 480
:height 0
:anchor "top right")
:stacking "overlay"
:monitor 0
(defwidget NotficationsCenter []
(revealer
:reveal { arraylength(notifications.popups) > 0 }
:transition "slidedown"
(box
:orientation "v"
:space-evenly false
:spacing 5
(for noti in {notifications.popups}
(singlenotif :noti noti :initial true)))))
:spacing spacing-default
(defwidget singlenotif [noti initial]
(for noti in {notifications.popups}
(SingleNotification :noti noti :initial true)))))
(defwidget SingleNotification [noti initial]
(box
:orientation "v"
:class "${initial ? 'popup' : 'notifbox'}"

View file

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