1

This is an odd one, but is there a way to change my GNOME lock screen (not Debian's login screen, mind you) to i3WM's super minimalist circle lock screen? I love it but don't want to use i3 all the time just for the lock screen.

Debian 12

1 Answer 1

0

Ensure packages are installed

sudo apt update sudo apt install i3lock xss-lock gsettings 

Create a Lock Replacement script like below

#!/bin/bash # -------------------------------------------------------------------- # End-to-End Script to Replace GNOME Lock Screen with i3lock # # This script: # • Checks for required dependencies (i3lock, xss-lock, gsettings) # • Disables GNOME's built-in lock screen # • Launches xss-lock to trigger i3lock with a custom background image # # Usage: Save this file (e.g., ~/bin/lock-replacer.sh), make it executable, # then run it or add it to your session's autostart. # ---------------------------------------------------------------------- set -e # --- 1. Check Required Dependencies ------------------------------- for cmd in i3lock xss-lock gsettings; do if ! command -v "$cmd" &>/dev/null; then echo "Error: '$cmd' is not installed. Please install it and try again." exit 1 fi done # --- 2. Disable GNOME's Built-in Lock Screen -------------------------------- echo "Disabling GNOME's built-in lock screen..." gsettings set org.gnome.desktop.screensaver lock-enabled false # --- 3. Configure i3lock --------------------------------------------- # Set the path to your desired background image for i3lock. # Ensure this image exists; otherwise, the script will exit. BACKGROUND_IMAGE="$HOME/.config/i3lock/background.png" if [ ! -f "$BACKGROUND_IMAGE" ]; then echo "Error: Background image not found at '$BACKGROUND_IMAGE'." echo "Please set BACKGROUND_IMAGE to a valid image file path." exit 1 fi # --- 4. Start xss-lock with i3lock ---------------------------------- echo "Starting xss-lock with i3lock..." # xss-lock listens for X idle events and launches i3lock. xss-lock -- i3lock -i "$BACKGROUND_IMAGE" & # --- 5. Instructions for Manual Locking ----------------------------- MANUAL_LOCK_CMD="i3lock -i \"$BACKGROUND_IMAGE\"" echo "Setup complete." echo "To manually lock your screen, run:" echo " $MANUAL_LOCK_CMD" echo "Or configure a custom keyboard shortcut with this command." # --- 6. Keep Script Running -------------------------------------------------- # The script waits so that xss-lock stays active. wait 

Save this file as lock_replacer.sh in your path. Change the permission to executable with following command

chmod +x ~/lock_replacer.sh 

Assuming the lock_replacer.sh is in your home path.

Use AutoStart in GNOME to get this executable run every time it is booted.

mkdir -p ~/.config/autostart sudo apt install vim vi ~/.config/autostart/i3lock-replacer.desktop 

In this file configure it like below

[Desktop Entry] Type=Application Name=i3lock Replacer Exec=/home/yourusername/lock-replacer.sh X-GNOME-Autostart-enabled=true Comment=Replace GNOME lock screen with i3lock 

Save and close this file.

Run the file with setting custom shortcuts to add the desired shortcut to the above script.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.