Opera Tab Count in Conky (for Linux)

Have you ever wanted to keep an eye on the number of tabs that you have open in Opera? Now you can very easily!

Check Out The Script!

I came across a link a while back (sorry, I can’t remember who posted this) for a script in windows that fetches the window count from Opera’s autosave.win file (this file stores your currently open windows and tabs so it can restore them if Opera crashes or for the next time you open Opera).

If you’re using Windows, you can probably do something with this script, though I have not tested it yet.

If you’re using Linux then you can take advantage of a script that I wrote and I’ll tell you how below.

  1. Open a text editor and copy the 10 lines of script from the following page:
    http://kyleabaker.pastebin.com/HngpxisB
  2. Save this file anywhere you would like to. I saved mine as “opera-tab-count.sh” on my desktop for testing, but it should work fine from any directory.
  3. Right click on the file you created and select “Properties -> Permissions -> Execute = True“. This allows the script file to run.
  4. Now you can open up a terminal window and find out how many tabs you have open by using the following command:
    $ ./.opera-tab-count.sh

Add This To Conky!

One of the main reasons that I wrote this script is to start showing more Opera stats on my desktop via Conky which I wrote about a while back!

Opera tab count as it will appear in Conky!

If you’re interested in displaying some stats via Conky then all you have to do to get what I’ve got is:

  1. Move the “opera-tab-count.sh” file that you’ve saved from the steps above into your Home directory.
  2. Rename your “opera-tab-count.sh” file to “.opera-tab-count.sh” (notice the leading period). This makes it a hidden file in the future so it won’t waste space in your file browser unless you choose to view Hidden files via “View menu -> Show Hidden Files”.
  3. Add the following lines to your “.conkyrc” file (located in your root directory)
    ${color orange}OPERA ${hr 2}$color
    Opera currently has ${exec ./.opera-tab-count.sh} tabs open
  4. Save your “.conkyrc” file and launch Conky or wait for it to refresh with your update!

If you did everything correctly then you should see something similar to what the image above.

I do plan to add more stats to this soon and will probably post a link to my script when I’m done, so keep an eye out!

*You Mac users may be able to modify this to work with Mac as well. 😉

UPDATE 1 (2010-05-04):
If you want to use my latest update with more details, create a file named “.opera-stats.sh” that is executable and stored in your Home directory (old: with the script from here) with the script that fearphage has updated here. Now add two lines (or edit the two you added from above) to your “.conkyrc” file:
${color orange}OPERA ${hr 2}$color
${exec ./.opera-stats.sh}

..that should give you the following:

Opera Stats v0.1 in Conky