Skip to content

Instantly share code, notes, and snippets.

@keuv-grvl
Created February 2, 2023 09:19
Show Gist options
  • Save keuv-grvl/26700f9c73b5f434b59cad3199122e29 to your computer and use it in GitHub Desktop.
Save keuv-grvl/26700f9c73b5f434b59cad3199122e29 to your computer and use it in GitHub Desktop.
Lock and turn off your screen on Pop!_OS

(properly) Lock and turn off your screen on Pop!_OS 22.04 LTS

Pop!_OS does not turn off your screen when you lock your screen. Where you hit tue Super+L shortcut, it seems to start some screensaver which display a black image and coincidently lock your session. But the screen itself does not go to its standby mode.

Here is my solution:

  1. Nuke the <Super>l shortcut occurences:
    • List conf keys: {dconf dump / ; gsettings list-recursively } | less
    • Use dconf-editor to unset them
  2. Copy the lock_and_turnoff_screen file to /bin/ or /usr/bin/ or some ${PATH}-accessible directory
  3. chmod +x /bin/lock_and_turnoff_screen
  4. Setup a custom shortcut via the Gnome controle center
    Name: Lock screen
    Command: /bin/lock_and_turnoff_screen
    Shortcut: <Super>+l
#!/usr/bin/bash
dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock \
&& sleep 3 \
&& xset dpms force off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment