[SOLVED]Remove Logout&Lock Screen but not Quit in Cinnamon menu

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
majpooper
Level 8
Level 8
Posts: 2076
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

[SOLVED]Remove Logout&Lock Screen but not Quit in Cinnamon menu

Post by majpooper »

I am finishing up a fresh install of LMDE3 cinnamon. I am trying to unclutter menu favorites by removing the Logout and Lock Screen buttons (icons ?) in the favorites section of the menu. However I want to keep the Quit button. I have found several HOW TO threads on how to do this but are not working. I have edited the applet.js file found at:
/usr/share/cinnamon/applets like below:

Code: Select all

for ( let i = 0; i < launchers.length; ++i ) {
            let app = appSys.lookup_app(launchers[i]);
            if (app) {
                let button = new FavoritesButton(this, app, launchers.length + 1);
                this._favoritesButtons[app] = button;
                this.favoritesBox.add_actor(button.actor, { y_align: St.Align.END, y_fill: false });

                this._addEnterEvent(button, Lang.bind(this, this._favEnterEvent, button));
                button.actor.connect('leave-event', Lang.bind(this, this._favLeaveEvent, button));

                ++j;
            }
        }

//        //Separator
//        if (launchers.length != 0) {
//                let separator = new PopupMenu.PopupSeparatorMenuItem();
//                this.favoritesBox.add_actor(separator.actor, { y_align: St.Align.END, y_fill: false });
//        }
//
//        //Lock screen
//        let button = new SystemButton(this, "system-lock-screen", launchers.length + 3,
... 24 more lines ...
//        this.favoritesBox.add_actor(button.actor, { y_align: St.Align.END, y_fill: false });
//
//        //Logout button
//        let button = new SystemButton(this, "system-log-out", launchers.length + 3,
... 11 more lines ...
//        this.favoritesBox.add_actor(button.actor, { y_align: St.Align.END, y_fill: false });

        //Shutdown button
        button = new SystemButton(this, "system-shutdown" launchers.length + 1,
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Hoser Rob
Level 20
Level 20
Posts: 11762
Joined: Sat Dec 15, 2012 8:57 am

Re: Remove Logout&Lock Screen but not Quit in menu

Post by Hoser Rob »

Have you been reading sources for Ubuntu based Mint? LMDE is Debian based and Ubuntu solutions aren;'t necessarily going to work..
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
User avatar
Moem
Level 22
Level 22
Posts: 16193
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Remove Logout&Lock Screen but not Quit in menu

Post by Moem »

Mod note:
Moved thread into the LMDE section to avoid confusion.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
majpooper
Level 8
Level 8
Posts: 2076
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: Remove Logout&Lock Screen but not Quit in menu

Post by majpooper »

Moem wrote: Mon Nov 12, 2018 9:48 am Mod note:
Moved thread into the LMDE section to avoid confusion.
Hoser Rob wrote: Mon Nov 12, 2018 9:35 am Have you been reading sources for Ubuntu based Mint? LMDE is Debian based and Ubuntu solutions aren;'t necessarily going to work..
The question is pertains to Cinnamon - does it not?
User avatar
Moem
Level 22
Level 22
Posts: 16193
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Remove Logout&Lock Screen but not Quit in menu

Post by Moem »

majpooper wrote: Mon Nov 12, 2018 1:51 pm The question is pertains to Cinnamon - does it not?
It does, but not to Cinnamon on the main edition. LMDE is not 'main edition'. So questions about Cinnamon on LMDE go under LMDE.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
DAMIEN1307

Re: Remove Logout&Lock Screen but not Quit in menu

Post by DAMIEN1307 »

does right clicking on the "menu" icon on panel bar show you "properties"?...if so click properties and see if it shows you something like "commands" in the top tabs and see if there are boxes to be unticked that could remove these...just a shot in the dark here since im running a "whisker" menu here but it may be similar on your LMDE.
User avatar
majpooper
Level 8
Level 8
Posts: 2076
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: Remove Logout&Lock Screen but not Quit in menu

Post by majpooper »

THX for the tip - been all over the menu - there are boxes that can be ticked to add/remove almost everything in the categories in "favorites" but not for Logout/Lock Screen/Quit. For now I am convinced the answer is in the applet.js Cinnamon configuration file - the problem is I don't understand how to read the file so some of the old solutions are not working.

THX again - Hoooah
User avatar
majpooper
Level 8
Level 8
Posts: 2076
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

Re: [SOLVED]Remove Logout&Lock Screen but not Quit in Cinnamon menu

Post by majpooper »

First this was a Cinnamon issue as I solved it both on LMDE3 Cinnamon and LM19 Cinnamon.
The fix is in /usr/share/cinnamon/applets/applet.js
Not being a coder I really did not understand what exactly I was looking at.
On top of that some of the older threads suggested changes that seemed to make things worse as I was dealing with a much newer version of Mint/Cinnamon. But at least they got me in the right church and from there it was trial and error.

The fix:
I made a copy of the original file, of course, and then deleted from:

Code: Select all

//Lock screen
down to the line just before

Code: Select all

//Shutdown

For what ever reason commenting out didn't seem to work
I made one change to the line below

Code: Select all

//Shutdown button
        button = new SystemButton(this, "system-shutdown" launchers.length + 3,
to

Code: Select all

//Shutdown button
     let  button = new SystemButton(this, "system-shutdown" launchers.length + 3,
This worked - some of the older solutions threads no longer work
User avatar
smurphos
Level 18
Level 18
Posts: 8501
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: [SOLVED]Remove Logout&Lock Screen but not Quit in Cinnamon menu

Post by smurphos »

Glad you got it sorted majpooper.

One hint - if editing the stock applets in this way I'd suggest copying the original from /usr/share/cinnamon/applets to ~/.local/share/cinnamon/applets and working on the local copy. The system always uses the local folder in preference to the system if the are two copies of the same applet.

That way your edits won't be overwritten by a Cinnamon update, you've always got a backup of the original, no need to edit anything as root, and recovery is easier should you inadvertently introduce a bug that crashes cinnamon.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
Locked

Return to “Software & Applications”