franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
781 stars 71 forks source link

Check active window in Linux #9

Closed asymmetric closed 7 years ago

asymmetric commented 7 years ago

Depends on: #7. Closes: #8.

asymmetric commented 7 years ago

@aristidesfl it is, you can get it via homebrew for example.

On the other hand, iTerm definitely isn't a Linux application, but I decided to keep things simple and only use one string to match against, instead of platform-specific ones, as there are no negative consequences in doing so IMO.

But to answer your question, no, I didn't test this on macOS.

franciscolourenco commented 7 years ago

tmux is a command line application. not macOS application. does the linux terminal you are using get renamed to tmux in xprops when you are using it, instead of its original name?

On 20 Nov 2016, at 18:16, Lorenzo Manacorda notifications@github.com wrote:

@aristidesfl it is, you can get it via homebrew for example.

On the other hand, iTerm definitely isn't a Linux application, but I decided to keep things simple and only use one string to match against, instead of platform-specific ones, as there are no negative consequences in doing so IMO.

But to answer your question, no, I didn't test this on macOS.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

franciscolourenco commented 7 years ago

@asymmetric is this terminal detection working on linux for you?

asymmetric commented 7 years ago

@aristidesfl yes, it is. I tested termite and Gnome Terminal on i3, and they both set the window name to a string containing "tmux", so they both work.

asymmetric commented 7 years ago

So obviously this only works when people are using tmux, which leaves plenty of space for improvement. But the OSX detection of iTerm functions along the same set of assumptions, so I thought it was fine.

franciscolourenco commented 7 years ago

so is it not possible to get the terminal application name with xprops on linux?

On 22 Nov 2016, at 15:30, Lorenzo Manacorda notifications@github.com wrote:

@aristidesfl yes, it is. I tested termite and Gnome Terminal on i3, and they both set the window name to a string containing "tmux", so they both work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

asymmetric commented 7 years ago

I don't get the question. I am using xprop to get the window name. What am I missing? :confused:

asymmetric commented 7 years ago

Ooh, I get it now, sorry! I'll try playing around with xprop and see if I can get the application name :+1:

asymmetric commented 7 years ago

Tested on termite and gnome-terminal.

franciscolourenco commented 7 years ago

Cool. The window name could actually be useful. if you can set the window name form the terminal, then would could see if you are in the right window or not, even if you are still using the terminal.

Did you test the applescript with the array?

asymmetric commented 7 years ago

Nope, I don't have a macOS machine, sorry.

x4121 commented 7 years ago

I guess there is still some errors

set active_application ...
if echo $active_window ...

This doesn't really make sense

jorgebucaran commented 7 years ago

@asymmetric Ping pong.

franciscolourenco commented 7 years ago

@asymmetric why did you switch from detecting windows to detecting applications?

franciscolourenco commented 7 years ago

Since there are questions about the code and no answers for a while, I'm closing this. The functionality has been implemented in https://github.com/fisherman/done/releases/tag/0.5.0 Thank you for the contribution.