summaryrefslogtreecommitdiff
path: root/.config/bspwm/bspwmrc
blob: 15e8de93b5e95283b7a52bf0c80bc75667e02dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/sh

#
# Always running programs.
#

feh --bg-fill ~/pix/wp/dracula_1.png
# Since polybar_panel already manages the starting
# of the actual polybar(s), just check if (any) polybar
# is running, if not, run the specified command to run them.
# The reload of polybar_panel is managed by sxhkd, as it should be.
pgrep -x polybar > /dev/null || polybar_panel
# Checks if sxhkd is running, if not, run it.
# Also use setsid so it's appart from status bar
# and the kill doesn't ruin it.
pgrep -x sxhkd > /dev/null || setsid sxhkd &

# This starts or restarts panel. Be careful
# with pkill, if neither of these two programs have
# a 'setsid' prepended to their command, sxhdk wil crash.
# if [ $(pgrep -x lemonbar_panel | wc -l) = 1 ];then
# 	killall lemonbar
# 	lemonbar_panel &
# else
# 	lemonbar_panel &
# fi

# Multihead stuff.
# I changed hostname for uname -u, because
# I didn't know hostname was in inetutils package, kek.
if [ $(uname -n) = "arch" ]; then
	# Run a script to select the main monitor.
	if [ $(pgrep -f bspwm_enforce_monitor_position | wc -l) < 2]; then
		bspwm_enforce_monitor_position $MAINMON '^1' &
	else
		killall bspwm_enforce_monitor_position
		bspwm_enforce_monitor_position $MAINMON '^1' &
	fi

	bspc monitor $MAINMON -d I II III IV V
	bspc monitor $SECMON -d VI VII VIII IX X
else
	bspc monitor -d I II III IV V VI VII VIII IX X
fi

#
# Config (defaults).
#

# General.
bspc config top_padding				35
bspc config bottom_padding			10
bspc config left_padding			10
bspc config right_padding			10

bspc config border_width			2
bspc config window_gap				5

bspc config split_ratio				0.6

bspc config borderless_monocle		true
bspc config gapless_monocle			true

# Could try poniter_follows_monitor instead.
# This fucks up when switching tags via polybar.
# bspc config pointer_follows_focus	true

# Colors.
# First get all colors.
# COLOR_FOREGROUND=$(xresource foreground)
# COLOR_BACKGROUND=$(xresource background)
# COLOR_FOREGROUND_ALT=$(xresource selbackground)
# COLOR_BACKGROUND_ALT=$(xresource selbackground)
# COLOR_BLACK=$(xresource color0)
COLOR_BLACK_ALT=$(xresource color8)
# COLOR_RED=$(xresource color1)
# COLOR_RED_ALT=$(xresource color9)
# COLOR_GREEN=$(xresource color2)
# COLOR_GREEN_ALT=$(xresource color10)
COLOR_YELLOW=$(xresource color3)
# COLOR_YELLOW_ALT=$(xresource color11)
COLOR_BLUE=$(xresource color4)
# COLOR_BLUE_ALT=$(xresource color12)
# COLOR_PURPLE=$(xresource color5)
# COLOR_PURPLE_ALT=$(xresource color13)
COLOR_CYAN=$(xresource color6)
# COLOR_CYAN_ALT=$(xresource color14)
# COLOR_WHITE=$(xresource color7)
# COLOR_WHITE_ALT=$(xresource color15)

bspc config normal_border_color				$COLOR_BLACK_ALT
bspc config active_border_color				$COLOR_CYAN
bspc config focused_border_color			$COLOR_BLUE
bspc config presel_feedback_color			$COLOR_BLUE

# Rules.
bspc rule -a *:*:"Picture-in-Picture" state=floating rectangle=640x360+640+360
bspc rule -a "Peek":*:* state=floating
bspc rule -a "Zathura":*:* state=tiled
bspc rule -a "Godot":*:* state=floating
bspc rule -a "picocad":*:* state=floating
bspc rule -a "Steam":*:* state=floating
# bspc rule -a "pentablet":*:* state=floating rectangle=1130x1020+640+360
# bspc rule -a Gimp desktop='^8' state=floating follow=on
# bspc rule -a Chromium desktop='^2'
# bspc rule -a mplayer2 state=floating
# bspc rule -a Kupfer.py focus=on
# bspc rule -a Screenkey manage=off