Mabox do not lock the screen after suspend

My dconf looks fine, all the locks enabled.
I can lock using Super + L, but not after suspend.

Tried with i3lock and with betterlockscreen (and its systemd service), but no luck.

I wonder if this issue is related.

2 Likes

For those having the same problem, you can do this workaround:

Right click on the power button to edit the exit.csv file

On the Suspend line, it must say
Suspend,mbscreenlocker && systemctl suspend,system-supend

Save the file, and on the Preferences menu, select Reconfigure Openbox.
Now suspending through the menu button should lock the screen.

This workaround will not lock the screen if you use the physical button.

4 Likes

I was going through the same problem, when I closed the lid of my laptop and it wouldn’t lock or suspend because there was an alert on the screen saying that I couldn’t use any tool to lock the screen.

But I managed to find a solution to my problem after doing some research.

In the first comment by Zulan on the Arch Linux forum, he mentions about xflock4, and leaves a link to an article on the Arch Linux wiki where I was able to find a solution.

Where I found the following command.

xfconf-query --create -c xfce4-session -p /general/LockCommand -t string -s "light-locker-command --lock"

And replaced it with.

xfconf-query --create -c xfce4-session -p /general/LockCommand -t string -s "mbscreenlocker"

To use the screen lock of Mabox with xfce4-power-manage.

With this, now whenever I close the lid of my laptop, it locks the screen and if I activate the suspension in the power settings, it suspends and locks the screen as well.

I apologize in advance if something is unclear, as I am Brazilian and understand basic English. However, seeing this post by Kiri, I was inspired to publish here as a response and want to help other people who may be experiencing the same problem and it may be a possible solution for this bug in Mabox, an Arch Linux distribution that I have enjoyed using.

5 Likes

Ill have to try this. I always chocked up my inability to suspend correctly to using a dumb chromebook.

Hello, eulukasthyago!

I found and tried this solution:

It worked in the sense that the message appears no more.

1 Like

Interesting, it’s another good solution, thank you for sharing :smiley:

Reading the post, i like to show how i manage the screen and lock + lid.

Xset for blanking, lock screen with betterlockscreen (or other locker, like i3lock).

Method without the need of xfconf. (xfce4-power-manager)


part 1: check blanking and lock


Lock screen when screen goes blank.

xss-lock is needed to be installed. (man xss-lock)

yay xss-lock

The following script need to be started during boot and checks every sec the dpms status.
MB HOTKEY [W-A-b] = enable/disable DPMS.

Script when screen goes blank (dpms on), betterlockscreen will start.

#!/bin/bash

watch -n 1 /usr/bin/xss-lock -- /usr/bin/betterlockscreen --lock

part 2 : lid closed


Below i recently started to use. When lid is closed display goes off and in my case betterlockscreen goes on.

To automatically turn off the display when the laptop lid is closed.

  1. Install acpid if it’s not already installed. acpid is a daemon that handles ACPI events.

    sudo pacman -S acpid
    
  2. Enable and start the acpid service:

    sudo systemctl enable acpid
    sudo systemctl start acpid
    
  3. Create an ACPI event script to run a command when the lid is closed.

    sudo nano /etc/acpi/events/lid
    

    Add the following lines to the file:

    event=button/lid.*
    action=/etc/acpi/lid.sh %e
    

    This configuration tells acpid to run the /etc/acpi/lid.sh script when the lid button is pressed.

  4. Create the lid script:

    Create the script that will turn off the display when the lid is closed:

    sudo nano /etc/acpi/lid.sh
    

    Add the following lines to the script:

    #!/bin/sh
    
    case "$1" in
        button/lid)
            case "$3" in
                close)
                    # When the lid is closed, turn off the display
                    su -l `yourusername` -c 'export DISPLAY=:0; xset dpms  force off
                    exec /usr/bin/betterlockscreen --lock'
                    ;;
                open)
                    # When the lid is opened, turn on the display
                    su -l `yourusername` -c 'export DISPLAY=:0; xset dpms force on'
                    ;;
            esac
            ;;
    esac
    

    Make sure to replace yourusername with your actual username. This script uses xset to turn off the display when the lid is closed and turn it back on when the lid is opened.

  5. Make the script executable:

    sudo chmod +x /etc/acpi/lid.sh
    
  6. Reload the acpid service:

    sudo systemctl restart acpid
    

Now, when you close the laptop lid, the display should turn off, and when you open the lid, the display should lock.


get dpms status …

xset q

:bird:

edit:typo

3 Likes