Set up Polybar and launch with i3

This commit is contained in:
tactonbishop 2022-05-14 13:56:21 +01:00
parent 7dc142b742
commit 00004d3ee4
3 changed files with 168 additions and 134 deletions

View file

@ -180,18 +180,18 @@ mode "resize" {
bindsym $mod+r mode "resize" bindsym $mod+r mode "resize"
# Start i3bar to display a workspace bar (plus the system information i3status # --- Status bar --- #
# finds out, if available)
bar {
status_command i3status
}
for_window [class="^.*"] border pixel 1 # Launch Polybar on init instead of default i3bar:
gaps inner 10 exec_always --no-startup-id $HOME/.config/polybar/launch.sh
gaps outer 5
# Theming # --- Theming ----- #
gaps inner 5
gaps outer 3
for_window [class="^.*"] border pixel 2
set $yellow #717f24 set $yellow #717f24
set $green #2f7e25 set $green #2f7e25

View file

@ -15,32 +15,38 @@
; The README contains a lot of information ; The README contains a lot of information
; ;
;========================================================== ;==========================================================
[colors] [colors]
;background = ${xrdb:color0:#222}
background = #112615 background = #112615
background-alt = #444 background-alt = #444
;foreground = ${xrdb:color7:#222}
foreground = #637d75 foreground = #637d75
foreground-alt = #7f2b26 foreground-alt = #717f24
primary = #ffb52a primary = #2f7e25
secondary = #e60053 secondary = #2f6a7f
alert = #bd2c40 alert = #7f2b26
disabled = #707880
; [colors]
; background = #282A2E
; background-alt = #373B41
; foreground = #C5C8C6
; primary = #F0C674
; secondary = #8ABEB7
; alert = #A54242
; disabled = #707880
[bar/example] [bar/example]
;monitor = ${env:MONITOR:HDMI-1}
width = 100% width = 100%
height = 27 height = 27
;offset-x = 1%
;offset-y = 1%
radius = 0 radius = 0
fixed-center = false
; dpi = 96
monitor = ${env:MONITOR:}
background = ${colors.background} background = ${colors.background}
foreground = ${colors.foreground} foreground = ${colors.foreground}
line-size = 2 line-size = 2
line-color = #f00
border-size = 0 border-size = 0
border-color = #00000000 border-color = #00000000
@ -49,139 +55,193 @@ padding-left = 2
padding-right = 2 padding-right = 2
module-margin-left = 1 module-margin-left = 1
module-margin-right = 2 module-margin-right =3
font-0 = Roboto:pixelsize=11:style=Medium; 1 ;separator = |
;separator-foreground = ${colors.disabled}
font-0 = Roboto:pixelsize=11:style=Medium; 2
font-1 = unicode:fontformat=truetype:size=8:antialias=false;0 font-1 = unicode:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1 font-2 = siji:pixelsize=10;1
font-3 = SymbolsNerdFont:size=15;3
modules-left = spotify modules-left = my-text-label xworkspaces xwindow
modules-center = modules-right = filesystem memory cpu battery temperature wlan date
modules-right = filesystem memory cpu battery temperature date eth wlan ; modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date
tray-position = right tray-position = right
tray-padding = 2 tray-padding = 2
;tray-background = #0063ff
;wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize
enable-ipc = true
; tray-position = right
; wm-restack = generic
; wm-restack = bspwm
; wm-restack = i3
; override-redirect = true
[module/xworkspaces]
type = internal/xworkspaces
label-active = %name%
label-active-foreground = #0f1610
label-active-background = #2f7e25
;label-active-underline= #18e000
label-active-padding = 3
label-occupied = %name%
label-occupied-padding = 3
label-occupied-background = #0f1610
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 3
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 3
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
;format-foreground = #717f24
[module/filesystem] [module/filesystem]
type = internal/fs type = internal/fs
interval = 25 interval = 25
mount-0 = / mount-0 = /
label-mounted = %{F#0a81f5}%mountpoint%%{F-}: %percentage_used%% label-mounted = %{F#18e000}%mountpoint%%{F-} %percentage_used%% (%used%/%free%)
label-mounted-underline = #2f7e25
label-unmounted = %mountpoint% not mounted label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt} label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>
[module/cpu] label-volume = %percentage%%
type = internal/cpu
interval = 2 label-muted = muted
format-prefix = " " label-muted-foreground = ${colors.disabled}
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #df8008 [module/xkeyboard]
label = %percentage:2%% type = internal/xkeyboard
blacklist-0 = num lock
label-layout = %layout%
label-layout-foreground = ${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}
[module/memory] [module/memory]
type = internal/memory type = internal/memory
interval = 2 interval = 2
format-prefix = " " format-prefix = ""
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #707f23 format-underline = #707f23
label = %percentage_used%% format-prefix-foreground = ${colors.primary}
;format-prefix-foreground = ${colors.primary}
label = %percentage_used:2% (%gb_used%/%gb_free%)
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = ""
format-underline = #df8008
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
[module/wlan] [module/wlan]
type = internal/network inherit = network-base
interface = wlp9s0 interface-type = wireless
;label-connected = %{F#F0C674}%ifname%%{F-} %essid%
interval = 3.0 interval = 3.0
format-connected = <ramp-signal> <label-connected> format-connected = <ramp-signal> <label-connected>
format-connected-underline = #47577e format-connected-underline = #47577e
label-connected = %essid% label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = ramp-signal-0 =
ramp-signal-1 = ramp-signal-1 =
ramp-signal-2 = ramp-signal-2 =
ramp-signal-3 = ramp-signal-3 =
ramp-signal-4 = ramp-signal-4 =
ramp-signal-foreground = ${colors.foreground-alt} ramp-signal-foreground = ${colors.primary}
[module/eth] [module/eth]
type = internal/network inherit = network-base
interface = eno1 interface-type = wired
interval = 3.0 label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date] [module/date]
type = internal/date type = internal/date
interval = 5 interval = 1
date =
date-alt = " %Y-%m-%d"
format-underline = #2f697f
format-prefix-foreground = ${colors.primary}
format-prefix = " "
date = %a %d %b %Y
date-alt = %Y-%m-%d %H:%M:%S
time = %H:%M time = %H:%M
time-alt = %H:%M:%S time-alt = %H:%M:%S
label = %date% %{F#717f24}%time%
; label-foreground = ${colors.primary}
format-prefix = [module/temperature]
format-prefix-foreground = ${colors.foreground-alt} type = internal/temperature
format-underline = #2f697f thermal-zone = 0
warn-temperature = 60
label = %date% %time% format = <ramp> <label>
format-underline = #327f77
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.alert}
ramp-0 =
ramp-1 =
ramp-2 =
ramp-foreground = ${colors.primary}
[module/battery] [module/battery]
type = internal/battery type = internal/battery
battery = BAT0 battery = BAT0
adapter = ADP1 adapter = ADP1
full-at = 98 full-at = 100
interval = 1
format-charging = <animation-charging> <label-charging> format-charging = <animation-charging> <label-charging>
format-charging-underline = #2f7e25 format-charging-underline = #637d75
format-discharging = <animation-discharging> <label-discharging> format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline} format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " " format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt} format-full-prefix-foreground = ${colors.primary}
format-full-underline = ${self.format-charging-underline} format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = ramp-capacity-0 =
ramp-capacity-1 = ramp-capacity-1 = c
ramp-capacity-2 = ramp-capacity-2 =
ramp-capacity-foreground = ${colors.foreground-alt} ramp-capacity-foreground = ${colors.primary}
animation-charging-0 = animation-charging-0 =
animation-charging-1 = animation-charging-1 =
@ -192,50 +252,15 @@ animation-charging-framerate = 750
animation-discharging-0 = animation-discharging-0 =
animation-discharging-1 = animation-discharging-1 =
animation-discharging-2 = animation-discharging-2 =
animation-discharging-foreground = ${colors.foreground-alt} animation-discharging-foreground = ${colors.alert}
animation-discharging-framerate = 750 animation-discharging-framerate = 750
[module/temperature] [module/my-text-label]
type = internal/temperature type = custom/text
thermal-zone = 0 content =
warn-temperature = 60 ;content-background = #2f7e25
content-foreground = #2f6a7f
format = <ramp> <label> content-padding = 1
format-underline = #7f2b26
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 =
ramp-1 =
ramp-2 =
ramp-foreground = ${colors.foreground-alt}
[module/spotify]
type = custom/script
interval = 1
format-prefix = " "
format = <label>
exec = ~/.config/polybar/scripts/spotify-status.py -f '{artist}: {song}'
format-underline = #317f76
;control players (optional)
click-left = playerctl --player=spotify play-pause
click-right = playerctl --player=spotify next
click-middle = playerctl --player=spotify previous
[settings] [settings]
screenchange-reload = true screenchange-reload = true
;compositing-background = xor pseudo-transparency = true
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 0
; vim:ft=dosini

9
polybar/launch.sh Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
killall -q polybar
# Launch Polybar on all connected monitors
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar --reload example &
done