diff options
| -rw-r--r-- | config.ini | 94 | ||||
| -rwxr-xr-x | polybar-launch.sh | 17 |
2 files changed, 111 insertions, 0 deletions
diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..1277963 --- /dev/null +++ b/config.ini @@ -0,0 +1,94 @@ +;; ~/.config/polybar/config.ini +[colors] +bg = #111111 +bg-alt = #1c1c1c +fg = #e8e8e8 +fg-dim = #b0b0b0 +accent = #285577 +urgent = #cc4444 +[bar/main] +monitor = +width = 100% +height = 22 +offset-x = 0 +offset-y = 0 +bottom = true +background = ${colors.bg} +foreground = ${colors.fg} +padding-left = 0 +padding-right = 0 +module-margin-left = 0 +module-margin-right = 0 +font-0 = "Fira Nerd Font:pixelsize=11:antialias=true;3" +modules-left = xmonad +modules-center = +modules-right = cpu memory volume battery date time +tray-position = right +tray-padding = 6 +tray-background = ${colors.bg} +tray-maxsize = 14 +cursor-default = default +cursor-click = default +cursor-scroll = default +[module/xmonad] +type = custom/script +exec = tail -F /tmp/xmonad-log 2>/dev/null +tail = true +format-padding = 1 +[module/cpu] +type = internal/cpu +interval = 2 +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label = CPU %percentage%% +label-foreground = ${colors.fg-dim} +[module/memory] +type = internal/memory +interval = 2 +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label = MEM %used% +label-foreground = ${colors.fg-dim} +[module/volume] +type = custom/script +exec = pamixer --get-volume-human 2>/dev/null || echo -- +interval = 2 +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label = VOL %output% +label-foreground = ${colors.fg-dim} +[module/battery] +type = custom/script +exec = now=$(cat /sys/class/power_supply/BAT0/charge_now); full=$(cat /sys/class/power_supply/BAT0/charge_full); status=$(cat /sys/class/power_supply/BAT0/status); pct=$((now * 100 / full)); suffix=""; [ "$status" = "Charging" ] && suffix=" ↑"; [ "$pct" -ge 98 ] && echo "BAT FULL" || echo "BAT ${pct}%${suffix}" +interval = 30 +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label-foreground = ${colors.fg-dim} +[module/date] +type = internal/date +interval = 10 +date = %a %d %b +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label = %date% +label-foreground = ${colors.fg-dim} +[module/time] +type = internal/date +interval = 10 +date = %H:%M +format = <label> +format-background = ${colors.accent} +format-padding = 2 +format-margin-left = 2 +label = %date% +label-foreground = #ffffff diff --git a/polybar-launch.sh b/polybar-launch.sh new file mode 100755 index 0000000..6ef9fa2 --- /dev/null +++ b/polybar-launch.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Wait briefly for WM to settle +sleep 0.5 + +# Kill existing bars +killall -q polybar +while pgrep -u $UID -x polybar > /dev/null; do sleep 0.1; done + +# Launch on all connected monitors +if type "xrandr" > /dev/null 2>&1; then + for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do + MONITOR=$m polybar --reload main & + done +else + polybar --reload main & +fi |
