You are not logged in.

#1 2016-02-07 13:40:20

gurkan
Member
Registered: 2016-02-01
Posts: 28

[SOLVED]sxlock doesnt work like I want to

Hi!

I have installed sxlock ( https://aur.archlinux.org/packages/sxlock-git/ ) and cant get it to work properly on Fluxbox. After an hibernate Im getting stright to the Fluxbox environment ( I want to get asked for a password to get access). When Im trying to follow this tutorial ( https://github.com/lahwaacz/sxlock ) Im stuck since it cant find a directory when Im typing "sudo systemctl enable sxlock".

Am I way off and should do something different? Bare with me, Im still a fresh noob. Any help is much appreciated.

I can mention that if I type "sxlock" in terminal it works, but its the hibernate thing I want to work.

Its maybe easier to get another screen locker to work with Fluxbox?

/Gurkan

Last edited by gurkan (2016-02-10 05:20:11)

Offline

#2 2016-02-07 14:55:04

ymihc
Member
Registered: 2016-02-03
Posts: 21

Re: [SOLVED]sxlock doesnt work like I want to

From the github page of sxlock that you've mentioned:

When using systemd, you can use the following service (create /etc/systemd/system/sxlock.service) to let the system lock your X session on hibernation or suspend:

[Unit]
Description=Lock X session using sxlock

[Service]
User=<username>
Environment=DISPLAY=:0
ExecStart=/usr/bin/sxlock

[Install]
WantedBy=sleep.target

Have you actually created and adjusted the entry above?

An advice for posting problems in forums: Try to describe as detailed as possible (including used commands / terminal outputs) what you have done so far. That makes it a lot easier to understand your problem and what might have gone wrong. I advice you to read the forum etiquette and smart questions.

Offline

#3 2016-02-08 05:28:52

gurkan
Member
Registered: 2016-02-01
Posts: 28

Re: [SOLVED]sxlock doesnt work like I want to

Sry for my bad explonation. No I didnt create the "sxlock.service" at first, I was too dumb to understand. But now I have done so and the "sudo systemctl enable sxlock.service" works (doesnt complain it cant find sxlock.service). But after a hibernation it still wont work. I have also changed "username" to my username in the entries. Is there something else I should change?

I should use the "systemctl enable" to get it work, right? Or I am missing something out?

And yes, my hibernation works as it should!

Offline

#4 2016-02-08 06:28:44

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,475

Re: [SOLVED]sxlock doesnt work like I want to

post output of

systemctl status sxlock.service

I am running similar service with slock as below, which works

[Unit]
Description=sharad resume actions
After=sleep.target

[Service]
User=sharad
Environment=DISPLAY=:0
ExecStart=/usr/bin/slock
ExecStartPost=/usr/bin/sleep 1

[Install]
WantedBy=sleep.target

Last edited by Docbroke (2016-02-08 06:30:38)

Offline

#5 2016-02-08 07:10:14

gurkan
Member
Registered: 2016-02-01
Posts: 28

Re: [SOLVED]sxlock doesnt work like I want to

Thanks! I will post the output status  when I get home. But I can see know that I dont have "ExecStartPost=/usr/bin/sleep 1". Maybe Im missing something in the entries...

Offline

#6 2016-02-08 11:25:09

ymihc
Member
Registered: 2016-02-03
Posts: 21

Re: [SOLVED]sxlock doesnt work like I want to

Have a look in the Wiki regarding power management and sleep hooks: https://wiki.archlinux.org/index.php/Po … leep_hooks
Maybe you just have to replace sleep.target by hibernate.target?

Offline

#7 2016-02-08 13:03:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: [SOLVED]sxlock doesnt work like I want to

hibernate.target pulls in sleep.target.  If you want this to only run when hibernating but not when suspending, then use hibernate.target - but if you want it to run when suspending or hibernating, sleep.target should be used.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2016-02-08 18:20:43

gurkan
Member
Registered: 2016-02-01
Posts: 28

Re: [SOLVED]sxlock doesnt work like I want to

Something is disabled and have failed, but I cant figure outwhat it is...

My output of "systemctl status sxlock.service" is:

● sxlock.service - Lock X session using sxlock
   Loaded: loaded (/etc/systemd/system/sxlock.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since mån 2016-02-08 19:17:31 CET; 2min 39s ago
  Process: 2143 ExecStart=/usr/bin/sxlock (code=exited, status=217/USER)
Main PID: 2143 (code=exited, status=217/USER)

feb 08 19:17:31 archi7power systemd[1]: Started Lock X session using sxlock.
feb 08 19:17:31 archi7power systemd[1]: sxlock.service: Main process exited, code=exited, status=217/USER
feb 08 19:17:31 archi7power systemd[1]: sxlock.service: Unit entered failed state.
feb 08 19:17:31 archi7power systemd[1]: sxlock.service: Failed with result 'exit-code'.
[gurkan@archi7power ~]$

Offline

#9 2016-02-08 19:55:27

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED]sxlock doesnt work like I want to

gurkan wrote:

feb 08 19:17:31 archi7power systemd[1]: sxlock.service: Main process exited, code=exited, status=217/USER

Make sure the user you specified is valid. And please use code tags when posting output.

Offline

#10 2016-02-10 05:18:50

gurkan
Member
Registered: 2016-02-01
Posts: 28

Re: [SOLVED]sxlock doesnt work like I want to

Raynman wrote:
gurkan wrote:

feb 08 19:17:31 archi7power systemd[1]: sxlock.service: Main process exited, code=exited, status=217/USER

Make sure the user you specified is valid. And please use code tags when posting output.


Geez, Im sorry for my stupidness. I have typed my username wrong! Now it works like it should. Thanks for the help!

Offline

Board footer

Powered by FluxBB