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

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
User avatar
majpooper
Level 5
Level 5
Posts: 701
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 » Sun Nov 11, 2018 7:01 pm

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 majpooper on Mon Nov 12, 2018 5:29 pm, edited 1 time in total.

Hoser Rob
Level 12
Level 12
Posts: 4462
Joined: Sat Dec 15, 2012 8:57 am

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

Post by Hoser Rob » 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..

User avatar
Moem
Level 17
Level 17
Posts: 7235
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 » Mon Nov 12, 2018 9:48 am

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 5
Level 5
Posts: 701
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 » Mon Nov 12, 2018 1:51 pm

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 17
Level 17
Posts: 7235
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 » Mon Nov 12, 2018 1:55 pm

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
Level 6
Level 6
Posts: 1239
Joined: Tue Feb 21, 2017 8:13 pm
Location: Alamogordo, New Mexico, USA

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

Post by DAMIEN1307 » Mon Nov 12, 2018 1:56 pm

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.
ORDO AB CHAO

User avatar
majpooper
Level 5
Level 5
Posts: 701
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 » Mon Nov 12, 2018 2:51 pm

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 5
Level 5
Posts: 701
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 » Mon Nov 12, 2018 5:49 pm

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 8
Level 8
Posts: 2255
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » Tue Nov 13, 2018 12:16 am

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.

Post Reply

Return to “Software & Applications”