kovetskiy / dotfiles

an effective environment based on arch linux w/ i3, vim, alacritty, zsh, polybar
25 stars 4 forks source link

Move mcabber-auto-esc into separate binary (or plugin for mcabber?) #1

Closed seletskiy closed 9 years ago

kovetskiy commented 9 years ago

Cannot be plugin, because mcabber headers does not provide methods which can do this. So, there is two ways:

  1. plugin with strange behaviour (get pid, get parent (terminal), check focus, send key to parent window)
  2. patch mcabber

or of course seperate binary

Guesses?

seletskiy commented 9 years ago

You can use xdo bindings: https://github.com/jordansissel/xdotool/blob/master/xdo.h (package xdotool-git in AUR).

There is method xdo_wait_for_window_focus, which can be used to wait until focus changed, and then you just call some function from mcabber/screen.h to hide chat window.

kovetskiy commented 9 years ago

Hmm, I found interesting method in mcabber/commands.h - do_chat_disable(char *arg);. Yes, I think I implement this awesome plugin.

kovetskiy commented 9 years ago

Moved to https://github.com/kovetskiy/mcabber-focus