Nemo plug-in API / examples

About programming and getting involved with Linux Mint development
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
stefan_o
Level 2
Level 2
Posts: 55
Joined: Wed Jan 11, 2017 4:40 pm

Nemo plug-in API / examples

Post by stefan_o »

Hey,
I would really love to have a simple, but powerful file search function inside Nemo, similar to the one that existed in Windows 2000. For example find "*.jpg", last modified between 1.5.2016 and 1.10.2016, filesize larger than 2MB, maximum dir depth 3 levels.
I already wrote a minimalist example that performs the search, but I couldn't find any information how to integrate into Nemo. My idea is to have an additional button and a menu entry for advanced search and if clicked the sidebar changes (or is shown if disabled) to show search parameters. You click search, the main frame with files is cleared and new title of windows is "search result", it starts searching and most important feature: Results are displayed life, if you see the file you were looking for, just press stop.

My question now: Is there a plug-in API (in C) that allows:
1) Allows new buttons/menu entry
2) Replace sidebar
3) Allows showing a custom list of files

Best regards,
Stefan
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12333
Joined: Sun Aug 09, 2015 10:00 am

Re: Nemo plug-in API / examples

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
stefan_o
Level 2
Level 2
Posts: 55
Joined: Wed Jan 11, 2017 4:40 pm

Re: Nemo plug-in API / examples

Post by stefan_o »

Hello,
while this scripting functionality looks interesting, I don't think it's possible to do with them what I'm planning to do.
Is there any example of a sidebar other than places and tree view as a plug-in/extension?
Best regards
Stefan
User avatar
xenopeek
Level 25
Level 25
Posts: 29460
Joined: Wed Jul 06, 2011 3:58 am

Re: Nemo plug-in API / examples

Post by xenopeek »

While there is a lot of documentation available for Cinnamon development (just install cinnamon-doc package and access the DevHelp menu entry under the Programming category in your menu after installation) I don't know of a ready set of documentation like that for Nemo development. I think you will have to write an extension. You can find the source code for Nemo extensions maintained by Linux Mint here https://github.com/linuxmint/nemo-extensions. Possibly the Nemo extensions library source code itself will also be useful: https://github.com/linuxmint/nemo/tree/ ... -extension. Perhaps nemo-terminal will be useful to look at; it adds a pane above the file list (click to enlarge):

Image

To try it out install the nemo-terminal package and in Nemo go to Edit > Plugins and ensure in the Extensions box it is enabled.

For more help I'd suggest getting in contact with the developers. You can find them on our IRC channel #linuxmint-dev on irc.spotchat.org. Just open HexChat from your menu to connect to the Linux Mint IRC support channels and type /join #linuxmint-dev to join the develop channel. Helpful hints on how to be most effective on this channel noted here: http://projects.linuxmint.com/contributing.html
Image
stefan_o
Level 2
Level 2
Posts: 55
Joined: Wed Jan 11, 2017 4:40 pm

Re: Nemo plug-in API / examples

Post by stefan_o »

Thank you very much! I already looked at the source at it seems that there is no way for an extension to create a custom sidebar, the two possible sidebars seem to be hardcoded at a lot of places.
As there is already a search function (where now the terminal in your picture is), I rather want to improve that one than to reinvent the wheel. I already made a first improvement, allow wildcard search (without breaking backward compatibility with existing search phrases).
I have been to the IRC channel and I made a git pull request like I was told to, but no reaction yet: https://github.com/linuxmint/nemo/pull/1397

One major problem with the search that really annoys me, it does not show partial results. But problem is not the search itself, even when every file is reported immediately (default behavior wait until at least 500 files are on the list and then report), at some point all the update events are stalled and processed when search is finished. I couldn't figure out the problem, probably related to multi-threading.
Locked

Return to “Programming & Development”