Created
December 31, 2020 00:10
-
-
Save wimstefan/64e17d257d07b666079628a7e1859823 to your computer and use it in GitHub Desktop.
bspwm external rules script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
logfile=/tmp/bspwm_external_rules.log | |
window_id="$1" | |
window_class="$2" | |
window_instance="$3" | |
window_title="$(xwininfo -id "$window_id" | sed '/^xwininfo/!d ; s,.*"\(.*\)".*,\1,')" | |
window_type="$(xprop -id "$window_id" _NET_WM_WINDOW_TYPE | sed '/^_NET_WM_WINDOW_TYPE/!d ; s/^.* = \(.*\),.*/\1/')" | |
case "$window_title" in | |
Calculator|Explore|Keybindings|Ranger|Scratchpad ) | |
echo "state=floating" | |
;; | |
esac | |
case "$window_class" in | |
[Dd]arktable|[Gg]imp ) | |
case "$window_type" in | |
*DIALOG* ) | |
echo "state=floating" | |
echo "center=on" | |
;; | |
*_NET_WM_WINDOW_TYPE_NORMAL* ) | |
echo "state=fullscreen" | |
;; | |
esac | |
;; | |
esac | |
case "$window_class" in | |
[Ss]cribus ) | |
case "$window_title" in | |
Outline|Properties ) | |
echo "state=floating" | |
;; | |
* ) | |
echo "state=fullscreen" | |
;; | |
esac | |
;; | |
esac | |
echo "Id: $window_id" >> "$logfile" | |
echo "Class: $window_class" >> "$logfile" | |
echo "Instance: $window_instance" >> "$logfile" | |
echo "Title: $window_title" >> "$logfile" | |
echo "Type: $window_type" >> "$logfile" | |
echo "---" >> "$logfile" |
bspwmrc
#!/bin/sh
xsetroot -cursor_name left_ptr
pkill sxhkd
sxhkd -c ${HOME}/.config/bspwm/sxhkdrc &
pkill picom
while pgrep -x picom >/dev/null; do sleep 1; done
picom &
pkill dunst
dunst &
feh --bg-fill ${HOME}/system/wallpapers/default.jpg &
${HOME}/.config/polybar/launch.sh
source ${HOME}/.config/bspwm/scripts/bspwm_dimensions.sh
bspc monitor -d 1 2 3 4 5 6 7 8 9
bspc config border_width 04
bspc config normal_border_color '#2e3440'
bspc config active_border_color '#4e586d'
bspc config focused_border_color '#8894aa'
bspc config window_gap 12
bspc config top_padding $(echo ${POLYBAR_HEIGHT})
bspc config bottom_padding 04
bspc config left_padding 04
bspc config right_padding 04
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle false
bspc config focus_follows_pointer true
bspc config ignore_ewmh_focus false
bspc rule -a \* state=floating
bspc rule -a \*:\*:sys desktop='^1'
bspc rule -a \*:\*:work desktop='^2'
bspc rule -a \*:\*:com desktop='^3'
bspc rule -a \*:\*:tj desktop='^3'
bspc rule -a \*:\*:komala desktop='^5'
bspc rule -a \*:\*:tj-laptop desktop='^6'
bspc rule -a \*:\*:home desktop='^6'
bspc rule -a \*:\*:swimmer desktop='^6'
bspc rule -a scribus desktop='^7'
bspc rule -a Thunderbird desktop='^7'
bspc rule -a 'VirtualBox Manager' desktop='^7'
bspc rule -a 'VirtualBox Machine' desktop='^7'
bspc rule -a Darktable desktop='^8'
bspc rule -a Gimp desktop='^8'
bspc rule -a Inkscape desktop='^8'
bspc rule -a Audacity desktop='^9'
bspc rule -a puddletag desktop='^9'
bspc rule -a Lxappearance center=on rectangle=${newwidth}x${newheight}+${hor}+${ver}
bspc config external_rules_command ${HOME}/.config/bspwm/scripts/external_rules.sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xprop output for Gimp dialog window: