Update polybar

This commit is contained in:
Marco Thomas
2021-03-21 11:15:28 +01:00
parent 3d0e3cbcbf
commit 56f57ce801
2 changed files with 62 additions and 44 deletions

View File

@@ -13,8 +13,7 @@
# ======================================== COLORS # ======================================== COLORS
[colors] [colors]
#background = #1C1B1D background = #1C1B1D
background = #282c34
foreground = #ffffff foreground = #ffffff
foreground-alt = #999999 foreground-alt = #999999
@@ -36,12 +35,8 @@ accent = ${colors.green}
[bar/main] [bar/main]
monitor = ${env:MONITOR} monitor = ${env:MONITOR}
height = 35px height = 30
width = 100% width = 100%
#radius-bottom = 12
#border-left-size = 4px
#border-right-size = 4px
padding-left = 3 padding-left = 3
padding-right = 3 padding-right = 3
@@ -56,25 +51,32 @@ fixed-center = true
line-size = 0 line-size = 0
tray-position = right
font-0 = "Product Sans:pixelsize=10:weight=regular;2" font-0 = "Product Sans:pixelsize=10:weight=regular;2"
#font-1 = "Noto Sans CJK JP:antialiase=false:pixelsize=11;3" #font-1 = "Noto Sans CJK JP:antialiase=false:pixelsize=11;3"
font-1 = "Stick:pixelsize=13;3" font-1 = "Stick:pixelsize=13;3"
font-2 = "Material Design Icons:size=10;3" font-2 = "Material Design Icons:size=10;2"
wm-restack = i3 wm-restack = i3
override-redirect = false
modules-left = i3 modules-left = i3 spotify
modules-center = spotify modules-center = date
modules-right = volume date sep clock sep modules-right = volume
[bar/bottom]
inherit = bar/main
bottom = true
modules-left = xwindow
modules-center =
modules-right =
tray-position = right
[bar/laptop] [bar/laptop]
inherit = bar/main inherit = bar/main
modules-right = volume battery date sep clock sep modules-right = volume battery
# ======================================== MODULES # ======================================== MODULES
[module/i3] [module/i3]
@@ -95,7 +97,6 @@ ws-icon-8 = 9;九
ws-icon-9 = 10;十 ws-icon-9 = 10;十
label-focused = "%icon%" label-focused = "%icon%"
label-focused-overline = ${colors.accent}
label-focused-foreground = ${colors.foreground} label-focused-foreground = ${colors.foreground}
label-focused-background = ${colors.background} label-focused-background = ${colors.background}
label-focused-padding = 2 label-focused-padding = 2
@@ -109,7 +110,6 @@ label-visible = "%icon%"
label-visible-padding = 2 label-visible-padding = 2
label-urgent = "%icon%" label-urgent = "%icon%"
label-urgent-overline = ${colors.urgent}
label-urgent-foreground = ${colors.urgent} label-urgent-foreground = ${colors.urgent}
label-urgent-background = ${colors.background} label-urgent-background = ${colors.background}
label-urgent-padding = 2 label-urgent-padding = 2
@@ -128,18 +128,17 @@ label-underline = ${colors.accent}
type = internal/date type = internal/date
label = %time% label = %time%
time = %I:%M %p time = %H:%M
#format-prefix = "󰥔 " format-prefix = "󰥔 "
[module/date] [module/date]
type = internal/date type = internal/date
label = %date% label = %date%
date = %d %B date = %A, %d %b %Y, %H:%M
format-prefix = "󰃭 " #format-prefix = "󰃭 "
format-overline = ${colors.green}
[module/backlight] [module/backlight]
type = internal/backlight type = internal/backlight
@@ -148,7 +147,6 @@ card = amdgpu_bl0
label = %percentage%% label = %percentage%%
format-prefix = "󰃟 " format-prefix = "󰃟 "
#format-underline = ${colors.accent}
[module/battery] [module/battery]
type = internal/battery type = internal/battery
@@ -194,41 +192,65 @@ animation-charging-framerate = 200
[module/volume] [module/volume]
type = internal/pulseaudio type = internal/pulseaudio
format-volume = <label-volume> format-volume = <bar-volume>
label-volume = %percentage%% label-volume = %percentage%%
format-volume-prefix = "󰕾 " format-volume-prefix = "󰕾 "
format-volume-overline = ${colors.red}
bar-volume-width = 5
bar-volume-gradient = false
bar-volume-indicator =
bar-volume-fill = ━
bar-volume-fill-foreground = ${colors.blue}
bar-volume-empty = ━
click-right = pavucontrol
label-muted = Muted label-muted = Muted
format-muted-prefix = "󰖁 " format-muted-prefix = "󰖁 "
format-muted-foreground = ${colors.urgent} format-muted-foreground = ${colors.urgent}
format-muted-underline = ${colors.urgent}
[module/spotify] [module/spotify]
type = custom/script type = custom/script
#exec = python ~/.config/polybar/scripts/spotify_status.py -f '{artist}: {song} '
exec = ~/.config/polybar/scripts/song.sh 2>/dev/null || echo "Not running" exec = ~/.config/polybar/scripts/song.sh 2>/dev/null || echo "Not running"
interval = 1 interval = 1
tail = true tail = true
format-prefix = "󰓇 " format-prefix = "󰓇 "
format-overline = ${colors.green} format-prefix-foreground = ${colors.green}
[module/cpu] [module/cpu]
type = custom/script type = internal/cpu
exec = ~/.config/polybar/scripts/cpu.sh
click-left = ~/.config/polybar/scripts/cpu.sh --popup interval = 3
format = <bar-load>
bar-load-indicator =
bar-load-fill = ━
bar-load-empty = ━
bar-load-width = 10
bar-load-foreground = ${colors.green}
format-prefix = "󰌣 " format-prefix = "󰌣 "
format-overline = ${colors.yellow}
[module/memory] [module/memory]
type = custom/script type = internal/memory
exec = ~/.config/polybar/scripts/memory.sh
click-left = ~/.config/polybar/scripts/memory.sh --popup interval = 3
format = <bar-used>
bar-used-indicator =
bar-used-fill = ━
bar-used-empty = ━
bar-used-width = 10
bar-used-foreground = ${colors.yellow}
format-prefix = "󰍛 " format-prefix = "󰍛 "
format-overline = ${colors.blue}
[module/wlan] [module/wlan]
type = internal/network type = internal/network
@@ -238,10 +260,5 @@ interval = 3.0
format-connected = <label-connected> format-connected = <label-connected>
format-connected-prefix = "󰤨 " format-connected-prefix = "󰤨 "
label-connected = %essid% label-connected = %essid%
format-connected-overline = ${colors.magenta}
format-disconnected = "󰤮 No Connection" format-disconnected = "󰤮 No Connection"
[module/sep]
type = custom/text
content = |

View File

@@ -3,6 +3,7 @@ while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
if type "xrandr"; then if type "xrandr"; then
for mon in $(xrandr --query | grep " connected" | cut -d" " -f1); do for mon in $(xrandr --query | grep " connected" | cut -d" " -f1); do
MONITOR=$mon polybar --reload bottom &
if [ $mon = "eDP" ]; then if [ $mon = "eDP" ]; then
MONITOR=$mon polybar --reload laptop & MONITOR=$mon polybar --reload laptop &
else else