feat: music player

This commit is contained in:
hesam-init 2024-07-02 10:29:02 +03:30
parent f3830fc2db
commit eeb13714e3
12 changed files with 136 additions and 117 deletions

View file

@ -44,3 +44,32 @@
} }
} }
} }
.media-player {
@extend .panel-widget;
padding: 0px;
.player-cover {
transition: 600ms ease;
margin: get-token(margin);
border-radius: get-token(border-radius);
background-repeat: no-repeat;
background-size: cover;
background-position: center;
opacity: 0.1;
}
.player-controls {
label {
font-size: get-token(font-sizes, large);
padding: 15px;
}
}
.player-info {
label {
font-size: get-token(font-sizes, large);
}
}
}

View file

@ -68,6 +68,7 @@ checkbutton {
border-radius: 24px; border-radius: 24px;
background-color: $surface1; background-color: $surface1;
padding: 4px; padding: 4px;
check { check {
min-height: 15px; min-height: 15px;
min-width: 15px; min-width: 15px;

View file

@ -1,5 +1,5 @@
.control-panel { .control-panel {
padding: 0.4em; padding: get-token(padding, small);
background-color: $base; background-color: $base;
} }
@ -94,21 +94,6 @@
margin: 5px; margin: 5px;
} }
.coolmpd label {
color: $white0;
}
.mpdcover {
transition: 500ms ease;
background-color: $surface0;
margin: 5px;
border-radius: 5px;
background-repeat: no-repeat;
background-size: cover;
background-position: center;
opacity: 0.3;
}
.circiconcontain { .circiconcontain {
border-radius: 70px; border-radius: 70px;
background-color: $surface0; background-color: $surface0;

View file

@ -1,3 +1,9 @@
.dashboard {
padding: get-token(padding);
border-radius: get-token(border-radius);
background-color: $base;
}
.heading { .heading {
font-size: 25px; font-size: 25px;
color: $accent; color: $accent;

View file

@ -26,22 +26,6 @@
background-color: $red; background-color: $red;
} }
// .mpd label {
// color: $sky;
// }
//
// .playerctl label {
// color: $sapphire;
// }
.mpd_controls label {
font-family: "Symbols Nerd Font";
min-width: 1em;
min-height: 1em;
font-size: 30px;
padding: 15px;
}
.seektime { .seektime {
trough { trough {
min-height: 10px; min-height: 10px;

View file

@ -6,8 +6,8 @@
@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 "./src/dashboard/styles.scss";
@import "./src/dock/styles.scss"; @import "./src/dock/styles.scss";
@import "./src/desktop/styles.scss"; @import "./src/desktop/styles.scss";
@import "./src/notification/styles.scss"; @import "./src/notification/styles.scss";

View file

@ -12,11 +12,11 @@
(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 "./setups.yuck") (include "./setups.yuck")
(include "./src/wallpapers/main.yuck") (include "./src/wallpapers/main.yuck")
(include "./src/dashboard/main.yuck")
(include "./src/dock/main.yuck") (include "./src/dock/main.yuck")
(include "./src/desktop/main.yuck") (include "./src/desktop/main.yuck")
(include "./src/notification/main.yuck") (include "./src/notification/main.yuck")

View file

@ -22,3 +22,14 @@
:wm-ignore false :wm-ignore false
(VerticalBar)) (VerticalBar))
(defwindow dashboard
:geometry (geometry
:x 0
:y 0
:width 800
:height 420
:anchor "center")
:stacking "overlay"
:monitor 0
(Dashboard))

View file

@ -20,6 +20,56 @@
(button :onclick "playerctl next" (button :onclick "playerctl next"
(label :class "icon" :text "󰒭"))))) (label :class "icon" :text "󰒭")))))
(defwidget MediaPlayer [h permashow]
(box
:class "media-player"
(overlay
(box
:orientation "v"
:halign "fill"
:height h
:class { pcover != "" ? "player-cover" : ""}
:style "background-image: url('${pcover}')"
:visible {permashow ? true : pcover != "" })
(box
:orientation "h"
:space-evenly false
:halign "center"
:valign "center"
:spacing 10
(image :image-width 100 :image-height 100 :path { pcover == "" ? "./assets/image/emptympd.png" : pcover })
(box
:orientation "v"
:space-evenly false
:width 200
:halign "center"
:valign "center"
:class "player-info"
(scroll
:hscroll true
:vscroll false
(label :text psong))
(scroll
:hscroll true
:vscroll false
(label :text partist))
(box
:orientation "h"
:class "player-controls"
(button :onclick "playerctl previous"
(label :text "󰒮"))
(button :style "padding-right: 3px;" :onclick "playerctl play-pause"
(label :text { pstatus == "Playing" ? "" : ""} ))
(button :onclick "playerctl next"
(label :text "󰒭"))))))
)
)
(defwindow MusicPlayerPopup (defwindow MusicPlayerPopup
:geometry (geometry :geometry (geometry
:width "440" :width "440"

View file

@ -99,30 +99,30 @@
(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")

View file

@ -10,7 +10,7 @@
(chooser) (chooser)
; (weather) ; (weather)
(coolmpd :h 160 :permashow true) (MediaPlayer :h 160 :permashow true)
(box (box
:orientation "h" :orientation "h"
@ -479,44 +479,3 @@
(label (label
:class "quoteauthor" :class "quoteauthor"
:text "- ${quotejson.author}"))) :text "- ${quotejson.author}")))
(defwidget coolmpd [h permashow]
(overlay
(box
:orientation "v"
:halign "fill"
:height h
:class { pcover != "" ? "mpdcover" : "panel-widget"}
:style "background-image: url('${pcover}')"
:visible {permashow ? true : pcover != "" })
(box
:orientation "h"
:space-evenly false
:halign "center"
:valign "center"
:spacing 10
(image :image-width 100 :image-height 100 :path { pcover == "" ? "./assets/image/emptympd.png" : pcover })
(box
:orientation "v"
:space-evenly false
:width 200
:halign "center"
:valign "center"
:class "coolmpd"
(scroll
:hscroll true
:vscroll false
(label :style "font-size: 20px;" :text psong))
(scroll
:hscroll true
:vscroll false
(label :text partist))
(box
:orientation "h"
:class "mpd_controls"
(button :onclick "playerctl previous"
(label :text "󰒮"))
(button :style "padding-right: 3px;" :onclick "playerctl play-pause"
(label :text { pstatus == "Playing" ? "" : ""} ))
(button :onclick "playerctl next"
(label :text "󰒭")))))))

View file

@ -1,29 +1,22 @@
(defwidget Dashboard []
(defwindow dashboard
:geometry (geometry
:x 0
:y 0
:width 800
:height 420
:anchor "center")
:stacking "overlay"
:monitor 0
(structure))
(defwidget structure []
(box (box
:class "popup" :class "dashboard"
:space-evenly false :space-evenly false
:orientation "v" :orientation "v"
(duser :name "Failed" :tag "failed.sh" :pfp "./assets/image/roundpfp.png") (duser :name "Failed" :tag "failed.sh" :pfp "./assets/image/roundpfp.png")
(box (box
:space-evenly true :space-evenly true
:orientation "h" :orientation "h"
:vexpand true :vexpand true
(box (box
:space-evenly false :space-evenly false
:orientation "v" :orientation "v"
(coolmpd :h 150 :permashow true)
(MediaPlayer :h 150 :permashow true)
(box (box
:space-evenly false :space-evenly false
:orientation "h" :orientation "h"
@ -35,6 +28,7 @@
(theme)) (theme))
(dcal) (dcal)
)) ))
(box (box
:orientation "v" :orientation "v"
:space-evenly false :space-evenly false