Package list openbox-menu / c0eb9cc
Imported Upstream version 0.8.0 Mateusz Łukasik 6 years ago
9 changed file(s) with 310 addition(s) and 34 deletion(s). Raw diff Collapse all Expand all
0 repo: 236107f09e6cbb1efcfcbcfca7fe3d01d6756c53
1 node: eae8c7854dab0437d283ae286b6b08dfb4af67d0
2 branch: default
3 latesttag: v0.8.0
4 latesttagdistance: 1
5 changessincelatesttag: 1
0 syntax: glob
1 *.orig
2 *.rej
3 *~
4 *.o
5 *.so
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 &quot;
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
0178 2013-08-20 Fabrice THIROUX <fabrice.thiroux@free.fr>
1179
2180 * .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:
3193 Added tag v0.5.0 for changeset c32044967c4d
4 [b11386081931] [tip]
194 [b11386081931]
5195
6196 * menu.c:
7197 No need to free reload_notify_id, this is done by
8198 menu_cache_remove_reload_notify.
9 [c32044967c4d] [v0.5.0]
199 [c32044967c4d]
10200
11201 2013-08-18 Fabrice THIROUX <fabrice.thiroux@free.fr>
12202
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 }
00 // 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>
22 //
33 // This program is free software; you can redistribute it and/or modify
44 // it under the terms of the GNU General Public License as published by
3838 g_main_loop_quit (loop);
3939 }
4040
41
42 /****f* openbox-menu/get_application_menu
41 /****f* openbox-menu/get_default_application_menu
4342 * FUNCTION
4443 * Try to determine which menu file to use if none defined by user.
4544 * XDG_MENU_PREFIX variable exists, it is used to prefix menu name.
4847 * a char that need to be freed by caller.
4948 ****/
5049 gchar *
51 get_application_menu (void)
50 get_default_application_menu (void)
5251 {
5352 gchar menu[APPMENU_SIZE];
5453
5554 gchar *xdg_prefix = getenv("XDG_MENU_PREFIX");
5655 if (xdg_prefix)
5756 {
58 g_warning ("XDG_MENU_PREFIX environment variable set, this could prevent the menu from loading. Unset it if an error happens");
5957 g_snprintf (menu, APPMENU_SIZE, "%sapplications.menu", xdg_prefix);
6058 }
6159 else
6361
6462 return strdup (menu);
6563 }
66
6764
6865 /****f* openbox-menu/check_application_menu
6966 * FUNCTION
112109 gboolean show_kde = FALSE;
113110 gboolean show_xfce = FALSE;
114111 gboolean show_rox = FALSE;
112 gboolean show_unknown = FALSE;
115113 gboolean no_icons = FALSE;
116114 gchar *template = NULL;
117115 gboolean sn = FALSE;
118116 gchar *output = NULL;
119117 gchar **app_menu = NULL;
120118
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 */
136119 GOptionEntry entries[] = {
137120 { "comment", 'c', 0, G_OPTION_ARG_NONE, &comment,
138121 "Show generic name instead of application name", NULL },
146129 "Show XFCE entries", NULL },
147130 { "rox", 'r', 0, G_OPTION_ARG_NONE, &show_rox,
148131 "Show ROX entries", NULL },
132 { "unknown", 'u', 0, G_OPTION_ARG_NONE, &show_unknown,
133 "Show Unknown deskstop entries", NULL },
149134 { "persistent",'p', 0, G_OPTION_ARG_NONE, &persistent,
150135 "stay active", NULL },
151136 { "sn", 's', 0, G_OPTION_ARG_NONE, &sn,
181166 else
182167 context->output = NULL;
183168
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;
188177
189178 if (terminal_cmd)
190179 context->terminal_cmd = terminal_cmd;
204193 context->persistent = TRUE;
205194
206195 if (!app_menu)
207 context->menu_file = get_application_menu ();
196 context->menu_file = get_default_application_menu();
208197 else
209198 context->menu_file = strdup (*app_menu);
210199
221210 {
222211 gpointer reload_notify_id = NULL;
223212 MenuCache *menu_cache = NULL;
213
214 g_unsetenv("XDG_MENU_PREFIX"); // For unknow reason, it doesn't work when it is set.
224215
225216 if (context->persistent) /* persistent mode */
226217 {
00 // 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>
22 //
33 // This program is free software; you can redistribute it and/or modify
44 // it under the terms of the GNU General Public License as published by
139139 break;
140140
141141 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))
143143 menu_application (l->data, context);
144144 }
145145 }
206206 context->code = MENU_DIR_ERROR;
207207 return;
208208 }
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);
209214
210215 GSList *l = menu_cache_dir_get_children (dir);
211216
00 /*
11 * 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>
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published
2020 #define __OPENBOXMENU_APP__
2121 #include <menu-cache.h>
2222
23 #define VERSION "0.7.0"
23 #define VERSION "0.8.0"
2424 #define APPMENU_SIZE 30
2525 #define TERMINAL_CMD "xterm -e"
2626
5757 gchar *clean_exec (MenuCacheApp *);
5858 gchar *safe_name (const char *);
5959 gchar *item_icon_path (MenuCacheItem*);
60 guint32 get_current_desktop_flag ();
61 void add_current_desktop_to_context (MenuCache *, OB_Menu *);
6062
6163 void menu_display (MenuCache *, OB_Menu *);
6264
00 // 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>
22 //
33 // This program is free software; you can redistribute it and/or modify
44 // it under the terms of the GNU General Public License as published by
8282 const char *exec = menu_cache_app_get_exec (MENU_CACHE_APP(app));
8383
8484 g_return_val_if_fail(exec,"");
85
85
8686 GString *cmd = g_string_sized_new (64);
8787
8888 for (;*exec; ++exec)
204204 else
205205 return menu_cache_app_get_is_visible(MENU_CACHE_APP(app), de_flag);
206206 }
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