Launch multiple programs in different workspaces
I'm trying to make an startup script which launches several programs in a new gnome workspace using wmctrl. However, the script is not working as intended. The windows do not move until the script is run again.
#!/bin/bash
firefox &
gnome-system-monitor &
gnome-control-center network &
while [[ $(wmctrl -l | wc -l) -lt 3 ]]; do sleep 1 date
done
wmctrl -r Mozilla Firefox -t 1
wmctrl -r System Monitor -t 2
wmctrl -r Settings -t 3 3 Reset to default