Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Another week, another tiny utility.

Another week, another tiny utility.

Scheduled Pinned Locked Moved Uncategorized
8 Posts 3 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • simontatham@hachyderm.ioS This user is from outside of this forum
    simontatham@hachyderm.ioS This user is from outside of this forum
    simontatham@hachyderm.io
    wrote last edited by
    #1

    Another week, another tiny utility.

    I was in a Zoom call last week with very poor video quality, which we figured out was because I was also running a long compile which wasn't leaving Zoom enough CPU to work with. So I paused the compile with ^Z and things improved.

    Three hours after the call, I found the compile job, still suspended, in a window hidden behind something else. Oops. If only I'd been able to arrange to _automatically_ resume the job when the Zoom call terminated, instead of relying on my own memory!

    I already have a tool 'after' which waits for a specified Unix process to terminate. But Zoom stays running even when not on a call, and there's no reason to suppose it puts the call in an easy-to-identify subprocess.

    But it does put it in a separate _window_. So I wrote a tool 'xafter', which waits for a specified X window to close. Completely trivial – X11 makes it easy to ask for StructureNotify events on a window whether it's your own or not. Now if I suspend a job that's interfering with my meeting, I can immediately type 'xafter;fg' and select the meeting window, and then it'll restart automatically.

    I have no idea if it would be easy to write analogues of this for Wayland, or Windows, or Mac.

    uep@timeloop.cafeU webhat@infosec.exchangeW simontatham@hachyderm.ioS 3 Replies Last reply
    2
    0
    • simontatham@hachyderm.ioS simontatham@hachyderm.io

      Another week, another tiny utility.

      I was in a Zoom call last week with very poor video quality, which we figured out was because I was also running a long compile which wasn't leaving Zoom enough CPU to work with. So I paused the compile with ^Z and things improved.

      Three hours after the call, I found the compile job, still suspended, in a window hidden behind something else. Oops. If only I'd been able to arrange to _automatically_ resume the job when the Zoom call terminated, instead of relying on my own memory!

      I already have a tool 'after' which waits for a specified Unix process to terminate. But Zoom stays running even when not on a call, and there's no reason to suppose it puts the call in an easy-to-identify subprocess.

      But it does put it in a separate _window_. So I wrote a tool 'xafter', which waits for a specified X window to close. Completely trivial – X11 makes it easy to ask for StructureNotify events on a window whether it's your own or not. Now if I suspend a job that's interfering with my meeting, I can immediately type 'xafter;fg' and select the meeting window, and then it'll restart automatically.

      I have no idea if it would be easy to write analogues of this for Wayland, or Windows, or Mac.

      uep@timeloop.cafeU This user is from outside of this forum
      uep@timeloop.cafeU This user is from outside of this forum
      uep@timeloop.cafe
      wrote last edited by
      #2

      @simontatham cool..

      There's a similar thing under wayland used to suppress screen locking when apps are active that don't require the normal mouse and kbd interaction, like media players and conference calls.

      Having jobs that only run when one of these inhibitors isn't held seems useful!

      simontatham@hachyderm.ioS 1 Reply Last reply
      1
      0
      • uep@timeloop.cafeU uep@timeloop.cafe

        @simontatham cool..

        There's a similar thing under wayland used to suppress screen locking when apps are active that don't require the normal mouse and kbd interaction, like media players and conference calls.

        Having jobs that only run when one of these inhibitors isn't held seems useful!

        simontatham@hachyderm.ioS This user is from outside of this forum
        simontatham@hachyderm.ioS This user is from outside of this forum
        simontatham@hachyderm.io
        wrote last edited by
        #3

        @uep and on the flip side, when an application fails to suppress the screen lock, I've been known to work around the problem by making a very cheap video file (small plain black rectangle at 1fps) and run a media player on it, which is easier than figuring out the proper lock-suppression API 🙂

        uep@timeloop.cafeU 1 Reply Last reply
        0
        • simontatham@hachyderm.ioS simontatham@hachyderm.io

          @uep and on the flip side, when an application fails to suppress the screen lock, I've been known to work around the problem by making a very cheap video file (small plain black rectangle at 1fps) and run a media player on it, which is easier than figuring out the proper lock-suppression API 🙂

          uep@timeloop.cafeU This user is from outside of this forum
          uep@timeloop.cafeU This user is from outside of this forum
          uep@timeloop.cafe
          wrote last edited by
          #4

          @simontatham "the"? singular? LOL

          simontatham@hachyderm.ioS 1 Reply Last reply
          0
          • simontatham@hachyderm.ioS simontatham@hachyderm.io

            Another week, another tiny utility.

            I was in a Zoom call last week with very poor video quality, which we figured out was because I was also running a long compile which wasn't leaving Zoom enough CPU to work with. So I paused the compile with ^Z and things improved.

            Three hours after the call, I found the compile job, still suspended, in a window hidden behind something else. Oops. If only I'd been able to arrange to _automatically_ resume the job when the Zoom call terminated, instead of relying on my own memory!

            I already have a tool 'after' which waits for a specified Unix process to terminate. But Zoom stays running even when not on a call, and there's no reason to suppose it puts the call in an easy-to-identify subprocess.

            But it does put it in a separate _window_. So I wrote a tool 'xafter', which waits for a specified X window to close. Completely trivial – X11 makes it easy to ask for StructureNotify events on a window whether it's your own or not. Now if I suspend a job that's interfering with my meeting, I can immediately type 'xafter;fg' and select the meeting window, and then it'll restart automatically.

            I have no idea if it would be easy to write analogues of this for Wayland, or Windows, or Mac.

            webhat@infosec.exchangeW This user is from outside of this forum
            webhat@infosec.exchangeW This user is from outside of this forum
            webhat@infosec.exchange
            wrote last edited by
            #5

            @simontatham nice, I need this

            simontatham@hachyderm.ioS 1 Reply Last reply
            0
            • uep@timeloop.cafeU uep@timeloop.cafe

              @simontatham "the"? singular? LOL

              simontatham@hachyderm.ioS This user is from outside of this forum
              simontatham@hachyderm.ioS This user is from outside of this forum
              simontatham@hachyderm.io
              wrote last edited by
              #6

              @uep indeed, I've long suspected that part of the _reason_ applications sometimes fail to suppress my screen lock is that there's more than one API and they used the other one!

              1 Reply Last reply
              0
              • drajt@fosstodon.orgD drajt@fosstodon.org shared this topic
              • simontatham@hachyderm.ioS simontatham@hachyderm.io

                Another week, another tiny utility.

                I was in a Zoom call last week with very poor video quality, which we figured out was because I was also running a long compile which wasn't leaving Zoom enough CPU to work with. So I paused the compile with ^Z and things improved.

                Three hours after the call, I found the compile job, still suspended, in a window hidden behind something else. Oops. If only I'd been able to arrange to _automatically_ resume the job when the Zoom call terminated, instead of relying on my own memory!

                I already have a tool 'after' which waits for a specified Unix process to terminate. But Zoom stays running even when not on a call, and there's no reason to suppose it puts the call in an easy-to-identify subprocess.

                But it does put it in a separate _window_. So I wrote a tool 'xafter', which waits for a specified X window to close. Completely trivial – X11 makes it easy to ask for StructureNotify events on a window whether it's your own or not. Now if I suspend a job that's interfering with my meeting, I can immediately type 'xafter;fg' and select the meeting window, and then it'll restart automatically.

                I have no idea if it would be easy to write analogues of this for Wayland, or Windows, or Mac.

                simontatham@hachyderm.ioS This user is from outside of this forum
                simontatham@hachyderm.ioS This user is from outside of this forum
                simontatham@hachyderm.io
                wrote last edited by
                #7

                … I forgot to provide a link, didn't I? See, that's why I prefer to avoid relying on my own memory.

                'xafter' is available from my miscellaneous utilities page (also including 'after' and lots of other unrelated things):
                https://www.chiark.greenend.org.uk/~sgtatham/utils/

                1 Reply Last reply
                0
                • webhat@infosec.exchangeW webhat@infosec.exchange

                  @simontatham nice, I need this

                  simontatham@hachyderm.ioS This user is from outside of this forum
                  simontatham@hachyderm.ioS This user is from outside of this forum
                  simontatham@hachyderm.io
                  wrote last edited by
                  #8

                  @webhat well reminded, I've now put a link in a followup post!

                  1 Reply Last reply
                  0
                  • R relay@relay.publicsquare.global shared this topic
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups