dotfiles/homedir/.config/bspwm/bin/bspset
fbt c78cb78ff0 init
Signed-off-by: fbt <fbt@fleshless.org>
2017-05-03 16:10:13 +03:00

46 lines
653 B
Bash
Executable File

#!/usr/bin/bash
usage() {
printf 'No help available'
}
main() {
while (( $# )); do
case "$1" in
(-h) usage;;
(-d) desktop=$2; shift;;
(--) shift; break;;
(*) break;;
esac
shift
done
setting=$1
shift
desktop=${desktop:-"focused"}
case "$setting" in
(padding)
if [[ "$1" =~ ^(north|west|south|east)$ ]]; then
direction=$1
fi
if [[ "$direction" ]]; then
bspc config -d "$desktop" "${direction}_padding" "$1"
else
for d in top bottom right left; do
bspc config -d "$desktop" "${d}_padding" "$1"
done
fi
;;
(gaps)
bspc config -d "$desktop" window_gap "$1"
;;
esac
}
main "$@"