Coder Social home page Coder Social logo

Recent window sorting about dswitcher HOT 5 OPEN

excerion avatar excerion commented on September 27, 2024
Recent window sorting

from dswitcher.

Comments (5)

jtsymon avatar jtsymon commented on September 27, 2024

I don't think its possible to get windows in any particular order using wmctrl.
You could possibly maintain a list of recently used windows, but that would require having a program constantly running and listening for focus change events.
I wrote a tool that outputs changes in the active window (for my i3bar) which could be used to keep the list of windows sorted by most recently active, but your idea would also need to notice when windows are closed so they don't stay in the list.

from dswitcher.

orschiro avatar orschiro commented on September 27, 2024

@jtsymon,

Thanks for outlining. I see that this is far more complex and I doubt that it justifies the effort to implement.

Please feel free to close it if you think the same.

from dswitcher.

jtsymon avatar jtsymon commented on September 27, 2024

I just tried writing a program to listen for window close events, and it looks like only the window manager and the process which created the window can receive those.
So it doesn't seem to be possible to know when windows are closed without either hooking into the window manager (which would of course only work for certain WMs), or polling for events (e.g. running wmctrl -l in a loop - which I would avoid because its inefficient and slow to receive updates).

I can't close the issue (only you or Antithesisx can do that), but its not really resolved so it might as well stay open.

from dswitcher.

orschiro avatar orschiro commented on September 27, 2024

It's interesting to know how Rof does this.

from dswitcher.

jtsymon avatar jtsymon commented on September 27, 2024

It doesn't seem to have proper history for window focus (looks like that's just for the run/ssh menu), although it does group windows by their workspace and somehow sorts the workspaces by last focused (seems to be handled by the X server rather than Rofi, because I can kill Rofi and switch workspaces in an order, then start Rofi and it shows my workspaces in that same order even though it couldn't have known).

from dswitcher.

Related Issues (4)

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.