Imported Upstream version 0.8.0
Mateusz Łukasik
8 years ago
0 | repo: 236107f09e6cbb1efcfcbcfca7fe3d01d6756c53 | |
1 | node: eae8c7854dab0437d283ae286b6b08dfb4af67d0 | |
2 | branch: default | |
3 | latesttag: v0.8.0 | |
4 | latesttagdistance: 1 | |
5 | changessincelatesttag: 1 |
0 | 607cb011a046afb469c8c6a32cb25fe82e1a9c99 v0.3.6 | |
1 | 85b6eda07d65fcb7dabde2cafba53d99597087ce v0.3.6.1 | |
2 | ce182c3b44d00d85ba2175c6276173ddd9f3dccd v0.3.6.3 | |
3 | a68d53a9e5a38c90cea912d0aa814d49c4275b41 v0.3.6.5 | |
4 | 2cc5c76a25810677086acecabc0ba6d7665f4633 v0.3.6.4 | |
5 | 989c9da7fd1d1a8ecce1f2e9ed00cf73d86219ae v0.3.6.6 | |
6 | 8aec06a014523304f4c85735af3d114cb8bd870d v0.3.6.7 | |
7 | 64441862ddf4be3f15207b7904b036b033b01805 v0.3.6.8 | |
8 | aec5f6b3bb4bb61fa1ff10bc7362c52e775b0ceb v0.4.99 | |
9 | c32044967c4d99dfc67b38ba7b29e57c344da4f3 v0.5.0 | |
10 | c32044967c4d99dfc67b38ba7b29e57c344da4f3 v0.5.0 | |
11 | 0000000000000000000000000000000000000000 v0.5.0 | |
12 | 0000000000000000000000000000000000000000 v0.5.0 | |
13 | 4974c50d687eae19ec284fb7911471a1eed9c4c2 v0.5.0 | |
14 | ffbe369c5cbd80c372cbff08d01e12c3c93bfa17 v0.5.1 | |
15 | ffbe369c5cbd80c372cbff08d01e12c3c93bfa17 v0.5.1 | |
16 | 0000000000000000000000000000000000000000 v0.5.1 | |
17 | 0000000000000000000000000000000000000000 v0.5.1 | |
18 | d03ae08b671008d672170356d201227360fbd37c v0.5.1 | |
19 | 3c78153fc3cb9115e83db95b6f4f0ca5a698f762 v0.7.0 | |
20 | a7f8a5815fd2443b43d3428901cee078bbfaf7c6 v0.8.0 |
0 | 2014-10-27 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
1 | ||
2 | * .hgtags: | |
3 | Added tag v0.7.0 for changeset 3c78153fc3cb | |
4 | [3daf21c3b626] [tip] | |
5 | ||
6 | * openbox-menu.h: | |
7 | Change version to 0.7.0 as it targets menu-cache 0.7.0 | |
8 | [3c78153fc3cb] [v0.7.0] | |
9 | ||
10 | * menu.c: | |
11 | Warn if XDG_MENU_PREFIX is set. This cause trouble with menu-cache | |
12 | 0.7 | |
13 | [b42fd73621d6] | |
14 | ||
15 | * utils.c: | |
16 | Won't crash if menu entry doesn't have exec key (thanks LStranger) | |
17 | [6a67e27a21a6] | |
18 | ||
19 | 2014-05-30 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
20 | ||
21 | * utils.c: | |
22 | Fix quote XML entity name, it is obviously named " | |
23 | [414186d93f26] | |
24 | ||
25 | 2013-11-30 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
26 | ||
27 | * .hgtags: | |
28 | Added tag v0.5.1 for changeset d03ae08b6710 | |
29 | [d8857e942f8c] | |
30 | ||
31 | * .hgtags: | |
32 | Removed tag v0.5.1 | |
33 | [d03ae08b6710] [v0.5.1] | |
34 | ||
35 | * ob_display.c: | |
36 | Fix missing double quote (issue #3) | |
37 | [2c8ef0cbc8f4] | |
38 | ||
39 | 2013-11-24 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
40 | ||
41 | * .hgtags: | |
42 | Added tag v0.5.1 for changeset ffbe369c5cbd | |
43 | [728467bbe0e6] | |
44 | ||
45 | * openbox-menu.h: | |
46 | Bump to 0.5.1 | |
47 | [ffbe369c5cbd] | |
48 | ||
49 | * README.md: | |
50 | Documentation updated | |
51 | [abc31487545b] | |
52 | ||
53 | 2013-11-17 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
54 | ||
55 | * ob_display.c: | |
56 | small change in XML template. | |
57 | [a3176b559389] | |
58 | ||
59 | * menu.c, ob_display.c, openbox-menu.h: | |
60 | Header and footer flags were removed. A XML template can be used | |
61 | instead (-T flags). | |
62 | [f2e2f8aa7463] | |
63 | ||
64 | 2013-11-11 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
65 | ||
66 | * README.md: | |
67 | Documentation correction | |
68 | [bb1d0bc4df6c] | |
69 | ||
70 | * ob_display.c: | |
71 | XML definition header added | |
72 | [51972bddb66a] | |
73 | ||
74 | 2013-11-09 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
75 | ||
76 | * README.md: | |
77 | line feeds removed in documentation | |
78 | [9329bcdd2b23] | |
79 | ||
80 | * README.md: | |
81 | Add custom header and footer section in documentation | |
82 | [e5f33a1cc4b3] | |
83 | ||
84 | 2013-11-04 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
85 | ||
86 | * TODO: | |
87 | TODO updated | |
88 | [cf2a78005b52] | |
89 | ||
90 | 2013-11-03 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
91 | ||
92 | * ob_display.c: | |
93 | Drop menu_cache_get_root_dir as it is marked as deprecated since | |
94 | 0.3.4 | |
95 | [50f75e1603d5] | |
96 | ||
97 | * menu.c, ob_display.c, openbox-menu.h, utils.c: | |
98 | Header and footer of the pipe-menu may be customize by user with -H | |
99 | and -F parameters. Minor changes in doc | |
100 | [2b97a171fdff] | |
101 | ||
102 | * menu.c, ob_display.c, openbox-menu.h: | |
103 | Error code retreived from callback | |
104 | [62e9c9e90c59] | |
105 | ||
106 | * menu.c, ob_display.c, openbox-menu.h, utils.c: | |
107 | Cold and rainy day: big changes in code | |
108 | [7ff8f172d1f3] | |
109 | ||
110 | * menu.c, openbox-menu.h: | |
111 | Use of a context to configure the program | |
112 | [0a9c0f5aac1b] | |
113 | ||
114 | 2013-10-26 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
115 | ||
116 | * README.md: | |
117 | Markdown syntax modification | |
118 | [fb3d86453f1b] | |
119 | ||
120 | * README.md: | |
121 | Example added in documentation | |
122 | [ead077817a39] | |
123 | ||
124 | 2013-10-25 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
125 | ||
126 | * README.md: | |
127 | README update | |
128 | [21d95458fade] | |
129 | ||
130 | * openbox-menu.h: | |
131 | A sort of version check added in order to inform user of older | |
132 | version of menu-cache during compilation | |
133 | [40f2d7b6d415] | |
134 | ||
135 | * menu.c: | |
136 | Changes in check_application_menu documentation | |
137 | [04e8f25ac257] | |
138 | ||
139 | * menu.c: | |
140 | Openbox can use user custom menus. | |
141 | ||
142 | XDG_CONFIG_DIRS is used to set ordered base directories for | |
143 | configuration as defined in XDG base directory specification. | |
144 | [e113bcf53407] | |
145 | ||
146 | 2013-10-24 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
147 | ||
148 | * menu.c, openbox-menu.h: | |
149 | date updated | |
150 | [4d3588e67180] | |
151 | ||
152 | * menu.c: | |
153 | menu_cache_lookup is called when openbox-menu is ran in persistent | |
154 | mode. | |
155 | [6c35466488e3] | |
156 | ||
157 | * menu.c: | |
158 | get_application_menu 2: the return. | |
159 | [3a02f28aff65] | |
160 | ||
161 | 2013-10-17 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
162 | ||
163 | * menu.c: | |
164 | free output variable only if it is allocated | |
165 | [86e1c4b18cdd] | |
166 | ||
167 | * menu.c: | |
168 | Fix bad propagated error return | |
169 | [409a1bb496e4] | |
170 | ||
171 | 2013-10-16 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
172 | ||
173 | * menu.c: | |
174 | Remove tests on xdg menu files asLibmenu-cache seems to take care of | |
175 | non-existent files and XDG_PREFIX value. | |
176 | [82f72f650e44] | |
177 | ||
0 | 178 | 2013-08-20 Fabrice THIROUX <fabrice.thiroux@free.fr> |
1 | 179 | |
2 | 180 | * .hgtags: |
181 | Added tag v0.5.0 for changeset 4974c50d687e | |
182 | [0e52ecf29860] | |
183 | ||
184 | * ChangeLog, openbox-menu.h: | |
185 | Definitively the 0.5.0 version. | |
186 | [4974c50d687e] [v0.5.0] | |
187 | ||
188 | * .hgtags: | |
189 | Removed tag v0.5.0 | |
190 | [3705bd7152a7] | |
191 | ||
192 | * .hgtags: | |
3 | 193 | Added tag v0.5.0 for changeset c32044967c4d |
4 | [b11386081931] [tip] | |
194 | [b11386081931] | |
5 | 195 | |
6 | 196 | * menu.c: |
7 | 197 | No need to free reload_notify_id, this is done by |
8 | 198 | menu_cache_remove_reload_notify. |
9 | [c32044967c4d] [v0.5.0] | |
199 | [c32044967c4d] | |
10 | 200 | |
11 | 201 | 2013-08-18 Fabrice THIROUX <fabrice.thiroux@free.fr> |
12 | 202 |
0 | # Contributors: Calimero <calimeroteknik@free.fr> | |
1 | # Maintainer: mimas <mimasgpc@free.fr> | |
2 | ||
3 | _pkgname=openbox-menu | |
4 | pkgname=$_pkgname-hg | |
5 | pkgver=66.35d948d8b998 | |
6 | pkgrel=1 | |
7 | pkgdesc="Dynamic XDG menu for openbox" | |
8 | arch=('i686' 'x86_64') | |
9 | provides=("openbox-menu") | |
10 | conflicts=("openbox-menu") | |
11 | url="http://mimasgpc.free.fr/openbox-menu.html" | |
12 | license=('GPL3') | |
13 | depends=('gtk2' 'menu-cache') | |
14 | makedepends=("mercurial") | |
15 | optdepends=('lxmenu-data: LXDE menus' 'gnome-menus: GNOME menus') | |
16 | source=("hg+https://bitbucket.org/fabriceT/openbox-menu") | |
17 | md5sums=('SKIP') | |
18 | ||
19 | pkgver() { | |
20 | cd $_pkgname | |
21 | echo $(hg identify -n).$(hg identify -i) | |
22 | } | |
23 | ||
24 | build() { | |
25 | cd $_pkgname | |
26 | make | |
27 | } | |
28 | ||
29 | package() { | |
30 | cd $_pkgname | |
31 | make install DESTDIR="${pkgdir}/usr/" | |
32 | } |
0 | 0 | // openbox-menu - a dynamic menu for openbox |
1 | // Copyright (C) 2010-13 mimas <mimasgpc@free.fr> | |
1 | // Copyright (C) 2010-15 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
2 | 2 | // |
3 | 3 | // This program is free software; you can redistribute it and/or modify |
4 | 4 | // it under the terms of the GNU General Public License as published by |
38 | 38 | g_main_loop_quit (loop); |
39 | 39 | } |
40 | 40 | |
41 | ||
42 | /****f* openbox-menu/get_application_menu | |
41 | /****f* openbox-menu/get_default_application_menu | |
43 | 42 | * FUNCTION |
44 | 43 | * Try to determine which menu file to use if none defined by user. |
45 | 44 | * XDG_MENU_PREFIX variable exists, it is used to prefix menu name. |
48 | 47 | * a char that need to be freed by caller. |
49 | 48 | ****/ |
50 | 49 | gchar * |
51 | get_application_menu (void) | |
50 | get_default_application_menu (void) | |
52 | 51 | { |
53 | 52 | gchar menu[APPMENU_SIZE]; |
54 | 53 | |
55 | 54 | gchar *xdg_prefix = getenv("XDG_MENU_PREFIX"); |
56 | 55 | if (xdg_prefix) |
57 | 56 | { |
58 | g_warning ("XDG_MENU_PREFIX environment variable set, this could prevent the menu from loading. Unset it if an error happens"); | |
59 | 57 | g_snprintf (menu, APPMENU_SIZE, "%sapplications.menu", xdg_prefix); |
60 | 58 | } |
61 | 59 | else |
63 | 61 | |
64 | 62 | return strdup (menu); |
65 | 63 | } |
66 | ||
67 | 64 | |
68 | 65 | /****f* openbox-menu/check_application_menu |
69 | 66 | * FUNCTION |
112 | 109 | gboolean show_kde = FALSE; |
113 | 110 | gboolean show_xfce = FALSE; |
114 | 111 | gboolean show_rox = FALSE; |
112 | gboolean show_unknown = FALSE; | |
115 | 113 | gboolean no_icons = FALSE; |
116 | 114 | gchar *template = NULL; |
117 | 115 | gboolean sn = FALSE; |
118 | 116 | gchar *output = NULL; |
119 | 117 | gchar **app_menu = NULL; |
120 | 118 | |
121 | /* | |
122 | * TODO: Registered OnlyShowIn Environments | |
123 | * Ref: http://standards.freedesktop.org/menu-spec/latest/apb.html | |
124 | * | |
125 | * GNOME GNOME Desktop | |
126 | * KDE KDE Desktop | |
127 | * LXDE LXDE Desktop | |
128 | * MATE MATÉ Desktop | |
129 | * Razor Razor-qt Desktop | |
130 | * ROX ROX Desktop | |
131 | * TDE Trinity Desktop | |
132 | * Unity Unity Shell | |
133 | * XFCE XFCE Desktop | |
134 | * Old Legacy menu systems | |
135 | */ | |
136 | 119 | GOptionEntry entries[] = { |
137 | 120 | { "comment", 'c', 0, G_OPTION_ARG_NONE, &comment, |
138 | 121 | "Show generic name instead of application name", NULL }, |
146 | 129 | "Show XFCE entries", NULL }, |
147 | 130 | { "rox", 'r', 0, G_OPTION_ARG_NONE, &show_rox, |
148 | 131 | "Show ROX entries", NULL }, |
132 | { "unknown", 'u', 0, G_OPTION_ARG_NONE, &show_unknown, | |
133 | "Show Unknown deskstop entries", NULL }, | |
149 | 134 | { "persistent",'p', 0, G_OPTION_ARG_NONE, &persistent, |
150 | 135 | "stay active", NULL }, |
151 | 136 | { "sn", 's', 0, G_OPTION_ARG_NONE, &sn, |
181 | 166 | else |
182 | 167 | context->output = NULL; |
183 | 168 | |
184 | if (show_gnome) context->show_flag |= SHOW_IN_GNOME; | |
185 | if (show_kde) context->show_flag |= SHOW_IN_KDE; | |
186 | if (show_xfce) context->show_flag |= SHOW_IN_XFCE; | |
187 | if (show_rox) context->show_flag |= SHOW_IN_ROX; | |
169 | // We add extra desktop entries to display. | |
170 | // Our current desktop is set when menu_cache has loaded its own cache. | |
171 | // (likely in menu_display function). | |
172 | if (show_gnome) context->show_flag |= SHOW_IN_GNOME; | |
173 | if (show_kde) context->show_flag |= SHOW_IN_KDE; | |
174 | if (show_xfce) context->show_flag |= SHOW_IN_XFCE; | |
175 | if (show_rox) context->show_flag |= SHOW_IN_ROX; | |
176 | if (show_unknown) context->show_flag |= 1 << N_KNOWN_DESKTOPS; | |
188 | 177 | |
189 | 178 | if (terminal_cmd) |
190 | 179 | context->terminal_cmd = terminal_cmd; |
204 | 193 | context->persistent = TRUE; |
205 | 194 | |
206 | 195 | if (!app_menu) |
207 | context->menu_file = get_application_menu (); | |
196 | context->menu_file = get_default_application_menu(); | |
208 | 197 | else |
209 | 198 | context->menu_file = strdup (*app_menu); |
210 | 199 | |
221 | 210 | { |
222 | 211 | gpointer reload_notify_id = NULL; |
223 | 212 | MenuCache *menu_cache = NULL; |
213 | ||
214 | g_unsetenv("XDG_MENU_PREFIX"); // For unknow reason, it doesn't work when it is set. | |
224 | 215 | |
225 | 216 | if (context->persistent) /* persistent mode */ |
226 | 217 | { |
0 | 0 | // ob_display.c - this file is part of openbox-menu |
1 | // Copyright (C) 2010-13 mimas <mimasgpc@free.fr> | |
1 | // Copyright (C) 2010-15 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
2 | 2 | // |
3 | 3 | // This program is free software; you can redistribute it and/or modify |
4 | 4 | // it under the terms of the GNU General Public License as published by |
139 | 139 | break; |
140 | 140 | |
141 | 141 | case MENU_CACHE_TYPE_APP: |
142 | if (app_is_visible (MENU_CACHE_APP(l->data), 0)) | |
142 | if (app_is_visible (MENU_CACHE_APP(l->data), context->show_flag)) | |
143 | 143 | menu_application (l->data, context); |
144 | 144 | } |
145 | 145 | } |
206 | 206 | context->code = MENU_DIR_ERROR; |
207 | 207 | return; |
208 | 208 | } |
209 | ||
210 | // Desktops are dynamically detected by menu_cache when reloading | |
211 | // its cache. It is now time to add our desktop to the show_flag in | |
212 | // the application context. | |
213 | add_current_desktop_to_context (menu, context); | |
209 | 214 | |
210 | 215 | GSList *l = menu_cache_dir_get_children (dir); |
211 | 216 |
0 | 0 | /* |
1 | 1 | * openbox-menu.h - this file is part of openbox-menu |
2 | * Copyright (C) 2010-13 mimas <mimasgpc@free.fr> | |
2 | * Copyright (C) 2010-15 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
3 | 3 | * |
4 | 4 | * This program is free software; you can redistribute it and/or modify |
5 | 5 | * it under the terms of the GNU Lesser General Public License as published |
20 | 20 | #define __OPENBOXMENU_APP__ |
21 | 21 | #include <menu-cache.h> |
22 | 22 | |
23 | #define VERSION "0.7.0" | |
23 | #define VERSION "0.8.0" | |
24 | 24 | #define APPMENU_SIZE 30 |
25 | 25 | #define TERMINAL_CMD "xterm -e" |
26 | 26 | |
57 | 57 | gchar *clean_exec (MenuCacheApp *); |
58 | 58 | gchar *safe_name (const char *); |
59 | 59 | gchar *item_icon_path (MenuCacheItem*); |
60 | guint32 get_current_desktop_flag (); | |
61 | void add_current_desktop_to_context (MenuCache *, OB_Menu *); | |
60 | 62 | |
61 | 63 | void menu_display (MenuCache *, OB_Menu *); |
62 | 64 |
0 | 0 | // utils.c - this file is part of openbox-menu |
1 | // Copyright (C) 2010-13 mimas <mimasgpc@free.fr> | |
1 | // Copyright (C) 2010-15 Fabrice THIROUX <fabrice.thiroux@free.fr> | |
2 | 2 | // |
3 | 3 | // This program is free software; you can redistribute it and/or modify |
4 | 4 | // it under the terms of the GNU General Public License as published by |
82 | 82 | const char *exec = menu_cache_app_get_exec (MENU_CACHE_APP(app)); |
83 | 83 | |
84 | 84 | g_return_val_if_fail(exec,""); |
85 | ||
85 | ||
86 | 86 | GString *cmd = g_string_sized_new (64); |
87 | 87 | |
88 | 88 | for (;*exec; ++exec) |
204 | 204 | else |
205 | 205 | return menu_cache_app_get_is_visible(MENU_CACHE_APP(app), de_flag); |
206 | 206 | } |
207 | ||
208 | const char* get_desktop_name() { | |
209 | const gchar *desktop = g_getenv ("XDG_CURRENT_DESKTOP"); | |
210 | if (desktop) | |
211 | return desktop; | |
212 | ||
213 | desktop = g_getenv ("DESKTOP_SESSION"); | |
214 | if (desktop) | |
215 | return desktop; | |
216 | ||
217 | // We return nothing. | |
218 | return NULL; | |
219 | } | |
220 | ||
221 | void | |
222 | add_current_desktop_to_context (MenuCache *menu, OB_Menu *context) { | |
223 | const char* desktop = get_desktop_name (); | |
224 | if (desktop) { | |
225 | context->show_flag |= menu_cache_get_desktop_env_flag(menu, desktop); | |
226 | } | |
227 | } | |
228 |