Skip to content

Show window title next to the indicator #38

Open

Description

@Krever

Hey, thanks a lot for the stackline, it's really useful.

In my setup I'm working with multiple windows of the same app (IntelliJ in my case) and navigating to the given one requires remembering the order of them (or browsing until you find what you look for).

It could be useful to show the titles next to the indicators. This would be quite intrusive so I was thinking of showing them only for a limited period of time since the last focus change.

I tried looking at the code myself but my lack of knowledge of both Lua and hammerspoon API made implementing it a real challenge.

Activity

  1. added
    enhancement
    on Sep 10, 2020
  2. AdamWagner commented on Sep 10, 2020

    @AdamWagner
    Owner

    That's an awesome idea @Krever … something I've been thinking about too.

    One of my use-cases for stackline is grouping browser tabs. The result is a stack of 4-5 chrome icons that all look the same. Personally, this hasn't been that disorienting (which is probably why I haven't done it yet) … but I can see how it could be a problem.

    showing them only for a limited period of time since the last focus change.

    Now THAT is brilliant! I had only thought of displaying them on hover … which isn't great because … mouse. This is a much better idea.

    Would you expect the title to appear on the inside-side of the indicator, which would overlap parts of the active window?

    A challenge I foresee with this is the need to filter window title text. Windows (especially browser windows) sometimes have ridiculous titles like:

    Ridiculously long blog post title: 10 quick tricks on how to write awesome blog posts · Writing · Freelance · Other cool keyword · Search results for "how to write more gud"  – WriteBuddy is the BEST – writebuddy.com – YOU'RE THE 1,000th VISITOR! CLAIM YOUR PRIZE!
    

    Sigh. :-) I guess the quick version can just truncate with ellipses after a reasonable number of characters, and get smarter about displaying only relevant parts of the window title in a future revision.

  3. Krever commented on Sep 11, 2020

    @Krever
    Author

    Would you expect the title to appear on the inside-side of the indicator, which would overlap parts of the active window?

    Yup, this sounds most intuitive.

    Sigh. :-) I guess the quick version can just truncate with ellipses after a reasonable number of characters, and get smarter about displaying only relevant parts of the window title in a future revision.

    That would be totally fine with me, especially if we could put the number of characters in the config.

  4. AdamWagner commented on Sep 18, 2020

    @AdamWagner
    Owner

    That would be totally fine with me, especially if we could put the number of characters in the config.

    Cool! I hadn't thought of making truncateAt configurable. Very neat.

  5. AdamWagner commented on Sep 20, 2020

    @AdamWagner
    Owner

    Really thought I'd be able to work on this this weekend… but #32 was trickier than expected. I'd like to get that and #33 done first, but I'm looking forward to window titles!

  6. added this to the v0.1.70 milestone on Sep 20, 2020
  7. self-assigned this
    on Sep 20, 2020
  8. AdamWagner commented on Oct 15, 2020

    @AdamWagner
    Owner

    Note to self: Hammerspoon pro https://github.com/szymonkaliski implemented window title function like this:

    --[[ make a descriptive title for a window
        params : window, length (int)
        returns : string
        combines the application title and, if it's different, the window title
        too. the whole thing will get truncated if it's too long ]]
    function windowDescriptor(window, maxDescriptorLength)
        out = window:application():title()
        wt = window:title()
    
        if (wt ~= out) then out = out .. " / " .. wt end
        if (out:len() > maxDescriptorLength) then
            out = out:sub(0, maxDescriptorLength)
        end
    
        return out
    end

    from: https://github.com/szymonkaliski/dotfiles/blob/master/Dotfiles/hammerspoon/playground/cheaphints.lua

  9. AdamWagner commented on Nov 29, 2020

    @AdamWagner
    Owner

    @Krever Just wanted to give you an update on this. Here's a rough list of what I'm planning to work on:

    1. Add tests to improve reliability & enable faster iteration (see progress here)
    2. Address show-stopping bugs (Loosing left Click >> Hammerspoon Error : attempt to index a nil value (field 'indicator') #41, Stackline sometimes missing icons #44, Stackline crash #46, Not really reactive using yabai -m window --insert stack #47)
    3. Refactor to a component+event model (this may be required to truly complete number 2)
    4. Add enhancements (such as showing window title next to the indicator 😉️ )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions