From 3499355af77b259177fce6e44ded4ff3049226f2 Mon Sep 17 00:00:00 2001 From: ray Date: Tue, 7 Apr 2020 17:05:34 +0100 Subject: [PATCH] add fullscreen and floating window rules --- bspwmrc | 39 +++++++++++++++++++++------------------ external.sh | 17 +++++++++++++++++ 2 files changed, 38 insertions(+), 18 deletions(-) create mode 100755 external.sh diff --git a/bspwmrc b/bspwmrc index 76c22a8..9cb2267 100755 --- a/bspwmrc +++ b/bspwmrc @@ -3,29 +3,32 @@ if pgrep sxhkd ; then pkill sxhkd; fi if [ "$(hostname)" = Patricia ] ; then - # aoc - bspc monitor HDMI-0 -n pat-0 -d I II III IV V VI VII VIII IX X - # the other one - bspc monitor DVI-0 -n pat-1 -d 001 010 011 100 x101 - sxhkd -c ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/sxhkdrc.bspwm ~/.config/sxhkd/sxhkdrc.bspwm.patricia & + # aoc + bspc monitor HDMI-0 -n pat-0 -d I II III IV V VI VII VIII IX X + # the other one + bspc monitor DVI-0 -n pat-1 -d 001 010 011 100 x101 + sxhkd -c ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/sxhkdrc.bspwm ~/.config/sxhkd/sxhkdrc.bspwm.patricia & elif [ "$(hostname)" = Pamela ] ; then - # AOC - bspc monitor HDMI-1-1 -n pam-2 -d I II III IV V VI xVII xVIII - # samsung - bspc monitor VGA-1-1 -n pam-1 -d 0111 1000 1001 x1010 x1011 - # laptop - bspc monitor eDP-1-1 -n pam-0 -d ∞ α β γ δ - sxhkd -c ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/sxhkdrc.bspwm ~/.config/sxhkd/sxhkdrc.bspwm.pamela & + # AOC + bspc monitor HDMI-1-1 -n pam-2 -d I II III IV V VI xVII xVIII + # samsung + bspc monitor VGA-1-1 -n pam-1 -d 0111 1000 1001 x1010 x1011 + # laptop + bspc monitor eDP-1-1 -n pam-0 -d ∞ α β γ δ + sxhkd -c ~/.config/sxhkd/sxhkdrc ~/.config/sxhkd/sxhkdrc.bspwm ~/.config/sxhkd/sxhkdrc.bspwm.pamela & fi -bspc config border_width 1 -bspc config window_gap 0 +bspc config border_width 1 +bspc config window_gap 0 -bspc config split_ratio 0.50 -bspc config borderless_monocle true -bspc config gapless_monocle true -bspc config focus_follows_pointer true +bspc config split_ratio 0.50 +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config focus_follows_pointer true +bspc config external_rules_command ~/.config/bspwm/external.sh + +bspc rule -a mpv state=floating follow=on # bspc rule -a Gimp desktop='^8' state=floating follow=on # bspc rule -a Chromium desktop='^2' # bspc rule -a mplayer2 state=floating diff --git a/external.sh b/external.sh new file mode 100755 index 0000000..60f4977 --- /dev/null +++ b/external.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +wid=$1 +class=$2 +instance=$3 +consequences=$4 + +title=$(xtitle "$wid") + +case "$title" in + WM_FORCE_FLOATING) + echo "state=floating" + ;; + WM_FORCE_FULLSCREEN) + echo "state=fullscreen" + ;; +esac