0

I am trying to setup Sway with swaylock. My configuration in my ~/.config/sway/config is as follows:

exec swayidle -w \
    timeout 1800 'swaylock -f -c 000000' \
    timeout 3600 'swaymsg "output * dpms off"' \
        resume 'swaymsg "output * dpms off"' \
    before-sleep 'playerctl pause' \
    before-sleep 'swaylock -f -c 000000'

However, this also locks my screen after 30 minutes of watching a movie in the browser (I use Chromium for this). Is there a way to disable swayidle while watching a movie? I couldn't find any hints in the man pages.

I run Sway on Arch Linux.

Thank you very much for your help!

Sebastian Führ
  • 71
  • 1
  • 2
  • 11
  • [so] is for programming questions, not questions about using or configuring Unix and its utilities. [unix.se] or [su] would be better places for questions like this. – Barmar Aug 07 '21 at 16:15
  • 1
    Thank you for the suggestion, for all following questions I will (and already did) refer to one of those platforms. However, deciding which one to use is still a hustle for me. – Sebastian Führ Aug 30 '21 at 18:52
  • 1
    @Barmar don't be that guy. This most certainly IS a programming question. What do you think a sway config is? – RichieHH Feb 23 '23 at 19:11
  • @RichieHH I don't know what Sway is. And the definition of "programming" can be fuzzy. But I generally fall on the side of considering programming to involve some notion of variables and/or control flow. Configuration is usually just a list of settings, with little in the way of programming. – Barmar Feb 23 '23 at 19:22

2 Answers2

3

Try it:

for_window [class=".*"] inhibit_idle fullscreen
for_window [app_id=".*"] inhibit_idle fullscreen

If you have some window in fullscreen mode, this make stop swayidle

Radek Rojík
  • 104
  • 5
0

I'm using systemd-inhibit sleep infinity right now, which seems to be working as intended.

Nathan Lilienthal
  • 864
  • 1
  • 10
  • 16
  • Nope, this doesn't work, we'd need to disable the `swayidle` process first and renable it afterwards. Since I startup my `swayidle` process inside `~/.config/sway/config` right now, I'm not quite sure the best way to do this yet. – Nathan Lilienthal Dec 24 '21 at 17:12