From 76f91e5636f12b38d767fa3d93c1e0945192e949 Mon Sep 17 00:00:00 2001 From: angelic-sedition Date: Fri, 20 Feb 2015 21:50:41 -0500 Subject: [PATCH] add support for more floating/stacking WMs: xfwm4, metacity, fvwm, sawfish, and goomwwm --- README.md | 7 ++++++- tdrop | 9 ++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 16c0456..29e6fb4 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,17 @@ If your window manager does not support floating, there's nothing to worry about For floating window managers, tdrop should also generally "just work", but you will need to add the '-a' option. Many floating window managers will either center or resize a window when mapping then unmapping it. Tdrop provides for a `--post-commmand` to deal with this. '-a' will automatically determine the proper post command to use for your window manager if one exists. The '-a' option will also set things up so that window geometry/position will be properly restored on an `auto_show`. That said, these are the floating window managers that currently have '-a' settings: +- xfwm4 +- metacity - openbox - pekwm - fluxbox - blackbox +- fvwm +- sawfish +- goomwwm -It is a simple matter to add new ones to this list. If your dropdown moves out of place when being shown, make an issue, and I will add settings for it. +Usually, it is a simple matter to add new ones to this list. If your dropdown moves out of place when being shown, make an issue, and I will add settings for it. #### Tiling with Floating Support These window managers currently will work with '-a'. I will add a lot more. diff --git a/tdrop b/tdrop index 8996c99..dcb0908 100755 --- a/tdrop +++ b/tdrop @@ -103,7 +103,8 @@ done # get_window_manager() { - xprop -notype -id "$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" -f _NET_WM_NAME 8u | awk -F "\"" '/WM_NAME/ {print $2}' + # xfwm4 and fvwm at least will give two names (hence piping into head) + xprop -notype -id "$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}')" -f _NET_WM_NAME 8u | awk -F "\"" '/WM_NAME/ {print $2}' | head -n 1 } # tilers w/ floating support: settings for floating a window when mapping it @@ -177,12 +178,14 @@ wm_autoset_for_window() { xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height" } # floating window managers that may move a window after unmapping then mapping it - elif [[ $wm == pekwm ]] || [[ $wm == fluxbox ]] || [[ $wm == Blackbox ]]; then + elif [[ $wm =~ ^(pekwm|fluxbox|Blackbox|xfwm4|Metacity|FVWM|Sawfish|GoomwW)$ ]]; then + # most will center + # xfwm4 will normally move to top left; metacity will move close to top left + # sawfish just moves all over the place map_post() { xdotool windowmove "$1" "$xoff" "$yoff" } fi - } #