Webmin - Name for PWA (Progressive Web App)

I can edit my app icon name. I have android.

Edit it after install.

Yeah I can’t find anyway to do this if installed as PWA app.

I think it is possible with shortcut but not PWA app.

If you’ve managed it can you post instructions?

Many thanks

Goto to your apps, find the icon, hold your finger on it, select edit

Thanks. I don’t get that option.

Just get:

  • site settings
  • select
  • remove
  • uninstall

None of which lead to options to edit name or icon.

Yeah I can’t name or rename either.

Digging a bit, there is a file at /etc/webmin/authentic-theme called manifest-webmin.json.

I tried editing this to set the short_name for the manifest to my preferred value but it is overwritten by some background process and changes are lost.

There is also a file at /share/webmin/authentic-theme/manifest.template

in which there is a placeholder variable as shown below:

{
    "name": "%name%",
    "short_name": "%name_short%",
    "description": "%desc%",
    "start_url": "./",
    "scope": ".",
    "icons": [
    {
        "src": "images/favicons/%prod%/android-chrome-192x192.png",
        "sizes": "192x192",
        "type": "image/png",
        "purpose": "any"
    }

So the value is derived from some variable - but I can’t see where that is set.

try here. Maybe editing the json file will do the trick

ignore, the json files get overwritten when I clear cache.

Hi yeah I tried that and it gets overwritten. :slightly_smiling_face:

The manifest file is automatically generated by the theme. It will get overwritten.

Everything work fine for me, why don’t you try another phone and see what happens

Hi thanks - unfortunately I only have one phone.

I ended up sorting it by editing this file: /usr/share/webmin/authentic-theme/authentic-init.pl

I changed line 185 from

my $manifest_product_name_uc = ucfirst($product_name);

to

my $manifest_product_name_uc = $display_hostname;

This then uses the hostname as the app name rather than Webmin.

I did this yesterday but wanted to wait to see if it would be overwritten before posting. It hasn’t - but I guess any updates to the authentic-theme would overwrite this change (?).

I did have to uninstall the apps from my phone AND also clear browsing data (inc cache) for the webmin sites on Chrome to so that the manifest and service worker would be reloaded/restarted.

1 Like

This isn’t the right solution—you shouldn’t be editing theme files. I’ve added a patch to support this, though there isn’t an explicit option for it, at least not yet.

You can apply the patch:

webmin patch https://github.com/webmin/authentic-theme/commit/67ec74e

Then, open the browser’s console and run these commands while logged in as root:

settings_manifest_product_name = 'My App';
settings_manifest_product_name_full = 'My App Long Name';
theme.config.save();
4 Likes

Cool, when it arrives a GUI option is welcomed.

Is there a reset option or do you run the commands with no value?

Yeah, just set it to an empty string.

I’m not sure we actually want that.

Hi apologies. I kinda knew I shouldn’t do it that way but needed a quick fix.

Patch applied. Thanks for implementing this.

1 Like

I feel like intuitively people might want it to be something like “Webmin on hostname”, by default. Configurable is fine. It’s a little confusing that it’s a theme feature rather than in Webmin proper, I wouldn’t think to go looking in theme options for the name.

I think Webmin on Hostname is fine as a default (and is all I personally would need) but configurable would be great as the icon tells me the app is Webmin.

It is confusing that it’s a theme feature - I did dig around in Webmin config before posting.

With regard to Ilia’s response, while I was able to apply the patch I am unclear about where/how to run the commands:

settings_manifest_product_name = 'My App';
settings_manifest_product_name_full = 'My App Long Name';
theme.config.save();

If it is on the browser’s console (rather than the server console) I cannot access this on my mobile where I want to install the app.

Can you please clarify?
Many thanks

Yeah, the name field already contains “Webmin on hostname,” but the name_short field is recommended to be limited to 12-15 characters. This is necessary for space-constrained screens like mobile devices, where “Webmin on hostname” won’t fit.

To be clear, on desktops, we already use “Webmin on hostname,” but on mobile, it’s shortened to just Webmin or Usermin.

Yes, I agree—that’s just how it is for now.

You can’t do this on a mobile device, but you can log in as the root user on a desktop, open the browser console, and run the commands there.

A perfect example of why the theme code and the logic code should be split :smile: