Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #240472

Re: silence audio on locked screen?

From Dan Ritter <dsr@randomstring.org>
Newsgroups linux.debian.user
Subject Re: silence audio on locked screen?
Date 2021-09-28 12:40 +0200
Message-ID <D2iGK-4aw-13@gated-at.bofh.it> (permalink)
References <D1OyZ-2sx-1@gated-at.bofh.it> <D1WmS-7go-7@gated-at.bofh.it> <D2gbT-2tH-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Richard Hector wrote: 
> On 27/09/21 11:39 pm, Dan Ritter wrote:
> > 
> > One option is to run a mute and stop-playing command immediately
> > on screensaver interaction.
> > 
> > For XFCE4, that's as easy as adding a panel object which runs an
> > application, pointing that at a script, and adding an
> > appropriate icon. Install xmacro.
> > 
> > ~/bin/quiet-and-dark
> > 
> > #!/bin/sh
> > #not actually tested
> > echo 'KeyStrPress XF86AudioPlay KeyStrRelease XF86AudioPlay' | xmacroplay :0
> > echo 'KeyStrPress XF86AudioMute KeyStrRelease XF86AudioMute' | xmacroplay :0
> > xscreensaver -command activate
> > 
> > 
> > You can also assign it to run as a keyboard shortcut.
> 
> Thanks Dan,
> 
> If I understand correctly,  you're suggesting to create a clickable button
> which will mute the audio, and then creating a macro to do that from within
> a script, which I then need to run manually?

That sounds inverted. The button executes a script when you
click it; the script mutes and pauses audio, then activates the
screensaver.

There might be a way to invoke the mute-and-pause from the
screensaver when it activates by itself, but I don't know that
one and a few minutes searching didn't reveal it.

> I'd like this to still happen if the screen locks due to inactivity. I
> haven't found yet what triggers that, or where to configure the timeout.

That's in Settings, Screensaver. Try right clicking on an empty
area of desktop.

> Secondly, will it re-enable audio when the screen is unlocked?

This won't, but the same invocations without the final
screensaver activation will un-mute and start playing whatever
is listening to XF86 media keys.

-dsr-

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

silence audio on locked screen? Richard Hector <richard@walnut.gen.nz> - 2021-09-27 04:30 +0200
  Re: silence audio on locked screen? "Alexander V. Makartsev" <avbetev@gmail.com> - 2021-09-27 08:30 +0200
  Re: silence audio on locked screen? Dan Ritter <dsr@randomstring.org> - 2021-09-27 12:50 +0200
    Re: silence audio on locked screen? Richard Hector <richard@walnut.gen.nz> - 2021-09-28 10:00 +0200
      Re: silence audio on locked screen? Dan Ritter <dsr@randomstring.org> - 2021-09-28 12:40 +0200
        Re: silence audio on locked screen? Richard Hector <richard@walnut.gen.nz> - 2021-09-29 05:50 +0200
          Re: silence audio on locked screen? Dan Ritter <dsr@randomstring.org> - 2021-09-29 12:50 +0200
          Re: silence audio on locked screen? David Wright <deblis@lionunicorn.co.uk> - 2021-09-30 05:40 +0200
            Re: silence audio on locked screen? rhkramer@gmail.com - 2021-09-30 14:10 +0200
              Re: silence audio on locked screen? Kenneth Parker <sea7kenp@gmail.com> - 2021-09-30 16:40 +0200

csiph-web