Search code examples
firefoxxdotool

How can I get the number of Firefox windows currently opened?


I tried xdotool search --name firefox | wc -l, but it shows wierd numbers like 8,11 or more, when only one windows is opened. Any ideas? Thanks!


Solution

  • Try with the option --onlyvisible. Like this:

    xdotool search --onlyvisible --name firefox | wc -l

    It worked here. Maybe it could work for you too.