mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-04-11 15:46:55 +02:00
feat: eww vertical slider
This commit is contained in:
parent
9906ad4f85
commit
978037d7d0
12 changed files with 126 additions and 95 deletions
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.yuck": "clojure"
|
// "*.yuck": "clojure"
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -18,3 +18,27 @@
|
||||||
background-color: $white;
|
background-color: $white;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vertical-bar-slider {
|
||||||
|
scale {
|
||||||
|
all: unset;
|
||||||
|
|
||||||
|
trough {
|
||||||
|
background-color: $surface2;
|
||||||
|
border-radius: get-token(border-radius);
|
||||||
|
min-height: 80px;
|
||||||
|
min-width: 10px;
|
||||||
|
|
||||||
|
slider {
|
||||||
|
background-color: $white2;
|
||||||
|
border-radius: get-token(border-radius, large);
|
||||||
|
margin: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
highlight {
|
||||||
|
background-color: $white0;
|
||||||
|
border-radius: get-token(border-radius);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -7,31 +7,6 @@ tooltip {
|
||||||
border-color: $surface2;
|
border-color: $surface2;
|
||||||
}
|
}
|
||||||
|
|
||||||
scale {
|
|
||||||
all: unset;
|
|
||||||
|
|
||||||
trough {
|
|
||||||
background-color: $surface2;
|
|
||||||
border-radius: 24px;
|
|
||||||
min-height: 80px;
|
|
||||||
min-width: 10px;
|
|
||||||
margin: 5px;
|
|
||||||
|
|
||||||
slider {
|
|
||||||
background-color: $white2;
|
|
||||||
border-radius: 25px;
|
|
||||||
min-height: 15px;
|
|
||||||
min-width: 15px;
|
|
||||||
margin: -10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
highlight {
|
|
||||||
background-color: $white0;
|
|
||||||
border-radius: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
entry {
|
entry {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
|
|
|
@ -26,7 +26,7 @@ $magenta_dark: #875fd4;
|
||||||
$cyan: #2b9eb0;
|
$cyan: #2b9eb0;
|
||||||
$cyan_dark: #1f7a89;
|
$cyan_dark: #1f7a89;
|
||||||
|
|
||||||
$base: $black;
|
$base: #0c0c0c;
|
||||||
$surface0: $gray80;
|
$surface0: $gray80;
|
||||||
$surface1: $gray70;
|
$surface1: $gray70;
|
||||||
$surface2: $gray60;
|
$surface2: $gray60;
|
||||||
|
|
10
hypr-configs/hyprland/eww/assets/scss/windows/_osd.scss
Normal file
10
hypr-configs/hyprland/eww/assets/scss/windows/_osd.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
@mixin window {
|
||||||
|
border-radius: 1rem;
|
||||||
|
padding: 1rem;
|
||||||
|
box-shadow: 0 0 4px 2px;
|
||||||
|
margin: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-osd {
|
||||||
|
@include window;
|
||||||
|
}
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
(include "./src/-components/_helpers.yuck")
|
(include "./src/-components/_helpers.yuck")
|
||||||
(include "./src/-components/_separator.yuck")
|
(include "./src/-components/_separator.yuck")
|
||||||
|
(include "./src/-components/_sliders.yuck")
|
||||||
|
|
||||||
(include "./src/-modules/_language.yuck")
|
(include "./src/-modules/_language.yuck")
|
||||||
(include "./src/-modules/_system-tray.yuck")
|
(include "./src/-modules/_system-tray.yuck")
|
||||||
|
@ -13,6 +14,7 @@
|
||||||
(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")
|
||||||
|
(include "./src/windows/_osd.yuck")
|
||||||
|
|
||||||
(include "./setups.yuck")
|
(include "./setups.yuck")
|
||||||
|
|
||||||
|
|
|
@ -33,3 +33,14 @@
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
:monitor 0
|
:monitor 0
|
||||||
(Dashboard))
|
(Dashboard))
|
||||||
|
|
||||||
|
(defwindow osd
|
||||||
|
:monitor 0
|
||||||
|
:stacking "overlay"
|
||||||
|
:geometry (geometry
|
||||||
|
:anchor "bottom center"
|
||||||
|
:width "2px"
|
||||||
|
:height "2px"
|
||||||
|
)
|
||||||
|
(VolumeOsd)
|
||||||
|
)
|
|
@ -13,45 +13,44 @@
|
||||||
(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`
|
||||||
|
|
||||||
(box
|
(box
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
(label :class "icon" :text icon)
|
(label :class "icon" :text icon)
|
||||||
|
|
||||||
(revealer
|
(revealer
|
||||||
:reveal var
|
:reveal var
|
||||||
:transition {transition ?:"slidedown"}
|
:transition {transition ?:"slidedown"}
|
||||||
:duration animation-duration-default
|
:duration animation-duration-fast
|
||||||
(box :class "reveal-on-hover" (children :nth 0))))
|
(box :class "reveal-on-hover" (children :nth 0))))
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget RevealOnClick [var varname direction ?class ?duration ?transition]
|
(defwidget RevealOnClick [var varname direction ?class ?duration ?transition]
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:class "widget"
|
:class "widget"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
|
|
||||||
(eventbox
|
(eventbox
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
:visible {direction == "up"}
|
:visible {direction == "up"}
|
||||||
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
||||||
|
|
||||||
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text ""))
|
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text ""))
|
||||||
|
|
||||||
(revealer
|
(revealer
|
||||||
:reveal var
|
:reveal var
|
||||||
:transition {direction == "up" ? "slideup" : "slidedown"}
|
:transition {direction == "up" ? "slideup" : "slidedown"}
|
||||||
:duration animation-duration-fast
|
:duration animation-duration-fast
|
||||||
|
|
||||||
(box :style "padding: 6px 0px" (children :nth 0)))
|
(box :style "padding: 6px 0px" (children :nth 0)))
|
||||||
|
|
||||||
|
|
||||||
(eventbox
|
(eventbox
|
||||||
:cursor "pointer"
|
:cursor "pointer"
|
||||||
:visible {direction == "down"}
|
:visible {direction == "down"}
|
||||||
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
:onclick `${EWW_CMD} update ${varname}=${!var}`
|
||||||
|
|
||||||
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text ""))
|
(label :angle {direction == "up" ? (var ? 270 : 90) : (var ? 90 : 270)} :class "reveal-on-click" :tooltip "touch control" :text ""))
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
11
hypr-configs/hyprland/eww/src/-components/_sliders.yuck
Normal file
11
hypr-configs/hyprland/eww/src/-components/_sliders.yuck
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
(defwidget VerticalBarSlider [var ?onchange]
|
||||||
|
(box
|
||||||
|
:class "vertical-bar-slider"
|
||||||
|
(scale
|
||||||
|
:value var
|
||||||
|
:onchange onchange
|
||||||
|
:orientation "v"
|
||||||
|
:tooltip "${var}%"
|
||||||
|
:max 101
|
||||||
|
:min 0
|
||||||
|
:flipped true)))
|
|
@ -50,6 +50,9 @@
|
||||||
(defvar borderpixel 2)
|
(defvar borderpixel 2)
|
||||||
(defvar caffeine false)
|
(defvar caffeine false)
|
||||||
|
|
||||||
|
; Osd
|
||||||
|
(defvar revealOsd true)
|
||||||
|
|
||||||
; Sidebar
|
; Sidebar
|
||||||
(defvar revealVolume false)
|
(defvar revealVolume false)
|
||||||
(defvar revealMicrophone false)
|
(defvar revealMicrophone false)
|
||||||
|
|
15
hypr-configs/hyprland/eww/src/windows/_osd.yuck
Normal file
15
hypr-configs/hyprland/eww/src/windows/_osd.yuck
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
(defwidget VolumeOsd []
|
||||||
|
(revealer :transition "slideup" :reveal revealOsd :duration "500ms"
|
||||||
|
(box :orientation "h" :class "volume-osd" :space-evenly false
|
||||||
|
(VolumeScale))))
|
||||||
|
|
||||||
|
(defwidget VolumeScale []
|
||||||
|
(overlay :hexpand true
|
||||||
|
(scale :min 0 :max 100 :active {volume != "muted"} :value {volume == "muted" ? 0 : volume} :onchange "pamixer --set-volume {}" :class "volume-scale")
|
||||||
|
(label :class 'volume-icon ${volume == "muted" ? "less" : volume < 5 ? "less" : "more"}' :halign "start" :text {volume == "muted" ? "" : volume < 33 ? "" : volume < 67 ? "" : ""})))
|
||||||
|
|
||||||
|
(defwidget VolumeControlCenter []
|
||||||
|
(box :orientation "h" :class "volume-control-center" :space-evenly false
|
||||||
|
(volume_scale)
|
||||||
|
(button :class "volume-mute ${volume == 'muted' ? 'active' : ''}" :onclick "pamixer -t" "")
|
||||||
|
(button :class "volume-arrow" :onclick "scripts/toggle_control_center.sh close && pavucontrol &" "")))
|
|
@ -3,21 +3,21 @@
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:class "vbar"
|
:class "vbar"
|
||||||
|
|
||||||
(revealer
|
(revealer
|
||||||
:transition "slideleft"
|
:transition "slideleft"
|
||||||
:reveal revealControlpanel
|
:reveal revealControlpanel
|
||||||
:duration animation-duration-fast
|
:duration animation-duration-fast
|
||||||
|
|
||||||
(ControlPanel))
|
(ControlPanel))
|
||||||
|
|
||||||
(centerbox
|
(centerbox
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
|
||||||
(BarTop)
|
(BarTop)
|
||||||
(BarMiddle)
|
(BarMiddle)
|
||||||
(BarBottom)
|
(BarBottom)
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(defwidget BarTop []
|
(defwidget BarTop []
|
||||||
(box
|
(box
|
||||||
|
@ -26,59 +26,59 @@
|
||||||
:valign "start"
|
:valign "start"
|
||||||
:height 250
|
:height 250
|
||||||
:vexpand false
|
:vexpand false
|
||||||
|
|
||||||
(Logo)
|
(Logo)
|
||||||
(Workspaces)
|
(Workspaces)
|
||||||
(Shortcuts)
|
(Shortcuts)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget BarMiddle []
|
(defwidget BarMiddle []
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:valign "center"
|
:valign "center"
|
||||||
|
|
||||||
(Clock)
|
(Clock)
|
||||||
|
|
||||||
(Separator :orientation "h" :dots "[1, 2, 3]" :visible true)
|
(Separator :orientation "h" :dots "[1, 2, 3]" :visible true)
|
||||||
|
|
||||||
(PlayerCtl :cover false)
|
(PlayerCtl :cover false)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget BarBottom []
|
(defwidget BarBottom []
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:valign "end"
|
:valign "end"
|
||||||
|
|
||||||
(RevealOnClick
|
(RevealOnClick
|
||||||
:var revealSystray
|
:var revealSystray
|
||||||
:varname "revealSystray"
|
:varname "revealSystray"
|
||||||
:direction "up"
|
:direction "up"
|
||||||
(Systemtray :orientation "v")
|
(Systemtray :orientation "v")
|
||||||
)
|
)
|
||||||
;; (Language)
|
;; (Language)
|
||||||
(Sliders)
|
(Sliders)
|
||||||
;; (Clock)
|
;; (Clock)
|
||||||
))
|
))
|
||||||
|
|
||||||
(defwidget Shortcuts []
|
(defwidget Shortcuts []
|
||||||
(RevealOnClick
|
(RevealOnClick
|
||||||
:var revealShortcuts
|
:var revealShortcuts
|
||||||
:varname "revealShortcuts"
|
:varname "revealShortcuts"
|
||||||
:direction "down"
|
:direction "down"
|
||||||
|
|
||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:spacing spacing-default
|
:spacing spacing-default
|
||||||
|
|
||||||
(button :onclick "swaymsg kill"
|
(button :onclick "swaymsg kill"
|
||||||
(label :class "icon" :text ""))
|
(label :class "icon" :text ""))
|
||||||
(button :onclick "wofi --show=drun -i -I"
|
(button :onclick "wofi --show=drun -i -I"
|
||||||
(label :class "icon" :text ""))
|
(label :class "icon" :text ""))
|
||||||
(button :onclick "./scripts/touchkey.sh"
|
(button :onclick "./scripts/touchkey.sh"
|
||||||
(label :class "icon" :text ""))))
|
(label :class "icon" :text ""))))
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget Sliders []
|
(defwidget Sliders []
|
||||||
(box
|
(box
|
||||||
|
@ -87,49 +87,30 @@
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:spacing spacing-default
|
:spacing spacing-default
|
||||||
:valign "end"
|
:valign "end"
|
||||||
|
|
||||||
(button :onclick "alacritty -e nmtui" :tooltip wifi_essid
|
(button :onclick "alacritty -e nmtui" :tooltip wifi_essid
|
||||||
(label :class "icon" :text wifi_icon))
|
(label :class "icon" :text wifi_icon))
|
||||||
|
|
||||||
(RevealOnHover
|
(RevealOnHover
|
||||||
:var revealVolume
|
:var revealVolume
|
||||||
:varname "revealVolume"
|
:varname "revealVolume"
|
||||||
:icon {volumemute == 'false' ? "" : ""}
|
:icon {volumemute == 'false' ? "" : ""}
|
||||||
|
|
||||||
(scale
|
(VerticalBarSlider :var volume :onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%")
|
||||||
:value volume
|
)
|
||||||
:onchange "pactl set-sink-volume @DEFAULT_SINK@ {}%"
|
|
||||||
:orientation "v"
|
|
||||||
:tooltip "${volume}%"
|
|
||||||
:max 101
|
|
||||||
:min 0
|
|
||||||
:flipped true))
|
|
||||||
|
|
||||||
(RevealOnHover
|
(RevealOnHover
|
||||||
:var revealMicrophone
|
:var revealMicrophone
|
||||||
:varname "revealMicrophone"
|
:varname "revealMicrophone"
|
||||||
:icon {volumemute == 'false' ? "" : ""}
|
:icon {volumemute == 'false' ? "" : ""}
|
||||||
|
|
||||||
(scale
|
(VerticalBarSlider :var mic_volume :onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%")
|
||||||
:value mic_volume
|
)
|
||||||
:onchange "pactl set-source-volume @DEFAULT_SOURCE@ {}%"
|
|
||||||
:orientation "v"
|
|
||||||
:tooltip "${mic_volume}%"
|
|
||||||
:max 101
|
|
||||||
:min 0
|
|
||||||
:flipped true))
|
|
||||||
|
|
||||||
(RevealOnHover
|
(RevealOnHover
|
||||||
:var revealBrightness
|
:var revealBrightness
|
||||||
:varname "revealBrightness"
|
:varname "revealBrightness"
|
||||||
:icon ""
|
:icon ""
|
||||||
|
|
||||||
(scale
|
(VerticalBarSlider :var brightness :onchange "brightnessctl set {}%"))
|
||||||
:onchange "brightnessctl set {}%"
|
))
|
||||||
:value brightness
|
|
||||||
:orientation "v"
|
|
||||||
:tooltip "${brightness}%"
|
|
||||||
:max 100
|
|
||||||
:min 0
|
|
||||||
:flipped true))
|
|
||||||
))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue