2022-06-01 23:21:34 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2022-06-04 22:03:36 +00:00
|
|
|
monitor_internal=eDP
|
|
|
|
monitor_external=HDMI-A-0
|
|
|
|
monitor_primary=$monitor_external
|
|
|
|
|
|
|
|
# check if we are connected to an second monitor
|
|
|
|
dock_status=docked
|
|
|
|
if xrandr | grep "$monitor_external disconnected"; then
|
|
|
|
dock_status=undocked
|
|
|
|
monitor_primary=$monitor_internal
|
|
|
|
fi
|
|
|
|
|
|
|
|
# set primary monitor
|
|
|
|
xrandr --output $monitor_primary --primary
|
|
|
|
|
|
|
|
if [[ "$dock_status" = "docked" ]]; then
|
|
|
|
# lower external monitor resolution and set up positioning
|
|
|
|
xrandr --output $monitor_external --mode 2560x1440 --right-of $monitor_internal
|
|
|
|
fi
|
2022-06-01 23:21:34 +00:00
|
|
|
|
|
|
|
# start sxhkd
|
|
|
|
pgrep -x sxhkd > /dev/null || sxhkd &
|
|
|
|
|
2022-06-04 22:03:36 +00:00
|
|
|
# create/move desktops
|
2022-06-04 22:07:27 +00:00
|
|
|
# !!!!!!!!!! DISCLAIMER !!!!!!!!!!
|
|
|
|
# dynamically moving desktops with a config reload is currently still broken,
|
|
|
|
# however things are configured properly for either one or two monitors on boot
|
2022-06-04 22:03:36 +00:00
|
|
|
if [[ "$dock_status" = "docked" ]]; then
|
|
|
|
if [[ "$(bspc query -D -m $monitor_internal | wc -l)" = "10" ]]; then
|
|
|
|
bspc query -D -m $monitor_internal --names | tail -5 | xargs -rd'\n' -i'{}' bspc desktop {} -m $monitor_external --follow
|
|
|
|
else
|
|
|
|
bspc monitor $monitor_internal -d 1 2 3 4 5
|
|
|
|
bspc monitor $monitor_external -d 6 7 8 9 10
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [[ "$(bspc query -D --names | grep -v ghost | wc -l)" = "10" ]]; then
|
|
|
|
# create ghost desktop so all external desktops can be moved
|
|
|
|
#bspc monitor $monitor_external -d ghost
|
|
|
|
bscp query -D -m $monitor_external --names | grep -v ghost | xargs -rd'\n' -i'{}' bspc desktop {} -m $monitor_internal --follow
|
|
|
|
else
|
|
|
|
bspc monitor $monitor_internal -d 1 2 3 4 5 6 7 8 9 10
|
|
|
|
fi
|
|
|
|
fi
|
2022-06-01 23:21:34 +00:00
|
|
|
|
|
|
|
bspc config border_width 4
|
|
|
|
bspc config window_gap 15
|
|
|
|
bspc config split_ratio 0.5
|
|
|
|
bspc config borderless_monocle true
|
|
|
|
bspc config gapless_monocle true
|
|
|
|
|
|
|
|
# theme
|
|
|
|
hsetroot -solid '#181926'
|
|
|
|
|
|
|
|
bspc config normal_border_color \#b4befe
|
|
|
|
bspc config focused_border_color \#cba6f7
|
|
|
|
bspc config active_border_color \#cba6f7
|
|
|
|
bspc config urgent_border_color \#cba6f7
|
|
|
|
bspc config presel_feedback_color \#cba6f7
|
|
|
|
|
2022-06-02 00:40:27 +00:00
|
|
|
# rules
|
2022-06-04 22:03:36 +00:00
|
|
|
bspc rule -a discord -o node=@^1:^1:/2 desktop=1 follow=off focus=off
|
|
|
|
bspc rule -a Element -o node=@^1:^1:/1 desktop=1
|
|
|
|
bspc rule -a TelegramDesktop -o node=@^1:^1:/1 desktop=1
|
|
|
|
|
|
|
|
firefox_desktop=6
|
|
|
|
claws_desktop=7
|
|
|
|
obsidian_desktop=8
|
|
|
|
if [[ "$dock_status" = "undocked" ]]; then
|
|
|
|
firefox_desktop=2
|
|
|
|
claws_desktop=3
|
|
|
|
obsidian_desktop=4
|
|
|
|
fi
|
|
|
|
|
|
|
|
bspc rule -a firefox desktop=$firefox_desktop follow=off
|
|
|
|
bspc rule -a Claws-mail desktop=$claws_desktop follow=off
|
|
|
|
bspc rule -a obsidian desktop=$obsidian_desktop follow=off
|
2022-06-01 23:21:34 +00:00
|
|
|
bspc rule -a REAPER desktop='10' follow=off
|
2022-06-02 00:40:27 +00:00
|
|
|
|
|
|
|
# floating windows
|
|
|
|
bspc rule -a Pavucontrol state=floating rectangle=600x800+0+0 center=on
|
|
|
|
bspc rule -a 1Password state=floating rectangle=1000x900+0+0 center=on
|
|
|
|
bspc rule -a Org.gnome.Nautilus state=floating rectangle=1200x900+0+0 center=on
|
2022-06-02 14:31:32 +00:00
|
|
|
bspc rule -a kitty_float state=floating rectangle=1000x700+0+0 center=on
|
2022-06-04 22:03:36 +00:00
|
|
|
bspc rule -a Popsicle-gtk state=floating rectangle=800x300+0+0 center=on
|
2022-06-01 23:21:34 +00:00
|
|
|
|
|
|
|
# startup
|
|
|
|
picom --experimental-backends &
|
|
|
|
polybar-msg cmd quit
|
|
|
|
polybar left &
|
|
|
|
polybar right &
|
|
|
|
dunst &
|
2022-06-04 22:03:36 +00:00
|
|
|
rofi-polkit-agent &
|
|
|
|
|
2022-06-01 23:21:34 +00:00
|
|
|
|
|
|
|
if [ ! -f /tmp/startup.lock ]; then
|
|
|
|
touch /tmp/startup.lock
|
|
|
|
|
|
|
|
element-desktop &
|
|
|
|
telegram-desktop &
|
|
|
|
discord-canary &
|
|
|
|
|
|
|
|
firefox &
|
2022-06-02 15:19:54 +00:00
|
|
|
claws-mail &
|
2022-06-04 22:03:36 +00:00
|
|
|
obsidian &
|
2022-06-01 23:21:34 +00:00
|
|
|
fi
|