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

13
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)
# newest bspwm version retuns an id instead of the name
if [[ $current_monitor =~ ^0x ]]; then
current_monitor=$(bspc query -T -m | grep -Po '^{"name":.*?",' | \ current_monitor=$(bspc query -T -m | grep -Po '^{"name":.*?",' | \
awk -F ":" '{gsub("[\",]", ""); print $2}') 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,17 +303,11 @@ 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 bspc rule -a "$class" -o state=floating
else else
bspc rule -a \*:"$class" -o state=floating bspc rule -a \*:"$class" -o state=floating
fi fi
else
# compatability with older syntaxes
bspc rule -a "$class" -o state=floating
bspc rule -a "$class" -o floating=on
fi
} }
elif [[ $wm == awesome ]]; then elif [[ $wm == awesome ]]; then
# awesome remembers size, but need to float and then set size first # awesome remembers size, but need to float and then set size first
@ -352,9 +342,6 @@ 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 | grep -i "$(printf 0x%x "$1").*f-" || \
bspc query -T -w | grep '"state": "floating"' || \
bspc query -T -n | grep '"state":"floating"' bspc query -T -n | grep '"state":"floating"'
} }
elif [[ $wm == i3 ]]; then elif [[ $wm == i3 ]]; then

Loading…
Cancel
Save