Ubuntu 20.04 has decided we need 4 clicks to shut down:
- Click top right of screen arrow-down
- Expand "power off/logout" panel
- Click "Power off"
- Confirm you want to power off by choosing power off vs reboot etc
Let's cut out at least 2 clicks here... how?
UPDATE: This is a "Lounge PC" - operated by mouse (no power button within reach as the laptop is closed). We watch a film, we want to click to shutdown and not type commands.
You can easily make it 2 clicks:
Now click the physical power button on your device and then select power off from the prompt - that is 2 clicks (1 if you don't count pressing the power button as a click).
Reduce by two clicks
Option 1) Install the Poweroff Button on Topbar extension by Darknico. It adds a separate Power button on the right of the top bar.
Option 2) Create a "regular" launcher for "Power Off" (with thanks to pomsky). Either:
You may reduce with one more click by substituting the command in the launcher with "poweroff". Then, a single click on the launcher will immediately shut down the machine without confirmation dialog.
Reduce by one click
Option 3) Use the extension Bring Out Submenu Of Power Off/Logout Button by Pratap, or Simpler Off Menu by K3rcus. These extensions bring the items in the "Power Off/Log Out" submenu directly into the system menu, allowing to access them with one less click.
Getting it down to 1 "click" (technically a button press):
By default, ubuntu shuts down the machine when you press the power button.
Then just wait 60 seconds for the machine to power off instead of clicking again.
I have the habit of creating my own keyboard shortcut to shutdown the PC because this is lot easier and less painful.
I have used too many buttons to avoid any accidental shutdown.
You can decrease it and make it like Super+P or something like that if you are careful enough.
The answer is 0.
Install KShutdown, specify how long are you going to be online. As long as you stick to the plan and not mess with the time and save whatever you're doing 2 minutes prior. The machine will turn itself off, without you even touching it.
If you want to write your own command, start the terminal and type:
+30 (minutes) is an example. Change it to however long you want to stay online. And if you want the machine to turn itself off at a specific time, try:
(time is hypothetical, change it to whatever you want).
Note: Without the
-h
or-r
switch it isn't a valid command.0 clicks, a few clacks.
An alternative solution that doesn't require a mouse (just keyboard):
This brings up a terminal window.
Sony TV remote suspends laptop via network control
tvpowered
(TV controls power to the computer) is a bash script that automatically suspends laptop when Sony Bravia TV is powered off. Additionally it will:Please note this only works with Sony Bravia TVs.
Overview
When TV is turned off
tvpowered
automatically suspends, hibernates or powers off the laptop. Change the setting ofSCTL
global variable to control which action is taken.tvpowered
should be run as a normal user and called in Startup Applications.Program design is straight forward:
In between these steps pop-up bubble messages appear on Desktop and are also logged to
journalctl
:tvpowered
scriptCopy and paste the script into a file on your computer and mark it executable with:
Where
/path/to/
is the directory name you created the file in.You can also user your file manager (like Nautilus) to make the file executable.
In the script below there are a few constants you will need to set:
tvpowered
complete bash scriptSummary
I was inspired by OP's question and never realized how cumbersome and time-consuming my end of day suspend process used to be:
tvpowered
has eliminated time consuming steps 1. through 4.Bonus - Turn of Light Behind TV
For nighttime viewing, there is a light behind the TV. Whenever the laptop goes to sleep, it first shuts off the light.
Create the script
/etc/NetworkManager/dispatcher.d/pre-down.d/smartplug_off
and place into it:I have a laptop by my television that I access with a wireless keyboard/touchpad device. I also keep the lid closed as well.
What I did is add a simple gnome extension called Gnome-Shutdown-Button. You can find a ton of these extensions at https://extensions.gnome.org/
It opens a dialogue that says "shutting down in 30 seconds" (it might be less) and offers a second option to shut down now.
in terminal
shutdown now
do the trick for me