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

Add gnome shell search provider #48

Open
brunelli opened this issue Jan 22, 2016 · 22 comments
Open

Add gnome shell search provider #48

brunelli opened this issue Jan 22, 2016 · 22 comments

Comments

@brunelli
Copy link

GNOME Terminal has a search feature that allows you to search terminal outputs, see here.

It has a GNOME Shell search provider (very useful) and it even lets you search using regex.

It'd be very nice to have this feature added into Terminix too.

@alex285
Copy link
Contributor

alex285 commented Jan 22, 2016

Terminix also has an identical search to Gnome Terminal, with Regex.
But has no search provider though. Do you want to change the subject to search provider?

@brunelli
Copy link
Author

Oh... After reading your comment I finally found it!

But that are some issues with it:

  • The search widget is weird, and it gets in front of the content. Maybe it would look better if it was like the one in Nautilus?
  • A search provider would be awesome, because it would help to find things between sessions and tiles.

I'll change the title, thanks.

@brunelli brunelli changed the title Search text in the terminal output Add search provider and improve the overall look of the search box Jan 22, 2016
@gnunn1
Copy link
Owner

gnunn1 commented Jan 23, 2016

I liked your idea of emulating the Nautilus search, how about this? I moved the Revealer (i.e. the slider) out of the overlay and made it a peer to the terminal so now it pushes the terminal down when revealed. I also tried to make it more compact by moving the options into a menu button.

screenshot from 2016-01-22 20-52-13

gnunn1 added a commit that referenced this issue Jan 23, 2016
@bilelmoussaoui
Copy link
Contributor

Looks better! maybe showing the number of the results somewhere too?

@gnunn1
Copy link
Owner

gnunn1 commented Jan 23, 2016

Unfortunately the terminal widget I'm using doesn't support things like showing the number of results or highlighting all matches. You can see the docs for it here if interested: https://developer.gnome.org/vte/0.40/VteTerminal.html

@brunelli
Copy link
Author

Really a improvement!

I was playing a bit with it and ended up with this:

139590d8-c14a-11e5-895e-c1edc149bd57

It mixes up a bit the current status of searching in Epiphany with the upcoming Nautilus search.

Also, maybe the checkboxes should be changed to ON/OFF switchers.

@gnunn1
Copy link
Owner

gnunn1 commented Jan 23, 2016

That looks great, thanks a lot for taking the time to do this, let me see what I can do to emulate it. I particularly like how you have the options right after the search box which follows the flow of a user does a search, much better then at the end where I have it.

With respect to switches, Gnome HIG is to use switches for hardware devices (i.e. like the terminal bell in preferences) and checkbuttons for options which is the case here.

https://developer.gnome.org/hig/stable/switches.html.en

@brunelli
Copy link
Author

Nice, thanks for point to the HIG! I was a little confused because the new Nautilus search uses a switcher to turn on/off the "Search Subfolders" option.

@gnunn1
Copy link
Owner

gnunn1 commented Jan 23, 2016

Here's what have now, based on brunellli's mockup. BTW what icons are you using in that mockup, like them better then ones I'm using, if they are part of standard icon themes I'll look into switching.

screenshot from 2016-01-23 17-16-45

@bilelmoussaoui
Copy link
Contributor

@gnunn1 the icons are go-up-symbolic and go-down-symbolic i guess

gnunn1 added a commit that referenced this issue Jan 23, 2016
@gnunn1
Copy link
Owner

gnunn1 commented Jan 23, 2016

That's what I'm using already, I guess it's just differences in icon packs
(I'm using Moka)

On Sat, Jan 23, 2016 at 5:21 PM, Bilal Elmoussaoui <notifications@github.com

wrote:

@gnunn1 https://github.com/gnunn1 the icons are go-up-symbolic and
go-down-symbolic i guess


Reply to this email directly or view it on GitHub
#48 (comment).

@bilelmoussaoui
Copy link
Contributor

The default icons(Adwaita) are the same as in the mockup of @brunelli

@gnunn1 gnunn1 self-assigned this Jan 23, 2016
@gnunn1
Copy link
Owner

gnunn1 commented Jan 28, 2016

Improved search box rolled out with 0.45, going to edit this to just reflect the search provider enhancement.

@gnunn1 gnunn1 changed the title Add search provider and improve the overall look of the search box Add gnome shell search provider Jan 28, 2016
@bilelmoussaoui
Copy link
Contributor

Btw, the next and previous need to be marked as insensitive if there's no more previous/next results ! 👍

@gnunn1
Copy link
Owner

gnunn1 commented Jan 28, 2016

Good point, the find previous/next does return a bool indicating whether a match is found, so I couldn't make the buttons insensitive until at least one failure happened. There is also the wrap around option that this would need to work with as well.

I'll play around with it and see if some sort of reasonable behavior can be achieved.

@gnunn1
Copy link
Owner

gnunn1 commented Feb 10, 2016

Gnome search provider is dependent on #24, adding DBus support.

@dsboger-zz
Copy link
Contributor

According to [1], if your application is a GApplication and it does not override the default command line argument parsing function, it is very simple to make it DBus-activatable. I can make a simple PR to enable that it that is the case.

[1] https://wiki.gnome.org/HowDoI/DBusApplicationLaunching

@gnunn1
Copy link
Owner

gnunn1 commented Feb 20, 2016

I looked at that link, from a code perspective Terminix should work with this as I am using the built-in command line handling for GTKApplication. If you have time to put together a PR for this that would be great. Note I do override the local handling but that's only there from when I was debugging and the value it returns indicates default processing should continue, I'll remove it though as it adds no value.

The gnome-search-provider does require a specific interface to be implemented though:

https://developer.gnome.org/SearchProvider/

If you want to go further and write some D code to tackle that as well I'd be happy to accept a PR here too, but it might be a bit of effort as D does not have great integration with DBus at this point. I can give you some more detailed thoughts on this if you want to try though.

@dsboger-zz
Copy link
Contributor

Well, I've done the easy part, i.e. sent a PR that makes Terminix DBus activatable. Works For Me.

I've also investigated the state of DBus bindings for D. I looked at ddbus [1] and dbus-d (last commit 8 years old) [2], but it seems both lack support for dictionary type, which is required by the GetResultMetas method of the search provider. I've reported an issue [3] in ddbus asking if there are plans to support dictionary types. I don't think I can move any further than that by now, as I'm not a D programmer, have only basic knowledge of DBus and no experience with language bindings whatsoever.

EDIT: Feel free to drop some ideas, as I may try to dig deeper when I have the chance.

[1] https://github.com/trishume/ddbus
[2] http://www.dsource.org/projects/dbus-d/
[3] trishume/ddbus#3

@gnunn1
Copy link
Owner

gnunn1 commented Feb 21, 2016

My plan was to leverage the existing DBus support in GtkD, see here for the docs for DBusServer as a starting point. GtkD already supports Dictionary and I'd strongly prefer to stick with this implementation because it fits in seamlessly since Terminix is already using GtkD for the user interface.

The issue with the GtkD implementation is that it is low level with callbacks requiring C functions declared in D versus extern. I'd want to wrap this to make it more user friendly and to allow DBus to interface easily with D objects/delegates which is what the library at [1] is doing. So essentially a composite approach where we would use a similar style to [1] but based on the existing GtkD APIs instead of re-importing the C functions and introducing a potentially different memory management strategy.

This is a fair amount of work and this feature, while nice to have, isn't critical so for me this is somewhat low priority.

@bijanbina
Copy link

bijanbina commented May 27, 2016

Hi,
sorry to interrupt. here I created a minimal working example of gnome-search-provider which is based on cosimoc work. (it upgraded to support gnome 3.20 and maded more minimal).
just think that it may helpful to you.

@vaijab
Copy link

vaijab commented Aug 15, 2016

I am not trying to push or anything. I just wanted to say that I used to use gnome search to switch between terminals quite a lot when I was using gnome-terminal. It is very handy.

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

7 participants