meta: Modernize polybar

It turns out that merge commit messages are used to keep track of
branch information since the commits themselves only reference other
commits and the actual branches may be deleted at a future date (even
`git clone` by default will not pull in any other branches).

Personally, I find a meaningful commit message more useful than a merge
commit message, so I'll be using that instead. Later when looking at
the commit history, "Merge branch <branch_name>" will not be useful
since the mentioned branches will have already been deleted.

Some projects rebase all changes into one commit, then push that
single commit to master. This seems like a very convenient approach
for small fixes, although if done for larger changes, each individual
commit and its respective explanation is lost.

In particular, this merge commit adds a bunch of config changes that
make polybar (and the system itself) more practical to use. Borders and
gaps are now disabled by default, and can be manually set through bspc
for your ricing needs.
This commit is contained in:
Donovan Glover 2018-12-05 18:35:30 -05:00
commit c0526a8c55
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 15 additions and 35 deletions

View File

@ -14,14 +14,14 @@ background-alt = ${xrdb:color8}
[bar/main] [bar/main]
modules-left = bspwm modules-left = bspwm
modules-center = mpd modules-center = window
modules-right = cpu ram volume date time modules-right = cpu ram volume date time
monitor = VGA-1 monitor = VGA-1
wm-restack = bspwm wm-restack = bspwm
include-file = $HOME/.cache/polybar/config include-file = $HOME/.cache/polybar/config
foreground = ${color.text} foreground = ${color.background-alt}
background = ${color.background} background = ${color.background}
border-color = ${color.text} border-color = ${color.text}
@ -31,7 +31,8 @@ font-2 = "Font Awesome 5 Free:style=Solid:size=10"
font-3 = "Font Awesome 5 Free:style=Regular:size=10" font-3 = "Font Awesome 5 Free:style=Regular:size=10"
font-4 = "Font Awesome 5 Brands:style=Regular:size=10" font-4 = "Font Awesome 5 Brands:style=Regular:size=10"
padding = 2 padding-left = 1
padding-right = 2
module-margin = 1 module-margin = 1
[module/bspwm] [module/bspwm]
@ -50,52 +51,32 @@ label-private-padding = 1
label-sticky-padding = 1 label-sticky-padding = 1
label-monocle-foreground = ${color.yellow} label-monocle-foreground = ${color.yellow}
label-locked-foreground = ${color.background-alt}
label-private-foreground = ${color.background-alt}
label-sticky-foreground = ${color.background-alt}
label-focused-padding = 2 label-focused-padding = 1
label-urgent-padding = 2 label-urgent-padding = 1
label-occupied-padding = 2 label-occupied-padding = 1
label-empty-padding = 2 label-empty-padding = 1
label-focused-foreground = ${color.text} label-focused-foreground = ${color.text}
label-urgent-foreground = ${color.yellow} label-urgent-foreground = ${color.yellow}
label-occupied-foreground = ${color.background-alt}
label-empty-foreground = ${color.green}
ws-icon-0 = 1;一
ws-icon-1 = 2;二
ws-icon-2 = 3;三
ws-icon-3 = 4;四
ws-icon-4 = 5;五
ws-icon-5 = 6;六
ws-icon-6 = 7;七
ws-icon-7 = 8;八
ws-icon-8 = 9;九
ws-icon-9 = 10;十
[module/cpu] [module/cpu]
type = internal/cpu type = internal/cpu
label =  %percentage%% label =  %percentage%%
format-foreground = ${color.background-alt}
[module/ram] [module/ram]
type = internal/memory type = internal/memory
label =  %gb_used% label =  %gb_used%
format-foreground = ${color.background-alt}
[module/date] [module/date]
type = internal/date type = internal/date
date =  %d.%m.%y date =  %d.%m.%y
#date =  %B %d, %Y #date =  %B %d, %Y
#date =  %A #date =  %A
format-foreground = ${color.background-alt}
[module/time] [module/time]
type = internal/date type = internal/date
date =  %H:%M date =  %H:%M
format-foreground = ${color.background-alt}
[module/battery] [module/battery]
type = internal/battery type = internal/battery
@ -112,12 +93,14 @@ format-offline = No song is currently playing.
label-song-maxlen = 100 label-song-maxlen = 100
label-song-ellipsis = true label-song-ellipsis = true
format-online =  <label-song> format-online =  <label-song>
format-offline-foreground = ${color.background-alt}
format-online-foreground = ${color.background-alt}
[module/volume] [module/volume]
type = internal/alsa type = internal/alsa
label-volume =  %percentage%% label-volume =  %percentage%%
format-volume-foreground = ${color.background-alt}
[module/window]
type = internal/xwindow
label-maxlen = 120
label-empty = /usr/bin/bspwm
; vim:ft=dosini ; vim:ft=dosini

View File

@ -14,9 +14,6 @@ bspc_config() {
bspc config window_gap $3 & bspc config window_gap $3 &
} }
# If no bar was specified, we're done here.
if [ -z "$1" ]; then bspc_config 0 $((1 * $POLYBAR_SCALE)) 0; exit; fi
# Set defaults # Set defaults
POLYBAR_HEIGHT=$((40 * $POLYBAR_SCALE)) POLYBAR_HEIGHT=$((40 * $POLYBAR_SCALE))
HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width') HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width')
@ -32,8 +29,8 @@ fi
# Set the bspwm variables # Set the bspwm variables
BSPWM_TOP_PADDING=$(($POLYBAR_HEIGHT + ${POLYBAR_OFFSET_XY:-0} + ${POLYBAR_BORDER_SIZE:-0} * 2)) BSPWM_TOP_PADDING=$(($POLYBAR_HEIGHT + ${POLYBAR_OFFSET_XY:-0} + ${POLYBAR_BORDER_SIZE:-0} * 2))
BSPWM_BORDER_WIDTH=${POLYBAR_BORDER_SIZE:-$((1 * $POLYBAR_SCALE))} BSPWM_BORDER_WIDTH=${POLYBAR_BORDER_SIZE:-0}
BSPWM_WINDOW_GAP=${POLYBAR_OFFSET_XY:-$((20 * $POLYBAR_SCALE))} BSPWM_WINDOW_GAP=${POLYBAR_OFFSET_XY:-0}
bspc_config $BSPWM_TOP_PADDING $BSPWM_BORDER_WIDTH $BSPWM_WINDOW_GAP bspc_config $BSPWM_TOP_PADDING $BSPWM_BORDER_WIDTH $BSPWM_WINDOW_GAP