site  contact  subhomenews

CUPS web interface fixed

January 11, 2022 — BarryK

We discovered a bug with CUPS setup in Easy 3.2, that "flew under the radar", see a forum post:

The 'cupsd' daemon is a web server, and seamonkey is used to view the CUPS GUI interface. However, the move to running seamonkey non-root, as user 'seamonkey', has caused a permissions problem. Forum member 'Airdale' proposed a fix for the permissions.

Opportunity to take a fresh look at the CUPS web interface. What we really want is just a bare window, without all that "browser stuff" -- menu-bar, address-bar, status-bar, bookmarks-bar. So, have done it, and now when choose from the menu "Setup -> CUPS printer wizard", this is what comes up:


...just a bare window!

I have set this up to work for both seamonkey and firefox. The "CUPS printer wizard" launches script /usr/sbin/cups_shell, which has this new code in it:

if [ -d /root/.mozbare ];then #20220111
if [ -x /usr/bin/seamonkey.bin ];then #this will run sm as root.
#starts as separate instance, with bare window...
USEBROWSER="seamonkey.bin --no-remote --profile /root/.mozbare/seamonkey/profile1 -browser"
elif [ -x /usr/bin/firefox.bin ];then
USEBROWSER="firefox.bin --no-remote --profile /root/.mozbare/firefox/profile1 --browser"

The secret is that special profiles have been created for FF and SM, under /root/.mozbare, which are configured to hide all the unwanted stuff. The "--no-remote" is important, as it causes FF and SM to start in a separate window -- completely independent from the normal FF and SM window.

Another secret: /usr/bin/seamonkey will start SM running as user 'seamonkey', but there is also /usr/bin/seamonkey.bin which will run SM as user 'root' -- important to use that "--no-remote" so they don't get mixed if running both at the same time. Ditto for FF.

Looking inside /root/.mozbare/seamonkey/profile1, there are two files 'prefs.js' and 'xulstore.json', and folder 'chrome' with 'userChrome.css' in it.

I was messing around with userChrome.css, trying to get it to hide GUI elements such as the menu-bar, and that does work, except could not get rid of the status-bar at bottom of the window. Then I discovered how to create a skeleton xulstore.json that hides everything.

Works great. We could in the future add more profiles, where we might want a not-completely-bare window, maybe with back and forward arrows. Note, the above bare window does have back and forward in the right-click menu.   

Tags: easy