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
gene0915
Level 2
Level 2
Posts: 60
Joined: Sun Oct 26, 2014 7:52 pm

Want to reproduce the 'Quit' shortcut, how?

Postby gene0915 » Wed Aug 09, 2017 4:46 pm

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?

Postby omelgazzar » Wed Aug 09, 2017 5:58 pm

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 2
Level 2
Posts: 60
Joined: Sun Oct 26, 2014 7:52 pm

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

Postby gene0915 » Wed Aug 09, 2017 8:19 pm

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.
Attachments
edit menu.png
missing.png
missing.png (74.87 KiB) Viewed 284 times

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

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

Postby omelgazzar » Wed Aug 09, 2017 9:40 pm

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?

Postby janhostdk » Mon Sep 18, 2017 1:28 pm

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 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

User avatar
Schultz
Level 5
Level 5
Posts: 863
Joined: Thu Feb 25, 2016 8:57 pm

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

Postby Schultz » Mon Sep 18, 2017 2:22 pm

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?

Postby janhostdk » Mon Sep 25, 2017 1:23 pm

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 16.04 Mate LTS, Linux Mint 18 Sarah Mate, Win7

User avatar
Termy
Level 3
Level 3
Posts: 112
Joined: Mon Sep 04, 2017 8:49 pm
Location: UK
Contact:

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

Postby Termy » Wed Sep 27, 2017 9:40 pm

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.
Here to help.


Return to “Newbie Questions”

Who is online

Users browsing this forum: cecilieaux, fshsweden, Moem, prestonR and 9 guests