bspwm/external.sh

43 lines
934 B
Bash
Raw Normal View History

#!/bin/sh
wid=$1
class=$2
instance=$3
consequences=$4
title=$(xtitle "$wid")
2021-02-10 16:25:44 +00:00
role="$(xprop -id "$wid" WM_WINDOW_ROLE | awk -F '"' '{print $2}')"
2021-02-10 16:25:44 +00:00
if [ $class = "Thunderbird" ] && [ $role = "messageWindow" ] || [ $role = "Msgcompose" ] ; then
echo "state=floating"
echo "rectangle=1100x868+250+16"
exit
fi
# notify-send "$title" "$1 | $2 | $3 | $4 | $role"
2020-12-30 12:07:04 +00:00
#place floating windows
#adapted from https://github.com/baskerville/bspwm/issues/263
floats=$(bspc query -N -n .floating -d .focused | wc -l)
2020-12-30 12:19:13 +00:00
xdotool windowmove --sync $wid $(( 50 + 50 * floats )) y
2020-12-30 12:07:04 +00:00
2021-02-10 16:25:44 +00:00
case "$role" in
WM_FORCE_FLOATING)
echo "state=floating"
;;
2020-10-27 12:45:23 +00:00
WM_FORCE_TILED)
echo "state=tiled"
;;
WM_FORCE_FULLSCREEN)
echo "state=fullscreen"
;;
esac
2020-12-30 12:07:04 +00:00
# case $state in
# floating)
# if [ -z "$desktop" ] || [ "$desktop" = "$(bspc query -D -d --names)" ] && [ -z "$rectangle" ]; then
# rule="${rule}$(centerfloat) center=false "
# fi
# ;;
# esac