Skip to content

Instantly share code, notes, and snippets.

@pnchinmay
Forked from elsholz/i3wm_media_lock.md
Created January 15, 2023 10:58
Show Gist options
  • Save pnchinmay/36113f2aa6cc7782ee924d2527abe199 to your computer and use it in GitHub Desktop.
Save pnchinmay/36113f2aa6cc7782ee924d2527abe199 to your computer and use it in GitHub Desktop.
How to create a transparent lock screen in i3wm. Locks screen, but shows no lock screen. Unlocks as usual, if correct password is entered.

i3wm Transparent Lock screen.

Warning: If executed multiple times, unlock isn't possible anymore, use with caution!

Description

Block computer for input, but remain graphical output as usual. Can be used for example to watch a movie on your laptop but forbid any input during that.

Downside

Not tested thouroughly yet, and only tested on Debian 9 probably won't work if you already use Compton

Instructions

Install required programs

sudo apt install compton

Extend your i3 config

Add (depending on what you want) the following lines to your i3 config at ~/.config/i3/config

  • bindsym $mod+m exec ~/.config/i3/lock_transparent.sh

Create the script that locks the screen

Create file ~/.config/i3/lock_transparent.sh with the following contents:

#!/bin/bash

compton --config ~/.config/compton/compton.conf -f & 
i3lock_standard -n
pkill compton

execute chmod +x ~/.config/i3/lock_transparent.sh to make the script executable

Compton config

Create file ~/.config/compton/compton.conf with the following contents:

mark-ovredir-focused = true;
inactive-opacity = 0.7;
opacity-rule = [ "0:name *= 'i3lock'" ];

might need to restart or login again, not sure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment