This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
bspwmrc
executable file
·140 lines (115 loc) · 3.67 KB
/
bspwmrc
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/usr/bin/env bash
## Environtment
export PATH="${PATH}:$HOME/.config/bspwm/bin"
## Java Applications
wmname LG3D
export _JAVA_AWT_WM_NONREPARENTING=1
## Get colors from .Xresources -------------------------------#
xrdb ~/.Xresources
getcolors() {
FOREGROUND=$(xrdb -query | grep 'foreground:' | awk '{print $NF}')
BACKGROUND=$(xrdb -query | grep 'background:' | awk '{print $NF}')
BLACK=$(xrdb -query | grep 'color0:' | awk '{print $NF}')
RED=$(xrdb -query | grep 'color1:' | awk '{print $NF}')
GREEN=$(xrdb -query | grep 'color2:' | awk '{print $NF}')
YELLOW=$(xrdb -query | grep 'color3:' | awk '{print $NF}')
BLUE=$(xrdb -query | grep 'color4:' | awk '{print $NF}')
MAGENTA=$(xrdb -query | grep 'color5:' | awk '{print $NF}')
CYAN=$(xrdb -query | grep 'color6:' | awk '{print $NF}')
WHITE=$(xrdb -query | grep 'color7:' | awk '{print $NF}')
}
getcolors
## Configurations --------------------------------------------#
workspaces() {
name=1
for monitor in $(bspc query -M); do
bspc monitor ${monitor} -n "$name" -d '' '' '' '' 'ﭮ' '' ''
let name++
done
}
workspaces
bspc config border_width 2
bspc config window_gap 10
bspc config split_ratio 0.50
bspc config focused_border_color "#ff4c30"
bspc config normal_border_color "$BACKGROUND"
bspc config active_border_color "#ff4c30"
bspc config presel_feedback_color "$GREEN"
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config paddingless_monocle true
bspc config single_monocle false
bspc config focus_follows_pointer true
bspc config border_radius 5
## Window rules ----------------------------------------------#
# remove all rules first
bspc rule -r *:*
# 1 > terminal
bspc rule -a Alacritty desktop='^1' follow=on focus=on
bspc rule -a Xfce4-terminal desktop='^1' follow=on focus=on
# 2 > code
declare -a code=(Neovide nvim neovim nvide neovide Geany code-oss Visual-Studio-Code Code VSCode code vscode visual-studio-code jetbrains-webstorm)
for i in ${code[@]}; do
bspc rule -a $i desktop='^2' follow=on focus=on
done
# 3 > Browser
declare -a browsers=(Chromium Edge Microsoft-edge brave-browser Brave-browser brave Brave edge firefox Google-chrome Firefox firefox)
for i in ${browsers[@]}; do
bspc rule -a $i desktop='^3' follow=on focus=on
done
# 4 > Communication
declare -a comm=(Thunderbird TelegramDesktop Hexchat MongoDB\ Compass)
for i in ${comm[@]}; do
bspc rule -a $i desktop='^4' follow=on focus=on
done
# 5 > Discord
declare -a files=(discord Discord)
for i in ${files[@]}; do
bspc rule -a $i desktop='^5' follow=on focus=on
done
# 6 > files
declare -a files=(Pcmanfm Thunar qBittorrent)
for i in ${files[@]}; do
bspc rule -a $i desktop='^6' follow=on focus=on
done
# 7 > Spotify
declare -a music=(Spotify spotify spicetify mpd)
for i in ${music[@]}; do
bspc rule -a $i desktop='^7' follow=on focus=on
done
bspc rule -a Spotify desktop='^7' follow=on focus=on
bspc rule -a spotify desktop='^7' follow=on focus=on
## Autostart -------------------------------------------------#
# Kill if already running
killall -9 xsettingsd sxhkd dunst ksuperkey xfce4-power-manager
# Lauch xsettingsd daemon
xsettingsd &
# polkit agent
if [[ ! $(pidof xfce-polkit) ]]; then
/usr/lib/xfce-polkit/xfce-polkit &
fi
# Lauch keybindings daemon
sxhkd -c $HOME/.config/bspwm/sxhkd/sxhkdrc &
# Enable Super Keys For Menu
ksuperkey -e 'Super_L=Alt_L|F1' &
ksuperkey -e 'Super_R=Alt_L|F1' &
# Enable power management
xfce4-power-manager &
# Fix cursor
xsetroot -cursor_name left_ptr
# Restore wallpaper
bash $HOME/.fehbg
# Start mpd
# exec mpd &
# Start bspwm scripts
bspcolors
# bspbar
launch-polybar
multiple-screen
bspcomp
bspdunst
libinput-gestures-setup start
dbus-launch fctix5
discord
# livewallpaper &
bspfloat &