Want to reproduce the 'Quit' shortcut, how?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
gene0915
Level 4
Level 4
Posts: 241
Joined: Sun Oct 26, 2014 7:52 pm

Want to reproduce the 'Quit' shortcut, how?

Post by gene0915 »

Using Mate 18.2.

When I click the Menu button and click on 'Quit', it brings up a box that asks me if I want to shutdown the system, restart, cancel, etc. How do I recreate that box?

Reason being, I'm playing around with editing the Menu button and what's displayed and under which category. I found that by calling this: gnome-session-quit .... it brings up the box but it's missing some of the options like shutdown and restart.

Thanks
omelgazzar
Level 1
Level 1
Posts: 2
Joined: Wed Aug 09, 2017 5:56 pm

Re: Want to reproduce the 'Quit' shortcut, how?

Post by omelgazzar »

To show the dialog box you want:

Code: Select all

gnome-session-quit --power-off
For more options:

Code: Select all

gnome-session-quit -h
gene0915
Level 4
Level 4
Posts: 241
Joined: Sun Oct 26, 2014 7:52 pm

Re: Want to reproduce the 'Quit' shortcut, how?

Post by gene0915 »

omelgazzar wrote:To show the dialog box you want:

Code: Select all

gnome-session-quit --power-off
For more options:

Code: Select all

gnome-session-quit -h
That's exactly what I was looking for, thanks! Now, my next question, why isn't this working.

I added 'Quit' to 'Applications' but why isn't it showing up under the 'Preferences' menu item? I want to see 'Quit' as a separate shortcut right where my mouse pointer is.)

The reason for all this jumping through hoops is I need to use Mate so I can use Compton to eliminate a weird screen tearing bug that manifests itself after I use rdesktop. I prefer the look of Cinnamon over Mate so I just wanted to trim down the Mate menu and add a simple 'Quit' option and I'll be good to go.
omelgazzar
Level 1
Level 1
Posts: 2
Joined: Wed Aug 09, 2017 5:56 pm

Re: Want to reproduce the 'Quit' shortcut, how?

Post by omelgazzar »

To add a launcher to Preferences menu, you can create this desktop entry and put it in /usr/share/applications:

Code: Select all

[Desktop Entry]
Name=Quit
Comment=Shutdown
Exec=%YOUR COMMAND HER%
Icon=%YOUR ICON HERE%
Terminal=false
Type=Application
Categories=Settings
N.B add .desktop extension to the file e.g. /usr/share/applications/quit.desktop
User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: Want to reproduce the 'Quit' shortcut, how?

Post by janhostdk »

I'm using Ubuntu/linux mint , mate
and was after shortcuts for shutdown , reboot and logout without any questions asked :

Rightclick startmenu-choose edit-fx system tools
add item

Ubuntu:
Link for Shutdown:
Application - Name : Shutdown
Command:
shutdown -Ph now

Icon suggeststion:
Ubuntu
/usr/share/icons/matefaenza/apps/scalable/system-shut-down.svg
Mint
/usr/share/icons/Mint-X/apps/48/system-shut-down.png
-------
Link for LogOut:
Application - Name : LogOut
Command:
mate-session-save --logout
mate-session-save --logout-dialog

Icon suggeststion:
/usr/share/icons/matefaenza/actions/scalable/system-log-out.svg
Mint
/usr/share/icons/Mint-X/apps/48/gnome-session-logout.png

Link for restart:
Application - Name : Restart
Command:
shutdown -r now

Icon suggeststion:
Ubuntu
/usr/share/icons/matefaenza/apps/scalable/system-restart.svg
Mint
/usr/share/icons/Mint-X/apps/48/system-restart.png
------
Link for LogOut:
Application - Name : LogOut
Command:
mate-session-save --logout
mate-session-save --logout-dialog

Icon suggeststion:
/usr/share/icons/matefaenza/actions/scalable/system-log-out.svg
Mint
/usr/share/icons/Mint-X/apps/48/gnome-session-logout.png
-----
Now i can rightclick the shortcut and add to panel or desktop
Dell Vostro 270 4gb ram with Ubuntu 18.04.1 Mate LTS, Linux Mint 18 Sarah Mate, Win
Acer swift 3, 4gb ram with Ubuntu 18.04.1 Mate LTS
User avatar
Schultz
Level 8
Level 8
Posts: 2148
Joined: Thu Feb 25, 2016 8:57 pm

Re: Want to reproduce the 'Quit' shortcut, how?

Post by Schultz »

Or you could just simply add it to the panel and get one less mouse click.
User avatar
janhostdk
Level 2
Level 2
Posts: 61
Joined: Wed Jun 29, 2016 5:01 am
Location: Dk

Re: Want to reproduce the 'Quit' shortcut, how?

Post by janhostdk »

yes.. and when you choose remove from panel or desktop its gone..
but if your hunting fewer mouseclicks then just use terminal and the commands !
Dell Vostro 270 4gb ram with Ubuntu 18.04.1 Mate LTS, Linux Mint 18 Sarah Mate, Win
Acer swift 3, 4gb ram with Ubuntu 18.04.1 Mate LTS
User avatar
Termy
Level 6
Level 6
Posts: 1188
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

Re: Want to reproduce the 'Quit' shortcut, how?

Post by Termy »

You could create a custom keyboard shortcut so that, for example, if you press Ctrl + Alt + H, the computer shuts down. If you want to customize a dialogue window more, you could look into utilities like zenity, then have it process commands like systemctl suspend and shutdown now.
I use Linux Mint 18.3 with Cinnamon in a VirtualBox VM for testing & sandboxing.

I'm LearnLinux (LL) on YouTube: https://www.youtube.com/c/learnlinux
I'm also terminalforlife (TFL) on GitHub: https://github.com/terminalforlife
Post Reply

Return to “Newbie Questions”