My Quick Notes

Ain't Nobody Got Time to Read

March 11, 2026

Hyprland - Pixelated your screen when locking

Dependencies:

  • grim: to take screenshot.
  • ImageMagick: to edit image.
  • Create script ~/.local/bin/lock_screen.sh with content:

    #!/bin/bash
    
    # Take screenshot
    grim /tmp/screen.png
    
    # Pixelate it
    convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
    
    # Optional: Add a overlay image at center
    # convert /tmp/screen.png <your_image> -gravity center -composite -matte /tmp/screen.png
    
    # Lock screen
    hyprlock
  • Add execute permission:

    chmod +x ~/.local/bin/lock_screen.sh
  • Edit ~/.config/hypr/hyprlock.conf to use /tmp/screen.png for background:

    background {
        path = /tmp/screen.png
    }
  • Edit ~/.config/hypr/hyprland.conf to use lock_screen.sh when press Window+L:

    # Lock screen when press $mainMod + L
    bind = $mainMod, L, exec, ~/.local/bin/lock_screen.sh
  • Edit ~/.config/hypr/hypridle.conf to use lock_screen.sh for lock command:

    general {
        lock_cmd = pidof hyprlock | ~/.local/bin/lock_screen.sh
        before_sleep_cmd = loginctl lock-session
        after_sleep_cmd = hyprctl dispatch dpms on
    }
    
    listener {
        timeout = 300
        on-timeout = loginctl lock-session
    }
    
    listener {
        timeout = 360
        on-timeout = hyprctl dispatch dpms off
        on-resume = hyprctl dispatch dpms on
    }
PreviousRun vLLM with Docker on Fedora
NextSetup local agent on Raspberry Pi 5 with OpenClaw and Ollama

Comments