2023-07-07 10:28:48 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-07-09 00:52:05 +08:00
|
|
|
# 颜色定义, 同alacritty主题
|
2023-08-17 14:51:26 +08:00
|
|
|
color_border='#57606f'
|
2023-07-08 22:54:30 +08:00
|
|
|
color_background='#475569'
|
|
|
|
color_foreground='#d8dee9'
|
|
|
|
color_altbackground='#39404f'
|
|
|
|
color_altforeground='#768bb2'
|
|
|
|
color_accent='#81a1c1'
|
|
|
|
color_black='#3b4252'
|
|
|
|
color_red='#bf616a'
|
|
|
|
color_green='#a3be8c'
|
|
|
|
color_yellow='#ebcb8b'
|
|
|
|
color_blue='#81a1c1'
|
|
|
|
color_magenta='#b48ead'
|
|
|
|
color_cyan='#88c0d0'
|
|
|
|
color_white='#e5e9f0'
|
|
|
|
color_altblack='#4c566a'
|
|
|
|
color_altred='#bf616a'
|
|
|
|
color_altgreen='#a3be8c'
|
|
|
|
color_altyellow='#ebcb8b'
|
|
|
|
color_altblue='#81a1c1'
|
|
|
|
color_altmagenta='#b48ead'
|
|
|
|
color_altcyan='#8fbcbb'
|
|
|
|
color_altwhite='#eceff4'
|
2023-07-07 10:28:48 +08:00
|
|
|
|
|
|
|
|
2023-07-10 00:42:23 +08:00
|
|
|
|
|
|
|
## 修复java程序打开空白的问题
|
|
|
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
|
|
# 或者安装wmname后执行下面这句
|
|
|
|
#wmname LG3D
|
|
|
|
|
2023-07-10 10:17:31 +08:00
|
|
|
# 设置显示器分辨率
|
2023-07-11 15:29:36 +08:00
|
|
|
xrandr --output HDMI-2 --auto --right-of HDMI-1
|
|
|
|
xrandr --output HDMI-1 --mode 1920x1080 --rate 60
|
2023-07-10 00:42:23 +08:00
|
|
|
|
2023-07-07 10:28:48 +08:00
|
|
|
# 干掉已经运行的进程
|
2023-07-14 17:57:13 +08:00
|
|
|
#killall -9 sxhkd picom nm-applet dunst xsettingsd polybar plank xss-lock
|
|
|
|
killall -9 sxhkd xsettingsd
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-07-10 10:17:31 +08:00
|
|
|
# 2个显示器, 左显示器配置4个工作区, 右显示器只配置1个工作区
|
|
|
|
bspc monitor HDMI-1 -d I II III IV
|
2023-08-17 14:51:26 +08:00
|
|
|
bspc monitor HDMI-2 -d V VI
|
2023-07-07 10:28:48 +08:00
|
|
|
|
|
|
|
# bspwm 基础配置
|
|
|
|
bspc config border_width 2
|
|
|
|
bspc config window_gap 8
|
|
|
|
bspc config split_ratio 0.52
|
|
|
|
|
|
|
|
bspc config focused_border_color "$color_blue"
|
2023-08-17 14:51:26 +08:00
|
|
|
bspc config normal_border_color "$color_border"
|
|
|
|
bspc config active_border_color "$color_border"
|
|
|
|
bspc config presel_feedback_color "$color_border"
|
|
|
|
|
|
|
|
|
|
|
|
# 将这2个桌面的布局设为monocle
|
|
|
|
bspc desktop II -l monocle
|
|
|
|
bspc desktop V -l monocle
|
|
|
|
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-07-10 17:57:29 +08:00
|
|
|
# 工作区跟随鼠标切换
|
2023-07-11 15:29:36 +08:00
|
|
|
bspc config focus_follows_pointer false
|
2023-07-10 17:57:29 +08:00
|
|
|
|
|
|
|
# monocle 布局关闭边框、边距
|
|
|
|
bspc config borderless_monocle true
|
|
|
|
bspc config gapless_monocle true
|
|
|
|
|
|
|
|
|
|
|
|
# 工作区只有一个窗口时, 将工作区切为monocle布局
|
2023-07-13 12:25:35 +08:00
|
|
|
bspc config single_monocle true
|
2023-07-10 17:57:29 +08:00
|
|
|
|
2023-08-17 14:51:26 +08:00
|
|
|
# kill掉所有的订阅进程
|
|
|
|
all_sub_pid=$(pgrep -f 'bspc subscribe')
|
2023-07-10 17:57:29 +08:00
|
|
|
|
2023-08-17 14:51:26 +08:00
|
|
|
if [ "$all_sub_pid" ]; then
|
|
|
|
kill -9 $all_sub_pid
|
|
|
|
fi
|
2023-07-07 10:28:48 +08:00
|
|
|
|
|
|
|
# 删除已有的规则
|
|
|
|
bspc rule -r *:*
|
|
|
|
|
2023-07-10 17:57:29 +08:00
|
|
|
# 默认所有的应用都浮动
|
|
|
|
bspc rule -a *:* state=floating focus=on follow=on
|
|
|
|
|
2023-07-14 17:57:13 +08:00
|
|
|
bspc rule -a Plank layer=above
|
|
|
|
|
2023-07-07 10:28:48 +08:00
|
|
|
# 终端默认设为浮动
|
2023-07-10 17:57:29 +08:00
|
|
|
# bspc rule -a Alacritty state=floating focus=on follow=on
|
|
|
|
# bspc rule -a Xfce4-terminal state=floating focus=on follow=on
|
2023-07-07 10:28:48 +08:00
|
|
|
|
|
|
|
# 一些软件, 也设为浮动
|
2023-07-10 17:57:29 +08:00
|
|
|
# for app_c in Thunar Code Sublime_text Google-chrome Inkscape Gnome-boxes \
|
|
|
|
# dingtalk_run Crossover TelegramDesktop
|
|
|
|
# do
|
|
|
|
# bspc rule -a "$app_c" state=floating focus=on follow=on
|
|
|
|
# done
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-07-10 17:57:29 +08:00
|
|
|
# bspc rule -a Code state=tiled focus=on follow=on
|
2023-07-07 10:28:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 设置壁纸
|
2023-07-11 21:59:53 +08:00
|
|
|
feh --bg-fill --randomize ~/.local/share/backgrounds/
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-07-09 00:52:05 +08:00
|
|
|
# 修复鼠标状态
|
|
|
|
xsetroot -cursor_name left_ptr
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-07-09 00:52:05 +08:00
|
|
|
# 设置系统主题
|
|
|
|
xsettingsd &
|
2023-07-07 10:28:48 +08:00
|
|
|
|
2023-08-17 14:51:26 +08:00
|
|
|
|
|
|
|
if [[ ! "$(pidof picom)" ]]; then
|
|
|
|
picom -b --experimental-backends
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 一些配套服务
|
2023-07-10 13:55:27 +08:00
|
|
|
if [[ ! "$(pidof xfce-polkit)" ]]; then
|
|
|
|
xfce-polkit &
|
|
|
|
fi
|
|
|
|
|
2023-07-14 17:57:13 +08:00
|
|
|
if [[ ! "$(pidof polybar)" ]]; then
|
|
|
|
polybar main -r &
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! "$(pidof dunst)" ]]; then
|
|
|
|
dunst &
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ! "$(pidof plank)" ]]; then
|
2023-08-17 14:51:26 +08:00
|
|
|
# 延时5秒再执行
|
|
|
|
(sleep 5; plank) &
|
2023-07-14 17:57:13 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
#if [[ ! "$(pidof nm-applet)" ]]; then
|
|
|
|
# nm-applet &
|
|
|
|
#fi
|
|
|
|
|
2023-07-10 10:48:18 +08:00
|
|
|
# 启动配套的服务
|
2023-07-13 12:25:35 +08:00
|
|
|
|
|
|
|
# 睡眠/休眠时, 自动锁屏
|
2023-07-14 17:57:13 +08:00
|
|
|
if [[ ! "$(pidof xss-lock)" ]]; then
|
|
|
|
xss-lock --transfer-sleep-lock -- ~/.local/bin/scripts/xlock.sh &
|
|
|
|
fi
|
2023-07-13 12:25:35 +08:00
|
|
|
|
2023-07-14 17:57:13 +08:00
|
|
|
# 键盘热键
|
2023-07-09 00:52:05 +08:00
|
|
|
sxhkd &
|
2023-07-09 01:17:52 +08:00
|
|
|
|
|
|
|
## 一些已经用systemd启动的服务
|
2023-07-13 12:25:35 +08:00
|
|
|
# pipewire, mpd, blueman
|
2023-07-09 01:17:52 +08:00
|
|
|
|
2023-07-14 17:57:13 +08:00
|
|
|
|
|
|
|
|
2023-07-13 12:25:35 +08:00
|
|
|
# 每次启动时, 删除该文件
|
2023-08-17 14:51:26 +08:00
|
|
|
if [ -f ~/.cxoffice/wechat/.eval ]; then
|
|
|
|
rm ~/.cxoffice/wechat/.eval
|
|
|
|
fi
|
|
|
|
|
|
|
|
# 订阅事件`
|
|
|
|
(sleep 3; ~/.config/bspwm/subscribe.sh) &
|