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;
background-color: $surface1;
padding: 4px;
check {
min-height: 15px;
min-width: 15px;

View file

@ -1,5 +1,5 @@
.control-panel {
padding: 0.4em;
padding: get-token(padding, small);
background-color: $base;
}
@ -94,21 +94,6 @@
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 {
border-radius: 70px;
background-color: $surface0;

View file

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

View file

@ -26,22 +26,6 @@
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 {
trough {
min-height: 10px;

View file

@ -6,8 +6,8 @@
@import "./assets/scss/windows/control-panel";
@import "./assets/scss/windows/vertical-bar";
@import "./assets/scss/windows/dashboard";
@import "./src/dashboard/styles.scss";
@import "./src/dock/styles.scss";
@import "./src/desktop/styles.scss";
@import "./src/notification/styles.scss";

View file

@ -12,11 +12,11 @@
(include "./src/windows/_vertical-bar.yuck")
(include "./src/windows/_control-panel.yuck")
(include "./src/windows/_dashboard.yuck")
(include "./setups.yuck")
(include "./src/wallpapers/main.yuck")
(include "./src/dashboard/main.yuck")
(include "./src/dock/main.yuck")
(include "./src/desktop/main.yuck")
(include "./src/notification/main.yuck")

View file

@ -21,4 +21,15 @@
:exclusive true
: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"
(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
:geometry (geometry
:width "440"

View file

@ -99,30 +99,30 @@
(defpoll weatherjson
:initial '{
"FeelsLikeC": "0",
"FeelsLikeF": "0",
"cloudcover": "0",
"humidity": "0",
"localObsDateTime": "2000-00-00 07:27 AM",
"observation_time": "07:27 AM",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "0",
"pressureInches": "0",
"temp_C": "0",
"temp_F": "0",
"uvIndex": "0",
"visibility": "0",
"visibilityMiles": "0",
"weatherCode": "727",
"weatherDesc": [{"value": "Idk"}],
"weatherIconUrl": [{"value": ""}],
"winddir16Point": "",
"winddirDegree": "0",
"windspeedKmph": "0",
"windspeedMiles": "0",
"icon": "idk",
"hourly": []
}'
"FeelsLikeF": "0",
"cloudcover": "0",
"humidity": "0",
"localObsDateTime": "2000-00-00 07:27 AM",
"observation_time": "07:27 AM",
"precipInches": "0.0",
"precipMM": "0.0",
"pressure": "0",
"pressureInches": "0",
"temp_C": "0",
"temp_F": "0",
"uvIndex": "0",
"visibility": "0",
"visibilityMiles": "0",
"weatherCode": "727",
"weatherDesc": [{"value": "Idk"}],
"weatherIconUrl": [{"value": ""}],
"winddir16Point": "",
"winddirDegree": "0",
"windspeedKmph": "0",
"windspeedMiles": "0",
"icon": "idk",
"hourly": []
}'
:interval "1h"
:run-while revealControlpanel
"./scripts/weather.py")

View file

@ -10,7 +10,7 @@
(chooser)
; (weather)
(coolmpd :h 160 :permashow true)
(MediaPlayer :h 160 :permashow true)
(box
:orientation "h"
@ -478,45 +478,4 @@
:width 300))
(label
:class "quoteauthor"
: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 "󰒭")))))))
:text "- ${quotejson.author}")))

View file

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