cornerman / i3-easyfocus

Focus and select windows in i3
GNU General Public License v3.0
172 stars 12 forks source link

Adoption for marks #18

Closed weilbith closed 3 years ago

weilbith commented 5 years ago

I'm curious if this could be adopted to show the marks for each window that has one. I don't use window decoration, so only the title of the focused window is shown in the status bar. Therefore I "can't" activate show_marks. I'm using this tiny script to search for marks interactively with DMenu. But this does not help if I don't know the mark, especially when using my standard marks for quick assignment which are numbers. On the other hand using easyfocus all the time is also not a solution I like to use, since new windows cause unstable labels and comes with some overhead of shortcuts. So sometimes I have this situation where I know I've marked the window, but just don't remember its mark. So I have to switch to it manually and remark it with a new mark, which is maybe already used. Or I search through all marks with the mentioned script, hoping I remember it later on. So I imagine the usage that I can display the same labels as now with easyfocus but showing the mark, if such exist for the window. Of cause this works only for all windows for the current visible workspace(s). Also interesting are tabbed containers which contain split windows again. :thinking: Is this hard to implement? What would be necessary?

cornerman commented 5 years ago

@weilbith Thank you for opening this issue, that is an interesting use-case.

We could implement it quite easily if we just want to show the current marks of a window as additional information in the label. So, we can just have the labels and key matching as it is now and additionally query i3 for the marks of a window and display them in the label. We can introduce a cli option for this behaviour. Would that be enough?

If so, it should be possible to implement:

weilbith commented 5 years ago

Thanks for replying that fast! This would be a nice solution yes. In fact it is maybe even better, since it allows you to jump directly. In case you only want to see the marks, it can be canceled with <Esc> as normal I guess. To make sure it is easily visible which window contain a mark it would be nice, if the mark information could be highlighted in any way.

cornerman commented 5 years ago

it can be canceled with as normal I guess

Yep that just works.

if the mark information could be highlighted in any way.

I would love that but there is not much styling going on in the code right now - so we would need to tinker with xcb and change the font style or color for the mark information. It should be possible, but maybe not as easy. Alternatively, we could just put the mark in brackets: a [mark1 mark2]. What do you think?

weilbith commented 5 years ago

Yep. Then should brackets be enough. Thats also the style i3 is using for their window decoration. :+1:

cornerman commented 5 years ago

Great. I am not sure when I will have time to work on this. Are you interested in making a PR?

weilbith commented 5 years ago

I would love to, but I must admit that my development knowledge for C isn't that good. I would prefer to wait for it, if this is okay for you. My PR would be just a mess I guess.

weilbith commented 5 years ago

I would love to, but I must admit that my development knowledge for C isn't that good. I would prefer to wait for it, if this is okay for you. My PR would be just a mess I guess. I haven't even install a linter therefore. ^^

cornerman commented 5 years ago

Sure, I will try when I have some time, but I cannot promise anything :)

weilbith commented 3 years ago

I'm just going through the list of my open issues. I don't think I'm interested into this feature anymore. Though it would be a cool addition. In this case it could be re-opened at any time.