mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-06-05 19:43:44 +02:00
feat: osd widget
This commit is contained in:
parent
978037d7d0
commit
f0a51d2f8c
8 changed files with 119 additions and 101 deletions
|
@ -20,25 +20,25 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.vertical-bar-slider {
|
.vertical-bar-slider {
|
||||||
scale {
|
trough {
|
||||||
all: unset;
|
background-color: $surface2;
|
||||||
|
border-radius: get-token(border-radius);
|
||||||
|
min-height: 80px;
|
||||||
|
min-width: 10px;
|
||||||
|
|
||||||
trough {
|
slider {
|
||||||
background-color: $surface2;
|
background-color: $white2;
|
||||||
|
border-radius: get-token(border-radius, large);
|
||||||
|
margin: -10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
highlight {
|
||||||
|
background-color: $white0;
|
||||||
border-radius: get-token(border-radius);
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.volume-icon {
|
||||||
|
font-size: get-token(font-sizes, large);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@ entry {
|
||||||
color: $white0;
|
color: $white0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scale {
|
||||||
|
all: unset;
|
||||||
|
}
|
||||||
|
|
||||||
calendar {
|
calendar {
|
||||||
all: unset;
|
all: unset;
|
||||||
background-color: $surface0;
|
background-color: $surface0;
|
||||||
|
|
|
@ -1,10 +1,24 @@
|
||||||
@mixin window {
|
.volume-osd {
|
||||||
border-radius: 1rem;
|
@extend .panel-widget;
|
||||||
padding: 1rem;
|
border-radius: get-token(border-radius, large);
|
||||||
box-shadow: 0 0 4px 2px;
|
|
||||||
margin: 1rem;
|
min-width: 320px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.volume-osd {
|
.volume-scale {
|
||||||
@include window;
|
trough {
|
||||||
|
border-radius: get-token(border-radius, large);
|
||||||
|
min-height: 32px;
|
||||||
|
background-color: $surface1;
|
||||||
|
|
||||||
|
highlight {
|
||||||
|
border-radius: get-token(border-radius, large);
|
||||||
|
background-color: $accent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.volume-icon {
|
||||||
|
font-size: get-token(font-sizes, large);
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
@import "./assets/scss/windows/control-panel";
|
@import "./assets/scss/windows/control-panel";
|
||||||
@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 "./src/dock/styles.scss";
|
@import "./src/dock/styles.scss";
|
||||||
@import "./src/desktop/styles.scss";
|
@import "./src/desktop/styles.scss";
|
||||||
|
|
|
@ -5,42 +5,42 @@
|
||||||
:y 10
|
:y 10
|
||||||
:width 340
|
:width 340
|
||||||
:anchor "top left"
|
:anchor "top left"
|
||||||
)
|
)
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
:monitor 0
|
:monitor 0
|
||||||
|
|
||||||
(ControlPanel))
|
(ControlPanel))
|
||||||
|
|
||||||
(defwindow bar
|
(defwindow bar
|
||||||
:geometry
|
:geometry
|
||||||
(geometry
|
(geometry
|
||||||
:anchor "center left"
|
:anchor "center left"
|
||||||
:height "100%")
|
:height "100%")
|
||||||
|
|
||||||
:monitor 0
|
:monitor 0
|
||||||
:exclusive true
|
:exclusive true
|
||||||
:wm-ignore false
|
:wm-ignore false
|
||||||
|
|
||||||
(VerticalBar))
|
(VerticalBar))
|
||||||
|
|
||||||
(defwindow dashboard
|
(defwindow dashboard
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
:x 0
|
:x 0
|
||||||
:y 0
|
:y 0
|
||||||
:width 800
|
:width 800
|
||||||
:height 420
|
:height 420
|
||||||
:anchor "center")
|
:anchor "center")
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
:monitor 0
|
:monitor 0
|
||||||
(Dashboard))
|
(Dashboard))
|
||||||
|
|
||||||
(defwindow osd
|
(defwindow osd
|
||||||
:monitor 0
|
:monitor 0
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
:geometry (geometry
|
:geometry (geometry
|
||||||
:anchor "bottom center"
|
:anchor "bottom center"
|
||||||
:width "2px"
|
:width "2px"
|
||||||
:height "2px"
|
:height "2px"
|
||||||
)
|
)
|
||||||
(VolumeOsd)
|
(VolumeOsd)
|
||||||
)
|
)
|
|
@ -1,11 +1,10 @@
|
||||||
(defwidget VerticalBarSlider [var ?onchange]
|
(defwidget VerticalBarSlider [var ?onchange]
|
||||||
(box
|
(scale
|
||||||
|
:value var
|
||||||
|
:onchange onchange
|
||||||
:class "vertical-bar-slider"
|
:class "vertical-bar-slider"
|
||||||
(scale
|
:orientation "v"
|
||||||
:value var
|
:tooltip "${var}%"
|
||||||
:onchange onchange
|
:max 101
|
||||||
:orientation "v"
|
:min 0
|
||||||
:tooltip "${var}%"
|
:flipped true))
|
||||||
:max 101
|
|
||||||
:min 0
|
|
||||||
:flipped true)))
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
(defvar caffeine false)
|
(defvar caffeine false)
|
||||||
|
|
||||||
; Osd
|
; Osd
|
||||||
(defvar revealOsd true)
|
(defvar revealOsd false)
|
||||||
|
|
||||||
; Sidebar
|
; Sidebar
|
||||||
(defvar revealVolume false)
|
(defvar revealVolume false)
|
||||||
|
@ -71,13 +71,13 @@
|
||||||
|
|
||||||
; Notifications
|
; Notifications
|
||||||
(deflisten notifications :initial '{
|
(deflisten notifications :initial '{
|
||||||
"count": 0,
|
"count": 0,
|
||||||
"dnd": false,
|
"dnd": false,
|
||||||
"notifications": [],
|
"notifications": [],
|
||||||
"popups": []
|
"popups": []
|
||||||
}'
|
}'
|
||||||
"./scripts/notif.py"
|
"./scripts/notif.py"
|
||||||
)
|
)
|
||||||
|
|
||||||
; Playerctl
|
; Playerctl
|
||||||
(deflisten pstatus :initial "" "playerctl status -F")
|
(deflisten pstatus :initial "" "playerctl status -F")
|
||||||
|
@ -86,9 +86,9 @@
|
||||||
(deflisten pcover "./scripts/pollcover.sh")
|
(deflisten pcover "./scripts/pollcover.sh")
|
||||||
(deflisten ptime
|
(deflisten ptime
|
||||||
:initial '{
|
:initial '{
|
||||||
"position": 0,
|
"position": 0,
|
||||||
"duration": 0,
|
"duration": 0,
|
||||||
"readable": "0:00"
|
"readable": "0:00"
|
||||||
}'
|
}'
|
||||||
"playerctl -F metadata -f '{ \"position\": {{position/1000000}}, \"duration\": {{mpris:length/1000000}}, \"readable\": \"{{duration(position)}}/{{duration(mpris:length)}}\" }'")
|
"playerctl -F metadata -f '{ \"position\": {{position/1000000}}, \"duration\": {{mpris:length/1000000}}, \"readable\": \"{{duration(position)}}/{{duration(mpris:length)}}\" }'")
|
||||||
;; (deflisten pside "playerctl -F metadata -f '{ \"volume\": {{volume*100}}, \"shuffle\": \"{{shuffle}}\", \"loop\": \"{{loop}}\" }'")
|
;; (deflisten pside "playerctl -F metadata -f '{ \"volume\": {{volume*100}}, \"shuffle\": \"{{shuffle}}\", \"loop\": \"{{loop}}\" }'")
|
||||||
|
@ -101,34 +101,34 @@
|
||||||
(defpoll uptime :initial "idk" :interval "1m" "uptime -p")
|
(defpoll uptime :initial "idk" :interval "1m" "uptime -p")
|
||||||
(defpoll weatherjson
|
(defpoll weatherjson
|
||||||
:initial '{
|
:initial '{
|
||||||
"FeelsLikeC": "0",
|
"FeelsLikeC": "0",
|
||||||
"FeelsLikeF": "0",
|
"FeelsLikeF": "0",
|
||||||
"cloudcover": "0",
|
"cloudcover": "0",
|
||||||
"humidity": "0",
|
"humidity": "0",
|
||||||
"localObsDateTime": "2000-00-00 07:27 AM",
|
"localObsDateTime": "2000-00-00 07:27 AM",
|
||||||
"observation_time": "07:27 AM",
|
"observation_time": "07:27 AM",
|
||||||
"precipInches": "0.0",
|
"precipInches": "0.0",
|
||||||
"precipMM": "0.0",
|
"precipMM": "0.0",
|
||||||
"pressure": "0",
|
"pressure": "0",
|
||||||
"pressureInches": "0",
|
"pressureInches": "0",
|
||||||
"temp_C": "0",
|
"temp_C": "0",
|
||||||
"temp_F": "0",
|
"temp_F": "0",
|
||||||
"uvIndex": "0",
|
"uvIndex": "0",
|
||||||
"visibility": "0",
|
"visibility": "0",
|
||||||
"visibilityMiles": "0",
|
"visibilityMiles": "0",
|
||||||
"weatherCode": "727",
|
"weatherCode": "727",
|
||||||
"weatherDesc": [{"value": "Idk"}],
|
"weatherDesc": [{"value": "Idk"}],
|
||||||
"weatherIconUrl": [{"value": ""}],
|
"weatherIconUrl": [{"value": ""}],
|
||||||
"winddir16Point": "",
|
"winddir16Point": "",
|
||||||
"winddirDegree": "0",
|
"winddirDegree": "0",
|
||||||
"windspeedKmph": "0",
|
"windspeedKmph": "0",
|
||||||
"windspeedMiles": "0",
|
"windspeedMiles": "0",
|
||||||
"icon": "idk",
|
"icon": "idk",
|
||||||
"hourly": []
|
"hourly": []
|
||||||
}'
|
}'
|
||||||
:interval "1h"
|
:interval "1h"
|
||||||
:run-while revealControlpanel
|
:run-while revealControlpanel
|
||||||
"./scripts/weather.py")
|
"./scripts/weather.py")
|
||||||
(defpoll datehour :initial "12" :interval "30m" "date +'%H'")
|
(defpoll datehour :initial "12" :interval "30m" "date +'%H'")
|
||||||
(defpoll notesc :interval "2s" :run-while reveal4 "cat -s ~/Documents/fuck.txt")
|
(defpoll notesc :interval "2s" :run-while reveal4 "cat -s ~/Documents/fuck.txt")
|
||||||
(defpoll quotejson :interval "1h" `./scripts/quote.py`)
|
(defpoll quotejson :interval "1h" `./scripts/quote.py`)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
(defwidget VolumeOsd []
|
(defwidget VolumeOsd []
|
||||||
(revealer :transition "slideup" :reveal revealOsd :duration "500ms"
|
(revealer :transition "slideup" :reveal revealOsd :duration "500ms"
|
||||||
(box :orientation "h" :class "volume-osd" :space-evenly false
|
(box :orientation "h" :class "volume-osd" :space-evenly false
|
||||||
(VolumeScale))))
|
(VolumeScale))))
|
||||||
|
|
||||||
(defwidget VolumeScale []
|
(defwidget VolumeScale []
|
||||||
(overlay :hexpand true
|
(overlay :hexpand true :class "volume-scale"
|
||||||
(scale :min 0 :max 100 :active {volume != "muted"} :value {volume == "muted" ? 0 : volume} :onchange "pamixer --set-volume {}" :class "volume-scale")
|
(scale :min 0 :max 100 :active {volume != "muted"} :value {volume == "muted" ? 0 : volume} :onchange "pamixer --set-volume {}")
|
||||||
(label :class 'volume-icon ${volume == "muted" ? "less" : volume < 5 ? "less" : "more"}' :halign "start" :text {volume == "muted" ? "" : volume < 33 ? "" : volume < 67 ? "" : ""})))
|
(label :class 'volume-icon ${volume == "muted" ? "less" : volume < 5 ? "less" : "more"}' :halign "start" :text {volume == "muted" ? "" : volume < 33 ? "" : volume < 67 ? "" : ""})))
|
||||||
|
|
||||||
(defwidget VolumeControlCenter []
|
(defwidget VolumeControlCenter []
|
||||||
(box :orientation "h" :class "volume-control-center" :space-evenly false
|
(box :orientation "h" :class "volume-control-center" :space-evenly false
|
||||||
(volume_scale)
|
(volume_scale)
|
||||||
(button :class "volume-mute ${volume == 'muted' ? 'active' : ''}" :onclick "pamixer -t" "")
|
(button :class "volume-mute ${volume == 'muted' ? 'active' : ''}" :onclick "pamixer -t" "")
|
||||||
(button :class "volume-arrow" :onclick "scripts/toggle_control_center.sh close && pavucontrol &" "")))
|
(button :class "volume-arrow" :onclick "scripts/toggle_control_center.sh close && pavucontrol &" "")))
|
Loading…
Add table
Reference in a new issue