BrainOut!
The mumblings of a Christian autistic husband, dad, IT guy and amateur radio operator - Will Brokenbourgh / AF7EC
Gtk Menu - Standalone
Related: QtMenu
If you use this program and have questions, encounter a bug or have suggestions, please leave a comment below! If I don't hear from you, I can't make the program better for you! ;-)
Yet another standalone menu, this time written in Gtk 2.
What is this?
Gtk Menu - Standalone is a standalone
applications menu written in C for Unix-like (Linux, *BSD) operating systems.
It can be run by your favorite launcher (bbbutton, fluxbox menu, with
a hotkey app/binding, etc). This menu always shows the latest installed
applications that have .desktop
entries in the user and system
applications
directories.
Why would I want it?
If you use a window manager
that doesn't have a 'nice' built-in menu, ('nice' meaning similar to Xfce4,
LXDE or Mate's menus), you have to either manually edit your window
manager's menu, or hope your distro includes menu utilities to build menus
for you. Gtk Menu - Standalone takes a lot of the headaches out of using a
minimal window manager when you want a decent applications menu.
Just like the Qt Menu, I created Gtk Menu because I use Fluxbox as my window manager on Linux and I'm pretty happy with it. The problem is that Fluxbox's built-in toolbar doesn't have launchers nor does it have the kind of menu you might find on lxpanel or xfce4-panel. Unhappy with the reliability and performance of lxpanel and xfce4-panel, I decided to create this app up so I can have the kind of desktop I really want.
I've done my best to make this application menu XDG-compliant, so if you find any issues, let me know through the comments below.
I know a lot of folks put their projects on Sourceforge or Github. I tried Github, but it really wasn't worth the effort, and no one was even visiting the project page I set up.
Features
• Checks user and system applications
folders for .desktop
menu entries
• Checks every time menu is shown -- newly installed apps should appear right away.
• Menu position can be customized (defaults to lower-left).
• Custom frequently-used programs can be displayed (at top of menu).
• Commands for Run...
, Exit
, Reboot
and Shutdown
can be customized.
• All options are set in the well-commented config file
• Compiles fine on most Linux distros, FreeBSD and OpenBSD
Current Issues
• Only displays English text (should be fixed as of 0.3.0)
• No tooltips for menu items. I do not want them. Feel free to hack and add that!
• On some systems, if you launch this menu and it doesn't appear, the
delay
option in the config file may need to be increased. This
is because if you hold the mouse button down too long when clicking your favorite
launcher button, it will cause the menu to cancel prematurely and get stuck running in the
background. If you see a few instances of gtkmenu-standalone in your process list,
this may be the case. Increasing the delay should help but you also much make sure
not to hold the mouse button down too long when clicking. This is usually only a
problem on launchers such as lxpanel and fbpanel where the launching happens with
the mouse-down
event, instead of the correct mouse-up
event.
• Does not cache .desktop
files / menu items. This is by design.
If you have any questions, or have found a bug not mentioned above, just leave a comment below.
Download the Gtk Menu - Standalone source:
View the included README
file for building and installation instructions
- Version 0.5.1 [ 2019-04-16 · 10 KB ] - Fixed segfaulting on Ubuntu and other Linux distros
- Version 0.5.0 [ 2017-05-22 · 10 KB ] - Cleaned up / refactored code. Should work on OpenIndiana now. Added 'Show At Mouse Position' config option
- Version 0.4.4 [ 2016-06-02 · 10 KB ] - Cleaned up / refactored code.
- Version 0.4.2 [ 2015-08-18 · 10 KB ] - Fixed duplicate items from user's application folder. Fixed strncat compile warning.
- Version 0.4.1 [ 2015-07-26 · 10.3 KB ] - Another major rewrite. Fixed problems with user applications directory not being found, cleaned up some inefficient code. Fixed issue for items that don't have icons carrying over icon from last item. Other fun stuff. ;-)
- Version 0.3.0 [ 2015-03-17 · 8.9 KB ] - Major rewrite, change of config-file location, recurse into sub-directories, should be mostly localized, more desktop environment item options, added Makefile
- Version 0.2.1 [ 2014-03-05 · 8.2 KB ] - Cleanup, '.desktop' fix, 'strP' overflow fix, 'else' in categories
- Version 0.2.0 [ 2014-03-03 · 8.0 KB ] - Cleanup, new features, directives for Linux/FreeBSD
- Version 0.1.1 [ 2014-02-26 · 7.1 KB ] - Code cleanup
- Version 0.1.0 [ 2014-02-25 · 7.0 KB ] - First release
Comments
First:
Makefile needs -std=c11 in CFLAGS to compile on my machine
3.19.0-24-lowlatency Ubuntu
Second:
gtkmenu-standalone: Error opening /usr/share/Jwm/applications/ - aborting
This is an issue with
g_get_system_data_dirs()[0]
it takes the first entry of my XDG_DATA_DIRS rather than parsing the array and making sure the directory actually exists.
So my menu is populated with an 'Other' entry that is empty.
$ echo $XDG_DATA_DIRS
/usr/share/Jwm:/usr/local/share/:/usr/share/
it should pick the last one (since that is where my applications dir is)
Jesus is Lord thanks for your program, I am excited to use it
I actually have been laboring over gtkmenu-standalone the last couple of days and have re-coded some of it to address (most?) of your issues.
Since it might take a while for me to post an update on my blog, I will send you the source through e-mail, and you can give it a try.
If you find any other issues, please please please let me know.
One existing bug I have not been able to squash is if you hold down your mouse button for too long when you launch gtkmenu-standalone, it will not display and will get stuck in the background. I have posted a question on StackOverflow about it (see URL below) but I haven't received an answer yet. Just remember to quickly click whichever launcher you're using for best results.
http://stackoverflow.com/questions/31617096/gtk2-menu-only-app-doesnt-appear-when-mouse-button-that-launches-it-is-held-d(dead link)Thank you! :-D
God bless you! :-)