mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2025-12-20 07:15:23 +05:30
eww code refactor
This commit is contained in:
57
eww/eww.scss
57
eww/eww.scss
@@ -3,17 +3,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Background ***************************************/
|
|
||||||
.bg {
|
|
||||||
background-color: rgba(0,0,0,0);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Generic window ***********************************/
|
/** Generic window ***********************************/
|
||||||
.genwin {
|
.genwin {
|
||||||
//background-color: rgba(39, 40, 34, 0.7);
|
//background-color: rgba(39, 40, 34, 0.7);
|
||||||
background-color: rgba(0,0,0,0);
|
background-color: rgba(0,0,0,0);
|
||||||
border-radius: 16px;
|
border-radius: 8rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Clock ********************************************/
|
/** Clock ********************************************/
|
||||||
@@ -28,14 +22,12 @@
|
|||||||
.time_min {
|
.time_min {
|
||||||
margin : 0px 0px 10px 0px;
|
margin : 0px 0px 10px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time_mer {
|
.time_mer {
|
||||||
color: #A3BE8C;
|
color: #A3BE8C;
|
||||||
font-size : 40px;
|
font-size : 40px;
|
||||||
font-weight : bold;
|
font-weight : bold;
|
||||||
margin : 20px 0px 0px 0px;
|
margin : 20px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time_day {
|
.time_day {
|
||||||
color: #EBCB8B;
|
color: #EBCB8B;
|
||||||
font-size : 30px;
|
font-size : 30px;
|
||||||
@@ -43,60 +35,35 @@
|
|||||||
margin : 0px 0px 20px 0px;
|
margin : 0px 0px 20px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Music ***************************************/
|
/** Music ********************************************/
|
||||||
.album_art {
|
|
||||||
background-size: cover;
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
background-color: rgba(0,0,0,0);
|
|
||||||
min-height: 240px;
|
|
||||||
min-width: 240px;
|
|
||||||
margin: 0px 50px 0px 0px;
|
|
||||||
border-radius: 15px;
|
|
||||||
border-style:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.song {
|
.song {
|
||||||
color: #8FBCBB;
|
color: #8FBCBB;
|
||||||
font-size : 24px;
|
font-size : 24px;
|
||||||
font-weight : bold;
|
font-weight : bold;
|
||||||
margin : 10px 0px 0px 0px;
|
margin : 10px 0px 0px 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.artist {
|
.artist {
|
||||||
color: #EBCB8B;
|
color: #EBCB8B;
|
||||||
font-size : 20px;
|
font-size : 20px;
|
||||||
font-weight : normal;
|
font-weight : normal;
|
||||||
margin : 0px 0px 0px 0px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn_play {
|
.btn_play {
|
||||||
margin : 0px 0px 0px 0px;
|
|
||||||
color: #A3BE8C;
|
color: #A3BE8C;
|
||||||
font-family: IosevkaTerm Nerd Font Mono;
|
font-family: IosevkaTerm Nerd Font Mono;
|
||||||
font-size : 70px;
|
font-size : 70px;
|
||||||
}
|
}
|
||||||
|
.btn_play:hover {
|
||||||
.btn_prev {
|
color: #A2A852;
|
||||||
|
}
|
||||||
|
.btn_controls {
|
||||||
color: #EBCB8B;
|
color: #EBCB8B;
|
||||||
font-size : 32px;
|
font-size : 32px;
|
||||||
font-weight : normal;
|
font-family: IosevkaTerm Nerd Font Mono;
|
||||||
}
|
}
|
||||||
|
.btn_controls:hover {
|
||||||
.btn_next {
|
font-size : 50px;
|
||||||
color: #EBCB8B;
|
|
||||||
font-size : 32px;
|
|
||||||
font-weight : normal;
|
|
||||||
}
|
}
|
||||||
|
.music_bar {
|
||||||
.music_bar scale trough highlight {
|
color: #81A1C1;
|
||||||
all: unset;
|
background-color: rgba(0,0,0,0.1);
|
||||||
background-image: linear-gradient(to right, #77a5bf 30%, #91bdce 50%, #afcee0 100% *50);
|
|
||||||
border-radius: 24px;
|
|
||||||
}
|
|
||||||
.music_bar scale trough {
|
|
||||||
background-color: #232232;
|
|
||||||
border-radius: 24px;
|
|
||||||
min-height: 13px;
|
|
||||||
min-width: 190px;
|
|
||||||
margin : 0px 0px 10px 0px;
|
|
||||||
}
|
}
|
||||||
|
|||||||
82
eww/eww.yuck
82
eww/eww.yuck
@@ -10,7 +10,8 @@
|
|||||||
:reserve (struts :distance "40px" :side "top")
|
:reserve (struts :distance "40px" :side "top")
|
||||||
:windowtype "dock"
|
:windowtype "dock"
|
||||||
:wm-ignore false
|
:wm-ignore false
|
||||||
(clock))
|
(clock)
|
||||||
|
)
|
||||||
|
|
||||||
(defwindow time_0
|
(defwindow time_0
|
||||||
:monitor 0
|
:monitor 0
|
||||||
@@ -23,21 +24,25 @@
|
|||||||
:reserve (struts :distance "40px" :side "top")
|
:reserve (struts :distance "40px" :side "top")
|
||||||
:windowtype "dock"
|
:windowtype "dock"
|
||||||
:wm-ignore false
|
:wm-ignore false
|
||||||
(clock))
|
(clock)
|
||||||
|
)
|
||||||
|
|
||||||
(defpoll HOUR :interval "2s" `date +\"%I\"`)
|
(defpoll HOUR :interval "2s" $(date +'%I'))
|
||||||
(defpoll MIN :interval "2s" `date +\"%M\"`)
|
(defpoll MIN :interval "2s" $(date +'%M'))
|
||||||
(defpoll MER :interval "2s" `date +\"%p\"`)
|
(defpoll MER :interval "2s" $(date +'%p'))
|
||||||
(defpoll DAY :interval "5s" `date +\"%A\"`)
|
(defpoll DAY :interval "5s" $(date +'%A'))
|
||||||
|
|
||||||
(defwidget clock []
|
(defwidget clock []
|
||||||
(box :class "genwin" :orientation "h" :spacing 50 :space-evenly false :vexpand "false" :hexpand "false"
|
(box :class "genwin" :orientation "h" :spacing 50 :space-evenly false :vexpand "false" :hexpand "false"
|
||||||
(box :orientation "h" :spacing 0
|
(box :orientation "h" :spacing 0
|
||||||
(label :class "time_hour" :valign "start" :wrap "true" :limit-width 25 :text HOUR)
|
(label :class "time_hour" :valign "start" :wrap "true" :limit-width 25 :text HOUR)
|
||||||
(label :class "time_min" :valign "end" :wrap "true" :limit-width 25 :text MIN))
|
(label :class "time_min" :valign "end" :wrap "true" :limit-width 25 :text MIN))
|
||||||
(box :orientation "v" :spacing 0 :space-evenly true
|
(box :orientation "v" :spacing 0 :space-evenly true
|
||||||
(label :class "time_mer" :valign "start" :halign "end" :wrap "true" :limit-width 25 :text MER)
|
(label :class "time_mer" :valign "start" :halign "end" :wrap "true" :limit-width 25 :text MER)
|
||||||
(label :class "time_day" :valign "end" :halign "end" :wrap "true" :limit-width 25 :text DAY))))
|
(label :class "time_day" :valign "end" :halign "end" :wrap "true" :limit-width 25 :text DAY)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
;; music
|
;; music
|
||||||
(defwindow music_0
|
(defwindow music_0
|
||||||
@@ -51,7 +56,8 @@
|
|||||||
:reserve (struts :distance "10px" :side "bottom")
|
:reserve (struts :distance "10px" :side "bottom")
|
||||||
:windowtype "dock"
|
:windowtype "dock"
|
||||||
:wm-ignore true
|
:wm-ignore true
|
||||||
(music))
|
(music)
|
||||||
|
)
|
||||||
|
|
||||||
(defwindow music_1
|
(defwindow music_1
|
||||||
:monitor 1
|
:monitor 1
|
||||||
@@ -64,30 +70,32 @@
|
|||||||
:reserve (struts :distance "10px" :side "bottom")
|
:reserve (struts :distance "10px" :side "bottom")
|
||||||
:windowtype "dock"
|
:windowtype "dock"
|
||||||
:wm-ignore true
|
:wm-ignore true
|
||||||
(music))
|
(music)
|
||||||
|
)
|
||||||
|
|
||||||
(defpoll SONG :interval "2s" `./script song`)
|
(defpoll SONG :interval "2s" $(./script song))
|
||||||
(defpoll ARTIST :interval "2s" `./script artist`)
|
(defpoll ARTIST :interval "2s" $(./script artist))
|
||||||
(defpoll STATUS :interval "0.5s" `./script status`)
|
(defpoll STATUS :interval "0.4s" $(./script status))
|
||||||
(defpoll COVER :interval "2s" `./script cover`)
|
(defpoll COVER :interval "2s" $(./script cover))
|
||||||
(defpoll CURRENT :interval "1s" `./script time`)
|
(defpoll CURRENT :interval "0.4s" $(./script time))
|
||||||
(defpoll LYRICS :interval "0.4s" `./script lyrics`)
|
(defpoll LYRICS :interval "0.4s" $(./script lyrics))
|
||||||
|
|
||||||
(defwidget music []
|
(defwidget music []
|
||||||
(box :class "genwin" :orientation "v" :spacing 20 :space-evenly "false" :vexpand "true" :hexpand "true"
|
(box :class "genwin" :orientation "h" :spacing 50 :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||||
(box :orientation "h" :space-evenly "false" :vexpand "true" :hexpand "false"
|
(box :class "box_art" :vexpand "false" :hexpand "false"
|
||||||
(box :class "album_art" :vexpand "false" :hexpand "false" :style "background-image: url('${COVER}');")
|
(circular-progress :class "music_bar" :value CURRENT :thickness 10 :clockwise true :start-at 75
|
||||||
(box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false"
|
(image :path COVER :image-height 300 :image-width 300)))
|
||||||
(label :halign "center" :class "song" :wrap "false" :limit-width 25 :text SONG)
|
(box :orientation "v" :spacing 15 :space-evenly "false" :vexpand "false" :hexpand "false"
|
||||||
(label :halign "center" :class "artist" :wrap "false" :text ARTIST)
|
(label :halign "center" :class "song" :wrap "false" :limit-width 30 :text SONG)
|
||||||
(box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false"
|
(label :halign "center" :class "artist" :wrap "false" :text ARTIST)
|
||||||
(button :class "btn_prev" :onclick "./script prev" "玲")
|
(box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false"
|
||||||
(button :class "btn_prev" :onclick "./script seek '-1'" "")
|
(button :class "btn_controls" :onclick "./script prev" "玲")
|
||||||
(button :class "btn_play" :onclick "./script play_toggle" STATUS)
|
(button :class "btn_controls" :onclick "./script seek '-1'" "")
|
||||||
(button :class "btn_next" :onclick "./script seek '1'" "")
|
(button :class "btn_play" :onclick "./script play_toggle" STATUS)
|
||||||
(button :class "btn_next" :onclick "./script next" "怜"))
|
(button :class "btn_controls" :onclick "./script seek '1'" "")
|
||||||
(box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false" :space-evenly "false"
|
(button :class "btn_controls" :onclick "./script next" "怜"))
|
||||||
(scale :min 0 :active "true" :max 100 :value CURRENT))))
|
(label :halign "center" :wrap "true" :class "artist" :text LYRICS)
|
||||||
(label :halign "center" :class "artist" :text LYRICS)))
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|||||||
BIN
eww/music.png
Normal file → Executable file
BIN
eww/music.png
Normal file → Executable file
Binary file not shown.
|
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 26 KiB |
BIN
eww/music.png.bak
Normal file
BIN
eww/music.png.bak
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
@@ -6,12 +6,12 @@ case $1 in
|
|||||||
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
|
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
|
||||||
cut -d'>' -f1 < "/tmp/yt-music/current" | cut -d':' -f2 | sed 's|[^-]*$||;s|-$||'
|
cut -d'>' -f1 < "/tmp/yt-music/current" | cut -d':' -f2 | sed 's|[^-]*$||;s|-$||'
|
||||||
else
|
else
|
||||||
printf "Music widget by Coolans X"
|
printf "OFFLINE"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
artist)
|
artist)
|
||||||
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
|
if [ -n "$out" ] && pgrep -f mpvsocket >/dev/null 2>&1;then
|
||||||
cut -d'>' -f1 < "/tmp/yt-music/current" | sed 's_.* -__'
|
cut -d'>' -f1 < "/tmp/yt-music/current" | sed 's_.* -__;s| $||'
|
||||||
else
|
else
|
||||||
printf "Offline"
|
printf "Offline"
|
||||||
fi
|
fi
|
||||||
@@ -38,6 +38,9 @@ case $1 in
|
|||||||
next)
|
next)
|
||||||
pgrep -f mpvsocket >/dev/null 2>&1 && "$HOME/repos_scripts/yt-music" play_next
|
pgrep -f mpvsocket >/dev/null 2>&1 && "$HOME/repos_scripts/yt-music" play_next
|
||||||
;;
|
;;
|
||||||
|
next_song)
|
||||||
|
sed -n "$(cat /tmp/yt-music/counter){n;p}" /tmp/yt-music/next | cut -f1
|
||||||
|
;;
|
||||||
prev)
|
prev)
|
||||||
pgrep -f mpvsocket >/dev/null 2>&1 && ("$HOME/repos_scripts/yt-music" play "$(sed 's| >|\t|g' /tmp/yt-music/prev | cut -d':' -f2)")
|
pgrep -f mpvsocket >/dev/null 2>&1 && ("$HOME/repos_scripts/yt-music" play "$(sed 's| >|\t|g' /tmp/yt-music/prev | cut -d':' -f2)")
|
||||||
;;
|
;;
|
||||||
@@ -52,7 +55,7 @@ case $1 in
|
|||||||
if [ -f "/tmp/yt-music/lyrics" ]; then
|
if [ -f "/tmp/yt-music/lyrics" ]; then
|
||||||
sed -n "/^$(awk -v value="$(echo '{ "command": ["get_property", "time-pos"] }' | socat - /tmp/mpvsocket | sed -nE 's|.*data":([^,]*).*|\1|p')" '$1 > value*1000 {print $1;exit}' /tmp/yt-music/lyrics)\t/p" /tmp/yt-music/lyrics | cut -f2
|
sed -n "/^$(awk -v value="$(echo '{ "command": ["get_property", "time-pos"] }' | socat - /tmp/mpvsocket | sed -nE 's|.*data":([^,]*).*|\1|p')" '$1 > value*1000 {print $1;exit}' /tmp/yt-music/lyrics)\t/p" /tmp/yt-music/lyrics | cut -f2
|
||||||
else
|
else
|
||||||
printf "Lyrics By musixmatch"
|
printf "Lyrics will show here"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user