From 61a434af076418fe435ddd27fbb6428d0979cec8 Mon Sep 17 00:00:00 2001 From: Joachim Nielandt Date: Tue, 14 Jul 2020 21:46:34 +0200 Subject: [PATCH] Polybar update. --- dot_dotfiles/polybar/{config => config.tmpl} | 270 ++++++++++--------- 1 file changed, 147 insertions(+), 123 deletions(-) rename dot_dotfiles/polybar/{config => config.tmpl} (69%) diff --git a/dot_dotfiles/polybar/config b/dot_dotfiles/polybar/config.tmpl similarity index 69% rename from dot_dotfiles/polybar/config rename to dot_dotfiles/polybar/config.tmpl index a7d0cdb..152e6a7 100644 --- a/dot_dotfiles/polybar/config +++ b/dot_dotfiles/polybar/config.tmpl @@ -1,3 +1,4 @@ +; ;===================================================== ; ; To learn more about how to configure Polybar @@ -7,82 +8,88 @@ ; ;===================================================== [colors] -background = ${xrdb:color0:#222} -foreground = ${xrdb:color7:#222} -background-alt = ${xrdb:color10:#222} -foreground-alt = ${xrdb:color4:#222} -icon-color = ${xrdb:color4:#FF2} -primary = ${xrdb:color1:#222} -alert = ${xrdb:color10:#222} -secondary = ${xrdb:color10:#222} -; let's get some colors from xrdb (pywal) -col0 = ${xrdb:color0:#222} -col1 = ${xrdb:color1:#222} -col2 = ${xrdb:color2:#222} -col3 = ${xrdb:color3:#222} -col4 = ${xrdb:color4:#222} -col5 = ${xrdb:color5:#222} -col6 = ${xrdb:color6:#222} -col7 = ${xrdb:color7:#222} -col8 = ${xrdb:color8:#222} -col9 = ${xrdb:color9:#222} -col10 = ${xrdb:color10:#222} -col11 = ${xrdb:color11:#222} -col12 = ${xrdb:color12:#222} -col13 = ${xrdb:color13:#222} -gruvbg = ${xrdb:background:#222} -gruvbghard = ${xrdb:backgroundhard:#222} -gruvbgsoft = ${xrdb:backgroundsoft:#222} -gruvfg = ${xrdb:foreground:#222} -; control some of the later elements from here, nice and tidy -underline-cpu = ${xrdb:color2:#222} -underline-memory = ${xrdb:color3:#222} -underline-date = ${xrdb:color4:#222} -underline-battery = ${xrdb:color5:#222} -underline-temperature = ${xrdb:color6:#222} -underline-keyboard = ${xrdb:color7:#222} -underline-i3-focused = ${xrdb:color10:#222} -underline-i3-unfocused = ${xrdb:color8:#222} +# gruvbox colors +dark0_hard = #1d2021 +dark0 = #282828 +dark0_soft = #32302f +dark1 = #3c3836 +dark2 = #504945 +dark3 = #665c54 +dark4 = #7c6f64 +gray_245 = #928374 +gray_244 = #928374 +light0_hard = #f9f5d7 +light0 = #fbf1c7 +light0_soft = #f2e5bc +light1 = #ebdbb2 +light2 = #d5c4a1 +light3 = #bdae93 +light4 = #a89984 +bright_red = #fb4934 +bright_green = #b8bb26 +bright_yellow = #fabd2f +bright_blue = #83a598 +bright_purple = #d3869b +bright_aqua = #8ec07c +bright_orange = #fe8019 +neutral_red = #cc241d +neutral_green = #98971a +neutral_yellow = #d79921 +neutral_blue = #458588 +neutral_purple = #b16286 +neutral_aqua = #689d6a +neutral_orange = #d65d0e +faded_red = #9d0006 +faded_green = #79740e +faded_yellow = #b57614 +faded_blue = #076678 +faded_purple = #8f3f71 +faded_aqua = #427b58 +faded_orange = #af3a03 + +# want to get colors from xrdb / .Xresources? +# background = ${xrdb:color0:#222} +bar-background = #00FFFFFF + [bar/general] width = 100% - ; spaces before/after each module module-margin-left = 1 module-margin-right = 1 - height = 27 fixed-center = true -line-size = 3 +line-size = 2 line-color = #f00 - ; rounded corners of the bar radius = 0.0 - ;this makes sure that i3 doesn't reposition everything when polybar becomes active... is shit override-redirect = false wm-restack = i3 ; all the bar colors -background = ${colors.background} -foreground = ${colors.foreground} -border-color = ${colors.background} - +background = ${colors.bar-background} +foreground = ${colors.light0_hard} +border-color = ${colors.bright_blue} ; spaces on begin/end of bar padding-left = 2 padding-right = 2 - ; set the bar fonts ;font-0 = fixed:pixelsize=10;1 ;font-0 = "Wuncon Siji:pixelsize=15;1" ;font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 ;font-2 = "Inconsolata\ For\ Powerline:pixelsize=10;1" font-0 = FuraCode Nerd Font:pixelsize=11;1 - +;font-1 = Siji:style=Regular:pixelsize=11 +font-1 = Siji:pixelsize=14;0 ; override pointers cursor-click = pointer cursor-scroll = pointer -[bar/example] + + + +; this bar will contain the tray, only on primary monitor +[bar/primary] inherit = bar/general monitor = ${env:MONITOR:eDP-1} ;offset-x = 2% @@ -91,12 +98,10 @@ monitor = ${env:MONITOR:eDP-1} ;border-size = 20 ;border-left-size = 16 ;border-right-size = 16 - ;unused modules - mpd xbacklight backlight-acpi alsa modules-left = i3 modules-center = temperature battery xkeyboard memory cpu filesystem updates-arch reboot-check xbacklight top-process -modules-right = net1 wifi0 vpn powermenu - +modules-right = net wifi0 vpn powermenu ; TRAY MANAGEMENT ;tray-position = right tray-position = ${env:TRAY_POSITION:none} @@ -109,24 +114,34 @@ tray-offset-x = 0 tray-offset-y = 27 tray-padding = 2 tray-scale = 1.0 - scroll-up = i3wm-wsnext scroll-down = i3wm-wsprev - cursor-click = pointer ;cursor-scroll = ns-resize cursor-scroll = pointer + [bar/secondary] inherit = bar/general monitor = ${env:MONITOR:eDP-1} ;offset-x = 2% ;offset-y = 1% - ;unused modules - mpd xbacklight backlight-acpi alsa modules-right = pulseaudio modules-center = player-mpris-tail -modules-left = date info-hackspeed +modules-left = host-icon date info-hackspeed + + +[module/host-icon] +type = custom/script +exec = echo 0 +;tail = false +label-foreground = ${colors.bright_orange} +{{- if eq .chezmoi.hostname "carbonraptor" }} +label = "" +{{ else }} +label = "?" +{{- end }} [module/player-mpris-tail] type = custom/script @@ -137,15 +152,15 @@ label = %output% [module/info-hackspeed] type = custom/script format-prefix = " " -format-prefix-foreground = ${colors.icon-color} +format-prefix-foreground = ${colors.bright_blue} exec = ~/.config/polybar/polybar-scripts/polybar-scripts/info-hackspeed/info-hackspeed.sh tail = true [module/top-process] type = custom/script format-prefix = " " -format-prefix-foreground = ${colors.icon-color} -format-underline = ${colors.alert} +format-prefix-foreground = ${colors.bright_blue} +;format-underline = ${colors.bright_red} interval = 5 exec = ~/.dotfiles/scripts/top.process.sh tail = true @@ -157,32 +172,26 @@ label = %title:0:30:...% [module/xkeyboard] type = internal/xkeyboard blacklist-0 = num lock - format-prefix = " " -format-prefix-foreground = ${colors.icon-color} -format-prefix-underline = ${colors.underline-keyboard} - +format-prefix-foreground = ${colors.bright_blue} +;format-prefix-underline = ${colors.underline-keyboard} ; layout, number, name label-layout = %layout% -label-layout-underline = ${colors.underline-keyboard} - +;label-layout-underline = ${colors.underline-keyboard} label-indicator-padding = 2 label-indicator-margin = 1 -label-indicator-background = ${colors.secondary} -label-indicator-underline = ${colors.underline-keyboard} - +label-indicator-background = ${colors.neutral_blue} +;label-indicator-underline = ${colors.underline-keyboard} cursor-click = pointer - [module/vpn] type = custom/script exec = nmcli | grep "VPN connection" | sed -e "s/VPN connection//g" exec-if = pgrep -x openvpn interval = 5 -format-underline = #268bd2 +;format-underline = #268bd2 format-prefix = " " -format-prefix-foreground = ${colors.col1} - +format-prefix-foreground = ${colors.light0} [module/filesystem] type = internal/fs @@ -191,25 +200,25 @@ mount-0 = / mount-1 = /mnt/ext4 label-mounted = %{F#0a81f5}%mountpoint%%{F-} %percentage_used%% label-unmounted = %mountpoint% not mounted -label-unmounted-foreground = ${colors.foreground-alt} +label-unmounted-foreground = ${colors.bright_green} [module/bspwm] type = internal/bspwm label-focused = %index% label-focused-background = ${colors.background-alt} -label-focused-underline= ${colors.primary} +;label-focused-underline= ${colors.primary} label-focused-padding = 2 label-occupied = %index% label-occupied-padding = 2 label-urgent = %index%! -label-urgent-background = ${colors.alert} +label-urgent-background = ${colors.bright_red} label-urgent-padding = 2 label-empty = %index% -label-empty-foreground = ${colors.foreground-alt} +label-empty-foreground = ${colors.bright_green} label-empty-padding = 2 ; Separator in between workspaces @@ -249,10 +258,10 @@ ws-icon-default =  ; Whenever the 'move' changes... like 'resize', ... label-mode-padding = 2 -label-mode-foreground = ${colors.gruvfg} +label-mode-foreground = ${colors.light0_hard} ;label-mode-background = ${colors.primary} -label-mode-background = ${colors.col4} -label-mode-underline = ${colors.col12} +label-mode-background = ${colors.bright_yellow} +;label-mode-underline = ${colors.light2} ; focused = Active workspace on focused monitor label-focused = %icon% %name% @@ -260,15 +269,15 @@ label-focused = %icon% %name% ;label-focused-background = ${module/bspwm.label-focused-background} ;label-focused-underline = ${module/bspwm.label-focused-underline} ;label-focused-padding = ${module/bspwm.label-focused-padding} -label-focused-background = ${colors.col2} -label-focused-foreground = ${colors.gruvbghard} -label-focused-underline = ${colors.underline-i3-focused} +label-focused-background = ${colors.light1} +label-focused-foreground = ${colors.dark0_hard} +;label-focused-underline = ${colors.underline-i3-focused} label-focused-padding = 2 ; unfocused = Inactive workspace on any monitor ;label-unfocused = %index% label-unfocused = %icon% %name% -label-unfocused-underline = ${colors.underline-i3-unfocused} +;label-unfocused-underline = ${colors.underline-i3-unfocused} ;label-unfocused-padding = ${module/bspwm.label-occupied-padding} label-unfocused-padding = 2 @@ -278,17 +287,17 @@ label-visible = %icon% %name% ;label-visible-background = ${self.label-focused-background} ;label-visible-underline = ${self.label-focused-underline} ;label-visible-padding = ${self.label-focused-padding} -label-visible-background = ${colors.col12} -label-visible-foreground = ${colors.gruvbghard} -label-visible-underline = #FFFFFF +label-visible-background = ${colors.light2} +label-visible-foreground = ${colors.dark0_hard} +;label-visible-underline = #FFFFFF label-visible-padding = 2 ; urgent = Workspace with urgency hint set label-urgent = %icon% %name% ; label-urgent-background = ${module/bspwm.label-urgent-background} -label-urgent-background = ${colors.col1} -label-urgent-foreground = ${colors.col9} -label-urgent-underline = ${colors.col9} +label-urgent-background = ${colors.light0} +label-urgent-foreground = ${colors.bright_orange} +;label-urgent-underline = ${colors.bright_orange} label-urgent-padding = 2 ; Separator in between workspaces @@ -314,8 +323,8 @@ type = internal/xbacklight format =