Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for tab detection #40

Open
BarbzYHOOL opened this issue Jul 5, 2018 · 8 comments
Open

Support for tab detection #40

BarbzYHOOL opened this issue Jul 5, 2018 · 8 comments

Comments

@BarbzYHOOL
Copy link
Contributor

BarbzYHOOL commented Jul 5, 2018

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/ ??

@franciscolourenco
Copy link
Owner

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

@BarbzYHOOL
Copy link
Contributor Author

BarbzYHOOL commented Jul 6, 2018

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

@franciscolourenco
Copy link
Owner

@BarbzYHOOL This thread might give you some insight into conf.d #12

@BarbzYHOOL
Copy link
Contributor Author

(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

@franciscolourenco
Copy link
Owner

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.

@ammgws
Copy link
Contributor

ammgws commented Oct 12, 2019

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

@quantonganh
Copy link

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

@ammgws

  • Mac OS X 10.15
  • iTerm2 3.2

@eugene-babichenko
Copy link
Contributor

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

@franciscolourenco franciscolourenco changed the title Notif pops up when TAB is not focused (switched tab) Support for tab detection Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants