2016-12-21

Domoticz is controlled using its web interface. In fact, this application is, among other things, a Web server. Very quickly, I added a bookmark to this webpage whose address is http://192.168.0.22:8080 which I then placed on my personal bar in Firefox.

A lot of space is lost, even when the personal bar is hidden. However, the worst problem is that I can never resist adding tabs, while I look at other web pages. Before long, I "loose" the Domoticz page. This would be handy if you could do as in Android and add an icon to the home screen to turn the web page into application somehow. If Firefox is used in Linux, here's what can be done:

This is always a browser window, but there are no more tabs, address bars and so on. In addition, there is an icon on the launcher and also in the classic menu since I had already installed ClassicMenu Indicator. When the page is lost under a stack of open windows, I just press the launcher icon and Domoticz pops up over all the open application windows.

To achieve this result, I basically followed the recommendations that can be found in the ask ubuntu forum. I hope I have not forgotten steps:

  1. Close all Firefox windows: right-click on its icon in the launcher and click Exit.
  2. Open a terminal. In Ubuntu you can use the key combination AltCtrlT.
  3. StartFirefox with the profile manager:
    michel@hp:~$ firefox -P
  4. Create a new profile and give it an appropriate name. I used "Domespic" as can be seen below

    Click on Create Profile, then on Next in the wizard's welcome screen. Enter the name of the new profile in the following screen and click on the Finish button.
  5. Select the profile created in the previous step and start Firefox by clicking on the Start Firefox button.
  6. Ajust the window as desired. The easiest may be to install the Classic Theme Restorer extension. Here are the changes I made:
    • In Tabs/Page 2 check Hide tabs toolbar when only one visible tab.
    • In Toobars/Page 1 check Hide toolbar in Navigation Toolbar
    Furthermore, if the bookmarks toobar is visible, hide it using the Firefox menu unchecking View/Toobars/Bookmarks Toolbar.
  7. Close Firefox then modify the original firefox.desktop file so that the newly created profile will not be used by default. Otherwise, you may have a heart attack when bookmarks and other options have disappeared. Add the -P default option in the Exec command:
    michel@hp:~$ sudo nano /usr/share/applications/firefox.desktop
    Exec=firefox -P default %u
    As you can probably guess, this file is not very short and the original Exec=firefox %u line is not near the beginning.
  8. The next step is to create a new .desktop file to launch the Domoticz web page in Firefox with the newly created profile. I named the "application" Domespic but the name is really up to you.
    michel@hp:~$ sudo nano /home/michel/.local/share/applications/domespic.desktop
    [Desktop Entry] Name=Domespic your choice Comment=Domoticz sur Raspberry Pi your choice Exec=firefox -P "Domespic" -new-instance -url "http://192.168.0.22:8080" user the correct address Icon=Domoticz.xpm see below Terminal=false Type=Application StartupNotify=true Categories=GNOME; OnlyShowIn=GNOME;Unity; X-GNOME-Keywords=Domoticz;Domespic; your choice Name[en_US]=Domespic again, your choice
    Adjust the names and address in the file and remove the italic text.
  9. I think I got the image of the Domoticz logo in the wiki. It is a png image, but I transformed it into an .xpm image with Gimp. I saved the image in the usr/share/pixmaps directory. It may not be necessary to use this graphic format in the Unity launcher, but it does seem necessary if the icon is to appear in the classic menu.
  10. Use the file navigator, Files to locate the .desktop file created in the .local/share/applications/ directory. To see that directory, hidden files must be visible. Look at the View menu. Click and drag the domespic.desktop file and drop it on the launcher bar to add the icon to the latter.
  11. Done!