From f2d5836710cdf9665e8cde96dc2ccc21011bb23a Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Tue, 9 Feb 2021 16:34:28 +0100 Subject: [PATCH] Fixing polybar --- files/.config/polybar/config | 31 +++++++++++++------ .../.config/polybar/scripts/spotify_status.py | 2 +- files/scripts/polybar.sh | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/files/.config/polybar/config b/files/.config/polybar/config index 87cc05d..6d362f1 100644 --- a/files/.config/polybar/config +++ b/files/.config/polybar/config @@ -41,10 +41,9 @@ background = ${colors.background} fixed-center = true -line-size = 2 +line-size = 3 -module-margin-right = 2 -module-margin-left = 2 +module-margin= 2 font-0 = "Product Sans:pixelsize=9:weight=regular;2" font-1 = "Product Sans:pixelsize=9:weight=bold;2" @@ -58,24 +57,30 @@ override-redirect = true [bar/workspaces] inherit = bar/main +background = ${colors.clear} + width = 8% offset-x = 4px -modules-center = i3 +modules-left = i3 # ========== info [bar/info] inherit = bar/main -width = 17% -offset-x = 83%:-133px +width = 16% +offset-x = 84%:-133px -# TODO battery? modules-center = cpu memory volume date [bar/info_laptop] inherit = bar/info +width = 18% +offset-x = 82%:-133px + +modules-center = cpu memory battery volume date + [bar/tray] inherit = bar/main @@ -91,12 +96,13 @@ tray-padding = 1 [bar/music] inherit = bar/main -width = 15% -offset-x = 8%:+8px +background = ${colors.background} + +width = 18% +offset-x = 41% modules-center = spotify - # ======================================== MODULES [module/i3] type = internal/i3 @@ -117,9 +123,13 @@ ws-icon-9 = 10;十 label-focused = "%icon%" label-focused-underline = ${colors.accent} +label-focused-foreground = ${colors.foreground} +label-focused-background = ${colors.background} label-focused-padding = 2 label-unfocused = "%icon%" +label-unfocused-foreground = ${colors.foreground} +label-unfocused-background = ${colors.background} label-unfocused-padding = 2 label-visible = "%icon%" @@ -128,6 +138,7 @@ label-visible-padding = 2 label-urgent = "%icon%" label-urgent-overline = ${colors.urgent} label-urgent-foreground = ${colors.urgent} +label-urgent-background = ${colors.background} label-urgent-padding = 2 label-mode = "%mode%" diff --git a/files/.config/polybar/scripts/spotify_status.py b/files/.config/polybar/scripts/spotify_status.py index 7199f4e..f304dd4 100755 --- a/files/.config/polybar/scripts/spotify_status.py +++ b/files/.config/polybar/scripts/spotify_status.py @@ -68,7 +68,7 @@ def truncate(name, trunclen): # Default parameters output = fix_string(u'{play_pause} {artist}: {song}') -trunclen = 35 +trunclen = 50 play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused label_with_font = '%{{T{font}}}{label}%{{T-}}' diff --git a/files/scripts/polybar.sh b/files/scripts/polybar.sh index cefd6ff..83d5f91 100755 --- a/files/scripts/polybar.sh +++ b/files/scripts/polybar.sh @@ -4,7 +4,7 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done if type "xrandr"; then for mon in $(xrandr --query | grep " connected" | cut -d" " -f1); do MONITOR=$mon polybar --reload workspaces & - #MONITOR=$mon polybar --reload music & + MONITOR=$mon polybar --reload music & MONITOR=$mon polybar --reload tray & if [ $mon = "eDP" ]; then MONITOR=$mon polybar --reload info_laptop &