Results 1 to 9 of 9

Thread: Command to open Home Directory in Nautilus with search function?

  1. #1
    Join Date
    Oct 2020
    Beans
    32

    Command to open Home Directory in Nautilus with search function?

    Hi everyone, I hope you are doing well.

    I am looking to create a shortcut for the search key on my laptop keyboard. I would like to open the Home directory in Nautilus, then open a search at the same time (so I can just press that & type what I need to to find the files in my Home folder).

    Is there any command I can use to create this shortcut?

    Thank you, I'd really appreciate it,
    Gregg.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Command to open Home Directory in Nautilus with search function?

    IDK, but what would you type (don't use the mouse) to make this happen? Using xdotool, you can assign a key to run any command/script.

    With some DEs, you can tap the Super key, then start typing any filename ... then hit <enter> as the file is selected as more and more are removed with each character. No need for the extra step of a file manager.

  3. #3
    Join Date
    Oct 2020
    Beans
    32

    Re: Command to open Home Directory in Nautilus with search function?

    I understand that, and thank you for the suggestion.

    But I was writing this post to see if there was specficially a command to open a directory then turn on the search function in Nautilus.

  4. #4
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Command to open Home Directory in Nautilus with search function?

    Did you check the Nautilus manpage (aka Gnome-Files) help online?
    http://manpages.ubuntu.com/manpages/...autilus.1.html I just did. Perhaps you have a different OS release that has different options and could work? There doesn't seem to be any mention of 'search' there, but perhaps I missed it?

    I think using xdotool or just use a dedicated search tool, are the only real options. There must be 15 search tools. http://manpages.ubuntu.com/manpages/...ch-tool.1.html is one. It accepts a directory to search AND query terms. I think it could meet your needs, but only you can check it out. I don't have it on any of my systems and it isn't offered as an option.

    I like Recoll because it is basically google for my storage, but it needs daily indexing to keep current. I find the Recoll GUI much to fat/bloated for searching, but the CLI interface is very fast and returns relevant results in less than 1sec with lots of options possible - like soundex. I'm terrible at spelling, so soundex finds results that can be spelled very different, but the sounds are close. Also, it knows to ignore word endings. Ah ... Recoll looks inside files, not just at the filename. When I want to only search filenames, I use locate.

    Lots of possibilities.

  5. #5
    Join Date
    Apr 2008
    Beans
    111

    Re: Command to open Home Directory in Nautilus with search function?

    If a understand correctly what you want to do, then the following should work:

    Settings > Keyboard > Customise Shortcuts

    Click Custom Shortcuts > Add Shortcut

    Add

    Name: (whatever)
    Command: nautilus -w
    Shortcut: (whatever key combo you want)

    Now when you press that key combination, a new nautilus window will open with your Home directory selected, and you just need to start typing to activate the search function.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Command to open Home Directory in Nautilus with search function?

    But that won't automatically bring up the search.
    With xdotool and a tiny script can be tied to a keypress:
    Code:
    nautilus ~  ; sleep 1s; xdotool key --clearmodifiers C-f
    this assumes that <cntl>-f will bring up the search dialog and that the window manager sets a new window to have focus. Not the way my setup is, but I suspect most people work that way. IDK.

    I did test this with caja. The C-f didn't work even when the window focus was correct. That seems odd, since I use it lots of other places.

    I suppose a short cnee script could work. That tool is extremely positionally sensitive, so placement of the nautilus window and the geometry would likely be required. Something like: caja -g 600x400 & OTOH, it sends exact mouse and keyboard inputs, so it will work. The workflows I have it automating are usually 5-10 minutes long. cnee probably doesn't work with Wayland. It is an X/Windows tool, but so is xdotool. But IDK about recent Wayland. Last time I looked was about 2 yrs ago and it didn't work.
    Last edited by TheFu; April 12th, 2022 at 02:45 PM.

  7. #7
    Join Date
    Apr 2007
    Beans
    3,141
    Distro
    Ubuntu

    Re: Command to open Home Directory in Nautilus with search function?

    It is already working out of the box like that. Open Files. You can immediately start typing and search will begin.

  8. #8
    Join Date
    May 2008
    Beans
    4,132
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: Command to open Home Directory in Nautilus with search function?

    Quote Originally Posted by vanadium View Post
    It is already working out of the box like that. Open Files. You can immediately start typing and search will begin.
    That is a revelation.
    Even for those of us who have used Nautilus/Files for many years, there is always something to learn.

    Thanks for the tip.

  9. #9
    Join Date
    Oct 2020
    Beans
    32

    Re: Command to open Home Directory in Nautilus with search function?

    God I feel so stupid now lmao.

    Thank you so much.

Tags for this Thread

Bookmarks

Posting Permissions

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