Skip to content

(Its not an issue) A Guide : How to use ScreenLock while opening and closing the Laptop's lid #568

@arnav4o4

Description

@arnav4o4

App required : xfce-power-manager , bc

To install : yay -S xfce-power-manager bc

1️⃣ Create the missing key

xfconf-query -c xfce4-session \
             -p /general/LockCommand \
             -n -t string \
             -s "/home/ **username** /.config/bspwm/bin/ScreenLocker"
  • -n / --create – creates the property if it isn’t there.
  • -t string – tells xfconf the value type (a plain string).

You can verify it afterwards:

xfconf-query -c xfce4-session -p /general/LockCommand
# → should output the full path to ScreenLocker

2️⃣ Make sure the script is executable

chmod +x /home/ **username** /.config/bspwm/bin/ScreenLocker

3️⃣ Configure XFCE‑Power‑Manager to use the lock command

Run xfce4-power-manager-settings on terminal

  1. In the System tab, set “When laptop lid is closed” to “Lock screen”.

    The power manager will now call the LockCommand you just created.


4️⃣ Test the integration

# Direct test – should show your custom lock screen
/home/ **username** /.config/bspwm/bin/ScreenLocker

# XFCE‑triggered test
xfce4-session-logout --lock
# → same lock screen appears

# Lid‑close test (or simulate)
loginctl lock-session
# → lock screen appears

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions