-
Notifications
You must be signed in to change notification settings - Fork 804
make the shutdown dialog default action configurable #13108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
make the shutdown dialog default action configurable #13108
Conversation
Signed-off-by: Christoph Anton Mitterer <[email protected]>
Signed-off-by: Christoph Anton Mitterer <[email protected]>
This merely stores each of the button objects as well as their actions in a separate variable for later use. The assignment of `this._defaultAction` is also refactored. Signed-off-by: Christoph Anton Mitterer <[email protected]>
This reads the string array from GSesttings. While keeping the order, it filters out any values which are either completely unknown or whose action is not available (as determined by the `can*`- variables; the `cancel`-action is always available). Duplicate values donβt matter and are thus left as is. If the resulting array is empty, subscribing its first element will yield `undefined`, which is just as desired and causes no default action to be set at all. Signed-off-by: Christoph Anton Mitterer <[email protected]>
Signed-off-by: Christoph Anton Mitterer <[email protected]>
btw. If you like me, I could to the same for the logout dialog. :) |
Just as with shutdown, restart would loose any data where the application hasnβt installed an inhibitor or somehow else make a backup on spurious termination. Actually, one could even argue that suspend and hibernate are destructive as well (consider for example while downloading some data or burning an optical medium). Signed-off-by: Christoph Anton Mitterer <[email protected]>
Cool, I hardly ever use shutdown, maybe a couple of times a year for hardware cleaning maintenance. |
I've sneaked in another commit, which is strictly speaking not related. It marks restart as destructive, too. See the commit message for the rationale Actually, I'd even be tempted to also mark suspend/hibernate as such... if you'd agree, just tell me and I'll update the commit to include them, too. |
I personally mostly use only hibernate (and restart in case of new kernels). |
We could also export this in the control centre if desired... though I'd be happy for a pointer where this should be done. But actually it might be a bit more difficult to get that in GUI form, given that it's an "arbitrary" string. |
All my PC's are serving something, so run 24/7 |
Well... the better if it doesn't just help me :-) Would be great if you could review, and if good, merge it. |
What about applet Exit@claudiux? You can configure shortcuts. |
Uhm. Well I don't really think what I want is shortcuts, but really just which button is selected per default when going to te shutdown dialog. Also, my commit doesn't add some completely new functionality to cinnamon (the shutdown dialog is already there and definitely a core part of it, in the sense that it's important functionality). And in general (that is: not particular to Cinnamon, but to any software that has add-ons/extensions/plug-ins like from Firefox, Libreoffice, etc-) and not with respect to Exit@claudiux... IMO, add-ons/extensions/plug-ins while having some advantages also nearly always come with a great deal of disadvantages - unless perhaps when they're completely maintained/developed/delivered by upstream and considered core of the code:
Long story short... I can of course see why add-ons have some advantages (in particularly also removing some development burden from upstream). But I also think they have disadvantages. Here the changes in code are simple and don't even add new code, but merely makes existing one configurable, which is why I would hope it will be - despite Cheers and have a nice weekend. PS: Obviously I'd also hope that Cinnamon would make proper GPaste integration (isn't clipboard management something that neraly everyone wants?) as well as some system monitor applet part of the core |
Add-ons are good and pretty much required for a software like Cinnamon, and they rightfully get the same power any software would get, you need to stop expecting that add-ons are some magically sandboxed thing |
Cinnamon Spices are managed by the same upstream in the same GitHub organization. All contributed code is reviewed and the pipeline from submission to delivery is automated. The Spices infrastructure is also centrally managed. This is not Firefox or LibreOffice. The ecosystem is also built directly into Cinnamon and accessible via the system menus. Let's avoid assumptions here without facts. Many of the contributors to core also contribute Spices. The core feature that Spices offer is the option of immediacy for distribution rather than waiting for each new release or having to compile from source to get the latest updates. |
TL/DR:
Well that's good... but as laid out above, even then, the major issues remain:
Anyway... I merely made the above commits as I personally wanted that feature and then thought I'd do it properly in order to give something back (to Cinnamon... and the community). I mean I would have expected this from GNOME, where one only get's a new feature merged if at the same time one removes at least 5 others and breaks at least one major functionality. It's you guyβs project... take the commits if you want them... and if not.. no problem either. π |
There are Spices that offer this functionality and Mint ships with software that notifies on available updates as well. The threat factor is minimized though: Spices do not run with elevated permissions by default and anything that does require it requests with a user-visible prompt.
It's a different distribution model. Again, it is maintained and reviewed, no different than the core.
Again, this functionality is directly built into Cinnamon. It's all one ecosystem.
I took issue with some of the assumptions you made and continue to make. I haven't reviewed the pull request. Please don't make a habit of launching into assumptions of things you don't understand. If you have the time, I would encourage you to look into the infrastructure so that you can correct some of your assumptions. There is code in core and in the individual Spices repositories. It's very hard to contribute effectively from an uninformed position. π |
Here's my opinion. First of all, thank you. It might sound silly, but that's the most important thing here. Thanks for making a PR. It's always appreciated, by me anyway and I think by most people. No matter what the change implements and how it implements it, I'm glad people take the time to contribute. We don't always have the resources to answer quickly, to give proper feedback and to make sure people are welcome and treated nicely when they try to help. At least I can say this, I really appreciate it. Second, although Rick is right in what he says, I do see a difference between core and extensions. At least when it comes to users, some of them don't add extensions, won't add extensions, it's not part of the core experience obviously. Third, we do suffer from configuration overkill and GNOME is right in trying to minimize configuration. It's also much easier not to accept unnecessary configuration options than to remove them once they've been accepted. GNOME is brutal when it comes to that, we're not. I'm about to start working on the new menu, I can't just make it better, faster.. I also need to make sure I support all the configuration that crept into it until now. It's a bit like technical debt in a way, it gets in the way of fixing bugs, redesigns and improvements. Now when it comes to this PR. I think this is overkill. Not just because most people don't need it, but also because people who do need a quick way to perform a non-default endsession action can do it with a keyboard shortcut. For this reason I'd argue it shouldn't go in. From a technical point of view:
|
@leigh123linux mentioned to me that we didn't have shortcuts for Shutdown/Restart. ![]() The Shutdown and Logout shortcuts don't shutdown or logout, they pop up the endsession dialogs. They should be rephrased to be more explicit. I think we should also expose actual actions for shutdown and restart. |
Well, it's just my personal opinion, but OTOH I wouldn't be surprised if quite some users particularly of Cinnamon would share it. GNOME is not right in doing so. And weren't these points amongst if not the main reasons for Cinnamon to be even started? No offence meant, I merely say this with my users (who uses Cinnamon basically since shortly after GNOME shell came and since it got packaged for Debian) hat on: And yes, it's clear that more functionality makes maintenance more difficult, and that you also have to live with some changes you cannot really influence if you want to keep with the base libs.
That's the only kind of reason I'd say actually speaks against... but ... ;-)
Well the main reason I didn't do it is, because I'm not really good in GUI programming ^^ ... and since I thought it would be better to allow a list of defaults, one would need some GUI widget where one can e.g. drag&drop elements to some order but also completely disable them?
I'd agree, I merely choose CSM, because the first setting that seemed directly related to the shutdown dialog was
Originally I even had planned to only make one default (which would have made it even more simpler), but then I realised that it actually may be more common that an option isn't available than one might think. Some 1-2 years ago I learned the hard way, that Cinnamon get's the info which methods are available from systemd (or logind, IIRC)... and that started claiming that hibernate wasn't available.
Well rather to cancel, IMO.
Well... I also only learned during this little exercise, that the red colour de jure doesn't mean default ;-) ... but it actually seems there is a blueish colour which is chosen for the default, when that's not also destructive. In principle the idea of having two colours would be nice... but I guess users would only realise the meaning if this would be used more broadly. Again, I could change the commits to always make the default one destructive (and restart not in addition), but seems pointless now.
And "Shut down" is a bit of a misnomer, because it actually just displays the dialog that lets you choose.
Well thanks for the nice words. Likewise I appreciate the work you guys do which gives me a pretty good desktop, though I would of course have some wishes for further customisation and things like GPaste integration. Still, should I now ever cross my lazyness threshold again and would want to contribute something, I'd probably feel the need to get green-lit first, whether a new functionality would be even accepted. I kinda expected that any review discussions might be about my JS coding being π©π ... not about whether the feature itself is acceptable. Anyway... far too much discussion about not much. I guess it's best if I simply patch my JS file on every upgrade to default to hibernate and this PR being rejected whatsoever. Cheers, PS:
Overkill. π (sorry, couldn't resist π) |
π |
I think this shows already why making things quite configurable has also advantages: everyone has personal tastes that fit his uses cases better or worse :-) I for example rarely select shutdown/restart/hibernate/etc. via the menu. I simply press my powerbutton and am quite happy with the (current) dialog there giving me the choice of how I want to end the session. To make things even more convoluted O:-) ... having Switch User and Logout in their own dialog, makes sense when one looks at it from the PoV of the system being shut down) or at least suspended. |
Hey there.
This requires linuxmint/cinnamon-session#188 to be in place.
It basically makes the shutdown dialog's default action configurable, considering also that an action may not be available at all (which is why the setting is a list of strings, rather than e.g. a single enum).
I'd really be happy if this feature was accepted, I'd be longing for it since years (and finally crossed my laziness threshold ^^).
Please review (I'm not really a JS guy and completely new to Cinnamon's codebase).
Thanks,
Chris.