Code Monkey home page Code Monkey logo

Comments (4)

piu130 avatar piu130 commented on May 18, 2024 11

Sorry I just switched to sway recently. Would this script look like this:

# put task in background
swayidle \
    timeout 5 'swaymsg "output * dpms off"' \
    resume 'swaymsg "output * dpms on"' &
# lcok screen
swaylock -c000000
# kill last background task
kill %%

Or is there a better way to do this?

from swaylock.

piu130 avatar piu130 commented on May 18, 2024 1

Here is another solution to this problem.

from swaylock.

emersion avatar emersion commented on May 18, 2024

trap is a shell builtin, it doesn't matter whether it's X11 or Wayland.

Though, xset dpms manages the timeout to enable DPMS. The Wayland equivalent would be swayidle.

We should document this in the README or elsewhere too

Not in the README, no. You can add this to the wiki though.

from swaylock.

KristerV avatar KristerV commented on May 18, 2024

A year later this is not in readme, and there is no wiki at all. Been trying for hours to get this to work, only now found this issue. Mind you Google also doesn't know any solutions. I say it's a good fit for readme as is a typical usecase. Or at least open the wiki.

@piu130's approach seems to be working, although also gives an error: Failed to find session name: PID 2957 does not belong to any known session.

Yet the trap command version doesn't integrate with swayidle. My purpose is to blank the screen immediately and then engage lock in 5 sec. So moving mouse too soon will cancel the locking also.

from swaylock.

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.