Git Product home page Git Product logo

Comments (6)

Airblader avatar Airblader commented on May 9, 2024

I uses non-forking with a trap:

trap "…" EXIT

Seems to work fine for me. Why do you fork if you want to wait anyway?

from i3lock.

GuillaumeSeren avatar GuillaumeSeren commented on May 9, 2024

Hey Airblader,
thank's for your quick reply.

I know I can watch the PID and launch my command after, it works I did it in my wrapper script,
but it break the suspend.

So maybe I miss something, but I think forking is needed to let the suspend work.

from i3lock.

stapelberg avatar stapelberg commented on May 9, 2024

I think you should explain how you are running that script so that we get a bit more context.

from i3lock.

GuillaumeSeren avatar GuillaumeSeren commented on May 9, 2024

Hello @stapelberg , yes this is how I do

I created a systemd service, like explained in the debian / arch wiki here: https://wiki.debian.org/ScreenLockingOnSleep and here: https://bbs.archlinux.org/viewtopic.php?pid=1170536#p1170536

[Unit]
Description=i3lock
Before=sleep.target

[Service]
User=username
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -d -e -f -c 000000

[Install]
WantedBy=sleep.target

Then enable it, in systemd and you go, you have to unlock after come back from suspend, witch is want we want.

But I am searching a way to trigger on the 'unlock event' witch basically is end of the pid of i3lock to launch some command on unlock, here deactivate DPMS of my screen, but could be useful for many things.

So if I have done a script witch poll the pid of a running i3lock to check it, it work for locking only but it didn't work for locking + suspending (in my test at least), so I would like to embed the call to a script in i3lock.

Guillaume

from i3lock.

stapelberg avatar stapelberg commented on May 9, 2024

@GuillaumeSeren I think what you should do (based on what you describe you want) is create a service file with After=sleep.target, see also https://bbs.archlinux.org/viewtopic.php?id=151640

There’s nothing we need to change in i3lock for your use case.

from i3lock.

GuillaumeSeren avatar GuillaumeSeren commented on May 9, 2024

@stapelberg Yes I think too but I was just asking to know if you get a better solution.

Guillaume

from i3lock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.