|
ginnOS
The reference: libc, the libraries and the kernel
|
the programs of the desktop: the .app files. More...
#include <stdbool.h>Go to the source code of this file.
Data Structures | |
| struct | app_t |
| struct | app_list_t |
Macros | |
| #define | APPS_DIR "/usr/share/applications" |
| #define | APP_CATEGORIES "Accessories", "Development", "Games", "Graphics", "Sound", "System", "Other" |
| #define | APP_ARGS_MAX 16 |
Functions | |
| app_list_t * | apps_load (const char *dir) |
| read the .app files of a directory (APPS_DIR for the system ones). | |
| void | apps_free (app_list_t *list) |
| const app_t * | apps_find (const app_list_t *list, const char *id) |
| the program with this id. | |
| int | app_split_exec (const char *exec, char *buffer, char *argv[APP_ARGS_MAX+1]) |
| split exec into words. | |
the programs of the desktop: the .app files.
each program the launcher shows has a file /usr/share/applications/ <id>.app in the settings format of libconf:
[app] name = Window demo comment = A test of the window server exec = heimdemo 2 icon = application-x-executable category = Development
name and exec must be there. icon is a Tela icon name (the icon library gives "unknown" for a name it does not have). category is one of APP_CATEGORIES; another or no category is "Other". hidden = true keeps the program out of the launcher (it can still be found by its id).
exec is split into words at spaces. a word in double quotes can have spaces in it. the first word is the program: a path, or a name in /bin.
| #define APPS_DIR "/usr/share/applications" |
| #define APP_CATEGORIES "Accessories", "Development", "Games", "Graphics", "Sound", "System", "Other" |
| #define APP_ARGS_MAX 16 |
| app_list_t * apps_load | ( | const char * | dir | ) |
read the .app files of a directory (APPS_DIR for the system ones).
a file without a name or exec is skipped, with a warning on stderr.
| void apps_free | ( | app_list_t * | list | ) |
| const app_t * apps_find | ( | const app_list_t * | list, |
| const char * | id ) |
the program with this id.
| int app_split_exec | ( | const char * | exec, |
| char * | buffer, | ||
| char * | argv[APP_ARGS_MAX+1] ) |
split exec into words.
| buffer | receives the words (it must hold strlen(exec) + 1 bytes). |
| argv | receives up to APP_ARGS_MAX words and a NULL. |