refactor: remove all eww configs

This commit is contained in:
matt1432 2023-09-17 15:56:48 -04:00
parent 2d386cf499
commit 81c36b5dec
4 changed files with 0 additions and 347 deletions

View file

@ -1,90 +0,0 @@
.playerinfo {
padding: 10px;
min-width: 400px;
border-radius: 30px;
border-top: 2px solid $contrastbg;
border-bottom: 2px solid $contrastbg;
transition: background 250ms;
.top {
font-size: 23px;
}
.metadata {
.title{
font-weight: 500;
transition: text 250ms;
}
.artist{
font-weight: 400;
font-size: 15px;
transition: text 250ms;
}
}
.bottom {
font-size: 30px;
}
.pausebutton {
transition: background 250ms;
padding: 14px 16px;
font-size: 15px;
}
.playing {
transition: all ease .2s;
border-radius: 15px;
label {
padding-left: 4px;
}
}
.paused {
border-radius: 26px;
transition: all ease .2s;
padding: 14px 14px 14px 18px;
}
}
.previousbutton,
.nextbutton,
.shuffle,
.repeat {
border-radius: 100%;
transition: background-color 200ms;
&:hover {
border-radius: 100%;
background-color: rgba(127, 132, 156, 0.4);
transition: background-color 200ms;
}
}
.repeat {
label {
padding-right: 8px;
}
}
.song-pos {
scale {
highlight {
margin: 0px;
border-radius: 2em;
}
trough {
background-color: #363847;
border-radius: 2em;
}
slider {
margin: -8px;
min-height: 20px;
border-radius: 10px;
box-shadow: rgba(0, 0, 0, 0.25) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(0, 0, 0, 0.17) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
transition: background-color 0.5s ease-in-out;
}
slider:hover {
background-color: #303240;
transition: background-color 0.5s ease-in-out;
}
}
}

View file

@ -1,124 +0,0 @@
(defpoll player :interval "1s" "echo Spot")
(defpoll music_cover :interval "1s" "$EWW_PATH/music.sh cover") ;done
(defvar music_accent "rgb(0,0,0)") ;done
(defvar button_accent "rgb(0,0,0)") ;done
(defvar button_text "rgb(255,255,255)") ;done
(defpoll music_status :interval "1s" "playerctl -p Spot status")
(defpoll title :interval "1s" "playerctl -p Spot metadata title")
(defpoll artist :interval "1s" "playerctl -p Spot metadata artist")
(defvar button_height "42")
(defpoll shuffle_status :interval "1s" "playerctl -p Spot shuffle")
(defpoll repeat_icon :interval "1s" "$EWW_PATH/music.sh loop_status")
(defvar song_pos "0")
(defpoll song_length :interval "1s" "$EWW_PATH/music.sh length")
(defvar get_pos "true")
(defwidget playerinfo []
(centerbox :class "playerinfo"
:style "background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 30%, ${music_accent}), url(\"${music_cover}\");
background-size: cover;
background-position: center;"
:orientation "v"
(box :class "top"
:halign "start"
:valign "start"
:style "color: ${button_accent};"
"${player == 'Spot' ? '' : '爵' }"
)
(box :class "center"
:orientation "h"
:space-evenly false
(box :class "metadata"
:orientation "v"
:halign "start"
:valign "center"
:hexpand true
(label :limit-width 25 :halign "start" :text title :class "title")
(label :limit-width 25 :halign "start" :text artist :class "artist")
)
(centerbox :orientation "v"
(label)
(eventbox :class "pausebutton ${music_status == 'Playing' ? 'playing' : 'paused'}"
:halign "left"
:style "background-color: ${button_accent};
color: ${button_text};"
:onclick "playerctl -p Spot play-pause"
:cursor "pointer"
:onhover "eww update button_height=41"
:onhoverlost "eww update button_height=42"
(label :text "${music_status == 'Playing' ? ' ' : ''}"
:width button_height
:height button_height
)
)
(label)
)
)
(box :class "bottom"
:style "color: ${button_accent};"
:space-evenly false
:spacing 0
(eventbox :valign "end"
:halign "start"
:onclick "playerctl -p Spot previous & $EWW_PATH/music.sh cover"
:class "previousbutton"
:width 40
:cursor "pointer"
"󰒮"
)
(eventbox :cursor "pointer"
:class "song-pos"
:hexpand true
:onhover "eww update get_pos=false"
:onhoverlost "eww update get_pos=true"
(scale :value song_pos
:min 0
:max song_length
:orientation "h"
:onchange "playerctl -p Spot position {}"
:css "highlight { background-color: ${button_accent}; }
slider { background-color: ${button_accent}; }
trough { background-color: rgba(${button_accent}, 0.4); }"
)
)
(box :valign "end"
:halign "end"
(eventbox :onclick "playerctl -p Spot next & $EWW_PATH/music.sh cover"
:class "nextbutton"
:width 40
:cursor "pointer"
"󰒭"
)
(eventbox :onclick "playerctl -p Spot shuffle toggle"
:class "shuffle"
:width 40
:cursor "pointer"
"${shuffle_status == 'On' ? '󰒝' : '󰒞'}"
)
(eventbox :onclick "$EWW_PATH/music.sh loop"
:class "repeat"
:width 40
:cursor "pointer"
"${repeat_icon}"
)
)
)
)
)
(defwindow playerinfo
:monitor 0
:stacking "overlay"
:exclusive "ignore"
:focusable "false"
:geometry (geometry :x "800px"
:y "10px"
:width "0px"
:height "0px"
:anchor "top left"
)
(playerinfo)
)

View file

@ -1,46 +0,0 @@
#!/usr/bin/env bash
FILE="$HOME/.config/.heart"
toggle() {
if grep -q 󰣐 "$FILE"; then
eww update heart-ts=false
echo  > "$FILE"
else
eww update heart-ts=true
echo 󰣐 >> "$FILE"
fi
}
[[ "$1" == "toggle" ]] && toggle
startup() {
(
if [[ ! -f "$FILE" ]]; then
echo 󰣐 > "$FILE"
fi
if [[ ! -f "$HOME/.config/.bluetooth" ]]; then
echo 󰂲 > "$FILE"
fi
if grep -q 󰂲 "$HOME/.config/.bluetooth"; then
rfkill block bluetooth
fi
"$HYPR_PATH"/osk-toggle.sh getState &
"$EWW_PATH"/on-release.sh &
"$EWW_PATH"/music.sh accents &
input-emulator start mouse -n &
if grep -q 󰣐 "$FILE"; then
sleep 0.9 &&
eww update heart-ts=true
fi
) &
tail -f "$FILE"
}
[[ "$1" == "startup" ]] && startup

View file

@ -1,87 +0,0 @@
#!/usr/bin/env bash
loop() {
loop_status=$(playerctl -p Spot loop)
case $loop_status in
"None" )
playerctl -p Spot loop Playlist
eww update repeat_icon="󰑖"
;;
"Track" )
playerctl -p Spot loop None
eww update repeat_icon="󰑗"
;;
"Playlist" )
playerctl -p Spot loop Track
eww update repeat_icon="󰑘"
;;
* )
echo "Unknown loop status."
;;
esac
}
loop_status() {
loop_status=$(playerctl -p Spot loop)
case $loop_status in
"None" )
eww update repeat_icon="󰑗"
;;
"Track" )
eww update repeat_icon="󰑘"
;;
"Playlist" )
eww update repeat_icon="󰑖"
;;
* )
echo "Unknown loop status."
;;
esac
}
get_length() {
if [[ $(eww get get_pos) == "true" ]]; then
eww update song_pos="$(playerctl -p Spot position)"
fi
eww update song_length="$(echo "$(playerctl -p Spot metadata mpris:length)/1000000" | bc -l)"
}
get_accents() {
accents="$(coloryou /tmp/cover.jpg | sed 's/,//g' | sed 's/}//' | sed 's/'\''//g')"
music_accent=$(echo "$accents" | awk '{ print $2 }')
eww update music_accent="$music_accent"
button_accent=$(echo "$accents" | awk '{ print $4 }')
eww update button_accent="$button_accent"
button_text=$(echo "$accents" | awk '{ print $6 }')
eww update button_text="$button_text"
}
get_cover() {
existing_file="/tmp/cover.jpg"
new_image_url=$(playerctl -p Spot metadata mpris:artUrl)
existing_hash=$(md5sum "$existing_file" | awk '{print $1}')
# Download the new image only if the hashes are different
if [[ "$(wget -qO- "$new_image_url" | md5sum | awk '{print $1}')" != "$existing_hash" ]]; then
wget -qO "$existing_file" "$new_image_url"
get_accents
fi
if [[ -s "/tmp/cover.jpg" ]]; then
eww update showplayer=true
echo "/tmp/cover.jpg"
else
eww update showplayer=false
echo "randomfile"
fi
}
[[ "$1" == "accents" ]] && get_accents
[[ "$1" == "loop" ]] && loop
[[ "$1" == "loop_status" ]] && loop_status
[[ "$1" == "length" ]] && get_length
[[ "$1" == "cover" ]] && get_cover