change function order

long-opts
angelic-sedition 10 years ago
parent c684b55605
commit fde1fffd6e

29
tdrop

@ -83,10 +83,6 @@ do
esac esac
done done
get_class_name() {
xprop -id "$(xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}')" WM_CLASS | awk '{ gsub(/"/, ""); print $4}'
}
float_pre_command() { float_pre_command() {
if [[ -n $float_pre ]]; then if [[ -n $float_pre ]]; then
if [[ $float_pre == bspwm ]]; then if [[ $float_pre == bspwm ]]; then
@ -187,16 +183,8 @@ wid_toggle() {
fi fi
} }
auto_hide() { get_class_name() {
no_hide=$(< /tmp/tdrop/auto_hidden/no_hide) xprop -id "$(xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}')" WM_CLASS | awk '{ gsub(/"/, ""); print $4}'
if [[ -z $no_hide ]]; then
wid=$(xdotool getactivewindow)
mkdir -p /tmp/tdrop/auto_hidden
echo "$wid" > /tmp/tdrop/auto_hidden/wid
get_class_name > /tmp/tdrop/auto_hidden/class
get_geometry "$wid" > /tmp/tdrop/auto_hidden/geometry
xdotool windowunmap "$wid"
fi
} }
get_geometry() { get_geometry() {
@ -214,12 +202,23 @@ get_geometry() {
echo -e "X=$x\nY=$y" echo -e "X=$x\nY=$y"
} }
geometry_set() {
set_geometry() { set_geometry() {
eval "$(< /tmp/tdrop/auto_hidden/geometry)" eval "$(< /tmp/tdrop/auto_hidden/geometry)"
xdotool windowmove "$1" "$X" "$Y" xdotool windowmove "$1" "$X" "$Y"
} }
auto_hide() {
no_hide=$(< /tmp/tdrop/auto_hidden/no_hide)
if [[ -z $no_hide ]]; then
wid=$(xdotool getactivewindow)
mkdir -p /tmp/tdrop/auto_hidden
echo "$wid" > /tmp/tdrop/auto_hidden/wid
get_class_name > /tmp/tdrop/auto_hidden/class
geometry_get "$wid" > /tmp/tdrop/auto_hidden/geometry
xdotool windowunmap "$wid"
fi
}
auto_show() { auto_show() {
no_hide=$(< /tmp/tdrop/auto_hidden/no_hide) no_hide=$(< /tmp/tdrop/auto_hidden/no_hide)
if [[ -z $no_hide ]]; then if [[ -z $no_hide ]]; then

Loading…
Cancel
Save