cerebroapp / cerebro-basic-apps

📦 Cerebro plugin for applications search and launch on windows and linux
MIT License
11 stars 11 forks source link

How to configure to ignore paths/directories/folders? #13

Open amsheppard opened 7 years ago

amsheppard commented 7 years ago

Issue

How can I set Cerebro to ignore paths/directories/folders? I have duplicate app launcher icons from /usr/share/applications/ in my ~/.local/share/applications/ due to the way Loki's dock, plank, currently must be configured. I would like to ignore these *.desktop files located in that home dir's path.

While I've ensured these ~/.local/share/applications/*.desktop files all contain NoDisplay=true to so they do not appear as duplicates within Loki's Applications menu, I think I would also be interested in the ability to exclude other paths from Cerebro as well (eg: ~/tmp/*). How can this be accomplished?

(EDIT: clarity)

maximbaz commented 7 years ago

Speaking of launching applications, Cerebro is only looking for *.desktop files in specific set of folders (and ~/tmp/* is not one of them). And you have already discovered a way to ignore specific *.desktop files in these folders - by adding NoDisplay=true those *.desktop files will be omitted by Cerebro.

amsheppard commented 7 years ago

Very odd. I seem to be experiencing the very opposite behavior you state & that code implies.

While cat ~/.local/share/applications/networking/filezilla.desktop | grep "NoDisplay=true" is, of course, set by me, the stock /usr/share/applications/filezilla.desktop still gives me both icons when using Cerebro. I note each of the listings for that app have different time-stamps reported by Cerebro... so are the byte sizes (388B vs 403B). I would assume the latter byte size indicates my addition of NoDisplay=true to ~/.local/share/applications/networking/filezilla.desktop (403B) while /usr/share/applications/filezilla.desktop reports 388B. See below:

ll /usr/share/applications/filezilla.desktop
-rw-r--r-- 1 root root 388 Feb 25  2016 /usr/share/applications/filezilla.desktop
ll ~/.local/share/applications/networking/filezilla.desktop
-rw-r--r-- 1 null null 403 Mar 28 13:18 /home/null/.local/share/applications/networking/filezilla.desktop

I also installed Shotcut via snapd yet do not see /snap/shotcut/current/Shotcut.desktop in any results fr Cerebro. The code you linked seems to state that directory to be outside of its search parameters, would that be correct?

(Aside: I mentioned ~/tmp as I would think Cerebro would eventually have the ability to display results of searching for text documents, etc.)

Thanks for your continued assistance to my queries, maximbaz.

maximbaz commented 7 years ago

As a quick idea, drop the cache and see if it fixes all your problems 🙂 rm ~/.config/Cerebro/apps_cache.json

One *.desktop file should not result in two icons in cerebro, so if it's not some weird cache issue, it could just be a bug. But given that the sizes are different, my bet is on the cache 😉

Right, /snap/shotcut/current/ is not among the directories where Cerebro is looking for *.desktop files. Is it a common place for the *.desktop files to be? If so, perhaps raise a separate issue to add this folder to the list.

I mentioned ~/tmp as I would think Cerebro would eventually have the ability to display results of searching for text documents, etc.

Cerebro has file navigation (type ~ or / in the window), but not file search as far as I know. There are external plugins that do the search, for example Everything for Windows. So the request to filter search results would have to be filed for a specific plugin.

amsheppard commented 7 years ago

GOAL! ... almost.

rm ~/.config/Cerebro/apps_cache.json didn't seem to do it... but after then sudo dpkg --purge cerebro && sudo dpkg -i cerebro_0.2.7_amd64.deb it seems we're back on track... though I had to re-flag the system tray icon option. My previous plugins seem to be still registered (eg: Shell still works).

Maybe there should be some sort of option to rescan & rebuild the cache? Just a random thought...

IDK what's the expected snapd shortcut location. That's what it is on a fresh install of eOS 0.4 (Loki), based on Ubuntu 16.04. Other distros may be different, I'm guessing. I filed a new issue related to it.

(Kool. I didn't really expect Everything to be available for Linux. I'll take a shoot over & check it out. Thanks!)