#!/bin/sh # move all x-application to the defined place ps | grep poswindows | grep -v grep | grep -q -v $$ && exit export DISPLAY=:0 while true; do list="$(wmctrl -lx 2>/dev/null | cut -d " " -f -4)" if [ "$list" != "$old_list" ]; then . /etc/init.d/rc.functions echo "$list" | while read line; do if ! echo "$old_list" | grep -q "$line"; then id="${line%% *}" class="${line##* }" name="$(echo "$class" | sed "s/[^a-zA-Z0-9]//g")" if ! grep -q "$class" /usr/share/applicationclasses 2>/dev/null; then echo "$class" >> /usr/share/applicationclasses update_application_setup.sh fi if [ -n "$(eval echo "\$APPLICATION_POS_$name")" ]; then eval echo "\$APPLICATION_POS_$name" | { read x y w h f wmctrl -i -r $id -e 0,${x:--1},${y:--1},${w:--1},${h:--1} test -n "$f" && wmctrl -i -r $id -b toggle,fullscreen } fi fi done old_list="$list" fi usleep 100000 done