bspwm: Move monitor setup to its own file
It's complex enough to warrant it, I'd say
This commit is contained in:
parent
73315922ae
commit
9e1b4556d3
@ -29,20 +29,7 @@ unset dtfscript
|
|||||||
|
|
||||||
## bspwm GENERAL CONFIGURATION
|
## bspwm GENERAL CONFIGURATION
|
||||||
printf "[INFO] Configuring bspwm\n"
|
printf "[INFO] Configuring bspwm\n"
|
||||||
printf "[INFO] Setting up monitors\n"
|
$HOME/.config/bspwm/monitorset.sh
|
||||||
# Get the primary first, to ensure it's the first element
|
|
||||||
monitors=($(xrandr -q | awk '/primary/{print $1}' && xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}'))
|
|
||||||
desktops=8
|
|
||||||
deskpermon=$(expr $desktops / ${#monitors[@]})
|
|
||||||
printf " [INFO] Putting $desktops desktops across ${#monitors[@]} monitors, $deskpermon each\n"
|
|
||||||
for m in $(seq 0 $(expr ${#monitors[@]} - 1)); do
|
|
||||||
layout=$(seq --separator=" " $(expr 1 + $m) ${#monitors[@]} $(expr $desktops ))
|
|
||||||
printf " [INFO] Giving monitor $m (${monitors[$m]}) layout \"$layout\"\n"
|
|
||||||
bspc monitor ${monitors[$m]} -d $layout
|
|
||||||
done
|
|
||||||
unset monitors
|
|
||||||
unset desktops
|
|
||||||
unset deskpermon
|
|
||||||
|
|
||||||
bspc config border_width 4
|
bspc config border_width 4
|
||||||
bspc config window_gap 6
|
bspc config window_gap 6
|
||||||
|
20
.config/bspwm/monitorset.sh
Executable file
20
.config/bspwm/monitorset.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
#
|
||||||
|
# monitorset.sh
|
||||||
|
# Copyright (C) 2018 salt <salt@dsk-cstm-0>
|
||||||
|
#
|
||||||
|
# Distributed under terms of the MIT license.
|
||||||
|
#
|
||||||
|
|
||||||
|
printf "[INFO] Setting up monitors\n"
|
||||||
|
# Get the primary first, to ensure it's the first element
|
||||||
|
monitors=($(xrandr -q | awk '/primary/{print $1}' && xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}'))
|
||||||
|
desktops=8
|
||||||
|
deskpermon=$(expr $desktops / ${#monitors[@]})
|
||||||
|
printf " [INFO] Putting $desktops desktops across ${#monitors[@]} monitors, $deskpermon each\n"
|
||||||
|
for m in $(seq 0 $(expr ${#monitors[@]} - 1)); do
|
||||||
|
layout=$(seq --separator=" " $(expr 1 + $m) ${#monitors[@]} $(expr $desktops ))
|
||||||
|
printf " [INFO] Giving monitor $m (${monitors[$m]}) layout \"$layout\"\n"
|
||||||
|
bspc monitor ${monitors[$m]} -d $layout
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in New Issue
Block a user