Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Key for Hibernating and Shutdown

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Detzi
Posts: 7
Joined: 2017-11-06 06:32

Key for Hibernating and Shutdown

#1 Post by Detzi »

Hi there,
i installed a Debian 9 (Strecht) on my older ThinkPad T400 and am using GNOME 3.22.2 with Xsession (Standard).
I would like to bind the shutdown command to the Power button but when i open Configuration->Energy-> Key for Hibernationg and Shutdown, i can only pick between ''Nothing'' ''Hibernate'' and ''Sleep''.

I also tried to ''do nothing'' when i close the lid, but i can't find this option either.

I am aware that these are trivial questions which one coul think i had solved googeling 3 mins but i just can't find a solution. ( May be i am missing something.)

Thanks in foreward
Detzi

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Key for Hibernating and Shutdown

#2 Post by pylkko »

There is a configuration file for logind, called logind.conf where you can set what happen when the lid is closed or what happens when the power button is pressed. However, it is a bit more complicated than just this, because logind also allows other programs to prevent these from happening. Usually this is desktop environments. However, you can either try to override this or try to find somewhere in the hidden GNOME conf files where these are set. However, GNOME is known for hiding things like this from the user...

See logind.conf manual, i.e type "man logind.conf" in terminal.

especially
HandlePowerKey
HandleLidSwitch

and

PowerKeyIgnoreInhibited

Detzi
Posts: 7
Joined: 2017-11-06 06:32

Re: Key for Hibernating and Shutdown

#3 Post by Detzi »

Thank you for your reply. That does not sound like a very intuitive thing to do. But i will at leas try ;)

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Key for Hibernating and Shutdown

#4 Post by pylkko »

I'm not sure if I understand what you mean. If you want to change the power settings, then what more intuitive is there to do than configuration of the package that handles this on your operating system? Or perhaps you mean that the way systemd handles it is not easy to grasp? But then again it is more or less how it is done on all operating systems. It's basically copied from Windows. Or perhaps you mean that GNOME should have made it easier to do. In that case you could try another desktop. Or perhaps you need more help with this. If so, then ask.

Detzi
Posts: 7
Joined: 2017-11-06 06:32

Re: Key for Hibernating and Shutdown

#5 Post by Detzi »

What i mean is that it seems odd to hide the intentional function of a Key in a config File while putting the alternative functions in a place and form which is easy to find and access. Especially after i read
pylkko wrote: However, it is a bit more complicated than just this, because logind also allows other programs to prevent these from happening.
and therefore i also considered it possible not to be able to bind this function to the key because of my limited linux knowledge.
But thank you so far, i now have at least a point to start. :)

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Key for Hibernating and Shutdown

#6 Post by pylkko »

Almost all Linux programs work so that there is a "back end", a program that does that actual work (stuff that needs to be done) in the background and then a "front end" which is a separate program that allows users to easily interact with the backend program. So, for example, there is a very thorough and complex disk manipulation program called parted that you can use "off the commandline" if you dare/remember the commands, and there is a graphical tool called gparted that users can use to click on different options. When the user does this and clicks on "go", gparted then uses parted to do the work.

So, here for example, systemd (and it's daughter program logind) is a large collection of background programs that do stuff in the background (like power saving, starting and ending system sessions etc), whereas the desktop environment you are using (GNOME), is a program that "exposes" some of those options (the most needed ones) to the user (you). Quite often back ends are very complex, have millions of options and settings and flags that can be used in different ways. It is only good if such programs are "complete", complex and allow the manipulation of every minute detail. Whereas, often the user interface does not necessarily need to be as complex as possible (nor is it a good thing) to expose those million options, especially when many of then are nearly identical. Linux machines are often used as servers with no display, so it is good that programs that have a graphical user component also have some part that can be used without any display at all. So often only those unnecessary options are not shown to the user in the graphical interface, but instead those that the user likely needs frequently. GNOME is one of the worst programs in terms of hiding details from the user, so given that, this situation is not that surprising. Their philosophy is essentially to "not get in the way" of the user, so the user can concentrate on work and not "meta work" i.e adjusting the computer so that you can work on it. Although that sounds good in theory, in practice, at times (in my opinion) they go too far. This is a good example of that, why on earth do they not give you all the options in that menu? Because Linux can handle all that.. its not the problem. The problem is that GNOME devs have decided that you cannot need those options, which is odd.

logind is designed so that it under basic circumstances it takes care of everything related to loging in, logging out, starting a user's session, suspending and all that. So even on any minimal install you can get this to work. However, the designers realized that at times control of these functions need to be handled over to other programs and therefore they designed what the manual calls inhibitor locks, which allow certain processes to prevent logind from doing stuff until they see it fit. If you look at the default configuration, you will notice that closing the lid does not allow any program to inhibit it. What follows is that closing the lid always suspends the machine no matter what. Other things, such as pressing the power button, however does allow other programs (like graphical desktops for human users) to put inhibitor locks on it. This means that the machine will not allow power off from the button when important work is going on in the desktop session, until the session says that it is now OK. To me this seems more or less like exactly how it should be done.
Last edited by pylkko on 2017-11-09 18:11, edited 1 time in total.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Key for Hibernating and Shutdown

#7 Post by debiman »

this was foretold:
"there will come the day when young people won't even know anymore that computers have a layer beneath the graphical user interface - they will think that the GUI is the computer."
Detzi wrote:That does not sound like a very intuitive thing to do.
i think the day has come.

Detzi
Posts: 7
Joined: 2017-11-06 06:32

Re: Key for Hibernating and Shutdown

#8 Post by Detzi »

pylkko wrote:This is a good example of that, why on earth do they not give you all the options in that menu? Because Linux can handle all that.. its not the problem. The problem is that GNOME devs have decided that you cannot need those options, which is odd.
So we both exactly agree on that, you have just made a much more detailed explanation.
pylkko wrote:To me this seems more or less like exactly how it should be done.
Yes, that sounds sane to me also.
debiman wrote:this was foretold:
"there will come the day when young people won't even know anymore that computers have a layer beneath the graphical user interface - they will think that the GUI is the computer."
Detzi wrote:That does not sound like a very intuitive thing to do.
i think the day has come.
How have you made this link? Because me stating it odd to not find a shutdown function in a GUI dropdown for Shutdown and Hibernation? What has this to do with a basic knowledge about OS architecture?

Post Reply