more bar stuff

This commit is contained in:
elkowar 2021-08-11 12:43:34 +02:00
parent 64ac3ad811
commit 6e816303c5
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
4 changed files with 55 additions and 9 deletions

View file

@ -5,8 +5,9 @@ case "$1" in
"symbol") "symbol")
pactl subscribe | grep --line-buffered "Event 'change' on client" | while read -r; do pactl subscribe | grep --line-buffered "Event 'change' on client" | while read -r; do
case "$(pactl get-default-sink)" in case "$(pactl get-default-sink)" in
*Arctis_9*) echo "🎧";; *Arctis_9*) echo "";;
*) echo "📢";; #*Arctis_9*) echo "";;
*) echo "";;
esac esac
done done
;; ;;

View file

@ -15,6 +15,7 @@ window {
button { button {
background: none; background: none;
margin: 3px; margin: 3px;
padding-left: 1px;
&.inactive { &.inactive {
color: #888974; color: #888974;
} }
@ -53,7 +54,8 @@ window {
scale trough highlight { scale trough highlight {
all: unset; all: unset;
background-color: #8ec07c; //background-color: #8ec07c;
background-color: #665c54;
border-bottom-right-radius: 5px; border-bottom-right-radius: 5px;
} }
scale trough { scale trough {
@ -80,4 +82,16 @@ window {
.time { .time {
padding-top: 7px; padding-top: 7px;
padding-bottom: 7px; padding-bottom: 7px;
color: #a89984;
}
.music-popup {
all: unset;
background-color: #1d2021;
padding: 0px 20px;
margin: 0;
} }

View file

@ -2,7 +2,7 @@
(box :orientation "v" (box :orientation "v"
(box (box
(box :valign "start" (box :valign "start"
:halign "center" :halign "fill"
:class "segment-top" :class "segment-top"
(top :screen screen))) (top :screen screen)))
(box (box
@ -23,7 +23,7 @@
(defwidget middle [] (time)) (defwidget middle [] (time))
(defwidget time [] (defwidget time []
(box :orientation "v" (box :orientation "v"
:class "metric time" :class "time"
hour min sec)) hour min sec))
(defwidget bottom [] (defwidget bottom []
@ -31,18 +31,26 @@
:valign "end" :valign "end"
:space-evenly true :space-evenly true
:spacing "5" :spacing "5"
(box :class "metric" :orientation "v"
(button :onclick "eww -c /home/leon/.config/eww-bar open --toggle music-popup" "")
(music-button))
(volume) (volume)
(box :class "metric" :orientation "v" (box :class "metric" :orientation "v"
(large-sym :sym "" ) "${round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}%") (label :class "metric-icon" :style "font-size: 0.8rem;" :text "")
"${round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}%")
(box :class "metric" :orientation "v" (box :class "metric" :orientation "v"
(label :class "metric-icon":text "") (label :class "metric-icon":text "")
"${round(EWW_RAM, 0)}%") "${round(EWW_RAM, 0)}%")
(box :class "metric" :orientation "v" (box :class "metric" :orientation "v"
(label :class "metric-icon":text "") (label :class "metric-icon" :text "")
"${round(EWW_CPU_USAGE.avg, 0)}%") "${round(EWW_CPU_USAGE.avg, 0)}%")
(box :class "metric" (box :class "metric"
(date)))) (date))))
(defwidget music-button []
(button :onclick "playerctl play-pause"
"${music_data.status == "Playing" ? "⏸" : "▶"}"))
(defwidget volume [] (defwidget volume []
(box :class "volume-metric" (box :class "volume-metric"
:orientation "v" :orientation "v"
@ -58,11 +66,14 @@
:valign "fill" :valign "fill"
:vexpand true :vexpand true
(button :onclick "./audio.sh toggle" (button :onclick "./audio.sh toggle"
(large-sym :sym audio_sink)) (label :style "font-size: 1.2em; font-family: DejaVuSansMono Nerd Font Mono"
:text audio_sink))
(button :onclick "pavucontrol &" (button :onclick "pavucontrol &"
"${volume}%")))) "${volume}%"))))
(defwidget large-sym [sym] (defwidget large-sym [sym]
(label :class "metric-icon large-symbol" :text sym)) (label :class "metric-icon large-symbol" :text sym))
@ -74,6 +85,10 @@
(deflisten audio_sink "./audio.sh symbol") (deflisten audio_sink "./audio.sh symbol")
(deflisten volume :initial "0" "./audio.sh volume") (deflisten volume :initial "0" "./audio.sh volume")
(deflisten music_data
:initial `{"status": ""}`
`playerctl --follow metadata --format '{ "status": "{{status}}", "artist": "{{artist}}", "title": "{{title}}"}'`)
(defpoll hour :interval "1s" "date +%H") (defpoll hour :interval "1s" "date +%H")
(defpoll min :interval "1s" "date +%M") (defpoll min :interval "1s" "date +%M")
(defpoll sec :interval "1s" "date +%S") (defpoll sec :interval "1s" "date +%S")
@ -99,3 +114,18 @@
:anchor "top left" :anchor "top left"
:reserve (struts :distance "40px" :side "left") :reserve (struts :distance "40px" :side "left")
(bar :screen 2)) (bar :screen 2))
(defwidget music-popup []
(box :class "music-popup" :orientation "h" :space-evenly false :spacing 10
(button :onclick "playerctl previous" "⏮")
"${music_data.artist} - ${music_data.title}"
(button :onclick "playerctl next" "⏭"))
)
(defwindow music-popup
:monitor 1
:geometry (geometry :x "30px" :y "70%" :height "65px")
(music-popup))

View file

@ -276,6 +276,7 @@ myStartupHook = do
--spawnOnce "/home/leon/Downloads/picom --config /home/leon/.config/picom.conf --experimental-backends --backend xrender" --no-fading-openclose" --spawnOnce "/home/leon/Downloads/picom --config /home/leon/.config/picom.conf --experimental-backends --backend xrender" --no-fading-openclose"
spawnOnce "picom --config /home/leon/.config/picom.conf --experimental-backends --backend glx" --no-fading-openclose" spawnOnce "picom --config /home/leon/.config/picom.conf --experimental-backends --backend glx" --no-fading-openclose"
spawn "/home/leon/.config/polybar/launch.sh" spawn "/home/leon/.config/polybar/launch.sh"
spawn "xsetroot -cursor_name left_ptr"
spawnOnce "nitrogen --restore" spawnOnce "nitrogen --restore"
spawnOnce "mailnag" spawnOnce "mailnag"
spawnOnce "flameshot" spawnOnce "flameshot"