Rofi Lock Screen Script


#1

Hello,

I pulled up the Rofi script at “./bin/rofr.sh”, 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:
-l|–logout)
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
esac
done

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.

Thanks!


#2

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?


#3

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?


#4

@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.


#5

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.


#6

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


#7

That fixed it, thank you!


#8

Did the file move? I’m not seeing ./bin/rofr.sh anymore from a more recent install.


#9

Yea I’m stumped here:

█▓▒░user@core█▓▒░ Tue Jan 15 08:02:10pm 
/usr/bin/ rofi                                                                 20:02:10
 -> external command
rofi                    rofi-sensible-terminal                        
rofi_run                rofi-theme-selector 

rofi is unreadable and rofi_run does not open a config file.

According to ~/.config/i3/config:

# logout script
bindsym $Mod+x exec --no-startup-id rofi_run -l

#10

which rofi_run


#11

rofi_run -l


#12

Sorry man I’m am largely lost here, what are you trying to do?

My above post is not a question but a command, which will show you the canonical path of the command being executed so in this case it would tell you that rofi_run is located at ~/bin/rofi_run this is the best way to find what is actually being run when using a command.

Files in the user home (~/) are subject to change, once a user is created, the files are copied to their home and never touched again (updates will only change /etc/skel and other system locations), for this reason I suggest people retain their own version when migrating to a new version.


#13

Thank Nate, understood. I am trying to find the rofi config file which I can change
*Lock) i3lock-fancy ;; to be *Lock) sleep 0.5 && i3lock-fancy ;.

As it stands, the timing is too quick for i3lock’s screenshot, as it captures the rofi_run -l screen, and I was hoping to give it the delay you mentioned.


#14

Ok got ya, yea this will tell you where it is (it’s in ~/bin)

which rofi_run

Also of note, it’s not a config but an executable shell script.

Could also copy /usr/bin/i3lock-fancy to ~/bin and make changes there, it’s also just a shell script.


If you’re still having trouble finding it let me know.