Project

General

Profile

Newly created window to front focus?

Added by Rob Jones over 8 years ago

Hi guys!

I'm new to using Subtle and I was just wondering: is there a way to make a newly created window (e.g. mplayer or feh) become automatically focused no matter where the mouse is? Or maybe to remove the window focusing based on the mouse pointer all together if that's not possible.

I have the issue where when I type "feh *" in a folder full of images and cycle through them I always have to move the mouse or move focus to feh. This might be because I have set feh to float so that I can see the images as they were meant to be seen, i.e. not stretched. I've also set mplayer to float and I have the issue that whenever I open a video that the mplayer window won't focus and I'll have to focus it to change the volume, etc.

Thanks for any help!


Replies (2)

RE: Newly created window to front focus? - Added by Christoph Kappel over 8 years ago

Hello,

focus is bound to pointer position, because the specs say logical focus has to follow pointer.

There is more than one way to archive what you want.

  1. Set the window to urgent:
    {{hide}}tag "urgent" do
      match  "feh" 
      float  true
      stick  true
      urgent true
    end
  2. Add a custom hook:
    {{hide}}on :client_create do |c|
      c.focus if("feh" == c.name)
    end

If it doesn't work please let me know.

RE: Newly created window to front focus? - Added by Rob Jones over 8 years ago

Argh, I knew there was something that I must have missed in the tag properties. Thank you very much for pointing me in the right direction. :)

Happy New Year!

    (1-2/2)