SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-06-26 21:01:17

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

[RESOLVED] need help replacing xscreensaver with i3lock

Hi there folks!

Stock updated wally build.

I couldn't take it anymore and decided to swap xscreensaver for i3lock.  I followed this fine person's guide.  Although written for statler, it seems to be properly installed, I just need to fix a couple things before I try sharing a tip/trick thread.

1) Screenlock is working for keybind and timer.  Coming from suspend does not use it however even though it's checked in the xfce power management widget.  What do I need to do to get suspend to use i3lock?

2) I would like to pass some parameters to i3lock, like background color, for instance.  It's being started via autostart with the following line:

xautolock -time 1 -locker "i3lock" &

So where would I pass the parameters?  Would it be in the quotes with i3lock?

Thanks for your time!

Last edited by schwim (2013-06-29 02:31:17)

Offline

Help fund CrunchBang, donate to the project!

#2 2013-06-27 03:23:01

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Hi schwim. for color bg use

xautolock -time 1 -locker 'i3lock -c #111111' &

grill it | the rocky path may just be the best path

Offline

#3 2013-06-28 00:48:42

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Thanks a bunch for the response, dkeg.  Unfortunately, adding the color to the line as you suggested breaks xautolock and the screen just never shuts down.

I've searched a bunch, but haven't managed to make any headway at all on either issue.  Any other suggestions would be greatly appreciated!

Offline

#4 2013-06-28 01:19:59

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

dude, sorry, I'm a douche.   take out the '#'.  so it will read

xautolock -time 1 -locker 'i3lock -c 111111' &

grill it | the rocky path may just be the best path

Offline

#5 2013-06-28 01:24:26

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Haha, thanks a bunch smile  I was coming back to report success by removing the #.  My final line ended up being:

xautolock -time 1 -locker "i3lock -c 000000 -d -n" &

Thanks very much with your help on that.  Any thoughts on getting suspend to use i3lock?  I can't find anything so far in Google.

[EDIT]  I did find an arch thread(located here) but don't know if it applies here.  I can't find any similar file under /etc/systemd/system or /lib/systemd/system.[/EDIT]

Last edited by schwim (2013-06-28 01:31:43)

Offline

#6 2013-06-28 02:26:04

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

okay ... got it.  First, I never put any energy into this, just having the screen timeout to a locked screen was good enough, so thanks for the motivation. 
From the arch wiki
https://wiki.archlinux.org/index.php/Pm-utils
and this is my resulting script.  replace my -image flag with your -c 000000

#!/bin/bash
#
# screenlock: lock screen on hibernate or suspend
# place in /etc/pm/sleep.d
# chmod 755
# chown root:root

username=dkeg # add username here; i.e.: username=foobar
userhome=/home/$username
export XAUTHORITY="$userhome/.Xauthority"
export DISPLAY=":0"
case "$1" in 
	hibernate|suspend)
	   su $username -c "/usr/bin/i3lock -i /home/dkeg/.i3/i3lock_back.png"
	   ;;
	thaw|resume)
	   ;;
	*) exit $NA
	   ;; 
esac

Last edited by dkeg (2013-06-28 03:36:52)


grill it | the rocky path may just be the best path

Offline

#7 2013-06-28 03:39:40

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Thanks a bunch for your continued help!

It's getting closer, but the behavior is a little backwards, when I choose suspend, i3lock activates and then when I type my password, it goes into suspend mode.  When I bring the laptop out of suspend mode, i3lock doesn't activate.

Is there a way to get it to work on wake-up instead of when going to sleep?

Offline

#8 2013-06-28 03:44:07

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

I think I got it working:

#!/bin/bash
#
# screenlock: lock screen on hibernate or suspend
# place in /etc/pm/sleep.d
# chmod 777
# chown root:root

username=schwim # add username here; i.e.: username=foobar
userhome=/home/$username
export XAUTHORITY="$userhome/.Xauthority"
export DISPLAY=":0"
case "$1" in 
	hibernate|suspend)
	   ;;
	thaw|resume)
	   su $username -c "/usr/bin/i3lock -c 000000 -n -d"
	   ;;
	*) exit $NA
	   ;; 
esac

Does that look a-ok to you?

Last edited by schwim (2013-06-28 03:45:05)

Offline

#9 2013-06-28 04:01:54

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

hmm, that is  strange behavior.  so its working now as should?  works great for me in its original format.  when i suspend I do see it flash real quick before screen blackens.  but when I wake it up, no issues.   

I just tested the way you have it.  the susp is cleaner, no flash, but when I wake the machine up, it allows me to see my current session for a second or two before i3lock activates. 

So for me, I like the original method. 

see that I edited my original script post.  the chmod should now be 755 not 777.  it was a typo i noticed after the fact. 

glad its working though


grill it | the rocky path may just be the best path

Offline

#10 2013-06-28 04:14:02

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

for some reason, i3lock doesn't operate at all on wakeup with the script in it's original configuration, it goes straight to desktop, so I had to make the switch to get it to work as intended. I do notice a flash but I'm not sure if it's anything I can resolve.

Thanks a bunch for all the help.  I think it's all pretty clean now.

Offline

#11 2013-06-28 04:41:54

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Nice!  Worked out for both of us!   FWIW,  i'm not running #!


grill it | the rocky path may just be the best path

Offline

#12 2013-06-28 05:58:32

kbmonkey
#! Die Hard
From: South Africa
Registered: 2011-01-14
Posts: 879
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

I just modified the cb-lock script to use i3lock instead of xscreensaver, seeing as that already integrates into the system. Also I did not have that strange behaviour so no need for sleep.d scripts on my side, but that may only be because I don't have auto sleep, but a script to sleep.

Offline

#13 2013-06-28 12:08:22

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

That's right kb, i think I remember seeing that.  That's good work. 

schwim, if all is working, don't forget to mark solved!


grill it | the rocky path may just be the best path

Offline

#14 2013-06-29 02:34:31

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

kbmonkey wrote:

I just modified the cb-lock script to use i3lock instead of xscreensaver, seeing as that already integrates into the system. Also I did not have that strange behaviour so no need for sleep.d scripts on my side, but that may only be because I don't have auto sleep, but a script to sleep.

Boy, I wish I had thought of that before.  That would have been a much cleaner solution.

Well, for next time! smile

Offline

#15 2013-06-29 11:31:37

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

cleaner solution, how's that?   I would agree its a nice solution for bangers, wouldn't necessarily agree cleaner.  TEHO


grill it | the rocky path may just be the best path

Offline

#16 2013-06-29 12:25:32

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: [RESOLVED] need help replacing xscreensaver with i3lock

Only meant due to the fact that in my case, it was already implemented and only needed altering instead of removing and replacing. I did not intend to make it sound like yours was less of a solution.

Offline

#17 2013-06-29 13:13:46

dkeg
#! Die Hard
From: Mid-Atlantic Grill
Registered: 2011-12-05
Posts: 727

Re: [RESOLVED] need help replacing xscreensaver with i3lock

oh no, definitely not what I meant.   just a simple question of why cleaner, as opposed to simpler.  I'm thinking more universal here b/c a lot of members don't use cb or cb-exit tool.  I missed the fact that you removed the cb-tool, although TBH, suspending and hibernating through the terminal is way quicker and easier.  set up some aliases.   Quick and easy  . 
some of my aliases:
susp
reboot
poweroff

we both learned something new, so guess that's what its all about.  as cbiz would say ... viva la linux ... or something like that


grill it | the rocky path may just be the best path

Offline

#18 2015-07-04 15:36:44

tynman
Member
From: Edmonton, Canada
Registered: 2015-04-26
Posts: 22

Re: [RESOLVED] need help replacing xscreensaver with i3lock

As mentioned by kbmonkey way back in 2013, I too chose to implement the i3lock screen locker by updating the cb-lock script. I just wanted to report that this method worked good for me with respect to #!'s Suspend implementation.

Instructions:

- edit /usr/bin/cb-lock
- It consists of a single if-then-else statement
- in the else portion, replace the call to xscreensaver-command with:

i3lock -i /usr/share/backgrounds/fabric-tile-2.png -t

For the -i parameter, any "png" image file will do. The fabric-tile-2.png file would be a reasonable choice for a "screen saver", although for LCD monitors, I guess we don't really need to worry about image burn-in. I have xautolock and xfce4-power-manager set up so the fabric-tile-2.png image only displays for a couple of minutes and then the monitor gets put to sleep (a feeble attempt to lower my carbon footprint ?).

I think the remainder of the cb-lock script handles the case of running #! in live-iso mode, so it would probably be safe to just replace the entire script with the call to i3lock. But I'm timid about hacking perfectly good, working code, so I chose to just update the one line that needed to change.

Ben

(I'm running Debian 8.0 / Wally -- AFAIK, the cb-lock, exit, suspend stuff in Wally is unchanged from #! Waldorf.)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo