done icon indicating copy to clipboard operation
done copied to clipboard

Support for tab detection

Open BarbzYHOOL opened this issue 6 years ago • 8 comments

Actually, it displays the notification when the window is not focused, which is great, but if you open a new tab and switch to it, then the notification won't display because it considers you're in the same windows (which is true lol)

Need to add a tab option

I'm on linux so it's probably this line to edit, but no idea how:

	xprop -root 32x '\t$0' _NET_ACTIVE_WINDOW | cut -f 2

Maybe getting the tab title can work too?

PS: why is the main file in /conf.d/ ??

BarbzYHOOL avatar Jul 05 '18 23:07 BarbzYHOOL

There might be limitations in terms of tab detection.

conf.d is where you can add extra configuration files which get executed on setup. https://github.com/fish-shell/fish-shell/blob/master/etc/config.fish#L2

franciscolourenco avatar Jul 06 '18 08:07 franciscolourenco

Put system-wide fish configuration entries here

But it's a bunch of function, not a simple configuration file. Seems weird to me

For tab detection, I looked on google and found nobody who tried this yet... not very encouraging :P

BarbzYHOOL avatar Jul 06 '18 13:07 BarbzYHOOL

@BarbzYHOOL This thread might give you some insight into conf.d https://github.com/fisherman/done/issues/12

franciscolourenco avatar Jul 06 '18 14:07 franciscolourenco

(sorry for offtopic)

    In alternative why not define all the functions in conf.d/done.fish?

For the same reason you should not use alias in your config. If you put those functions in the snippet, then they will be eagerly loaded, completely missing the point of fish excellent lazy loading mechanism.

He said not to put all in conf.d (didn't read entire thread yet though), no?

His own plugin doesn't do it like this https://github.com/fisherman/fishtape

BarbzYHOOL avatar Jul 06 '18 15:07 BarbzYHOOL

These 2 functions need to be eagerly loaded:

function __done_started --on-event fish_preexec
function __done_ended --on-event fish_prompt 

It was not worthwhile to spread the other 3 functions in different files since the performance impact is negligible.

franciscolourenco avatar Jul 06 '18 17:07 franciscolourenco

@BarbzYHOOL What is a "tab" in this case? Which window manager/desktop environment were you using?

ammgws avatar Oct 12 '19 00:10 ammgws

What is a "tab" in this case? Which window manager/desktop environment were you using?

@ammgws

  • Mac OS X 10.15
  • iTerm2 3.2

quantonganh avatar Jul 09 '20 01:07 quantonganh

I think it is possible for at least for iTerm2, here's how zsh-notify does that https://github.com/marzocchi/zsh-notify/blob/master/applescript/resources/is-iterm2-active.applescript

eugene-babichenko avatar Sep 04 '20 18:09 eugene-babichenko