rofi icon indicating copy to clipboard operation
rofi copied to clipboard

Automatically select non-focused window

Open NoahLutz opened this issue 7 years ago • 10 comments

Version

Version: 1.3.1-342-git-ed647dc (master)

Configuration

https://gist.github.com/NoahLutz/1daaf469e96f7340fa5dd2bde5170f46

Launch Command

rofi -modi windowcd -show windowcd -no-fixed-num-lines

Steps to reproduce

  • Open two or more windows
  • launch rofi using command above (to use windowcd)

What behaviour you see

  • By default, the selected entry is the currently focused window

What behaviour you expect to see

  • By default, it should select one of the other, non focused windows

NoahLutz avatar Jul 25 '17 23:07 NoahLutz

What window manager are you using?

DaveDavenport avatar Jul 26 '17 06:07 DaveDavenport

I'm using bspwm. Heres the output of bspwm -v

[noah@winston /]$ bspwm -v
0.9.2-45-g96f337b

NoahLutz avatar Jul 26 '17 11:07 NoahLutz

I agree it would be nice. One of the problems is, what window to select? Different window managers return windows in different order when queried. f.e. with i3 the current window is not always the first one returned.

I'll keep this one open, might be nice to investigate, and see if we can do better for some WM's.

DaveDavenport avatar Jul 26 '17 15:07 DaveDavenport

It seems that rofi displays the windows in order of what was most recently used, with the first one being the one currently focused. Is this a function of rofi or bspwm? If rofi, would it be possible to just select the next element in the list?

NoahLutz avatar Jul 27 '17 01:07 NoahLutz

At least in i3wm selecting the next element in the list would work. +1 for the idea.

AlexDaniel avatar Aug 03 '17 21:08 AlexDaniel

At least in i3wm selecting the next element in the list would work. +1 for the idea.

Not for me in I3, it returns the same NET_CLIENT_LIST(_STACKING) order independent of focused window..

DaveDavenport avatar Aug 04 '17 06:08 DaveDavenport

This feature would be great :+1: Always need to go one line below to select the last window. Use i3wm and rofi -show window on Alt+Tab

nlack avatar Feb 09 '18 07:02 nlack

Same here. AFAICS i3 returns the window list sorted in most recently used order. An option to start at the second line, or to send the first line to the bottom, would be enough to get a more decent alt-tab behavior in i3. Currently almost all the time I need to go down at least one row.

memeplex avatar Jun 27 '18 16:06 memeplex

Btw, here is a simple workaround

rofi -show window& sleep 0.15 && xdotool key Down

memeplex avatar Jun 27 '18 16:06 memeplex

I've been testing this more carefully and the order of the clients returned by i3 is not completely reliable, not always the first client is the focused one and the next to first is the previously focused one, sometimes the previously focused client is at the top of the list, so maybe it's not worth the effort and this issue can be closed.

What can be easily (?) done is to filter the currently focused window from the list. This can be implemented as a general filtering/reordering utility that calls external scripts or, and I prefer this simpler approach, as a configuration option like focused = (omit|last) for instance.

memeplex avatar Jun 28 '18 18:06 memeplex

Any progress on this ? Escaping rofi just moves window focus to some another window. I'm on i3. Any workaround, would be greatly appreciated.

ghost avatar Nov 02 '22 00:11 ghost

closing this one, as i don't see a solution to have this one solved in a generic way. With the script mode support, it should be fairly simple to write a Window Manager specific window selector that can actually implement this.

DaveDavenport avatar Jan 25 '23 15:01 DaveDavenport

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Feb 26 '23 00:02 github-actions[bot]