Rofi Lock Screen Script



I pulled up the Rofi script at “./bin/”, so that I could attempt to remove the mini screen capture backdrop behind the ArchLabs logo for i3lock-fancy.

Upon analyzing I noticed that the following command was listed:
ANS="$(rofi -sep “|” -dmenu -i -p ‘System’ -width 20
-hide-scrollbar -line-padding 4 -padding 20
-lines 4 <<< “ Lock| Logout| Reboot| Shutdown”)"
case “$ANS” in
*Lock) i3lock-fancy ;;
*Logout) session-logout || pkill -15 -t tty"$XDG_VTNR" Xorg ;;
*Reboot) systemctl reboot ;;
*Shutdown) systemctl -i poweroff
esac ;;
*) echo; echo “Option does not exist: $arg”; echo; exit 2

i3lock-fancy doesn’t appear to specify anything that would tag on the mini backdrop.

Is there another script this script calls to and perhaps I am missing this?

When typing i3lock-fancy in a terminal, the mini backdrop is removed.



I’m sorry, can you please elaborate on what you mean by

Do you mean the menu that offers options to pick, or the pixelated image that is created when locking, or the image behind the lock?


I realized this actually a screenshot of the rofi logout menu getting caught. Is there a way to delay the screenshot timing so that rofi logout script has a chance to close?


@ionmod There are a plethora of scrot apps which will accomplish that, xfce4-screenshooter being at the top of my list.

However, easier and quicker to just open a terminal and…

scrot -d 5

the number ‘5’ being the delay duration in seconds.


This must be a recent thing, as it never used to do that. You can add a delay by editing the script

# change
*Lock) i3lock-fancy ;;

# to be
*Lock) sleep 0.5 && i3lock-fancy ;;

This will add a 0.5 second delay between choosing to lock the screen and the lock script being called.


I use teiler for all my screenshots. Great little tool.


That fixed it, thank you!