make bspwm config ready for the main desktop

This commit is contained in:
Valentin Boettcher 2020-12-31 18:23:06 +01:00
parent 9df431461f
commit e4e04bc7cf
5 changed files with 59 additions and 5 deletions

View file

@ -3,8 +3,9 @@ ETH_DEV="enp3s0"
MAIN_NET=$ETH_DEV
MAIN_FONT="Source Code Pro 8"
MAIN_MONITOR=DisplayPort-0
MONITORS=(DVI-I-0 DisplayPort-2)
MONITORS=($(xrandr | rg -i "\sconnected" | rg -v eDP | cut -d" " -f1))
MAIN_MONITOR=${MONITORS[2]}
SIDE_MONITORS=($(xrandr | rg -i "\sconnected" | rg -v eDP | cut -d" " -f1 | grep -v $MAIN_MONITOR))
RYGEL="true"
BAR_POS="bottom"
DPI=91

View file

@ -33,5 +33,12 @@ bspc config remove_unplugged_monitors true
# Scripts #
###############################################################################
{{ #laptop }}
~/.config/bspwm/monitor_laptop.sh
{{ /laptop }}
{{ ^laptop }}
~/.config/bspwm/monitor_desktop.sh
{{ /laptop }}
~/.config/polybar/launch.sh

View file

@ -0,0 +1,23 @@
###############################################################################
# External Monitor #
###############################################################################
declare -A workspaces
workspaces[2]="I V VI VIII IX X"
workspaces[0]="II IV VII"
workspaces[1]="III IX"
MONITORS=({{ MONITORS[@] }})
move_to_monitor() {
for D in $(echo $1 | tr " " "\n"); do
bspc desktop $D --to-monitor $2
done
}
I=0
for MONITOR in $MONITORS; do
bspc monitor $MONITOR -d ${workspaces[${I}]}
((I=I+1))
# move_to_monitor "${workspaces[${I}]}" $MONITOR
done

View file

@ -26,15 +26,23 @@ border-bottom-color = ${colors.bordercolor}
font-0 = Fira Code:size=10;2
font-1 = FontAwesome:size=10;2
{{ #LAPTOP }}
[bar/ext]
inherit = bar/base
monitor = HDMI-2
monitor = {{.}}
modules-left = bspwm
{{ /LAPTOP }}
{{#SIDE_MONITORS}}
[bar/ext__{{.}}]
inherit = bar/base
monitor = {{.}}
modules-left = bspwm
{{/SIDE_MONITORS}}
[bar/main]
inherit = bar/base
monitor = eDP-1
monitor = {{ MAIN_MONITOR }}
spacing = 3
lineheight = 2
@ -45,7 +53,14 @@ module-margin-right = 1
separator = |
modules-left = bspwm
{{ #LAPTOP }}
modules-right = battery clock
{{ /LAPTOP }}
{{ ^LAPTOP }}
modules-right = clock
{{ /LAPTOP }}
tray-position = center

View file

@ -1,5 +1,13 @@
#!/bin/sh
polybar-msg cmd quit
polybar main & disown
{{ #LAPTOP }}
polybar ext & disown
{{ /LAPTOP }}
{{#SIDE_MONITORS}}
polybar ext__{{.}} & disown
{{/SIDE_MONITORS}}
xdo id -m -N Polybar && polybar-msg cmd hide