Changing Main menu/start icon from command line?

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Changing Main menu/start icon from command line?

Post by KNERD »

Looking through all the possible gsetting options, I see
org.cinnamon app-menu-icon-name 'cinnamon-symbolic'
However, when I try using that setting, with the command, gsettings set org.cinnamon.desktop.interface app-menu-icon-name 'menu' I am getting
no such key “app-menu-icon-name”

Perhaps I am using it incorrectly? Or is there another means to change the icon?

Thanks!
Last edited by KNERD on Wed Nov 29, 2023 4:43 pm, edited 1 time in total.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

1. Why are you adding ".desktop.interface" when it's not there in your first quote?

2. From my testing, that gsetting isn't modifying the menu icon, probably just some legacy leftover. I tested changing menu icon via right click menu button > Configure... > Icon > select another icon. The change is recorded in ~/.config/cinnamon/spices/menu@cinnamon.org/0.json
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

Thanks for those tips, and taking the time to respond. I had added .desktop.interface because I had assumed it was the correct way due to the means to change other settings such as the theme and icons.

I even asked ChatGTP v3.5 , curious to see what it would tell me. It suggested I make a script to copy the new icon over the old one so it would take its place. :lol:

I guess I can look over the source code for that Cinnamon Menu and see what it is doing.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

JSON is a text file format. One can always edit it manually or programmatically.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

Problem is that JSON file is local. I need to make the change globally.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

Take a look at /usr/share/cinnamon/applets/menu@cinnamon.org/settings-override.json

p.s. From my experiment, the settings-override file doesn't affect existing menu icon setting until I "reload" and "reset" the menu. So you may as well also modify the icon config file for each account if you don't bother login to each of them.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

I don't see a settings-overide.json, but I do see settings-schema.json with the following setting. Does it look the same as the one you would be referring to?

"menu-icon" : {
"type" : "iconfilechooser",
"default" : "cinnamon-symbolic",
"description" : "Icon",
"tooltip" : "Select an icon to show in the panel.",
"default_icon" : "cinnamon-symbolic",
"dependency" : "menu-custom"
},
Also, how does it know whee to find the correct icon? Based on current theme ?
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

The settings-override.json file is in Mint 21.2 Cinnamon live session (booting the .iso in VM). Which distribution version are you running? Without the override file, the default menu icon would have been a Cinnamon logo, not the Mint logo. As in what you quoted, the schema file is referring to "cinnamon" in default icon.

And yes, the icon names are based on icon theme.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

I am using Debian 12, so it is showing the Cinnamon Logo (the mountain?)


I assume if I put a settings-override.json, it should accept it?
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

Here's the settings-override.json in Mint. Give it a try.

Code: Select all

{
    "menu-custom" : {
        "default" : true,
        "override-props" : true
    },
    "menu-label" : {
        "default" : "",
        "override-props" : true
    },
    "menu-icon" : {
        "icon_categories" : [{
            "name" : "Linux Mint",
            "icons" : [
                "linuxmint-logo",
                    "linuxmint-logo-badge",
                    "linuxmint-logo-badge-symbolic",
                    "linuxmint-logo-filled-badge",
                    "linuxmint-logo-filled-leaf-badge",
                    "linuxmint-logo-filled-leaf",
                    "linuxmint-logo-filled-ring",
                    "linuxmint-logo-leaf-badge",
                    "linuxmint-logo-leaf-badge-symbolic",
                    "linuxmint-logo-leaf",
                    "linuxmint-logo-leaf-symbolic",
                    "linuxmint-logo-neon",
                    "linuxmint-logo-ring",
                    "linuxmint-logo-ring-symbolic",
                    "linuxmint-logo-simple",
                    "linuxmint-logo-simple-symbolic",
                    "cinnamon-symbolic",
                    "emblem-favorite-symbolic",
                    "user-bookmarks-symbolic",
                    "start-here-symbolic"
            ]
        }],
        "default_category" : "Linux Mint",
        "default" : "linuxmint-logo-ring-symbolic",
        "default_icon" : "linuxmint-logo-ring-symbolic",
        "override-props" : true
    }
}
You may skip the "icon_categories" and "default_category" parts as that is unlikely what you want to override. This override file also clears up the "Menu" label into "", making the menu button textless. You may undo that as well if that's not what you like.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

Thanks for your help in assisting me to understand this.

I think using settings-override.json would probably be better than using gsettings.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

Well, gsettings command only changes your own user config. Modifying the global default is a lot more complicated. So for your goal, you are lucky in this regard.

But on the other hand, gsettings (or the dconf backend) allows one to inherit the global default automatically as long as the other users haven't modified the corresponding setting by themselves. But here the .json based applets won't take on the new default until you either "reset" the applet of all other accounts, or edit those 0.json in those other accounts one by one. (Removing the 0.json there work as reset if you want to auto-script it.)
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

I am going to do the changes during install time, not post install. For now I am just testing post install.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

billyswong wrote: Thu Nov 30, 2023 2:18 pm Here's the settings-override.json in Mint. Give it a try.

Code: Select all

{
    "menu-custom" : {
        "default" : true,
        "override-props" : true
    },
    "menu-label" : {
        "default" : "",
        "override-props" : true
    },
    "menu-icon" : {
        "icon_categories" : [{
            "name" : "Linux Mint",
            "icons" : [
                "linuxmint-logo",
                    "linuxmint-logo-badge",
                    "linuxmint-logo-badge-symbolic",
                    "linuxmint-logo-filled-badge",
                    "linuxmint-logo-filled-leaf-badge",
                    "linuxmint-logo-filled-leaf",
                    "linuxmint-logo-filled-ring",
                    "linuxmint-logo-leaf-badge",
                    "linuxmint-logo-leaf-badge-symbolic",
                    "linuxmint-logo-leaf",
                    "linuxmint-logo-leaf-symbolic",
                    "linuxmint-logo-neon",
                    "linuxmint-logo-ring",
                    "linuxmint-logo-ring-symbolic",
                    "linuxmint-logo-simple",
                    "linuxmint-logo-simple-symbolic",
                    "cinnamon-symbolic",
                    "emblem-favorite-symbolic",
                    "user-bookmarks-symbolic",
                    "start-here-symbolic"
            ]
        }],
        "default_category" : "Linux Mint",
        "default" : "linuxmint-logo-ring-symbolic",
        "default_icon" : "linuxmint-logo-ring-symbolic",
        "override-props" : true
    }
}
You may skip the "icon_categories" and "default_category" parts as that is unlikely what you want to override. This override file also clears up the "Menu" label into "", making the menu button textless. You may undo that as well if that's not what you like.
After doing some testing, it made no difference.

Isn't there a single location to set the global theme?
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

KNERD wrote: Wed Jan 24, 2024 10:04 pm After doing some testing, it made no difference.

Isn't there a single location to set the global theme?
So...
billyswong wrote: Wed Nov 29, 2023 1:19 am p.s. From my experiment, the settings-override file doesn't affect existing menu icon setting until I "reload" and "reset" the menu. So you may as well also modify the icon config file for each account if you don't bother login to each of them.
This doesn't work?

May I have a look at your resulting settings-override.json

In my computer, at /usr/share/icons/hicolor/scalable/apps there is a linuxmint-logo-ring-symbolic.svg. If your computer doesn't contain such file, the settings-override.json from Linux Mint won't work as is for obvious reason.
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

Code: Select all

code: Select all

{
    "themes": {
        "controls": "Windows-10",
        "cursors": "Windows-10",
        "icons": "Windows-10",
        "mousePointer": "Windows-10",
        "gtk": "Windows-10",
        "shell": "Windows-10",
        "menu": "menu-icon"
    }
}

I did did a complete restart of the system, and no change. Maybe I did not do it correctly.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

If what you show above is your content of settings-override.json, then there must be some heavy misunderstanding of the mechanism of that file.

/usr/share/cinnamon/applets/menu@cinnamon.org/settings-override.json is a file for overriding the default setting of Cinnamon start menu. It is not for anything else. I thought it is obvious from the folder path :(
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

Okay..I placed an SVG file in

Code: Select all

 /usr/share/icons/hicolor/scalable/apps/
and made the following changes in /usr/share/cinnamon/applets/menu@cinnamon.org/settings-override.json

Code: Select all


    "menu-custom" : {
        "default" : true,
        "override-props" : true
    },
    "menu-label" : {
        "default" : "",
        "override-props" : true
    },
    "menu-icon" : {



        "default" : "menu",
        "default_icon" : "menu",
        "override-props" : true
    }
}
Still no change to the menu. I guess I am still not understanding this file.
billyswong
Level 7
Level 7
Posts: 1874
Joined: Wed Aug 14, 2019 1:02 am

Re: Changing Main menu/start icon from command line?

Post by billyswong »

Let's fix things one step a time.

1. In your code quote, you are missing a opening curly bracket at the beginning.
2. In order to avoid potential issue caused by failure in adding custom icon or failure in pointing to custom icon, I recommend we test out icon names that already exist in your computer by default first. For example, try "start-here-symbolic". This icon exist in most icon themes.
3. As I wrote,
billyswong wrote: Wed Nov 29, 2023 1:19 am the settings-override file doesn't affect existing menu icon setting until I "reload" and "reset" the menu.
Restarting the OS is not enough to trigger the change to be applied as you are not editing the user setting file directly. Right click start menu button > configure > click on hamburger menu button on top-right corner > there you can see the "reload' and "reset" entry for cinnamon menu. Restarting the OS can achieve the same of "reload", but can't achieve the "reset" effect. Without "reset", the default config is not going to be reapplied to ~/.config/cinnamon/spices/menu@cinnamon.org/0.json
KNERD
Level 1
Level 1
Posts: 15
Joined: Mon Oct 23, 2023 11:57 pm

Re: Changing Main menu/start icon from command line?

Post by KNERD »

The curly brace was there, but I guess I missed it during a copy/paste.

I followed your guidance on the reset, and chose the "xterm.svg" file.

It did change the menu icon for sure. Then checking with my custom "menu.svg," it was not changed. I guess there is an issue with the conversion from .png to .svg.

From that method though, it only seems it would change the local account, not globally for which I really need for making a Live Booting system.
Post Reply

Return to “Cinnamon”