Author Topic: Feature request - ALT+F4 logout options after all windows are closed SOLVED  (Read 250 times)

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
Dear Peppermint development team.

I was wondering if it is at all possible to add a feature that allows ALT+F4 to bring up the Peppermint Session Logout options when the user is viewing the Desktop, like it is seen in Linux Mint or Windows.  I tried to create a shortcut for that on Peppermint 10, but it overrides closing active windows/programs and displays the session logout options instead.  Is it possible to make session logout options appear only when viewing the Desktop when pressing ALT+F4.

Thank you for all your help, and you guys are doing a great job with this OS.
« Last Edit: May 29, 2020, 05:18:45 pm by babis1 »
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2308
  • Karma: 612
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: Feature request
« Reply #1 on: May 29, 2020, 12:43:18 am »
Hi babis1,

I don't think that would be possible using the simple keyboard shortcuts. I imagine that a little bit of additional scripting would be required, but that is beyond my skill set  :(

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline spence

  • Administrator
  • Hero
  • *****
  • Posts: 2947
  • Karma: 333
  • peppermint user since 2010
    • View Profile
  • Peppermint version(s): PMVII, PMVIII, PMIX, PMX Respins
Re: Feature request
« Reply #2 on: May 29, 2020, 01:05:27 am »
Keyboard shortcuts are found:

Code: [Select]
menu >  settings > peppermint control panel > keyboard shortcuts
You may or may not succeed.

I suppose keyboard warriors may like that, but on my laptop, pressing the power button brings the close dialog right up...


 ;)
spence
PeppermintOS 8,9 & 10 Respins currently installed  on:
'16 Antec Aria rebuild
PMX Respin on '18 Asus VivoBook


Do not despair, grasshopper...
    with patience all will be revealed...
       Through pain, enlightenment will come.

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
Re: Feature request
« Reply #3 on: May 29, 2020, 06:54:14 am »
Menu -> Peppermint Settings Panel -> User -> Peppermint Control Center -> Keyboard Shortcuts -> close_window_key is set at ALT+F4. I had an idea last night to create a new shortcut hotkey that reads 'close_window_key || peppermint-logout' and set it to be ALT+F4, but it seems that close_window_key command is not found for some reason.  The reason why I thought it would work is if there is no window found for ALT+F4 the command peppermint-logout would execute presenting session logout options.  If anyone has any ideas how to access 'close_window_key' command, I am certain that we can get my idea to work.
I would appreciate any feedback.

Thank you so much.
« Last Edit: May 29, 2020, 06:57:02 am by babis1 »
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.

Offline spence

  • Administrator
  • Hero
  • *****
  • Posts: 2947
  • Karma: 333
  • peppermint user since 2010
    • View Profile
  • Peppermint version(s): PMVII, PMVIII, PMIX, PMX Respins
Re: Feature request
« Reply #4 on: May 29, 2020, 11:25:47 am »
You are diving deeper than I ever have...  other keyboard warriors may well chime in with their pointers & suggestions.

While PCNetSpec had a hate/love relationship with Mint & Windows, he well understood that the end users have free reign to modify their version of PeppermintOS to suit their favorite visuals and workflow preferences.

I tend to run as close to the stock ISO as possible. Firstly, because I just want everything to work. Now as an admin-in-training, I want to remain as stock as possible in order to best help triage our end users' support issues.

Welcome to our forums @babis1...
Happy Pepperminting!


 ;)
spence
PeppermintOS 8,9 & 10 Respins currently installed  on:
'16 Antec Aria rebuild
PMX Respin on '18 Asus VivoBook


Do not despair, grasshopper...
    with patience all will be revealed...
       Through pain, enlightenment will come.

Offline rayzer

  • Trusted User
  • Member
  • *****
  • Posts: 376
  • Karma: 147
  • Graphics n Stuff
    • View Profile
  • Peppermint version(s): 10 Respin
Re: Feature request
« Reply #5 on: May 29, 2020, 12:30:49 pm »
you can also use the lxsession-logout command because peppermint 10 is still using lxde, but unless you remove the current alt+F4 command youll just have to use something else. double clicking the shortcut will allow you to modify or delete the shortcut.
what i would do is setup the whiskermenu to be activated by the windows key (Super L) then remove its other Alt+F1 shortcut and use that keycombo to activate lxsession-logout which also logs out of peppermint

edit: ive just setup on mine and it works perfect
« Last Edit: May 29, 2020, 12:33:22 pm by rayzer »
For wallpapers ive made you can download them here

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
Re: Feature request
« Reply #6 on: May 29, 2020, 02:23:53 pm »
I found the answer that really works.  The solution to my original question works by using the following command and assigning ALT+F4 hotkey in the keyboard settings:
sh -c "wmctrl -c :ACTIVE: || peppermint-logout"

I hope people find my idea and research useful.
--Isaak
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
For some reason or the other if you restart the system and when the desktop appears and you press ALT+F4 the above command works in executing the peppermint-logout command, but that doesn't seem to work after you open a program and close it using ALT+F4 and press ALT+F4 again when you are seeing the desktop.
I am stumped. Can anyone help?
Thank you in advance
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
After some research and experimentation, I finally got the answer:

sh -c "xdotool getactivewindow windowkill || peppermint-logout"

The above works like a charm.  I already set it as a hotkey and use it on my system.  One note though: when you close all the windows with ALT+F4 (for each window), and you see the desktop with icons, when you press ALT+F4 it will close your desktop icons, and then you have to press ALT+F4 again for session logout options.  If you want your icons back you will have to log out and log back in. It is the only quark, other than that it works like a charm.

Hope my research finds you well.
-Isaak.
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.

Offline Slim.Fatz

  • Global Moderator
  • Veteran
  • *****
  • Posts: 2308
  • Karma: 612
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Hi babis1,

I guess for people like myself who never have any desktop icons the solution is perfect.  ;) 8) Thank you for the answer!  :)   

Regards,

-- Slim
Respect science, respect nature, respect each other.

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline babis1

  • Newly Subscribed
  • *
  • Posts: 17
  • Karma: 14
  • Admirer and Enthusiast of Peppermint Linux OS.
    • View Profile
  • Peppermint version(s): 10
I finally perfected the function that I am trying to implement by writing a script:

#!/bin/bash

if [ "$(xdotool getactivewindow getwindowname)" = $"Desktop" ]
then
    peppermint-logout
else
    wmctrl -c :ACTIVE:
fi
exit 0


save it as a file of your choice and mark it executable via terminal:
sudo chmod +x /pathtofile/filename

then create a keyboard shortcut and it works without flaws, just like in linux mint.

--Isaak
« Last Edit: June 01, 2020, 04:56:33 pm by babis1 »
Don't forget to click applaud to encourage effort on this forum whenever you learn something new, or interesting.  It will inspire me to research new information and put up new tutorials.
-Isaak.