Add initial awesome support

long-opts v0.1
angelic-sedition 10 years ago
parent 70c7e0c9ff
commit 7037fd5ff4

@ -70,9 +70,12 @@ That said, these are the floating window managers that currently have '-a' setti
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. 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 #### Tiling with Floating Support
These window managers currently will work with '-a'. I will add a lot more. These window managers currently will work with '-a' for a floating (instead of tiled) dropdown.
- bspwm - bspwm
- i3 - i3
- awesome
Awesome support may be buggy; if you encounter problems, please report them. Unmapping behaviour is different on awesome for some reason, so tdrop will act different when the dropdown is open on another workspace/tag (first call will unmap it and the second will map it on the current tag).
## Why Not Use wmctrl? ## Why Not Use wmctrl?
Necessary features don't work on many window managers, including mine. Necessary features don't work on many window managers, including mine.

18
tdrop

@ -45,7 +45,7 @@ See man page for more details.
width="100%" width="100%"
height="45%" height="45%"
xoff=0 xoff=0
yoff=1 yoff=2
map_pre="" map_pre=""
map_post="" map_post=""
unmap_post="" unmap_post=""
@ -118,6 +118,16 @@ wm_autoset_for_both() {
map_pre() { map_pre() {
bspc rule -a "$1" -o floating=on bspc rule -a "$1" -o floating=on
} }
elif [[ $wm == awesome ]]; then
# awesome remembers size, but need to float and then set size first
map_post_oneshot() {
# need sleep time to wait for window be created or will float wrong one.. not sure if way to float by window id
sleep 0.1 && echo 'local awful = require("awful") ; awful.client.floating.set(c, true)' | awesome-client && \
xdotool windowmove "$1" "$xoff" "$yoff" windowsize "$1" "$width" "$height"
}
map_post() {
echo 'local awful = require("awful") ; awful.client.floating.set(c, true)' | awesome-client
}
# tilers that won't remember sizing # tilers that won't remember sizing
elif [[ $wm == i3 ]]; then elif [[ $wm == i3 ]]; then
@ -207,6 +217,8 @@ map_pre_command() {
map_post_command() { map_post_command() {
if [[ -n $oneshot_post ]] && [[ $1 == oneshot ]]; then if [[ -n $oneshot_post ]] && [[ $1 == oneshot ]]; then
eval "$oneshot_post" eval "$oneshot_post"
elif [[ -n $(type map_post_oneshot) ]] && [[ $1 == oneshot ]]; then
map_post_oneshot "$2"
elif [[ -n $map_post ]]; then elif [[ -n $map_post ]]; then
eval "$map_post" eval "$map_post"
elif [[ -n $(type map_post) ]]; then elif [[ -n $(type map_post) ]]; then
@ -283,7 +295,7 @@ wid_toggle() {
else else
exists=false exists=false
fi fi
if $exists && [[ $visibility != IsUnviewable ]]; then if $exists; then
if [[ $visibility == IsUnMapped ]]; then if [[ $visibility == IsUnMapped ]]; then
if [[ $term == current ]]; then if [[ $term == current ]]; then
map_pre_command "$(< /tmp/tdrop/current"$num"_type)" map_pre_command "$(< /tmp/tdrop/current"$num"_type)"
@ -306,7 +318,7 @@ wid_toggle() {
else else
term_create term_create
fi fi
map_post_command oneshot map_post_command oneshot "$wid"
fi fi
} }

Loading…
Cancel
Save