From f028683a38ed74088f4c0b7902a36cfd624484e0 Mon Sep 17 00:00:00 2001 From: noctuid Date: Mon, 4 Jul 2016 17:18:19 -0400 Subject: [PATCH] Add workaround for chrome Classname may differ from command name (e.g. google-chrome vs. google-chrome-stable). --- tdrop | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tdrop b/tdrop index 1eb38c6..f5ca0f3 100755 --- a/tdrop +++ b/tdrop @@ -302,17 +302,21 @@ wm_autoset_for_all() { # bspwm will use previous size when floating already if [[ $wm == bspwm ]]; then map_pre() { + class=$1 + if [[ $1 =~ ^google-chrome ]]; then + class=google-chrome + fi # newest (using "instance" names) if [[ $(bspwm -v) =~ ^0.9.1 ]]; then - if [[ $1 =~ [A-Z] ]]; then - bspc rule -a "$1" -o state=floating + if [[ $class =~ [A-Z] ]]; then + bspc rule -a "$class" -o state=floating else - bspc rule -a \*:"$1" -o state=floating + bspc rule -a \*:"$class" -o state=floating fi else # compatability with older syntaxes - bspc rule -a "$1" -o state=floating - bspc rule -a "$1" -o floating=on + bspc rule -a "$class" -o state=floating + bspc rule -a "$class" -o floating=on fi } elif [[ $wm == awesome ]]; then