![]() As described earlier, we could have written s2idle to /sys/power/mem_sleep and then written mem to /sys/power/state instead to achieve the same result, but this would seem to be a more confusing way to do so. ![]() Note that no additional write of s2idle to /sys/power/mem_sleep is necessary, as the freeze write to /sys/power/state automatically uses s2idle (Suspend-To-Idle). įinally, we can also make a freeze script as follows: If deep is already selected as the current default, it will show as. This will only work if deep is an actual option on your system (remember to run cat /sys/power/mem_sleep to discover the memory sleep modes, and ensure deep is one of them). We took the extra step of writing deep to /sys/power/mem_sleep to be on the power-safe side, and to avoid Idle-To-Suspend. We define our sleep.sh script as follows:Įcho deep | sudo tee /sys/power/mem_sleep This will hibernate our system to disk (and turn off the computer) provided that we have sufficient swap space as described earlier in this guide.Ĭhanging this script to Suspend-To-RAM/Memory is now easy: simply swap the word disk to mem. Next we sleep for 3 seconds using sleep 3.įinally, we write (using echo) the word disk to /sys/power/state using tee (see man tee for more information if this is of interest, basically tee reads from standard input and writes to a file here) and sudo. The only purpose here is for subsequent sudo commands (like the last one) not to require us to enter authentication, as it is kind of hard to type a password into a terminal when your screen is locked already )Īfter this we invoke the operating system and choice of desktop/GUI/window manager specific lock command, being xflock4 for xcfe in Linux Mint 20. We simply invoice sleep 0.1 as a dummy command. In the first line we invoke sudo to enable root/super user level authentication. ![]() For this guide, we will use Linux Mint 20 running xcfe.Įcho disk | sudo tee /sys/power/state # Requires sufficient swap space Implementation of this will depend on the operating system, as well as the chosen Desktop/GUI.Ī quick search in your favorite search engine for lock Linux Distribution GUI from the command line where screen is an optional word/search term, Linux Distribution is the name of your Linux distribution, and GUI is the name of your GUI (like xcfe for example), will reveal one or more ways to lock your terminal from the command line. We thus need a script which will not just hibernate, sleep or freeze our machine but also one which will lock our desktop for us. An easier way to do things, and presumably the default way on all modern Linux operating systems, would be to simply leave /sys/power/mem_sleep set to deep and write freeze to /sys/power/state to Suspend-To-Idle, and to write mem to /sys/power/state to Suspend-To-RAM. Note also that it is thus possible to use two different ways to Suspend-To-Idle: either by writing freeze to /sys/power/state, or by writing s2idle to /sys/power/mem_sleep and subsequently writing mem to /sys/power/state.Īs you can see, the terminology used is slightly confusing and intermixed due to the presence of the /sys/power/mem_sleep file. Suspend-To-RAM, which is set by using deep in /sys/power/mem_sleep) rather than the Suspend-To-Idle mode as signified by s2idle. ) on all Linux operating systems, simply because when one sets the /sys/power/state option to mem, one would expect the system to write the contents to memory (i.e. Windows users who find Rufus confusing can also use Etcher, as the tool is also available for Windows.Generally speaking I would expect this option to be set by default to deep by default (as indicated by Etcher doesn't have many settings, but it works well the overwhelming majority of the time. Like Rufus, Etcher is tiny, very fast, and comes with a great GUI that makes the tool incredibly simple to use. Linux and macOS users should use Etcher, an open-source USB-burning tool. Furthermore, Rufus can detect the type of ISO you are attempting to burn and apply a common setup for any tiny Linux distro. It has decent customization options and can automatically detect your USB flash drive. Rufus is one of the fastest, smallest, and easiest USB-burning tools available for Windows users. However, the best recommendation for Windows users will be Rufus, while Linux and macOS users should try Etcher. There are numerous tools you can use to create a bootable USB flash drive. You'll need to burn the tiny Linux distro to bootable media before doing anything else. The first thing you need is a tool to create a bootable USB flash drive. Here are nine of the smallest Linux distros that need almost no space! Before You Start: How to Create Bootable USB Flash Drives
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |