viniarck / rofi-tmux

:heavy_check_mark: rft (rofi-tmux). Quickly switches tmux sessions, windows and tmuxinator projects
MIT License
26 stars 4 forks source link

fix i3ipc v2 compatibility, improve multi-mon support #6

Closed laur89 closed 4 years ago

laur89 commented 5 years ago
- i3ipc >= v2 incompatibility  - eg workspace.get() no longer works;
- fix poor multi-monitor support: i3wm._get_cur_workspace() finds visible
  workspace, but multi-head setup has many simultaneously visible workspaces;
  i3ipc has better apis for receiving current, _focused_, workspace;
- why limit ourselves to i3wm.switch_tmux_workspace()? this is rather poor
  UX if our tmux window is say in a stacked or tabbed container - window could still
  remain hidden; it'd be better to directly focus our tmux window.
- i3wm._find_tmux_workspace() currently searches for tmux window by session.name,
  which is likely to result in multiple matches, unless our session names are rather
  unique; eg for my session named 'main', I got 3+ matches across multiple workspaces;
- pass logger (debug) level down to i3wm module;
- bump required i3ipc ver to >= 2.0.1;
- _rofi_tmux_window() & _rofi_tmux_session(): for both of them, first
  try to switch to existing client via session.switch_client();
  if that fails, _only_ then try attaching with session.attach_session();
- introduce new config items:
  - tmux_title_rgx: regex to seek tmux window by - this allows us to
    more accurately trace down the window containing tmux window; note it supports
    optional placeholders {session} & {window};
  - ignored_sessions: array of tmux session names that should be ignored
    by rtf;

@viniarck - could you confirm switch vs attach logic described above is what we want? It differs from current behavior, but makes sense to me - first we try to switch to existing client; if that fails, then try attaching. Don't see why we should try attaching first in _rofi_tmux_session().

viniarck commented 4 years ago

Hi @laur89, I missed the notification of this PR. I'll review this PR in the next days.

Thanks for contributing.

viniarck commented 4 years ago

@laur89 yes, the new attaching and switching session behavior is still coherent, I've doubled checked with libtmux. Sorry it took so long to merge the PR. Thank you a lot for this significant contribution. If you have further contributions feel free to do so.

laur89 commented 4 years ago

No biggie, it's not like this monster of a commit was easy to review anyway. I do have some ideas around rtf; is there gitter or some other channel I could bounce my ideas off from?

viniarck commented 4 years ago

@laur89 great. I've just created a gitter community for this project https://gitter.im/rofi-tmux/community talk to you in the chat soon.