Score:1

How to configure Power Management by Command Line?

jp flag

I would like to configure Power Management by command line (CLI) on Ubuntu MATE.

I am already familiar with the GUI to configure Power Management on Ubuntu MATE 20.04 as shown below:

Control Center > Hardware >

  Power Management

    On AC Power tab

      Actions
        Put computer to sleep when inactive for:  Never

      Display
        Put display to sleep when inactive for:   Never


    General tab

      Actions
        When the power button is pressed:    Suspend
        When the suspend button is pressed:  Suspend

I would like to know the following three things.

  1. command statements on command line to set the values of Power Management as shown above

  2. the path to the configuration file that stores the Power Management configuration, and its keys and values to reflect the settings shown above

  3. how to force the new settings of Power Management to take effect promptly without rebooting the computer

Note in particular that, as "Never" indicates above, I want to prevent the display from being automatically put to sleep.

Score:2
zw flag

You can set and apply these settings using

  • GSettings backend with commands below:

    gsettings set org.mate.power-manager sleep-computer-ac 0
    gsettings set org.mate.power-manager sleep-display-ac 0
    
    gsettings set org.mate.power-manager button-power 'suspend'
    gsettings set org.mate.power-manager button-suspend 'suspend'
    
  • DConf backend with single long command below:

    cat <<EOF | dconf load /org/mate/power-manager/
    [/]
    sleep-computer-ac=0
    sleep-display-ac=0
    button-power='suspend'
    button-suspend='suspend'
    EOF
    
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.