1. Home
  2. Linux
  3. How to schedule restarts and shutdowns on linux

How to schedule restarts and shutdowns on Linux

Ever wanted to schedule when your Linux PC turns off? With the Time Switch app, you can. It allows you to schedule when your Linux system powers off when it reboots or even suspends. Here’s how to get it working on your system.

How to install Time Switch on Linux

Before you use the Time Switch application to schedule operations on your Linux PC, you will need to install the software. Currently, it is possible to install Time Switch via the Flathub app store as a Flatpak. Alternatively, you can also install Time Switch on Arch Linux User Repository.

To start the installation, you must open up a terminal window on the Linux desktop. To open up a terminal, press Ctrl + Alt + T on the keyboard. Or, search for “terminal” in the app menu and launch it that way.

With the terminal window open, the installation process is ready to begin. Follow the Time Switch application instructions below to learn how to get the app working on your system.

Arch Linux installation instructions

If you’re an Arch Linux user, you’ll be able to install the Time Switch application via the Arch Linux User repository. To start the installation process, use the pacman -S command to set up the “git” and “base-devel” packages.

sudo pacman -S git base-devel

After installing the two packages, use the git clone command to download the Trizen AUR helper app. This program will aid in installing software like Time Switch, as most programs from the AUR need to be compiled from the source code.

git clone https://aur.archlinux.org/trizen.git

Once you’ve downloaded the Trizen tool to your Arch Linux system, you can use the CD command to access the “trizen” folder.

cd trizen/

From here, you can install the Trizen package using the makepkg command.

makepkg -sri

With the Trizen application set up on your Arch Linux system, you can download and install the Time Switch application on your Arch system using the following trizen -S command.

trizen -S timeswitch-git 

Flatpak installation instructions

If you’re not on Arch Linux, you’ll need to install the Time Switch application on your computer via the Flathub app store as a Flatpak. To install the software, start by setting up the Flatpak runtime on your computer. You can get it set up by following our in-depth Flatpak setup guide.

After installing the Flatpak runtime on your computer, use the flatpak remote-add command to add the Flathub app store to your system.

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

With the Flathub app store set up, you can install the Time Switch application on your Linux PC with the following installation command.

flatpak install flathub io.github.fsobolev.TimeSwitch

How to use Time Switch on Linux

Despite being a fairly small program, Time Switch has a ton of powerful features. These features include timed power off, timed reboot, timed suspend, timed custom notifications, and even timed custom terminal commands! In this guide, we’ll go over how you can use it to schedule shutdowns and reboots.

To use the Time Switch app, you’ll need to open it up. Launch the Time Switch app from the app menu on the Linux desktop. Or, use the command below.

flatpak run io.github.fsobolev.TimeSwitch

How to set up timed power off

If you plan to shut your computer off at a specific time using Time Switch, do the following. First, find the Time Switch clock area (the place with 00:00:00). The timer section is laid out in the following format.

HR:MIN: SEC

For example, to restart your Linux PC in one hour, go to the HR section of the timer area of Time Switch, and enter “1”. Or, to shut it off in 30 mins, go to the MIN section of the timer area and enter “30”.

Once you’ve customized the time in which you wish to power off your Linux PC, find the “Start” button, and click on it with the mouse. Upon selecting “Start,” the timer will begin. When the timer completes, your Linux PC will reboot.

How to set up a timed reboot

If you wish to set up a timed reboot with Time Switch, do the following. First, select the “Reboot” option. Then, make your way to the Time Switch Timer, and enter your time. For example, to reboot in 1 hour, add “1” to the “HR” portion of the timer. Note that the timer is laid out as HR:MIN: SEC.

After entering your time, find the “Start” button, and click on it with the mouse. When you select this button, the timer will begin in Time Switch. When the timer is complete, your system will reboot itself.