From b417d75807f9b321e826479a497a2ddf195abab4 Mon Sep 17 00:00:00 2001 From: Daniil Tsivinsky Date: Sat, 2 Oct 2021 23:02:29 +0300 Subject: [PATCH] Add music player module --- polybar/config.ini | 50 +++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/polybar/config.ini b/polybar/config.ini index 57368b6..c3cd4ab 100644 --- a/polybar/config.ini +++ b/polybar/config.ini @@ -23,16 +23,19 @@ font-0 = FiraCode:size=11 font-1 = FontAwesome5Brands:size=11 font-2 = FontAwesome5FreeSolid:size=11 -modules-left = workspaces +modules-left = workspaces player modules-center = date modules-right = keyboard-layout volume-control control network power-menu module-margin = 1 -; -; LEFT MODULES -; +; _ _____ _____ _____ __ __ ___ ____ _ _ _ _____ ____ +; | | | ____| ___|_ _| | \/ |/ _ \| _ \| | | | | | ____/ ___| +; | | | _| | |_ | | | |\/| | | | | | | | | | | | | _| \___ \ +; | |___| |___| _| | | | | | | |_| | |_| | |_| | |___| |___ ___) | +; |_____|_____|_| |_| |_| |_|\___/|____/ \___/|_____|_____|____/ +; [module/workspaces] type = internal/i3 @@ -53,17 +56,33 @@ label-urgent-background = ${colors.primary} label-mode = --%mode%-- -[module/active-window] -type = internal/xwindow +[module/player] +type = custom/script + +exec = players=`playerctl -l | wc -l` ; [[ $players != "0" ]] && playerctl metadata -f "{{status}}: {{trunc(title, 40)}} by {{artist}}" || echo "Nothing playing" +tail = true format =