add mpd mdule locally and update config

This commit is contained in:
ksyasuda 2021-11-15 17:22:39 -08:00
parent ea1208137c
commit 0db918ee19
6 changed files with 65 additions and 21 deletions

View File

@ -134,21 +134,20 @@ module-margin-right = 0
; font-0 = "Terminus:size=10;3"
; font-1 = "waffle:size=10;3"
font-0 = "DroidSansMono Nerd Font:size=10;3"
font-1 = icomoon-feather:size=10;3
font-2 = "Weather Icons:size=10;3"
font-3 = "Material Icons:size=10;3"
font-0 = "DroidSansMono Nerd Font:size=8;3"
font-1 = icomoon-feather:size=8;3
font-2 = "Weather Icons:size=8;3"
font-3 = "Material Icons:size=8;3"
; ; Modules are added to one of the available blocks
; ; modules-left = cpu ram
; modules-center = xwindow xbacklight
; modules-right = ipc clock
modules-left = sep launcher sep workspaces sep flameshot color-picker sep cust-mpd-icon cust-mpd-prev custom-mpd cust-mpd-next
modules-center = title
modules-left = sep launcher sep workspaces sep flameshot color-picker
modules-center = title-icon title sep cust-mpd-icon cust-mpd-prev custom-mpd cust-mpd-next
; modules-right = color-switch sep alsa sep battery sep network sep date sep sysmenu sep
; modules-right = package-updates-trigger package-updates bluetooth sep pulseaudio sep network-wlan sep weather sep date sep sysmenu sep
modules-right = bluetooth sep pulseaudio sep network-wlan sep date weather sep sysmenu sep
modules-right = package-updates-trigger package-updates bluetooth sep pulseaudio sep network-wlan sep date weather sep sysmenu sep
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
@ -215,7 +214,7 @@ wm-restack = i3
; Set a DPI values used when rendering text
; This only affects scalable fonts
dpi = 90
dpi = 110
; Enable support for inter-process messaging
; See the Messaging wiki page for more details.

View File

@ -2,22 +2,21 @@
type = custom/script
tail = true
interval = 0
exec = $HOME/SudacodeRice/scripts/show-music.sh
exec = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/show-music.sh
format = <label>
click-left = exec $HOME/SudacodeRice/scripts/music-controls.sh -t
click-left = exec $HOME/SudacodeRice/polybar-themes/sblocks/scripts/music-controls.sh -t
click-right = alacritty -e ncmpcpp
format-padding = 1
; format-underline = #ecbe7b
; format-foreground = #51afef
format-background = ${color.background-alt}
format-prefix-padding = 1
format-overline = ${color.background}
format-underline = ${color.background}
format-foreground = ${color.foreground-alt}
[module/cust-mpd-next]
type = custom/script
click-left = $HOME/SudacodeRice/scripts/music-controls.sh -n
exec = $HOME/SudacodeRice/scripts/mpd-controls.sh next
click-left = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/music-controls.sh -n
exec = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/mpd-controls.sh next
format-padding = 1
format-background = ${color.background-alt}
format-prefix-padding = 1
@ -26,8 +25,8 @@ format-underline = ${color.background}
[module/cust-mpd-prev]
type = custom/script
click-left = $HOME/SudacodeRice/scripts/music-controls.sh -p
exec = $HOME/SudacodeRice/scripts/mpd-controls.sh prev
click-left = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/music-controls.sh -p
exec = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/mpd-controls.sh prev
format-padding = 1
format-background = ${color.background-alt}
format-prefix-padding = 1
@ -36,7 +35,7 @@ format-underline = ${color.background}
[module/cust-mpd-icon]
type = custom/script
exec = $HOME/SudacodeRice/scripts/mpd-controls.sh -i
exec = $HOME/SudacodeRice/polybar-themes/sblocks/scripts/mpd-controls.sh -i
format-background = ${color.indigo}
format-padding = 2
format-overline = ${color.background}

View File

@ -1222,6 +1222,14 @@ label-indicator-on = "%name% "
label-indicator-on-background = ${color.background-alt}
;; _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
[module/title-icon]
type = custom/script
exec = echo "  "
format-padding = 1
format-foreground = ${color.foreground}
format-background = ${color.blue}
format-overline = ${color.background}
format-underline = ${color.background}
[module/title]
type = internal/xwindow
@ -1229,7 +1237,7 @@ type = internal/xwindow
; Available tags:
; <label> (default)
format = <label>
format-prefix =
format-prefix =
; format-prefix = 
format-padding = 1
format-foreground = ${color.foreground-alt}
@ -1241,7 +1249,7 @@ format-underline = ${color.background}
; %title%
; Default: %title%
label = " %title%"
label-maxlen = 50
label-maxlen = 40
; Used instead of label when there is no window title
label-empty = " Desktop"

View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
checkRunning="$(mpc current)"
if [[ $checkRunning == '' ]]; then
exit 1
fi
arg=$1
if [[ $arg == 'next' ]] || [[ "$arg" == "-n" ]]; then
echo "怜"
elif [[ $arg == 'prev' ]] || [[ "$arg" == "-p" ]]; then
echo "玲"
elif [[ "$arg" == 'icon' ]] || [[ "$arg" == "-i" ]]; then
echo ""
fi

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
## display currently playing/paused song with zscroll
## no output when mpd is stopped
if ! mpc >/dev/null 2>&1; then
exit 1
else
(
mpc current | zscroll -l 30 --delay 0.3 \
--match-command "mpc status" \
--match-text "playing" "--before-text ' '" \
--match-text "paused" "--before-text '契 ' --scroll 0" \
--update-check true "mpc current" &
) &
fi
mpc idle >/dev/null

View File

@ -37,6 +37,7 @@ format-prefix-background = ${color.yellow}
format-prefix-padding = 1
format-overline = ${color.background}
format-underline = ${color.background}
format-foreground = ${color.foreground-alt}
; Available tokens:
; %output%
@ -97,7 +98,7 @@ click-right = ~/SudacodeRice/scripts/menu_full &
type = custom/text
content-prefix =
content-prefix-background = ${color.cyan}
content-prefix-background = ${color.red}
content-prefix-padding = 1
content = " System "
@ -292,6 +293,8 @@ label-close-padding = 1
; Default: none
;label-separator = " | "
; ------------------------------------------------------------------------------
[module/bluetooth]
type = custom/script
exec = rofi-bluetooth --status