[SOLVED] Searching in nautilus
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Searching in nautilus

    Lately I have been working with the keys in the gnome schema files. These are XML files located in /usr/share/glib-2.0/schemas/

    Most of the time I am look for a key, but I don't know which XML file it's in. I thought I could use the nautilus search feature to search the text inside the files for the key name I was looking for, but when I have tried this I get no results.

    I can open the files with gedit and search the file content with gedit and that works fine, but there a big bunch of files to look through and visual searching is not the most reliable.

    I thought there might be a problem with the file permissions and/or location so I copied them all to another disk into a directory I own and made sure the permission would not restrict reading the files. I can open the files with gedit as described above, but nautilus search would still not find anything based on the text inside the files even when I searched for text that I have verified was inside the files. I have looked in the "Files -> Preferences" but I did not find anything that would help.

    Nautilus search works fine to find files based on contained text for other file types; so I am mystified:

    Is nautilus prohibited from searching inside XML files?
    Is there a key or some other parameter I can set somewhere to allow searching inside XML files.
    Is there a different files tool (other than nautilus) I can use that will search inside XML files.

    Thanks in advance for your help on this.
    Have a Great Day!

  2. #2
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    It has occured to me that I should have probably approached this a different way. I have filed it as an issue for nautilus at the gnome GitLab site.

    I'll post back with whatever I find out.
    Have a Great Day!

  3. #3
    Join Date
    Jul 2018
    Location
    NSW, Australia
    Posts
    16
    Windows 7 Firefox 61.0

    Re: Searching in nautilus

    Quote Originally Posted by TablePC
    Is there a different files tool (other than nautilus) I can use that will search inside XML files.
    You probably already know this, and it's not a solution to your nautilus issue, but grep should work fine for this. For example:
    Code:
    $ grep "tray-enabled" /usr/share/glib-2.0/schemas/*.xml 
    /usr/share/glib-2.0/schemas/org.blueberry.gschema.xml:        <key name="tray-enabled" type="b">
    If you have a lot of similar searches to do you could make it a bit easier by defining a function in your .bashrc like:
    Code:
    mysearch() {
            grep "$1" /usr/share/glib-2.0/schemas/*.xml
    }
    which you could then use like:
    Code:
    $ mysearch "tray-enabled"
    /usr/share/glib-2.0/schemas/org.blueberry.gschema.xml:        <key name="tray-enabled" type="b">
    Apologies if I'm just stating the obvious...
    Last edited by Jim D; 9th August 2018 at 01:06 AM.

  4. #4
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    Thanks for the suggestion. Lately I have been using grep. I am far from a grep expert though and I never thought of making an alias for my search in my .bashrc. That's a great idea.

    I really didn't want to go CLI; it's a bit of a sensitive issue for me. Lately some of my favorite GUI applications that helped with common admin tasks and hardware programming tasks have been left unusable by changes and the answer is always going back to the CLI. I first used CLI on computers in the 60s. Back then I knew why the CLI was so arcane, obscure, and nasty; memory was a rare and very expensive commodity. So commands, their modifiers, and arguments had to be kept as short as possible. Though I will say that I didn't think of it as being obscure arcane etc back in the 60s. Then I thought it was way cool and I was like a member of a secret society that knew the secret codes to make a computer do things. I understand that bash will not be changing and I just have to go through learning all the stuff again.

    Thanks for your reply! An alias will save me a bunch of typing.
    Have a Great Day!

  5. #5
    Join Date
    Jul 2018
    Location
    NSW, Australia
    Posts
    16
    Windows 7 Firefox 61.0

    Re: Searching in nautilus

    Quote Originally Posted by TablePC
    Thanks for your reply! An alias will save me a bunch of typing.
    Well it's not an alias as such, it's a function, because aliases can't use arguments in the middle like that - an alias just expands to the string it represents, so to pass the "$1" it needs to be defined as a function. Personally I find it easier to jump to CLI for stuff like this, I use up/down arrows for command history search/completion with
    Code:
    #up/down arrow history search
    bind '"\e[A": history-search-backward'
    bind '"\e[B": history-search-forward'
    so repeating similar commands is easy, but I can understand when folks prefer a GUI solution. There are some grep GUI tools, I think, but I haven't used any linux ones, so can't recommend one. WinGrep is good in windows though. Hopefully the nautilus issue gets addressed/solved...
    Last edited by Jim D; 9th August 2018 at 03:26 PM.

  6. #6
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    The issue I filed with gnome in regard to nautilus has been responded to. As it turns out nautilus uses Tracker for searching and only directories that tracker has been told to search are indexed. So the Nautilus issue was closed.

    Then I opened nautilus and created a bookmark for the schemas directory. Then I opened gnome control center and in the Search panel under bookmarks, I turned on searching for schemas. After a system restart (just incase) I tried the search again, and continued getting "No Results Found" Now I have filed an issue with gnome in regard to Tracker.

    Stay tuned this should be interesting.
    Have a Great Day!

  7. #7
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    Thanks Jim. Now that I look at again, I see how it is really a function. I appreciate the CLI lessons. I really do have to get used to this again.
    Have a Great Day!

  8. #8
    Join Date
    Jun 2005
    Location
    Montreal, Que, Canada
    Posts
    5,225
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    Here is some info about compiling xmls for gnome-extensions. It indicates what gnome does with xml's and what I describe below may be similar to what you are wanting to do.

    Typically, the global gnome extension schemas (*.xml) are stored within /usr/share/glib-2.0/schemas
    or the local xmls are in your home directory as ~/.local/share/gnome-shell/extensions/anextension/schemas.

    Gnome does not use the *xml, but requires it to be compiled to produce gschemas.compiled

    If your one system has many users, each using the same gnome extensions, you may want those local ones to be made global.

    If you want a local extension to be globally available, move the "anextension" folder to /usr/share/gnome-shell/extensions/
    and copy the xml file from the "anextension/schemas/*xml" to the /usr/share/glib-2.0/schemas

    For global functionality, as root, you will need to "compile" the schemas to create usr/share/glib-2.0/schemas/gschemas.compiled
    The compiler is invoked as shown with "glib-compile-schemas"
    cd /usr/share/glib-2.0
    sudo glib-compile-schemas schemas

    Gnome compiles the xml's into the one file as noted above. On reboot, gnome will read that file's contents.

    Oh yes, you do not want to have a global extension competing with a local extension as you could get double execution. Remove the local one.
    Last edited by lsatenstein; 9th August 2018 at 05:20 PM.
    Leslie in Montreal

    Interesting web sites list
    http://forums.fedoraforum.org/showth...40#post1697840

  9. #9
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    Leslie Thanks for the information. I'm happy to say that all the PCs I manage have only two accounts my admin account and one user account. Both accounts have the same schema key settings. So I don't think I'm at a stage where I'll be worrying about global vs local yet. I'll keep a link to this in case I need it in the future.

    This all started because when I change the PCs to the next version of Fedora I do a "reclaim all space" clean bare metal install on the PC from DVD. There are reasons I do it this way instead of just doing an upgrade.

    I've been trying to get more efficient at this; so first I made some scripts to uninstall applications that are not used here and install the ones that are used.

    After I had that working I started thinking about all the scrolling and clicking I do to set the various preferences in the gnome control center and in gnome tweaks. I decided to make another script that is just a bunch of "gsettings set ..." commands. I have that mostly done and working now, but one of the problems I had along the way was figuring out which schema file I needed to reference. I tried searching for schema files based on contained text, but had no luck. Then I found the dconf dump command and used it on a system I had already set up with my standard settings. That helped a lot. Now I'm kind of backtracking to find out why nautilus / tracker couldn't find schema files for me based on contained text.
    Have a Great Day!

  10. #10
    Join Date
    Jan 2013
    Location
    New York state in USA
    Posts
    216
    Linux (Fedora) Firefox 61.0

    Re: Searching in nautilus

    This thread is getting quite deep; so I think I'll move on as they say.
    Have a Great Day!

Similar Threads

  1. Nautilus scripts, mostly bash, as root open nautilus in current folder.
    By leadgolem in forum Programming & Packaging
    Replies: 19
    Last Post: 4th December 2017, 12:42 PM
  2. Searching for files in Nautilus
    By John Lovely in forum Using Fedora
    Replies: 3
    Last Post: 24th May 2006, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •