add bspwm config and use as default WM

This commit is contained in:
2020-07-12 00:46:31 +02:00
parent 17bd71ac37
commit 25a350d962
4 changed files with 217 additions and 1 deletions

21
.config/bspwm/bspwmrc Executable file
View File

@ -0,0 +1,21 @@
#! /bin/sh
sxhkd &
~/.config/bspwm/panel &
xdo lower $(xdo id -a panel)
bspc monitor -d 1 2 3 4 5 6 7 8 9 0
bspc config border_width 2
bspc config window_gap 12
bspc config normal_border_color '#808080'
bspc config focused_border_color '#3585ce'
bspc config presel_feedback_color '#3585ce'
bspc config split_ratio 0.50
bspc config single_monocle true
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc rule -a Gimp desktop='^8' state=floating follow=on

64
.config/bspwm/panel Executable file
View File

@ -0,0 +1,64 @@
#!/bin/sh
BAR_BG='#1a343a'
BAR_FG='#e2f6e1'
ACTIVE_BG='#3585ce'
URGENT_BG='#ff0000'
FREE_FG='#808080'
PANEL_FIFO=~/.panel-fifo
[ -e "$PANEL_FIFO" ] && rm -f "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"
bspc subscribe > "$PANEL_FIFO" &
xtitle -sf 'T%s\n' > "$PANEL_FIFO" &
while true; do
echo "C$(date '+%H:%M')"
sleep 1
done > "$PANEL_FIFO" &
while read -r line ; do
case "$line" in
C*)
clock="${line#?}"
;;
T*)
title="${line#?}"
;;
W*)
wm=
IFS=':' set -- ${line#?}
while [ $# -gt 0 ]; do
item="$1"
name="${item#?}"
case "$item" in
[fFOoUu]*)
case "$item" in
[OF]*)
BG="${ACTIVE_BG}"
FG="-"
;;
o*)
BG="-"
FG="-"
;;
f*)
BG="-"
FG="${FREE_FG}"
;;
[uU]*)
BG="${URGENT_BG}"
FG="-"
;;
esac
wm="${wm}%{B${BG}}%{F${FG}}%{A:bspc desktop -f ${name}:} ${name} %{A}%{B-}%{F-}"
esac
shift
done
;;
esac
printf "%s\n" " ${wm} ${title}%{r}${clock} "
done < "$PANEL_FIFO" | lemonbar -B "${BAR_BG}" -F "${BAR_FG}" -n panel -f Iosevka:pixelsize=30:antialias=true:autohint=true | sh