Skip to content
idkCpp edited this page May 19, 2016 · 2 revisions

Albert comes with the convienient feature to extend it with plugins. Everyone is free and welcome to issue their own plugin to me to ship it with every new version of albert. However it has to pass specific checks. These checks are necessary to guarantee the functionality and maintainability of this application and are therefore vital.

First Steps

So you want to create an extension. When creating a new extension, make sure that:

  1. you create it with the script. This ensures that the code will be according to the basic template.
  2. you modify all copyright notices accordingly
  3. you modify the values in the metadata.json and CMakeLists.txt file
  4. you add an add_subdirectory line to the CMakeLists.txt file in the plugins folder

Gerneral File Setup

When adding header files to your extension make sure that:

  1. they have the copyright notice on the first lines
  2. you have updated the copyright notice accordingly
  3. there are not header guards. Instead use #pragma once

When adding source files make sure that:

  1. you don't use a namespace declaration. Instead prefix every member with the according namespace
  2. the function members are seperated by 3 newlines and a javadoc-comment looking like /** ****[...]****/
  3. also the source files are fitted with appropriate copyright notices

Code mechanics

Albert provides an icon lookup class. It's called XdgIconLookup. To use it you have to:

  1. include the xdgiconlookup.h
  2. add iconlookup to the target_link_libraries directive in your CMakeLists.txt
Clone this wiki locally