Drop support for prior versions of bspwm

break
noctuid 8 years ago
parent c0f0c7fecc
commit 4661ea84af

@ -125,7 +125,7 @@ Usually, it is a simple matter to add new ones to this list. If your dropdown mo
#### Tiling with Floating Support #### Tiling with Floating Support
These window managers currently will work with '-a' for a floating (instead of tiled) dropdown. These window managers currently will work with '-a' for a floating (instead of tiled) dropdown.
- bspwm - bspwm (support for versions prior to 0.9.1 was dropped on 2016/09/22)
- i3 - i3
- awesome - awesome

25
tdrop

@ -214,12 +214,8 @@ update_geometry_settings_for_monitor() {
local wm current_monitor local wm current_monitor
wm=$(get_window_manager) wm=$(get_window_manager)
if [[ $wm == bspwm ]]; then if [[ $wm == bspwm ]]; then
current_monitor=$(bspc query -m -M) current_monitor=$(bspc query -T -m | grep -Po '^{"name":.*?",' | \
# newest bspwm version retuns an id instead of the name awk -F ":" '{gsub("[\",]", ""); print $2}')
if [[ $current_monitor =~ ^0x ]]; then
current_monitor=$(bspc query -T -m | grep -Po '^{"name":.*?",' | \
awk -F ":" '{gsub("[\",]", ""); print $2}')
fi
elif [[ $wm == i3 ]]; then elif [[ $wm == i3 ]]; then
# I'd rather not make jq a dependency # I'd rather not make jq a dependency
current_monitor=$(i3-msg -t get_workspaces | sed 's/{"num"/\n/g' | \ current_monitor=$(i3-msg -t get_workspaces | sed 's/{"num"/\n/g' | \
@ -307,16 +303,10 @@ wm_autoset_for_all() {
class=google-chrome class=google-chrome
fi fi
# newest (using "instance" names) # newest (using "instance" names)
if [[ $(bspwm -v) =~ ^0.9.1 ]]; then if [[ $class =~ [A-Z] ]]; then
if [[ $class =~ [A-Z] ]]; then
bspc rule -a "$class" -o state=floating
else
bspc rule -a \*:"$class" -o state=floating
fi
else
# compatability with older syntaxes
bspc rule -a "$class" -o state=floating bspc rule -a "$class" -o state=floating
bspc rule -a "$class" -o floating=on else
bspc rule -a \*:"$class" -o state=floating
fi fi
} }
elif [[ $wm == awesome ]]; then elif [[ $wm == awesome ]]; then
@ -352,10 +342,7 @@ wm_autoset_for_hide_show() {
if [[ $wm == bspwm ]]; then if [[ $wm == bspwm ]]; then
subtract_when_same=false subtract_when_same=false
is_floating() { is_floating() {
# checking if the window id (converted from decimal to hex) is floating; empty if not floating bspc query -T -n | grep '"state":"floating"'
bspc query -T | grep -i "$(printf 0x%x "$1").*f-" || \
bspc query -T -w | grep '"state": "floating"' || \
bspc query -T -n | grep '"state":"floating"'
} }
elif [[ $wm == i3 ]]; then elif [[ $wm == i3 ]]; then
subtract_when_same=false subtract_when_same=false

Loading…
Cancel
Save