polybar: Get host width from bspc

Although width can also be found through xrandr, it felt a bit messy to
parse output that wasn't meant to be parsed by other programs.

Since I can guarantee that the user will have bspwm (and not xrandr)
installed, I decided to use bspc instead. The current setup only works
for one monitor, but it should be relatively painless to setup multiple
monitors in the future (assuming they share the same dpi).
This commit is contained in:
Donovan Glover 2018-10-21 11:00:52 -04:00
parent 22a4e548d1
commit 14fa7d6c52
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -16,7 +16,7 @@ if [ -z "$1" ]; then bspc_config 0 4 0; exit; fi
# Set defaults
POLYBAR_HEIGHT=80
HOST_WIDTH=3840
HOST_WIDTH=$(bspc query -T -m | jq '.rectangle.width')
# Make the bar float
if [ "$1" == "float" ]; then