eww: dashboard(fake) & spotify player
This commit is contained in:
7
.scripts/toggle-player.sh
Executable file
7
.scripts/toggle-player.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/env bash
|
||||
|
||||
if [ -n "$(eww active-windows | grep -i "player")" ]; then
|
||||
eww close player
|
||||
elif [ -n "$(pgrep -i "spotify")" ]; then
|
||||
eww open player
|
||||
fi
|
||||
8
.scripts/wp-vol
Executable file
8
.scripts/wp-vol
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Get the volume level and convert it to a percentage
|
||||
volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||
volume=$(echo "$volume" | awk '{print $2}')
|
||||
volume=$(echo "( $volume * 100 ) / 1" | bc)
|
||||
|
||||
notify-send -t 1000 -a 'wp-vol' -h int:value:$volume "Volume: ${volume}%"
|
||||
24
cava/config
24
cava/config
@@ -229,15 +229,15 @@ foreground = '#b4befe'
|
||||
# Gradient mode, only hex defined colors are supported,
|
||||
# background must also be defined in hex or remain commented out. 1 = on, 0 = off.
|
||||
# You can define as many as 8 different colors. They range from bottom to top of screen
|
||||
; gradient = 0
|
||||
; gradient_color_1 = '#59cc33'
|
||||
; gradient_color_2 = '#80cc33'
|
||||
; gradient_color_3 = '#a6cc33'
|
||||
; gradient_color_4 = '#cccc33'
|
||||
; gradient_color_5 = '#cca633'
|
||||
; gradient_color_6 = '#cc8033'
|
||||
; gradient_color_7 = '#cc5933'
|
||||
; gradient_color_8 = '#cc3333'
|
||||
gradient = 1
|
||||
gradient_color_1 = '#94e2d5'
|
||||
gradient_color_2 = '#89dceb'
|
||||
gradient_color_3 = '#74c7ec'
|
||||
gradient_color_4 = '#89b4fa'
|
||||
gradient_color_5 = '#cba6f7'
|
||||
gradient_color_6 = '#f5c2e7'
|
||||
gradient_color_7 = '#eba0ac'
|
||||
gradient_color_8 = '#f38ba8'
|
||||
|
||||
|
||||
|
||||
@@ -273,8 +273,8 @@ foreground = '#b4befe'
|
||||
# This one is tricky. You can have as much keys as you want.
|
||||
# Remember to uncomment more than one key! More keys = more precision.
|
||||
# Look at readme.md on github for further explanations and examples.
|
||||
1 = 2 # bass
|
||||
2 = 1.5
|
||||
1 = 1.5 # bass
|
||||
2 = 1
|
||||
3 = 1 # midtone
|
||||
4 = 1
|
||||
4 = 0.5
|
||||
5 = 0.5 # treble
|
||||
|
||||
216
eww/Main/eww.scss
Normal file
216
eww/Main/eww.scss
Normal file
@@ -0,0 +1,216 @@
|
||||
* {
|
||||
all: unset;
|
||||
transition: 200ms ease-out;
|
||||
}
|
||||
|
||||
.main-window {
|
||||
background-color: $bg;
|
||||
font-family: 'Fira Sans Semibold', 'Font Awesome 6 Free', FontAwesome;
|
||||
border-radius: 20px;
|
||||
border: 3px solid $blue;
|
||||
}
|
||||
|
||||
.date-box {
|
||||
background-color: $gray-alt;
|
||||
margin: 20px 20px 0px 20px;
|
||||
min-width: 290px;
|
||||
padding: 20px 10px 20px 10px;
|
||||
border-radius: 15px;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-weight: bold;
|
||||
font-size: 80px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.date {
|
||||
font-family: 'Noto Sans';
|
||||
font-size: 24px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.weather-box {
|
||||
background-color: $gray-alt;
|
||||
margin: 20px 20px 0px 0px;
|
||||
padding: 20px 20px 20px 10px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.weather-desc {
|
||||
font-family: 'Noto Sans';
|
||||
color: $fg-alt;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.weather-temp {
|
||||
font-size: 30px;
|
||||
color: $fg;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.weather-icon {
|
||||
font-family: 'JetBrainsMono Nerd Font';
|
||||
font-size: 60px;
|
||||
}
|
||||
|
||||
.stats-box {
|
||||
background-color: $gray-alt;
|
||||
margin: 20px 20px 0px 20px;
|
||||
padding: 20px 35px 20px 25px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.stats-header {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
.volume-icon,
|
||||
.brightness-icon,
|
||||
.cpu-icon,
|
||||
.memory-icon {
|
||||
font-size: 20px;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.volume-scale trough,
|
||||
.brightness-scale trough,
|
||||
.cpu-scale trough,
|
||||
.memory-scale trough {
|
||||
all: unset;
|
||||
background-color: $gray;
|
||||
min-height: 10px;
|
||||
border-radius: 15px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.volume-scale highlight {
|
||||
background-color: $green;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.brightness-scale highlight {
|
||||
background-color: $yellow;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.cpu-scale highlight {
|
||||
background-color: $red;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.memory-scale highlight {
|
||||
background-color: $blue;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.fortune-box {
|
||||
background-color: $gray-alt;
|
||||
margin: 20px 20px 0px 0px;
|
||||
padding: 20px 35px 20px 25px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.fortune-header {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
.fortune-text {
|
||||
font-family: 'Noto Sans';
|
||||
font-size: 14px;
|
||||
color: $fg;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.music-art-box {
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
min-width: 455px;
|
||||
min-height: 200px;
|
||||
border-radius: 17px;
|
||||
background-position: center;
|
||||
margin: 20px 0px 0px 20px;
|
||||
}
|
||||
|
||||
.music-title {
|
||||
margin: 20px 0px 0px 20px;
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.music-artist {
|
||||
margin: 10px 0px 0px 20px;
|
||||
font-size: 20px;
|
||||
color: $fg-alt;
|
||||
}
|
||||
|
||||
.music-length {
|
||||
margin: 90px 0px 0px 20px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: $fg-alt;
|
||||
}
|
||||
|
||||
.music-stuff-box {
|
||||
min-height: 200px;
|
||||
border-radius: 15px;
|
||||
background: linear-gradient(to right, $bg-alt, transparent);
|
||||
}
|
||||
|
||||
.music-controls-box {
|
||||
margin: 20px 20px 0px 20px;
|
||||
background-color: $gray-alt;
|
||||
padding: 0px 23px 0px 23px;
|
||||
border-radius: 15px;
|
||||
text-shadow: 0px 0px 10px rgba(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
.music-next,
|
||||
.music-previous {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.music-pp {
|
||||
font-size: 44px;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.music-next:hover,
|
||||
.music-previous:hover,
|
||||
.music-pp:hover {
|
||||
color: $orange;
|
||||
}
|
||||
|
||||
.profile-stuff-box {
|
||||
margin: 20px 20px 0px 20px;
|
||||
background-color: $gray-alt;
|
||||
border-radius: 15px;
|
||||
padding: 15px 20px 15px 20px;
|
||||
}
|
||||
|
||||
.profile-img {
|
||||
border-radius: 10px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
min-width: 90px;
|
||||
box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
.profile-stuff {
|
||||
font-family: 'Noto Sans';
|
||||
padding: 7px 0px 0px 30px;
|
||||
font-size: 16px;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.profile-name {
|
||||
font-family: 'Fira Sans Semibold', 'Font Awesome 6 Free', FontAwesome;
|
||||
font-weight: bold;
|
||||
}
|
||||
83
eww/Main/eww.yuck
Normal file
83
eww/Main/eww.yuck
Normal file
@@ -0,0 +1,83 @@
|
||||
;; variables
|
||||
(defvar window false)
|
||||
(defpoll time :interval "1s" "date '+%I %M'")
|
||||
(defpoll date :interval "1s" "date '+%A, %B %d'")
|
||||
(deflisten notifications-cards "Main/scripts/logger.zsh subscribe")
|
||||
(defpoll notifications-crits :interval "1s" "Main/scripts/logger.zsh crits")
|
||||
(defpoll weather-icon :interval "20m" "Main/scripts/weather --icon")
|
||||
(defpoll weather-temp :interval "20m" "Main/scripts/weather --temp")
|
||||
(defpoll weather-desc :interval "20m" "Main/scripts/weather --stat")
|
||||
(deflisten weather-color :initial "#7aa2f7" "Main/scripts/weather --hex")
|
||||
(defpoll calendar-day :interval "20h" "+%d")
|
||||
(defpoll calendar-year :interval "20h" "+%Y")
|
||||
(defpoll calendar-month :interval "20h" "%+B")
|
||||
(defpoll cpu :interval "1s" "Main/scripts/system --cpu")
|
||||
(defpoll memory :interval "1s" "Main/scripts/system --mem")
|
||||
(defpoll profile-image :interval "10h" "Main/scripts/details --image")
|
||||
(defpoll profile-username :interval "1h" "whoami")
|
||||
(defpoll profile-name :interval "1h" "Main/scripts/details --name")
|
||||
(defpoll profile-kernel :interval "1h" "Main/scripts/details --kernel")
|
||||
(defpoll profile-os :interval "1h" "Main/scripts/details --os")
|
||||
(defpoll music-length :interval "1s" "Main/scripts/music-length")
|
||||
(defpoll music-title :interval "1s" "Main/scripts/music-title --status")
|
||||
(defpoll music-pp :interval "1s" "Main/scripts/music-title --icon")
|
||||
(defpoll music-artist :interval "1s" "Main/scripts/music-artist")
|
||||
(defpoll music-art :interval "1s" "Main/scripts/music-art")
|
||||
(defpoll volume :interval "1s" "Main/scripts/system --vol")
|
||||
(defpoll brightness :interval "1s" "Main/scripts/system --bri")
|
||||
(defpoll fortune :interval "1h" "Main/scripts/fortune.py 32 9")
|
||||
|
||||
|
||||
;; widgets
|
||||
(defwidget main []
|
||||
(box :class "main-window" :space-evenly "false" :orientation "v"
|
||||
(box :class "top-row" :orientation "h" :space-evenly "false"
|
||||
(box :class "date-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false"
|
||||
(label :class "time" :text time)
|
||||
(label :class "date" :text date))
|
||||
(box :class "weather-box" :space-evenly "false" :hexpand "true" :orientation "v"
|
||||
(label :class "weather-desc" :halign "start" :text weather-desc)
|
||||
(label :class "weather-temp" :halign "start" :text weather-temp)
|
||||
(label :class "weather-icon" :halign "end" :valign "end" :text weather-icon :style "color: ${weather-color}")))
|
||||
(box :class "second-row" :orientation "h" :space-evenly "false"
|
||||
(box :class "stats-box" :space-evenly "false" :orientation "v" :spacing 8
|
||||
(label :class "stats-header" :halign "start" :text "Stats")
|
||||
(box :class "volume-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
|
||||
(label :tooltip "${volume}%" :class "volume-icon" :text "")
|
||||
(scale :min 0 :max 101 :active false :value {volume == "" ? 0 : volume} :class "volume-scale" :width 150))
|
||||
(box :class "brightness-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
|
||||
(label :tooltip "${brightness}%" :class "brightness-icon" :text "")
|
||||
(scale :min 0 :max 101 :active false :value {brightness == "" ? 0 : brightness} :class "brightness-scale" :width 150))
|
||||
(box :class "cpu-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
|
||||
(label :tooltip "${cpu}%" :class "cpu-icon" :text "")
|
||||
(scale :min 0 :max 101 :active false :value {cpu == "" ? 0 : cpu} :class "cpu-scale" :width 150))
|
||||
(box :class "memory-stats" :hexpand "false" :vexpand "false" :space-evenly "false"
|
||||
(label :tooltip "${memory}%" :class "memory-icon" :text "")
|
||||
(scale :min 0 :max 101 :active false :value {memory == "" ? 0 : memory} :class "memory-scale" :width 150)))
|
||||
(box :class "fortune-box" :space-evenly "false" :hexpand "true" :orientation "v"
|
||||
(label :class "fortune-header" :halign "start" :text "Fortune")
|
||||
(label :class "fortune-text" :halign "start" :text fortune :show-truncated true :wrap true)))
|
||||
(box :class "third-row" :orientation "h" :space-evenly "false"
|
||||
(box :class "music-art-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false" :style "background-image: url(\"${music-art}\");"
|
||||
(box :class "music-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v"
|
||||
(label :class "music-title" :text music-title :halign "start" :limit-width 22 :tooltip music-title)
|
||||
(label :class "music-artist" :text music-artist :halign "start" :limit-width 22 :tooltip music-artist)
|
||||
(label :class "music-length" :text music-length :halign "start" :valign "end")))
|
||||
(box :class "music-controls-box" :space-evenly "true" :hexpand "true" :vexpand "false" :orientation "v"
|
||||
(button :class "music-previous" :halign "center" :onclick "playerctl previous" "")
|
||||
(button :class "music-pp" :halign "center" :onclick "playerctl play-pause" "${music-pp}")
|
||||
(button :class "music-next" :halign "center" :onclick "playerctl next" "")))
|
||||
(box :class "profile-stuff-box" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "h" :height 140
|
||||
(box :class "profile-img" :space-evenly "false" :hexpand "false" :vexpand "false" :orientation "v" :style "background-image: url(\"${profile-image}\");")
|
||||
(box :class "profile-stuff" :orientation "v" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 8
|
||||
(label :class "profile-name" :text profile-name :halign "start")
|
||||
(label :class "profile-os" :text profile-os :halign "start")
|
||||
(label :class "profile-kernel" :text profile-kernel :halign "start")))))
|
||||
|
||||
;; windows
|
||||
(defwindow main
|
||||
:windowtype "normal"
|
||||
:wm-ignore true
|
||||
:monitor 0
|
||||
:geometry (geometry :x 2 :y 0 :width 600 :height 846)
|
||||
(main))
|
||||
1
eww/Main/images/.gitignore
vendored
Normal file
1
eww/Main/images/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
temp*
|
||||
1
eww/Main/images/default-music.svg
Normal file
1
eww/Main/images/default-music.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 148 KiB |
1
eww/Main/images/no-notifications.svg
Normal file
1
eww/Main/images/no-notifications.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svgjs="http://svgjs.com/svgjs" xmlns:xlink="http://www.w3.org/1999/xlink" id="SvgjsSvg1016" width="288" height="288" version="1.1"><g id="SvgjsG1018"><svg xmlns="http://www.w3.org/2000/svg" width="288" height="288" viewBox="0 0 512 512"><path fill="none" d="M416,512H96A96,96,0,0,1,0,416V96A96,96,0,0,1,96,0H416a96,96,0,0,1,96,96V416A96,96,0,0,1,416,512Zm0,0" data-name="Path 144"/><path fill="#7aa2f7" d="M234.672,384a40.052,40.052,0,0,0,39.184-32H195.473A40.069,40.069,0,0,0,234.672,384Zm0,0" class="colorffe777 svgShape" data-name="Path 145"/><path fill="#7aa2f7" d="M312,266.672H264a8.024,8.024,0,0,1-7.09-4.289,7.944,7.944,0,0,1,.516-8.254l39.293-56.785H264a8,8,0,1,1,0-16h48a8.024,8.024,0,0,1,7.09,4.289,7.944,7.944,0,0,1-.516,8.254l-39.293,56.785H312a8,8,0,0,1,0,16Zm0,0" class="colorffe777 svgShape" data-name="Path 146"/><g fill="#e0af68" class="color000 svgShape" data-name="Group 14"><path fill="#e0af68" d="M376,192H349.328a7.989,7.989,0,0,1-6.512-12.641l17.633-24.687H349.328a8,8,0,0,1,0-16H376a7.989,7.989,0,0,1,6.512,12.641L364.879,176H376a8,8,0,0,1,0,16Zm0,0" class="colorffd200 svgShape" data-name="Path 147"/><path fill="#e0af68" d="M334.7,308.4a71.3,71.3,0,0,1-19.344-26.078,23.138,23.138,0,0,1-3.359.336H264a23.993,23.993,0,0,1-19.711-37.664l21.918-31.664H264a24,24,0,0,1,0-48h16.656a74.56,74.56,0,0,0-35.312-15.152v-11.52a10.672,10.672,0,0,0-21.344.016v11.52A74.708,74.708,0,0,0,160,224v29.742A71.54,71.54,0,0,1,134.527,308.5a18.667,18.667,0,0,0,12.145,32.848h176A18.668,18.668,0,0,0,334.7,308.4Zm0,0" class="colorffd200 svgShape" data-name="Path 148"/></g></svg></g></svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
BIN
eww/Main/images/profile.png
Normal file
BIN
eww/Main/images/profile.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 182 KiB |
28
eww/Main/scripts/details
Executable file
28
eww/Main/scripts/details
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 == "--image" ]]; then
|
||||
FILE=$HOME/.face
|
||||
if [[ -f "$FILE" ]]; then
|
||||
echo "../../.face"
|
||||
else
|
||||
echo "Main/images/profile.png"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [[ $1 == "--name" ]]; then
|
||||
fullname=$(getent passwd "$(whoami)" | cut -d ':' -f 5 | cut -d ',' -f 1 | tr -d "\n")
|
||||
if [ -z "$fullname" ]; then
|
||||
echo "$(whoami)@$(hostnamectl | awk 'FNR==1 {print $3}')"
|
||||
else
|
||||
echo "$fullname"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $1 == "--kernel" ]]; then
|
||||
echo "$(uname -r)"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--os" ]]; then
|
||||
echo "$(cat /etc/os-release | awk 'NR==1'| awk -F '"' '{print $2}')"
|
||||
fi
|
||||
92
eww/Main/scripts/fortune.py
Executable file
92
eww/Main/scripts/fortune.py
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/bin/env python3
|
||||
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
|
||||
def wrap(text, width, height):
|
||||
lines = []
|
||||
|
||||
paragraphs = text.split('\n')
|
||||
|
||||
for paragraph in paragraphs:
|
||||
if len(lines) >= height:
|
||||
return []
|
||||
|
||||
# Skip empty paragraphs
|
||||
if not paragraph.strip():
|
||||
lines.append('')
|
||||
continue
|
||||
|
||||
current_line = ''
|
||||
words = paragraph.split()
|
||||
|
||||
for word in words:
|
||||
if current_line:
|
||||
test_line = current_line + ' ' + word
|
||||
else:
|
||||
test_line = word
|
||||
|
||||
if len(test_line) <= width:
|
||||
current_line = test_line
|
||||
else:
|
||||
if current_line:
|
||||
lines.append(current_line)
|
||||
current_line = word
|
||||
else:
|
||||
while len(word) > width:
|
||||
lines.append(word[:width])
|
||||
word = word[width:]
|
||||
current_line = word
|
||||
|
||||
if current_line:
|
||||
lines.append(current_line)
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
RETRY_LIMIT = 10
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage: fortune.py <width> <height>")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
width = int(sys.argv[1])
|
||||
if width <= 0:
|
||||
raise ValueError()
|
||||
height = int(sys.argv[2])
|
||||
if height <= 0:
|
||||
raise ValueError()
|
||||
except ValueError:
|
||||
print("Invalid argument.")
|
||||
sys.exit(1)
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
if i >= RETRY_LIMIT:
|
||||
print("Failed to get fortune after multiple attempts.")
|
||||
sys.exit(1)
|
||||
i += 1
|
||||
|
||||
try:
|
||||
buffer = subprocess.check_output(['fortune', '-s'], text=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error running fortune: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
lines = wrap(buffer, width, height)
|
||||
|
||||
if lines:
|
||||
break
|
||||
else:
|
||||
print("retrying...")
|
||||
|
||||
for line in lines:
|
||||
print(line)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
22
eww/Main/scripts/music-art
Executable file
22
eww/Main/scripts/music-art
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
tmp_dir="$HOME/.config/eww/Main/images"
|
||||
tmp_cover_path=$tmp_dir/cover.png
|
||||
tmp_temp_path=$tmp_dir/temp.png
|
||||
|
||||
if [ ! -d $tmp_dir ]; then
|
||||
mkdir -p $tmp_dir
|
||||
fi
|
||||
|
||||
artlink="$(playerctl -p spotify,$any,mpd,firefox,chromium,brave metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')"
|
||||
artFromBrowser=$(playerctl metadata mpris:artUrl | sed 's/file:\/\///g')
|
||||
|
||||
if [ $(playerctl -p spotify,%any,firefox,chromium,brave,mpd metadata mpris:artUrl) ]; then
|
||||
curl -s "$artlink" --output $tmp_temp_path
|
||||
echo $tmp_temp_path
|
||||
elif [[ -n $artFromBrowser ]]; then
|
||||
cp $artFromBrowser $tmp_temp_path
|
||||
echo $tmp_temp_path
|
||||
else
|
||||
echo Main/images/default-music.svg
|
||||
fi
|
||||
32
eww/Main/scripts/music-artist
Executable file
32
eww/Main/scripts/music-artist
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ artist }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="No Artist"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "No Artist"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "No Artist" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
32
eww/Main/scripts/music-length
Executable file
32
eww/Main/scripts/music-length
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ duration(position) }} / {{ duration(mpris:length) }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="--:-- / --:--"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "--:-- / --:--"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "--:-- / --:--" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
43
eww/Main/scripts/music-title
Executable file
43
eww/Main/scripts/music-title
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ title }}"
|
||||
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="Nothing is playing"
|
||||
fi
|
||||
|
||||
if [ "$1" == "--status" ]; then
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "Nothing is playing"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "Nothing is playing" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" == "--icon" ]; then
|
||||
if [[ $STATUS == "Playing" ]]; then
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
66
eww/Main/scripts/system
Executable file
66
eww/Main/scripts/system
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Files and Data
|
||||
PREV_TOTAL=0
|
||||
PREV_IDLE=0
|
||||
cpuFile="/tmp/.cpu_usage"
|
||||
|
||||
## Get CPU usage
|
||||
get_cpu() {
|
||||
if [[ -f "${cpuFile}" ]]; then
|
||||
fileCont=$(cat "${cpuFile}")
|
||||
PREV_TOTAL=$(echo "${fileCont}" | head -n 1)
|
||||
PREV_IDLE=$(echo "${fileCont}" | tail -n 1)
|
||||
fi
|
||||
|
||||
CPU=(`cat /proc/stat | grep '^cpu '`) # Get the total CPU statistics.
|
||||
unset CPU[0] # Discard the "cpu" prefix.
|
||||
IDLE=${CPU[4]} # Get the idle CPU time.
|
||||
|
||||
# Calculate the total CPU time.
|
||||
TOTAL=0
|
||||
|
||||
for VALUE in "${CPU[@]:0:4}"; do
|
||||
let "TOTAL=$TOTAL+$VALUE"
|
||||
done
|
||||
|
||||
if [[ "${PREV_TOTAL}" != "" ]] && [[ "${PREV_IDLE}" != "" ]]; then
|
||||
# Calculate the CPU usage since we last checked.
|
||||
let "DIFF_IDLE=$IDLE-$PREV_IDLE"
|
||||
let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL"
|
||||
let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10"
|
||||
echo "${DIFF_USAGE}"
|
||||
else
|
||||
echo "?"
|
||||
fi
|
||||
|
||||
# Remember the total and idle CPU times for the next check.
|
||||
echo "${TOTAL}" > "${cpuFile}"
|
||||
echo "${IDLE}" >> "${cpuFile}"
|
||||
}
|
||||
|
||||
## Get Used memory
|
||||
get_mem() {
|
||||
printf "%.0f\n" "$(free -m | grep Mem | awk '{print ($3/$2)*100}')"
|
||||
}
|
||||
|
||||
## Get Volume
|
||||
get_vol() {
|
||||
pamixer --get-volume
|
||||
}
|
||||
|
||||
## Get Brightness
|
||||
get_brightness() {
|
||||
brightnessctl i --machine-readable -d intel_backlight | tr ',' ' ' | awk '{print $4}' | tr -d '%'
|
||||
}
|
||||
|
||||
## Execute accordingly
|
||||
if [[ "$1" == "--cpu" ]]; then
|
||||
get_cpu
|
||||
elif [[ "$1" == "--mem" ]]; then
|
||||
get_mem
|
||||
elif [[ "$1" == "--vol" ]]; then
|
||||
get_vol
|
||||
elif [[ "$1" == "--bri" ]]; then
|
||||
get_brightness
|
||||
fi
|
||||
132
eww/Main/scripts/weather
Executable file
132
eww/Main/scripts/weather
Executable file
@@ -0,0 +1,132 @@
|
||||
#!/bin/bash
|
||||
|
||||
## Collect data
|
||||
cache_dir="$HOME/.cache/eww/weather"
|
||||
cache_weather_stat=${cache_dir}/weather-stat
|
||||
cache_weather_degree=${cache_dir}/weather-degree
|
||||
cache_weather_hex=${cache_dir}/weather-hex
|
||||
cache_weather_icon=${cache_dir}/weather-icon
|
||||
|
||||
if [[ -z "$OPENWEATHER_API_KEY" ]]; then
|
||||
echo "Please set the OPENWEATHER_API_KEY environment variable."
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "$OPENWEATHER_LAT" ]]; then
|
||||
echo "Please set the OPENWEATHER_LAT environment variable."
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "$OPENWEATHER_LON" ]]; then
|
||||
echo "Please set the OPENWEATHER_LON environment variable."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Weather data
|
||||
KEY=$OPENWEATHER_API_KEY
|
||||
LAT=$OPENWEATHER_LAT
|
||||
LON=$OPENWEATHER_LON
|
||||
UNITS=metric
|
||||
|
||||
## Make cache dir
|
||||
if [[ ! -d "$cache_dir" ]]; then
|
||||
mkdir -p ${cache_dir}
|
||||
fi
|
||||
|
||||
## Get data
|
||||
get_weather_data() {
|
||||
weather=`curl -sf "http://api.openweathermap.org/data/3.0/onecall?lat=${LAT}&lon=${LON}&exclude=minutely,hourly,daily&appid=${KEY}&units=${UNITS}" | jq -r ".current"`
|
||||
echo ${weather}
|
||||
|
||||
if [ ! -z "$weather" ]; then
|
||||
weather_temp=`echo "$weather" | jq ".temp" | cut -d "." -f 1`
|
||||
weather_icon_code=`echo "$weather" | jq -r ".weather[].icon" | head -1`
|
||||
weather_description=`echo "$weather" | jq -r ".weather[].description" | head -1 | sed -e "s/\b\(.\)/\u\1/g"`
|
||||
|
||||
#Big long if statement of doom
|
||||
if [ "$weather_icon_code" == "50d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "50n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "01d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#e0af68"
|
||||
elif [ "$weather_icon_code" == "01n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#c0caf5"
|
||||
elif [ "$weather_icon_code" == "02d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "02n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "03d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "03n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "04d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "04n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7aa2f7"
|
||||
elif [ "$weather_icon_code" == "09d" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#7dcfff"
|
||||
elif [ "$weather_icon_code" == "09n" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#7dcfff"
|
||||
elif [ "$weather_icon_code" == "10d" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#7dcfff"
|
||||
elif [ "$weather_icon_code" == "10n" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#7dcfff"
|
||||
elif [ "$weather_icon_code" == "11d" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#ff9e64"
|
||||
elif [ "$weather_icon_code" == "11n" ]; then
|
||||
weather_icon=""
|
||||
weather_hex="#ff9e64"
|
||||
elif [ "$weather_icon_code" == "13d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#c0caf5"
|
||||
elif [ "$weather_icon_code" == "13n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#c0caf5"
|
||||
elif [ "$weather_icon_code" == "40d" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7dcfff"
|
||||
elif [ "$weather_icon_code" == "40n" ]; then
|
||||
weather_icon=" "
|
||||
weather_hex="#7dcfff"
|
||||
else
|
||||
weather_icon=" "
|
||||
weather_hex="#c0caf5"
|
||||
fi
|
||||
echo "$weather_icon" > ${cache_weather_icon}
|
||||
echo "$weather_description" > ${cache_weather_stat}
|
||||
echo "$weather_temp""°C" > ${cache_weather_degree}
|
||||
echo "$weather_hex" > ${cache_weather_hex}
|
||||
else
|
||||
echo "Weather Unavailable" > ${cache_weather_stat}
|
||||
echo " " > ${cache_weather_icon}
|
||||
echo "-" > ${cache_weather_degree}
|
||||
echo "#adadff" > ${cache_weather_hex}
|
||||
fi
|
||||
}
|
||||
|
||||
## Execute
|
||||
if [[ "$1" == "--getdata" ]]; then
|
||||
get_weather_data
|
||||
elif [[ "$1" == "--icon" ]]; then
|
||||
cat ${cache_weather_icon}
|
||||
elif [[ "$1" == "--temp" ]]; then
|
||||
cat ${cache_weather_degree}
|
||||
elif [[ "$1" == "--hex" ]]; then
|
||||
tail -F ${cache_weather_hex}
|
||||
elif [[ "$1" == "--stat" ]]; then
|
||||
cat ${cache_weather_stat}
|
||||
fi
|
||||
217
eww/Player/eww.scss
Normal file
217
eww/Player/eww.scss
Normal file
@@ -0,0 +1,217 @@
|
||||
* {
|
||||
all: unset;
|
||||
transition: 200ms ease-out;
|
||||
}
|
||||
|
||||
.player-main-box {
|
||||
background-color: $bg;
|
||||
border-radius: 20px;
|
||||
border: 3px solid $blue;
|
||||
}
|
||||
|
||||
.spotify-header-logo {
|
||||
font-size: 24px;
|
||||
color: $green;
|
||||
margin: 30px 0px 0px 300px;
|
||||
}
|
||||
|
||||
.spotify-header-title {
|
||||
font-size: 28px;
|
||||
color: $green;
|
||||
font-weight: bold;
|
||||
margin-top: 30px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.spotify-header-player {
|
||||
font-size: 28px;
|
||||
color: $fg;
|
||||
font-weight: 200;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.player-cover-box {
|
||||
background-size: 222px;
|
||||
min-height: 222px;
|
||||
min-width: 222px;
|
||||
border-radius: 20px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
margin: 0px 40px 0px 0px;
|
||||
}
|
||||
|
||||
.player-box {
|
||||
background-color: $bg;
|
||||
margin: 40px 30px 30px 50px;
|
||||
}
|
||||
|
||||
.player-info-box {
|
||||
margin: 20px 0px 0px 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.player-info-title,
|
||||
.player-info-artist {
|
||||
color: $blue;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.player-info-album,
|
||||
.player-info-length {
|
||||
color: $gray;
|
||||
}
|
||||
|
||||
.player-info-button {
|
||||
background-color: $gray-alt;
|
||||
padding: 15px;
|
||||
border-radius: 20px;
|
||||
font-weight: bold;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.player-music-slider trough {
|
||||
background-color: $gray;
|
||||
}
|
||||
|
||||
.player-music-slider highlight {
|
||||
background-color: $blue;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.player-volume-slider trough {
|
||||
background-color: $gray;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.player-volume-slider highlight {
|
||||
background: linear-gradient(to right, $cyan, $blue);
|
||||
border-radius: 15px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.main-player-control-box {
|
||||
background-color: $bg-alt;
|
||||
border-radius: 0px 0px 25px 25px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.player-volume-icon {
|
||||
color: $cyan;
|
||||
font-size: 24px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.player-volume-box {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.shuffle-btn-on {
|
||||
color: $green;
|
||||
font-size: 26px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.shuffle-btn-off {
|
||||
color: $gray;
|
||||
font-size: 26px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.previous-btn,
|
||||
.next-btn {
|
||||
font-size: 30px;
|
||||
color: $fg;
|
||||
}
|
||||
|
||||
.player-pp-btn {
|
||||
font-size: 50px;
|
||||
color: $blue;
|
||||
}
|
||||
|
||||
.current-position {
|
||||
color: $fg;
|
||||
font-size: 20px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.length-of-song {
|
||||
color: $gray;
|
||||
font-size: 20px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.player-album-box {
|
||||
background-size: 150px;
|
||||
min-height: 150px;
|
||||
min-width: 150px;
|
||||
border-radius: 100px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
border: 5px solid $cyan;
|
||||
margin: 47px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.main-album-box {
|
||||
background-color: $bg;
|
||||
}
|
||||
|
||||
.visualizer-btn-on {
|
||||
background-color: $gray-alt;
|
||||
padding: 5px 15px 5px 10px;
|
||||
font-size: 24px;
|
||||
border-radius: 10px;
|
||||
color: $blue;
|
||||
box-shadow: 0px 0px 20px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.visualizer-btn-off {
|
||||
background-color: $gray-alt;
|
||||
padding: 5px 15px 5px 10px;
|
||||
font-size: 24px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 20px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.equalizer-btn-on {
|
||||
background-color: $gray-alt;
|
||||
padding: 5px 14px 5px 11px;
|
||||
font-size: 24px;
|
||||
border-radius: 10px;
|
||||
color: $blue;
|
||||
box-shadow: 0px 0px 20px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.equalizer-btn-off {
|
||||
background-color: $gray-alt;
|
||||
padding: 5px 14px 5px 11px;
|
||||
font-size: 24px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 20px 10px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.player-buttons {
|
||||
padding-left: 45px;
|
||||
text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.player-length-box {
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
.player-control-box-right {
|
||||
padding: 15px 0px 15px 40px;
|
||||
}
|
||||
|
||||
.vz-title {
|
||||
padding: 0px 0px 0px 0px;
|
||||
font-size: 22px;
|
||||
color: $blue;
|
||||
}
|
||||
|
||||
.cavabar {
|
||||
font-size: 24px;
|
||||
color: $lavender;
|
||||
}
|
||||
67
eww/Player/eww.yuck
Normal file
67
eww/Player/eww.yuck
Normal file
@@ -0,0 +1,67 @@
|
||||
;; variables
|
||||
(defpoll art :interval "1s" "Player/scripts/player --cover")
|
||||
(defpoll title :interval "1s" "Player/scripts/music-title --status")
|
||||
(defpoll artist :interval "1s" "Player/scripts/player --artist")
|
||||
(defpoll album :interval "1s" "Player/scripts/player --album")
|
||||
(defpoll current-pos :interval "1s" "Player/scripts/player --current-pos")
|
||||
(defpoll length-info :interval "1s" "Player/scripts/player --length-info")
|
||||
(defpoll length :interval "0s" "dbus-send --dest=org.mpris.MediaPlayer2.spotify --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:Metadata | grep uint | awk '{print $3}'")
|
||||
(defpoll position :interval "1s" "dbus-send --dest=org.mpris.MediaPlayer2.spotify --print-reply /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:org.mpris.MediaPlayer2.Player string:Position | awk 'FNR==2 {print $3}'")
|
||||
(defpoll trackid :interval "1s" "playerctl -p spotify metadata mpris:trackid")
|
||||
(defpoll current-volume :interval "1s" "Player/scripts/player --current-volume")
|
||||
(defpoll pp-icon :interval "1s" "Player/scripts/music-title --icon")
|
||||
(defpoll shuffle :interval "1s" "playerctl -p spotify shuffle")
|
||||
(deflisten eq-status "tail -F Player/status/eq-status")
|
||||
(deflisten vz-status "tail -F Player/status/vz-status")
|
||||
(deflisten ly-status "tail -F Player/status/ly-status")
|
||||
(defvar hover false)
|
||||
(deflisten cava "Player/scripts/cava")
|
||||
|
||||
;; widgets
|
||||
(defwidget player[]
|
||||
(box :class "player-main-box" :space-evenly "false" :orientation "v" :hexpand "false" :vexpand "false"
|
||||
; (box :class "header-box" :hexpand "false" :vexpand "false" :space-evenly "true"
|
||||
; (box :class "another-header-box" :space-evenly "false"
|
||||
; (label :class "spotify-header-logo" :text " " :halign "center")
|
||||
; (label :class "spotify-header-title" :text "Spotify" :halign "center")
|
||||
; (label :class "spotify-header-player" :text "Player" :halign "center")))
|
||||
(box :class "player-box" :hexpand "false" :vexpand "false" :space-evenly "true"
|
||||
(box :class "player-info-box" :hexpand "false" :vexpand "false" :space-evenly "false" :orientation "v" :spacing 15
|
||||
(label :class "player-info-title" :text " Title: ${title}" :halign "start" :limit-width 30 :tooltip "${title}")
|
||||
(label :class "player-info-artist" :text " Artist: ${artist}" :halign "start" :limit-width 30 :tooltip "${artist}")
|
||||
(label :class "player-info-album" :text " Album: ${album}" :halign "start" :limit-width 30 :tooltip "${album}")
|
||||
(label :class "player-info-length" :text " Length: ${length-info}" :halign "start" :tooltip "${length-info}"))
|
||||
(box :class "player-cover-box" :hexpand "false" :halign "end" :vexpand "false" :space-evenly "false" :style "background-image: url('${art}');"))
|
||||
(box :class "cava-box" :hexpand "false" :vexpand "false"
|
||||
(label :vexpand "false" :hexpand "false" :space-evenly "false"
|
||||
:class "cavabar"
|
||||
:text cava
|
||||
))
|
||||
(eventbox :onhover "eww update hover=true"
|
||||
:onhoverlost "eww update hover=false"
|
||||
:cursor "pointer"
|
||||
:space-evenly "false"
|
||||
(scale :orientation "h" :class "player-music-slider" :min 0 :max length :value position :tooltip current-pos :onchange { hover ? "dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.SetPosition objpath:${trackid} int64:{}" : "" }))
|
||||
(box :class "main-player-control-box" :hexpand "false" :vexpand "false" :space-evenly "false" :orientation "h" :height 70
|
||||
(box :class "player-volume-box" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 10
|
||||
(label :class "player-volume-icon" :text "")
|
||||
(scale :class "player-volume-slider" :width 140 :min 0 :max 100 :orientation "h" :value current-volume :halign "start" :onchange "Player/scripts/player --volume {}"))
|
||||
(box :class "player-buttons" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 10
|
||||
(button :class "shuffle-btn ${shuffle == "On" ? "shuffle-btn-on" : "shuffle-btn-off"}" :onclick "Player/scripts/player --shuffle" "")
|
||||
(button :class "previous-btn" :onclick "playerctl -p spotify previous" "")
|
||||
(button :class "player-pp-btn" :onclick "playerctl -p spotify play-pause" "${pp-icon}")
|
||||
(button :class "next-btn" :onclick "playerctl -p spotify next" ""))
|
||||
(box :class "player-length-box" :space-evenly "false" :hexpand "false" :vexpand "false" :halign "end" :width 150
|
||||
(label :class "current-position" :text "${current-pos} ")
|
||||
(label :class "length-of-song" :text "/ ${length-info}"))
|
||||
(box :class "player-control-box-right" :space-evenly "false" :hexpand "false" :vexpand "false" :spacing 15 :halign "end"
|
||||
(button :class "equalizer-btn ${eq-status == "On" ? "equalizer-btn-on" : "equalizer-btn-off"}" :onclick "Player/scripts/equalizer" "")))))
|
||||
|
||||
|
||||
;; windows
|
||||
(defwindow player
|
||||
:windowtype "normal"
|
||||
:wm-ignore true
|
||||
:monitor 0
|
||||
:geometry (geometry :anchor "top center" :y 100 :height 400 :width 680)
|
||||
(player))
|
||||
40
eww/Player/scripts/cava
Executable file
40
eww/Player/scripts/cava
Executable file
@@ -0,0 +1,40 @@
|
||||
#! /bin/bash
|
||||
|
||||
|
||||
bar="▁▂▃▄▅▆▇█"
|
||||
dict="s/;//g;"
|
||||
|
||||
# creating "dictionary" to replace char with bar
|
||||
i=0
|
||||
while [ $i -lt ${#bar} ]
|
||||
do
|
||||
dict="${dict}s/$i/${bar:$i:1}/g;"
|
||||
i=$((i=i+1))
|
||||
done
|
||||
|
||||
# make sure to clean pipe
|
||||
pipe="/tmp/cava.fifo"
|
||||
if [ -p $pipe ]; then
|
||||
unlink $pipe
|
||||
fi
|
||||
mkfifo $pipe
|
||||
|
||||
# write cava config
|
||||
config_file="/tmp/waybar_cava_config"
|
||||
echo "
|
||||
[general]
|
||||
bars = 49
|
||||
[output]
|
||||
method = raw
|
||||
raw_target = $pipe
|
||||
data_format = ascii
|
||||
ascii_max_range = 7
|
||||
" > $config_file
|
||||
|
||||
# run cava in the background
|
||||
cava -p $config_file &
|
||||
|
||||
# reading data from fifo
|
||||
while read -r cmd; do
|
||||
echo $cmd | sed $dict
|
||||
done < $pipe
|
||||
4
eww/Player/scripts/change-music
Executable file
4
eww/Player/scripts/change-music
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
TRACK_ID=$(playerctl -p spotify metadata mpris:trackid)
|
||||
dbus-send --type=method_call --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.SetPosition objpath:/com/spotify/track/0LnS7aOdOdI1dNKZqdOLz4 int64:120000000
|
||||
11
eww/Player/scripts/equalizer
Executable file
11
eww/Player/scripts/equalizer
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
if pgrep easyeffects; then
|
||||
pkill easyeffects
|
||||
echo "Off" > $HOME/.config/eww/Player/status/eq-status
|
||||
exit 1
|
||||
else
|
||||
exec easyeffects --gapplication-service &
|
||||
echo "On" > $HOME/.config/eww/Player/status/eq-status
|
||||
fi
|
||||
exit
|
||||
32
eww/Player/scripts/music-album
Executable file
32
eww/Player/scripts/music-album
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ album }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="No Album"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "No Album"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "No Alnum" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
22
eww/Player/scripts/music-art
Executable file
22
eww/Player/scripts/music-art
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
tmp_dir="$HOME/.config/eww/Main/images"
|
||||
tmp_cover_path=$tmp_dir/cover.png
|
||||
tmp_temp_path=$tmp_dir/temp.png
|
||||
|
||||
if [ ! -d $tmp_dir ]; then
|
||||
mkdir -p $tmp_dir
|
||||
fi
|
||||
|
||||
artlink="$(playerctl -p spotify,$any,mpd,firefox,chromium,brave metadata mpris:artUrl | sed -e 's/open.spotify.com/i.scdn.co/g')"
|
||||
artFromBrowser=$(playerctl metadata mpris:artUrl | sed 's/file:\/\///g')
|
||||
|
||||
if [ $(playerctl -p spotify,%any,firefox,chromium,brave,mpd metadata mpris:artUrl) ]; then
|
||||
curl -s "$artlink" --output $tmp_temp_path
|
||||
echo $tmp_temp_path
|
||||
elif [[ -n $artFromBrowser ]]; then
|
||||
cp $artFromBrowser $tmp_temp_path
|
||||
echo $tmp_temp_path
|
||||
else
|
||||
echo Main/images/default-music.svg
|
||||
fi
|
||||
32
eww/Player/scripts/music-artist
Executable file
32
eww/Player/scripts/music-artist
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ artist }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="No Artist"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "No Artist"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "No Artist" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
32
eww/Player/scripts/music-length
Executable file
32
eww/Player/scripts/music-length
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ duration(position) }} / {{ duration(mpris:length) }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="--:-- / --:--"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "--:-- / --:--"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "--:-- / --:--" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
32
eww/Player/scripts/music-length-info
Executable file
32
eww/Player/scripts/music-length-info
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ duration(mpris:length) }}"
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="--:--"
|
||||
fi
|
||||
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "--:--"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "--:--" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
4
eww/Player/scripts/music-position
Executable file
4
eww/Player/scripts/music-position
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
POS=$(playerctl -p spotify position)
|
||||
python -c "print(float($POS*1000000))"
|
||||
43
eww/Player/scripts/music-title
Executable file
43
eww/Player/scripts/music-title
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Set the source audio player here.
|
||||
# Players supporting the MPRIS spec are supported.
|
||||
# Examples: spotify, vlc, chrome, mpv and others.
|
||||
# Use `playerctld` to always detect the latest player.
|
||||
# See more here: https://github.com/altdesktop/playerctl/#selecting-players-to-control
|
||||
PLAYER="playerctld"
|
||||
|
||||
# Format of the information displayed
|
||||
# Eg. {{ artist }} - {{ album }} - {{ title }}
|
||||
# See more attributes here: https://github.com/altdesktop/playerctl/#printing-properties-and-metadata
|
||||
FORMAT="{{ title }}"
|
||||
|
||||
|
||||
PLAYERCTL_STATUS=$(playerctl --player=$PLAYER status 2>/dev/null)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
STATUS=$PLAYERCTL_STATUS
|
||||
else
|
||||
STATUS="Nothing is playing"
|
||||
fi
|
||||
|
||||
if [ "$1" == "--status" ]; then
|
||||
if [ "$STATUS" = "Stopped" ]; then
|
||||
echo "Nothing is playing"
|
||||
elif [ "$STATUS" = "Paused" ]; then
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
elif [ "$STATUS" = "Nothing is playing" ]; then
|
||||
echo "$STATUS"
|
||||
else
|
||||
playerctl --player=$PLAYER metadata --format "$FORMAT"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" == "--icon" ]; then
|
||||
if [[ $STATUS == "Playing" ]]; then
|
||||
echo ""
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
57
eww/Player/scripts/player
Executable file
57
eww/Player/scripts/player
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 == "--length" ]]; then
|
||||
playerctl -p spotify metadata mpris:length
|
||||
fi
|
||||
|
||||
if [[ $1 == "--open" ]]; then
|
||||
URL=$(playerctl -p spotify metadata xesam:url)
|
||||
echo "$URL?go=1&utm_medium=desktop"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--artist" ]]; then
|
||||
"$HOME/.config/eww/Player/scripts/music-artist"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--length-time" ]]; then
|
||||
"$HOME/.config/eww/Player/scripts/music-length"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--length-info" ]]; then
|
||||
"$HOME/.config/eww/Player/scripts/music-length-info"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--cover" ]]; then
|
||||
"$HOME/.config/eww/Player/scripts/music-art"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--album" ]]; then
|
||||
"$HOME/.config/eww/Player/scripts/music-album"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--current-volume" ]]; then
|
||||
VOLUME=$(playerctl -p spotify volume)
|
||||
echo $(python -c "print(float("$VOLUME")*100)")
|
||||
fi
|
||||
|
||||
if [[ $1 == "--volume" ]]; then
|
||||
CURRENT_VOLUME=$2
|
||||
NOW_VOLUME=$(python -c "print(float($CURRENT_VOLUME)/100)")
|
||||
playerctl -p spotify volume "$NOW_VOLUME"
|
||||
fi
|
||||
|
||||
if [[ $1 == "--shuffle" ]]; then
|
||||
if [[ $(playerctl -p spotify shuffle) == "On" ]]; then
|
||||
playerctl -p spotify shuffle off
|
||||
else
|
||||
playerctl -p spotify shuffle On
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $1 == "--current-pos" ]]; then
|
||||
playerctl -p spotify position --format '{{ duration(position) }}'
|
||||
fi
|
||||
|
||||
if [[ $1 == "--launch-lyrics" ]]; then
|
||||
eww open --toggle lyrics
|
||||
fi
|
||||
1
eww/Player/status/eq-status
Normal file
1
eww/Player/status/eq-status
Normal file
@@ -0,0 +1 @@
|
||||
On
|
||||
18
eww/eww.scss
Normal file
18
eww/eww.scss
Normal file
@@ -0,0 +1,18 @@
|
||||
/** Colors *******************************************/
|
||||
$bg: #1e1e2e;
|
||||
$bg-alt: #181825;
|
||||
$fg: #cdd6f4;
|
||||
$fg-alt: #a6adc8;
|
||||
$red: #f38ba8;
|
||||
$green: #a6e3a1;
|
||||
$yellow: #f9e2af;
|
||||
$orange: #fab387;
|
||||
$blue: #89b4fa;
|
||||
$purple: #cba6f7;
|
||||
$cyan: #89dceb;
|
||||
$gray: #585b70;
|
||||
$gray-alt: #313244;
|
||||
$lavender: #b4befe;
|
||||
|
||||
@import './Player/eww.scss';
|
||||
@import './Main/eww.scss';
|
||||
2
eww/eww.yuck
Normal file
2
eww/eww.yuck
Normal file
@@ -0,0 +1,2 @@
|
||||
(include "./Player/eww.yuck")
|
||||
(include "./Main/eww.yuck")
|
||||
@@ -10,7 +10,7 @@ env = INPUT_METHOD, fcitx
|
||||
# ############ Themes #############
|
||||
env = QT_QPA_PLATFORM, wayland
|
||||
env = QT_QPA_PLATFORMTHEME, qt5ct
|
||||
env = QT_STYLE_OVERRIDE,kvantum
|
||||
env = QT_STYLE_OVERRIDE, kvantum
|
||||
# env = WLR_NO_HARDWARE_CURSORS, 1
|
||||
|
||||
# ######## Screen tearing #########
|
||||
|
||||
@@ -61,12 +61,11 @@ bindl= ,XF86AudioPause, exec, playerctl play-pause # [hidden]
|
||||
|
||||
#!
|
||||
##! Sound & Brightness
|
||||
bindl = Alt ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden]
|
||||
bindl = Super ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SOURCE@ toggle # [hidden]
|
||||
bindl = ,XF86AudioMute, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% # [hidden]
|
||||
bindl = Super+Shift,M, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 0% # [hidden]
|
||||
bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ # [hidden]
|
||||
bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- # [hidden]
|
||||
bindl = ,XF86AudioMute, exec, pamixer --toggle-mute # [hidden]
|
||||
bindl = Super+Shift,M, exec, pamixer --toggle-mute # [hidden]
|
||||
bindle=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wp-vol # [hidden]
|
||||
bindle=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- && wp-vol # [hidden]
|
||||
|
||||
bindle=, XF86MonBrightnessUp, exec, brightnessctl -d intel_backlight set 5%+ # [hidden]
|
||||
bindle=, XF86MonBrightnessDown, exec, brightnessctl -d intel_backlight set 5%- # [hidden]
|
||||
|
||||
|
||||
15
mako/config
15
mako/config
@@ -13,4 +13,17 @@ border-color=#89b4fa
|
||||
progress-color=over #313244
|
||||
|
||||
[urgency=high]
|
||||
border-color=#fab387
|
||||
border-color=#fab387
|
||||
|
||||
[app-name=wp-vol]
|
||||
layer=overlay
|
||||
history=0
|
||||
anchor=top-center
|
||||
# Group all volume notifications together
|
||||
group-by=app-name
|
||||
# Hide the group-index
|
||||
format=<b>%s</b>\n%b
|
||||
|
||||
[app-name=volume group-index=0]
|
||||
# Only show last notification
|
||||
invisible=0
|
||||
@@ -61,9 +61,10 @@
|
||||
"custom/rofi": {
|
||||
"format": "",
|
||||
"tooltip": false,
|
||||
"on-click-right": "fuzzel -l 0 -p '>> ' | xargs -r sh -c",
|
||||
"on-click": "fuzzel",
|
||||
"on-click-middle": "pkill -9 fuzzel",
|
||||
// "on-click-right": "fuzzel -l 0 -p '>> ' | xargs -r sh -c",
|
||||
// "on-click": "fuzzel",
|
||||
// "on-click-middle": "pkill -9 fuzzel",
|
||||
"on-click": "eww open main --toggle",
|
||||
"min-length": 2,
|
||||
"max-length": 2
|
||||
},
|
||||
@@ -221,14 +222,14 @@
|
||||
"active-only": false
|
||||
},
|
||||
"hyprland/window": {
|
||||
"max-length": 40,
|
||||
"max-length": 100,
|
||||
"separate-outputs": true,
|
||||
"hide-empty-text": true
|
||||
},
|
||||
"custom/mediaplayer": {
|
||||
"format": "{text}",
|
||||
"return-type": "json",
|
||||
"max-length": 40,
|
||||
"max-length": 100,
|
||||
"format-icons": {
|
||||
"spotify": "",
|
||||
"default": ""
|
||||
@@ -236,6 +237,7 @@
|
||||
"escape": true,
|
||||
"exec": "$HOME/.config/waybar/modules/mediaplayer.py 2> /dev/null",
|
||||
"on-click": "playerctl play-pause",
|
||||
"on-click-right": "eww open --toggle player",
|
||||
"on-scroll-up": "playerctl next",
|
||||
"on-scroll-down": "playerctl previous"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user