os-js / osjs-client

OS.js Client Module
https://manual.os-js.org/
Other
31 stars 31 forks source link

Configuration of Application Menu to Show/Hide Items #137

Closed chaojian-zhang closed 3 years ago

chaojian-zhang commented 3 years ago

This issue is similar to #106 but somewhat different.

Basically, I wish there to be a way to organize application menus to hide unnecessary applications so it won't confuse the user.

For instance, my dist will come with a Calculator and some games pre-installed but I want to enable users to hide/show different apps through some settings (which will be provided by a separate application or incorporated into the Settings app).

Similarly, it would be ideal if attributes like autostart can be turned on and off during run-time. The thing is, currently it seemed to make modifications directly inside dist/metadata.json (which was not advised anyway), e.g. by adding attributes like autostart and disabled will not work.

I guess if #106 is resolved then the same effect can be achieved by directly uninstall the app.

Thanks!

andersevenrud commented 3 years ago

Similarly, it would be ideal if attributes like autostart can be turned on and off during run-time

You can programmatically auto-start applications via ex your src/client/index.js file, as well as a configuration option:

https://github.com/os-js/osjs-client/blob/d120d1439ad50e0365044625da21fbb1844b6aaf/src/config.js#L84

Configuration of Application Menu to Show/Hide Items

This could be added as a configuration option, ex:

disabled: ['Filemanager']

in https://github.com/os-js/osjs-client/blob/d120d1439ad50e0365044625da21fbb1844b6aaf/src/config.js#L78

Note All of this config stuff can be overridden in your distro under src/client/config.js.

andersevenrud commented 3 years ago

I guess if #106 is resolved then the same effect can be achieved by directly uninstall the app.

You can do this right now with npm remove <package> and npm run package:discover .

andersevenrud commented 3 years ago

I've released a new version of @osjs/client (3.2.1) that supports the following configuration entry:

// src/client/config.js
{
  packages: {
    hidden: ['Xterm']
  }
}

This also works for hiding themes via ex Settings app.

andersevenrud commented 3 years ago

I also updated the following article to reflect this: https://manual.os-js.org/guide/cli/#disabling-packages

Noticed that "disabling packages" was missing from the menu on the left, so added that as well.

Thanks for opening this issue. This is a nice feature to have :)