Search code examples
bashubuntu-16.04wmctrl

After run firefox go to full screen but not kiosk mode


I would like to start Firefox automatically on startup, and then maximize the window. With the code below, I am currently able to start Firefox, however I cannot get past that.

#!/bin/bash
firefox &
while [ "$(wmctrl -l | grep \"Mozilla Firefox\" 2>&1 | wc -l)" -eq 0 ]; 
do
  sleep 1;
done
wmctrl -r firefox -b toggle, fullscreen

The first portion starts running Firefox. After that there is a loop, which I'm writing to create and display the Firefox window. The last step is maximize Firefox to full screen.

I believe I have a problem with the while loop.


Solution

  • I suggest:

    while [[ $(wmctrl -l | grep "Mozilla Firefox" 2>&1 | wc -l) -eq 0 ]]; do