[SOLVED]How to change the width of the Cinnamon menu?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
Post Reply
User avatar
philotux
Level 3
Level 3
Posts: 178
Joined: Sat Jul 21, 2018 11:14 am

[SOLVED]How to change the width of the Cinnamon menu?

Post by philotux » Sat Dec 08, 2018 8:14 pm

Hi everyone,

As the title suggests, I wonder if there is any way to modify the width of the Cinnamon menu. I am quite happy with it's height but I would like it better if I could make if a bit smaller.

Any suggestions and pointers are highly appreciated.
Thanks!

philotux

PS. Sorry if the question has been answered before, I did search the forums but I didn't dig that deep.
Last edited by philotux on Mon Dec 10, 2018 10:59 am, edited 1 time in total.

redlined
Level 4
Level 4
Posts: 408
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: How to change the width of the Cinnamon menu?

Post by redlined » Sat Dec 08, 2018 9:32 pm

philotux wrote:
Sat Dec 08, 2018 8:14 pm
Hi everyone,

As the title suggests, I wonder if there is any way to modify the width of the Cinnamon menu. I am quite happy with it's height but I would like it better if I could make if a bit smaller.

Any suggestions and pointers are highly appreciated.
Thanks!

philotux

PS. Sorry if the question has been answered before, I did search the forums but I didn't dig that deep.
hi philotux!

I'm new to Linux so this is far from good or only options (and may be dangerous even:D)

First is right click Mint menu> configure> Menu tab> make adjustments there, also see "Open the menu editor" button. Otherwise I'd look at Themes and mix~n~match there to get a menu more like what you desire along with all you other preferences left in Themes (manager).

Other ideas I have, may cause issues, headaches, etc so "buyer beware"... but I had good experience editting system gtk2&3 css files to get a decent scrollbar systemwide (my one worst and persistent pet peeve since migrating to linux, lol) I could search and recommend some guides or questions on such answered for menu width and customizing in other ubuntu/mint haunts if you like.

Another option I bet can help do what you want, complete with even better haps and hazzards, is dconf editor (in SPM/apt) it can wreck things if you're not mindful though, so honor the warning it gives on open.
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

User avatar
smurphos
Level 8
Level 8
Posts: 2258
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: How to change the width of the Cinnamon menu?

Post by smurphos » Sun Dec 09, 2018 12:20 am

The element widths (and thus menu width) is hard coded into the menu applet, taking into account font sizes etc which are set by the theme. The easiest tweak is to directly modify the applet code to reduce the maximum button width of the main applications box.

This is using the Mint 19 version Cinnamon 3.8.x version of the applet.

1) Copy the folder /usr/share/cinnamon/applets/menu@cinnamon.org to ~/.local/share/cinnamon/applets/menu@cinnamon.org

2) In the local copy open ~/.local/share/cinnamon/applets/menu@cinnamon.org/applet.js in a text editor.

3) Navigate to line 32 const MAX_BUTTON_WIDTH = "max-width: 20em;"; and reduce the value of 20 (10 works good).

4) There is a default 42 px padding on the box - that's set on line 2942 - this.applicationsBox.set_width(this._applicationsBoxWidth + 42); // The answer to life... Optionally tweak...

5) Save your file and hit Ctrl-Alt-Esc to restart Cinnamon and then view your newly skinny menu.

Before (ignore my overloaded favorites and thus overly tall menu - I use Cinnamenu normally)
Image

After (max-width: 10em & this._applicationsBoxWidth + 21)
Image

redlined
Level 4
Level 4
Posts: 408
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: How to change the width of the Cinnamon menu?

Post by redlined » Sun Dec 09, 2018 11:00 am

smurphos wrote:
Sun Dec 09, 2018 12:20 am
4) There is a default 42 px padding on the box - that's set on line 2942 - this.applicationsBox.set_width(this._applicationsBoxWidth + 42); // The answer to life... Optionally tweak...
hi smurphos! awesome tweak, thanks for sharing that! also, for letting me know one of life's hidden secrets is shared in this code! :idea:
(I will have to consider most carefully changing that line to anything other than the default 42 :mrgreen:
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

User avatar
philotux
Level 3
Level 3
Posts: 178
Joined: Sat Jul 21, 2018 11:14 am

Re: How to change the width of the Cinnamon menu?

Post by philotux » Mon Dec 10, 2018 10:52 am

Hi redlined and smurphos,
Sorry for the delay in getting back to you.

@redlined

Thanks for your suggestions and pointers. I should have mentioned in my OP that I had already skimmed through the options under the menu icon's right-click but couldn't find anything related to modifying the size of the menu. Regarding debconf-editor, that one had completely fallen to oblivion for me. However, I have a vague memory that, once upon a time, I had looked into it to change some configuration but I don't remember what it was any longer. I got it installed now and I will go through it to get more acquainted with it.

Thanks once again!
philotux
smurphos wrote:
Sun Dec 09, 2018 12:20 am

1) Copy the folder /usr/share/cinnamon/applets/menu@cinnamon.org to ~/.local/share/cinnamon/applets/menu@cinnamon.org

2) In the local copy open ~/.local/share/cinnamon/applets/menu@cinnamon.org/applet.js in a text editor.

3) Navigate to line 32 const MAX_BUTTON_WIDTH = "max-width: 20em;"; and reduce the value of 20 (10 works good).

4) There is a default 42 px padding on the box - that's set on line 2942 - this.applicationsBox.set_width(this._applicationsBoxWidth + 42); // The answer to life... Optionally tweak...

5) Save your file and hit Ctrl-Alt-Esc to restart Cinnamon and then view your newly skinny menu.
That's great! Clear and straightforward instructions. It is exactly what I needed to change the width of the
menu. Now with my downsized Cinnamon menu, I enjoy my desktop even more.

Thank you so much!

greetings
philotux


PS. By the way, I've got Cinnamenu installed as well, but mine looks somewhat different than yours. One difference, among some others, is that it lacks the "Favorite Apps" column . Maybe I overlooked something in the configuration settings:
Image

redlined
Level 4
Level 4
Posts: 408
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by redlined » Mon Dec 10, 2018 11:59 am

hi philotux!

yah, smurphos really knocked it out of the park with that response! I did it too 8)

and similar on dconf editor, I came across some advice to use it for something semi-related to what I was trying to tweak early in my LM18.3 experience.. was trying to find gui to help as I was having hard time to figure out how to even close and save files editted with Xed in terminal :oops: I recall I ended up sorting it all with commandline edits with a desire to look at dconf again in future- it certainly has lots of nuts and bolts to tinker with :mrgreen:

I try not to assume anything in life, so went thru the common stuff to rule those options out for what you wanted. I often forget right click> configure> menu tab> menu editor (long way to menu> Cinnamon menu editor) so mentioned that. I bring that back up because I believe it will help with your missing favorites issue mentioned in your most recent response, take a relook at that menu tab (from right click>config) and see if "Show favorites and quit options" is enabled :wink:
(if already enabled, then ugh... :?
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

User avatar
philotux
Level 3
Level 3
Posts: 178
Joined: Sat Jul 21, 2018 11:14 am

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by philotux » Mon Dec 10, 2018 12:25 pm

Hi redlined,
redlined wrote:
Mon Dec 10, 2018 11:59 am
yah, smurphos really knocked it out of the park with that response!
Yah, he really nailed it!
I did it too 8)
Cool!
:D
...take a relook at that menu tab (from right click>config) and see if "Show favorites and quit options" is enabled :wink:
(if already enabled, then ugh... :?
Sure, I've got it enabled and they do appear in the Cinnamon menu (default menu). But I've got another menu applet installed as well via "applet manager" namely Cinnamenu and I don't find any "Show favorites and quit options" in it's configuration settings.

redlined
Level 4
Level 4
Posts: 408
Joined: Wed Jun 06, 2018 8:12 pm
Location: Mile High, Green State (Denver, CO:)

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by redlined » Mon Dec 10, 2018 1:10 pm

hi philotux! I apologize, completely missed the applet named Cinnamenu being used instead of default cinnamon menu. I may give that a run on my top panel as I do use (and prefer using) applications menu function from cairo dock for most of my menu'd maneuverings and meanderings from bottom custom panel(s)/docks..
Moem kōan 42: Should tool manufacturers be required to fix their products so that you cannot use their saws to cut the tree branch that you're sitting on?

(The answer to the ultimate question of life, the universe and everything is... 42!!;)

User avatar
philotux
Level 3
Level 3
Posts: 178
Joined: Sat Jul 21, 2018 11:14 am

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by philotux » Mon Dec 10, 2018 1:51 pm

redlined wrote:
Mon Dec 10, 2018 1:10 pm
hi philotux! I apologize, completely missed the applet named Cinnamenu being used instead of default cinnamon menu. I may give that a run on my top panel as I do use (and prefer using) applications menu function from cairo dock for most of my menu'd maneuverings and meanderings from bottom custom panel(s)/docks..
No worries!
Cinnamenu is a nice implementation. You may like it as well.

cheers
:D

User avatar
smurphos
Level 8
Level 8
Posts: 2258
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by smurphos » Mon Dec 10, 2018 2:50 pm

philotux wrote:
Mon Dec 10, 2018 12:25 pm
Sure, I've got it enabled and they do appear in the Cinnamon menu (default menu). But I've got another menu applet installed as well via "applet manager" namely Cinnamenu and I don't find any "Show favorites and quit options" in it's configuration settings.
The pic I posted was the 19 stock menu - just with too many favorites for it to handle (that's fixed for 19.1 BTW - the stock menu favorites turns into a scroll-box when it gets too full and has a user configurable maximum height)

The favorites in Cinnamenu is presented as another category. The thing I like about Cinnamenu in particular is being able to drag and drop the categories. So I've got my favorites on the top which works well with it in a top panel.

Image

User avatar
philotux
Level 3
Level 3
Posts: 178
Joined: Sat Jul 21, 2018 11:14 am

Re: [SOLVED]How to change the width of the Cinnamon menu?

Post by philotux » Mon Dec 10, 2018 3:07 pm

smurphos wrote:
Mon Dec 10, 2018 2:50 pm
The pic I posted was the 19 stock menu - just with too many favorites for it to handle (that's fixed for 19.1 BTW - the stock menu favorites turns into a scroll-box when it gets too full and has a user configurable maximum height)
Alrigh, that explains the whole thing. Excuse my misunderstanding.
The favorites in Cinnamenu is presented as another category. The thing I like about Cinnamenu in particular is being able to drag and drop the categories. So I've got my favorites on the top which works well with it in a top panel.
Thanks for this! That's a nice feature. Already rearranged the categories in Cinnamenu. I like that you could switch to grid view as well.

One thing that crossed my mind was if it would be possible to implement the resizing into the Cinnamon menu in a way similar to Whisker menu in Xfce. That would be nice.

philotux

Post Reply

Return to “Cinnamon”