From e9717375ea0f22ac273218eaead2857fbb5be960 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Fri, 21 May 2021 14:08:34 -0500 Subject: Switch from polybar to i3blocks Switch my top bar from polybar to i3blocks. Polybar requires a separate startup script while i3blocks runs as a child process of i3 itself. Signed-off-by: Danny Holman --- .config/i3/config | 26 ++--- .config/polybar/config | 302 ------------------------------------------------- .i3blocks.conf | 35 ++++++ 3 files changed, 48 insertions(+), 315 deletions(-) delete mode 100644 .config/polybar/config create mode 100644 .i3blocks.conf diff --git a/.config/i3/config b/.config/i3/config index 148db12..ecc383b 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -74,6 +74,12 @@ bindsym $mod+Shift+c reload # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym $mod+Shift+r restart +# i3blocks +bar { + status_command i3blocks + position top +} + # resize window (you can also use the mouse for that) set $mode_resize Resize window mode "$mode_resize" { @@ -101,13 +107,13 @@ mode "$mode_system" { } # Volume -bindsym $mod+Shift+greater exec --no-startup-id amixer sset Master 5%+ -bindsym $mod+Shift+less exec --no-startup-id amixer sset Master 5%- -bindsym $mod+Shift+m exec --no-startup-id amixer sset Master toggle -bindsym $mod+Shift+t exec --no-startup-id amixer sset Front toggle -bindsym XF86AudioRaiseVolume exec --no-startup-id amixer sset Master 5%+ -bindsym XF86AudioLowerVolume exec --no-startup-id amixer sset Master 5%- -bindsym XF86AudioMute exec --no-startup-id amixer sset Master toggle +bindsym $mod+Shift+greater exec --no-startup-id amixer sset Master 5%+ && pkill -RTMIN+10 i3blocks +bindsym $mod+Shift+less exec --no-startup-id amixer sset Master 5%- && pkill -RTMIN+10 i3blocks +bindsym $mod+Shift+m exec --no-startup-id amixer sset Master toggle && pkill -RTMIN+10 i3blocks +bindsym $mod+Shift+t exec --no-startup-id amixer sset Front toggle && pkill -RTMIN+10 i3blocks +bindsym XF86AudioRaiseVolume exec --no-startup-id amixer sset Master 5%+ && pkill -RTMIN+10 i3blocks +bindsym XF86AudioLowerVolume exec --no-startup-id amixer sset Master 5%- && pkill -RTMIN+10 i3blocks +bindsym XF86AudioMute exec --no-startup-id amixer sset Master toggle && pkill -RTMIN+10 i3blocks # Screen brightness bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10% @@ -133,18 +139,12 @@ bindsym $mod+Shift+p exec --no-startup-id "rofi-pass" # Gap stuff hide_edge_borders both new_window 1pixel -gaps inner 15 -gaps outer 15 # Start helpful programs exec --no-startup-id ~/.screenlayout/screen.sh exec --no-startup-id wal -s -i "$HOME/Pictures/wal/" exec --no-startup-id xautolock -time 5 -locker "i3lock -c 000000" -exec --no-startup-id picom -cCf -i 1 -m 1 exec --no-startup-id tilda -exec --no-startup-id polybar -r main0 -exec --no-startup-id polybar -r main1 -exec --no-startup-id polybar -r main2 exec --no-startup-id dex -a # Play nice with Steam windows diff --git a/.config/polybar/config b/.config/polybar/config deleted file mode 100644 index b20016c..0000000 --- a/.config/polybar/config +++ /dev/null @@ -1,302 +0,0 @@ -; Danny's Polybar config - -[colors] -trans = #00000000 -white = #FFFFFF -black = #000000 - -bg = #341d63 -bg-alt = #05668d -fg = #FFFFFF -fg-alt = #A9ABB0 -urgent = #FF0000 - -; Global - -[global/wm] -margin-top = 5 -margin-bottom = 5 - -[bar/main0] -monitor = ${env:MONITOR:HDMI-A-2} -;monitor = ${env:MONITOR:eDP1} -width = 100% -height = 23 -bottom = false -offset-x = 0% -offset-y = 0% -fixed-center = true -line-size = 2 -background = ${colors.bg} -foreground = ${colors.fg} - -overline-size = 0 -overline-color = ${colors.bg} -underline-size = 2 -underline-color = ${colors.bg} - -module-margin-left = 0 -module-margin-right = 0 - -; Fonts -font-0 = "PowerlineSymbols:pixelsize=15;3" -font-1 = "Fantasque Sans Mono:pixelsize=12;2" - -; System tray -tray-position = left -tray-padding = 2 -tray-transparent = false -tray-background = ${colors.bg-alt} - -; Module layouts -modules-left = RightArrow3 i3 RightArrow2 xwindow RightArrow1 RightStripe RightArrow1 -modules-center = RightStripe date LeftStripe -modules-right = arrow1 LeftStripe arrow1 filesystem arrow2 alsa arrow3 cpu arrow2 memory arrow3 updates - -[bar/main1] -inherit = bar/main0 -monitor = ${env:MONITOR:HDMI1} -tray-position = none -modules-left = i3 RightArrow2 xwindow RightArrow1 RightStripe RightArrow1 - -[bar/main2] -inherit = bar/main0 -monitor = ${env:MONITOR:DisplayPort-2} -tray-position = none -modules-left = i3 RightArrow2 xwindow RightArrow1 RightStripe RightArrow1 - -; Modules - -[module/filesystem] -type = internal/fs -interval = 5 -fixed-values = true - -mount-0 = / -mount-1 = /mnt/fileserver - -format-mounted = -format-mounted-foreground = ${colors.fg} -format-mounted-background = ${colors.bg-alt} -format-unmounted = -format-unmounted-foreground = ${colors.fg} -format-unmounted-background = ${colors.bg-alt} - -label-mounted = "%mountpoint%: %percentage_used%%" -; %free%% %percentage_used%% %used% -label-mounted-foreground = ${colors.fg} -label-mounted-background = ${colors.bg-alt} -label-unmounted = %mountpoint% -label-unmounted-foreground = ${colors.bg} -label-unmounted-background = ${colors.fg} - -[module/alsa] -type = internal/alsa - -master-soundcard = default -master-mixer = Master - -format-volume = -format-muted = -label-volume = VOL %percentage%% -label-muted = MUTED - -format-volume-foreground = ${colors.fg} -format-volume-background = ${colors.bg} -format-muted-foreground = ${colors.fg} -format-muted-background = ${colors.bg} - -[module/i3] -type = internal/i3 -format = -index-sort = true -wrapping-scroll = false -pin-workspaces = true -enable-scroll = true - -label-focused = %index% -label-focused-foreground = ${colors.fg} -label-focused-background = ${colors.bg} -label-focused-underline = ${colors.fg} -label-focused-padding = 2 -label-focused-font = 1 -label-unfocused = %index% -label-unfocused-padding = 2 -label-unfocused-foreground = ${colors.fg} -label-unfocused-background = ${colors.bg} -label-occupied = %index% -label-occupied-foreground = ${colors.fg} -label-occupied-background = ${colors.bg} -label-occupied-padding = 2 -label-urgent = %index% -label-urgent-foreground = ${colors.urgent} -label-urgent-background = ${colors.bg} -label-urgent-padding = 2 -label-empty = %index% -label-empty-foreground = ${colors.bg} -label-empty-background = ${colors.fg} -label-empty-padding = 2 -label-visible = %index% -label-visible-background = ${self.label-focused-background} -label-visible-underline = ${self.label-focused-underline} -label-visible-padding = ${self.label-focused-padding} -label-mode-foreground = ${colors.fg} -label-mode-background = ${colors.bg} - -[module/xwindow] -type = internal/xwindow - -format-foreground = ${colors.fg} -format-background = ${colors.bg-alt} -format-padding = 2 -label = %title% -label-maxlen = 25 - -[module/xbacklight] -type = internal/xbacklight - -format =