mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-04-27 00:13:43 +02:00
feat: eww system tray
This commit is contained in:
parent
4fcdb25eec
commit
b8d0c9e719
12 changed files with 82 additions and 61 deletions
|
@ -6,3 +6,15 @@
|
||||||
color: $surface2;
|
color: $surface2;
|
||||||
padding: 4px 0px;
|
padding: 4px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.separator {
|
||||||
|
padding: 6px;
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
padding: 2px;
|
||||||
|
|
||||||
|
border-radius: 100;
|
||||||
|
|
||||||
|
background-color: $white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
background-color: $surface1;
|
background-color: $surface1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.border {
|
||||||
|
border: 2px #fff solid;
|
||||||
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
transition-duration: 0.4s;
|
transition-duration: 0.4s;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
.clock {
|
.clock {
|
||||||
@extend .widget;
|
@extend .widget;
|
||||||
|
|
||||||
font-size: get-token(font-sizes);
|
font-size: get-token(font-sizes, large);
|
||||||
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
.language {
|
.language {
|
||||||
@extend .widget;
|
@extend .widget;
|
||||||
|
|
||||||
|
font-size: get-token(font-sizes);
|
||||||
|
font-weight: 900;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
|
@ -18,6 +22,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.system-tray {
|
||||||
|
@extend .widget;
|
||||||
|
}
|
||||||
|
|
||||||
.workspaces {
|
.workspaces {
|
||||||
@extend .widget;
|
@extend .widget;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
(include "./src/_definitions.yuck")
|
(include "./src/_definitions.yuck")
|
||||||
|
|
||||||
(include "./src/-components/_helpers.yuck")
|
(include "./src/-components/_helpers.yuck")
|
||||||
|
(include "./src/-components/_separator.yuck")
|
||||||
|
|
||||||
(include "./src/-modules/_language.yuck")
|
(include "./src/-modules/_language.yuck")
|
||||||
|
(include "./src/-modules/_system-tray.yuck")
|
||||||
(include "./src/-modules/_workspaces.yuck")
|
(include "./src/-modules/_workspaces.yuck")
|
||||||
(include "./src/-modules/_time.yuck")
|
(include "./src/-modules/_time.yuck")
|
||||||
(include "./src/-modules/_logo.yuck")
|
(include "./src/-modules/_logo.yuck")
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
(box :class "reveal-on-hover" (children :nth 0))))
|
(box :class "reveal-on-hover" (children :nth 0))))
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget RevealOnClick [var varname ?class ?duration ?transition]
|
(defwidget RevealOnClick [var varname ?class ?duration ?transition ?direction]
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:class "widget"
|
:class "widget"
|
||||||
|
@ -36,12 +36,12 @@
|
||||||
:reveal var
|
:reveal var
|
||||||
:transition "slideup"
|
:transition "slideup"
|
||||||
:duration animation-duration-fast
|
:duration animation-duration-fast
|
||||||
|
|
||||||
(box (children :nth 0)))
|
(box (children :nth 0)))
|
||||||
|
|
||||||
(eventbox
|
(eventbox
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
||||||
|
|
||||||
(label :angle {var ? 90 : 270} :class "reveal-on-click" :tooltip "touch control" :text "")
|
(label :angle {var ? 90 : 270} :class "reveal-on-click" :tooltip "touch control" :text ""))
|
||||||
)
|
|
||||||
))
|
))
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
(defwidget Separator [orientation dots ?visible] (box
|
||||||
|
:orientation orientation
|
||||||
|
:class "separator"
|
||||||
|
:space-evenly false
|
||||||
|
:visible visible
|
||||||
|
|
||||||
|
(for dot in dots
|
||||||
|
(box :class "dot" :halign "center" :hexpand true :valign "center"))))
|
|
@ -1,3 +1,3 @@
|
||||||
(defwidget Language []
|
(defwidget Language []
|
||||||
(eventbox :onclick "./scripts/kb-layout/set-active"
|
(eventbox :cursor "pointer" :onclick "./scripts/kb-layout/set-active"
|
||||||
(box :class "language" (label :text {kbLayout}))))
|
(box :class "language" (label :text {kbLayout}))))
|
||||||
|
|
|
@ -1,21 +1,23 @@
|
||||||
(defwidget PlayerCtl [?cover]
|
(defwidget PlayerCtl [?cover]
|
||||||
(eventbox
|
(eventbox
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
|
|
||||||
(box
|
(box
|
||||||
:class "widget"
|
:class "widget"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:spacing spacing-default
|
:spacing spacing-default
|
||||||
|
:space-evenly false
|
||||||
|
|
||||||
(eventbox
|
(eventbox
|
||||||
:onclick "${EWW_CMD} open MusicPlayerPopup --toggle"
|
:onclick "${EWW_CMD} open MusicPlayerPopup --toggle"
|
||||||
(image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20))
|
(image :path { pcover == "" ? "./assets/image/emptympd.png" : pcover } :image-width 20 :image-height 20))
|
||||||
|
|
||||||
(button :onclick "playerctl previous"
|
(button :onclick "playerctl previous"
|
||||||
(label :class "picon" :text ""))
|
(label :class "icon" :text ""))
|
||||||
(button :onclick "playerctl play-pause"
|
(button :onclick "playerctl play-pause"
|
||||||
(label :class "picon" :text { pstatus == "Playing" ? "" : ""}))
|
(label :class "icon" :text { pstatus == "Playing" ? "" : ""}))
|
||||||
(button :onclick "playerctl next"
|
(button :onclick "playerctl next"
|
||||||
(label :class "picon" :text "")))))
|
(label :class "icon" :text "")))))
|
||||||
|
|
||||||
(defwindow MusicPlayerPopup
|
(defwindow MusicPlayerPopup
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
|
|
19
hypr-configs/hyprland/eww/src/-modules/_system-tray.yuck
Normal file
19
hypr-configs/hyprland/eww/src/-modules/_system-tray.yuck
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
(defwidget Systemtray [?orientation ?class]
|
||||||
|
(box
|
||||||
|
:space-evenly false
|
||||||
|
:valign "center"
|
||||||
|
:halign "center"
|
||||||
|
:class "${class}"
|
||||||
|
|
||||||
|
(revealer
|
||||||
|
:reveal revealSystray
|
||||||
|
:transition "slideup"
|
||||||
|
|
||||||
|
(systray
|
||||||
|
:orientation orientation
|
||||||
|
:icon-size 18
|
||||||
|
:spacing spacing-default
|
||||||
|
)
|
||||||
|
|
||||||
|
)
|
||||||
|
))
|
|
@ -6,9 +6,9 @@
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:class "clock"
|
:class "clock"
|
||||||
|
:spacing spacing-small
|
||||||
(label :text thour)
|
(label :text thour)
|
||||||
(label :text tmin)
|
(label :text tmin))))
|
||||||
(label :text tpm))))
|
|
||||||
|
|
||||||
(defwindow CalendarPopup
|
(defwindow CalendarPopup
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
; Reveals
|
; Reveals
|
||||||
(defvar reveal1 false)
|
(defvar reveal1 false)
|
||||||
(defvar reveal2 false)
|
(defvar reveal2 false)
|
||||||
(defvar reveal3 false)
|
|
||||||
(defvar reveal4 false)
|
(defvar reveal4 false)
|
||||||
(defvar reveal5 false)
|
(defvar reveal5 false)
|
||||||
(defvar reveal6 false)
|
(defvar reveal6 false)
|
||||||
|
@ -55,7 +54,8 @@
|
||||||
(defvar revealVolume false)
|
(defvar revealVolume false)
|
||||||
(defvar revealMicrophone false)
|
(defvar revealMicrophone false)
|
||||||
(defvar revealBrightness false)
|
(defvar revealBrightness false)
|
||||||
(defvar revealSystray true)
|
(defvar revealSystray false)
|
||||||
|
(defvar revealShortcuts false)
|
||||||
|
|
||||||
; Dock
|
; Dock
|
||||||
(defvar revealDock true)
|
(defvar revealDock true)
|
||||||
|
|
|
@ -2,17 +2,16 @@
|
||||||
(box
|
(box
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:vexpand true
|
:class "vbar"
|
||||||
|
|
||||||
(revealer
|
(revealer
|
||||||
:transition "slideleft"
|
:transition "slideleft"
|
||||||
:reveal revealControlpanel
|
:reveal revealControlpanel
|
||||||
:duration animation-duration-default
|
:duration animation-duration-fast
|
||||||
|
|
||||||
(ControlPanel))
|
(ControlPanel))
|
||||||
|
|
||||||
(centerbox
|
(centerbox
|
||||||
:class "vbar"
|
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
|
||||||
(Top)
|
(Top)
|
||||||
|
@ -39,6 +38,10 @@
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:valign "center"
|
:valign "center"
|
||||||
|
|
||||||
|
(Clock)
|
||||||
|
|
||||||
|
(Separator :orientation "h" :dots "[1, 2, 3]" :visible true)
|
||||||
|
|
||||||
(PlayerCtl)
|
(PlayerCtl)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
@ -48,55 +51,20 @@
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:valign "end"
|
:valign "end"
|
||||||
|
|
||||||
;; (systemtray)
|
(RevealOnClick
|
||||||
|
:var revealSystray
|
||||||
|
:varname "revealSystray"
|
||||||
|
(Systemtray :orientation "v")
|
||||||
|
)
|
||||||
;; (Language)
|
;; (Language)
|
||||||
(Sliders)
|
(Sliders)
|
||||||
(Clock)
|
;; (Clock)
|
||||||
;; (battery)
|
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget systemtray []
|
|
||||||
(box
|
|
||||||
:class "widget"
|
|
||||||
:space-evenly false
|
|
||||||
:valign "end"
|
|
||||||
:orientation "v"
|
|
||||||
(eventbox
|
|
||||||
:onclick "${EWW_CMD} update revealSystray=${!revealSystray}"
|
|
||||||
(label :angle {!revealSystray ? 90 : 270} :class "revealtouch" :tooltip "reveal systray" :text ""))
|
|
||||||
(revealer
|
|
||||||
:reveal revealSystray
|
|
||||||
:transition "slideup"
|
|
||||||
(systray
|
|
||||||
:icon_size 6
|
|
||||||
:prepend-new true
|
|
||||||
))
|
|
||||||
))
|
|
||||||
|
|
||||||
(defwidget battery []
|
|
||||||
(box
|
|
||||||
:orientation "v"
|
|
||||||
:space-evenly false
|
|
||||||
:class "widget"
|
|
||||||
(overlay
|
|
||||||
(scale
|
|
||||||
:class "${EWW_BATTERY.BAT0.status == 'Charging' ? 'charging': bat0 < 16 ? 'dying': 'normal'} bat_scale"
|
|
||||||
:value "${bat0}"
|
|
||||||
:orientation "v"
|
|
||||||
:max 100
|
|
||||||
:min 0
|
|
||||||
:active false
|
|
||||||
:flipped true)
|
|
||||||
(label
|
|
||||||
:class "lightning"
|
|
||||||
:visible {EWW_BATTERY.BAT0.status == "Charging"}
|
|
||||||
:text ""))
|
|
||||||
(label :text "${EWW_BATTERY.BAT0.capacity}%" :limit-width 3 :show-truncated false)))
|
|
||||||
|
|
||||||
(defwidget Shortcuts []
|
(defwidget Shortcuts []
|
||||||
(RevealOnClick
|
(RevealOnClick
|
||||||
:var reveal3
|
:var revealShortcuts
|
||||||
:varname "reveal3"
|
:varname "revealShortcuts"
|
||||||
|
|
||||||
(box
|
(box
|
||||||
:class "touch"
|
:class "touch"
|
||||||
|
@ -128,7 +96,6 @@
|
||||||
:icon {volumemute == 'false' ? "" : ""}
|
:icon {volumemute == 'false' ? "" : ""}
|
||||||
|
|
||||||
(scale
|
(scale
|
||||||
:class "volslide"
|
|
||||||
:value volume
|
:value volume
|
||||||
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
|
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
@ -143,7 +110,6 @@
|
||||||
:icon {volumemute == 'false' ? "" : ""}
|
:icon {volumemute == 'false' ? "" : ""}
|
||||||
|
|
||||||
(scale
|
(scale
|
||||||
:class "volslide"
|
|
||||||
:value mic_volume
|
:value mic_volume
|
||||||
:onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%"
|
:onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
@ -158,7 +124,6 @@
|
||||||
:icon ""
|
:icon ""
|
||||||
|
|
||||||
(scale
|
(scale
|
||||||
:class "brislide"
|
|
||||||
:onchange "brightnessctl set {}%"
|
:onchange "brightnessctl set {}%"
|
||||||
:value brightness
|
:value brightness
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
|
Loading…
Add table
Reference in a new issue