How to Solve the Reload Menu Problem in FunOS

When using FunOS, you might notice that after installing an application via the terminal, you need to reload the menu for the new application to appear in the application menu. While this step ensures the menu stays updated, waiting 3–5 seconds for the newly installed application to show up can be inconvenient for some users.

In this article, we’ll provide a detailed solution to address this issue, enabling the application name to appear immediately after clicking “Reload menu,” without any delay.

What Causes the Reload Menu Delay?

By default, FunOS uses the mjwm command to regenerate the application menu. To display icons in the menu, FunOS includes the iconize=Papirus option in the mjwm command. However, this option is the reason for the delay when reloading the menu.

The solution involves creating a dedicated JWM icons configuration file and modifying the JWM menu setup to eliminate the iconize delay while still maintaining proper icon rendering.

FunOS application menu
FunOS application menu

Steps to Solve the Reload Menu Problem

Follow the steps below to resolve the delay issue:

1. Create Backups of Existing JWM Menu and Tray Configurations

Before making changes, create backups of the existing configurations. Run the following commands in the terminal:

mv $HOME/.config/jwm/menu $HOME/.config/jwm/menu.old
mv $HOME/.config/jwm/tray $HOME/.config/jwm/tray.old

2. Create a New JWM Menu Configuration

Open the Mousepad text editor to create a new menu configuration file:

mousepad $HOME/.config/jwm/menu

Insert the following content into the file:

<?xml version='1.0' encoding='utf-8'?>
<JWM>   
   <RootMenu onroot="123" height="20">
      <Program icon="lxterminal" label="Terminal" tooltip="Use the command line">lxterminal</Program>
      <Program icon="system-file-manager" label="File Manager" tooltip="Browse the file system and manage the files">pcmanfm</Program>
      <Program icon="mousepad" label="Text Editor" tooltip="Simple Text Editor">mousepad</Program> 
      <Program icon="firefox-esr" label="Web Browser" tooltip="Browse the World Wide Web">firefox-esr</Program>    
      <Program icon="nitrogen" label="Set Wallpaper" tooltip="Browse and set desktop backgrounds">nitrogen</Program>
      <Separator />
      <Program icon="org.gnome.Evince" label="Documentation">firefox-esr -new-tab https://funos.org/documentation/</Program> 
      <Separator />
      <Include>$HOME/.jwmrc-mjwm</Include>
      <Separator />
      <Include>$HOME/.config/jwm/themes-list</Include> 
      <Separator />
      <Program icon="system-reboot" label="Reload menu" confirm="false">mjwm --no-backup && jwm -reload</Program>
      <Separator />     
      <Program icon="system-shutdown" label="Log Out">/usr/bin/funos-logout</Program>      
   </RootMenu>   
</JWM>

Save the file and close Mousepad.

3. Create a New JWM Tray Configuration

Similarly, create a new tray configuration file:

mousepad $HOME/.config/jwm/tray

Insert the following content:

<?xml version="1.0" encoding="UTF-8"?>
<JWM>
    <Tray x="0" y="-1" height="30" autohide="off" delay="1000">
        <TrayButton popup="Menu" icon="/opt/artwork/jwmkit/traybutton.svg">root:1</TrayButton>
        <TrayButton popup="Terminal" icon="lxterminal">exec:lxterminal</TrayButton>
        <TrayButton popup="File Manager" icon="system-file-manager">exec:pcmanfm</TrayButton>
        <TrayButton popup="Text Editor" icon="org.xfce.mousepad">exec:mousepad</TrayButton>
        <TrayButton popup="Web Browser" icon="firefox-esr">exec:firefox-esr</TrayButton>
        <TaskList maxwidth="130" border="false" />
        <Pager labeled="true" />
        <Spacer width="2" />
        <Dock />
        <Clock format="%H:%M">showdesktop</Clock>
    </Tray>
</JWM>

Save the file and close Mousepad.

4. Create a JWM Icons Configuration

Create a new file to define the paths for application icons:

mousepad $HOME/.config/jwm/icons

Insert the following content:

<?xml version='1.0' encoding='utf-8'?>
<JWM>   
    <IconPath>/usr/share/icons/Papirus/48x48/actions</IconPath>
    <IconPath>/usr/share/icons/Papirus/48x48/apps</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/categories</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/devices</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/emblems</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/emotes</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/mimetypes</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/places</IconPath> 
    <IconPath>/usr/share/icons/Papirus/48x48/status</IconPath> 
</JWM>

Save the file and close Mousepad.

5. Edit the Main JWM Configuration File

Open the main JWM configuration file:

mousepad $HOME/.jwmrc

Add the following line before the closing </JWM> tag:

<Include>$HOME/.config/jwm/icons</Include>

The file should look like this:

<?xml version="1.0" encoding="UTF-8"?>
<JWM>
    <Include>$HOME/.config/jwm/keys</Include>
    <Include>$HOME/.config/jwm/menu</Include>
    <Include>$HOME/.config/jwm/preferences</Include>
    <Include>$HOME/.config/jwm/start</Include>
    <Include>$HOME/.config/jwm/theme</Include>
    <Include>$HOME/.config/jwm/tray</Include>
    <Include>$HOME/.config/jwm/icons</Include>
</JWM>

Save the file and close Mousepad.

6. Reload the Menu

Run the following command to reload the menu:

mjwm --no-backup && jwm -reload

7. Restart JWM

Finally, restart JWM with:

jwm -restart

Explanation

By removing the iconize=Papirus option in the mjwm command and replacing it with a dedicated icons configuration, the menu reload process becomes instantaneous. The icons are now handled by the custom JWM icons configuration.

Conclusion

Following this tutorial will eliminate the delay in updating the menu after installing new applications. The newly installed applications will now appear immediately in the application menu after reloading.

For more tips and tricks to enhance your FunOS experience, visit FunOS Documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *