Toggle menubar of any GTK2 or GTK3 application
  • C 79.9%
  • Makefile 20.1%
Find a file
2026-01-04 03:27:19 +01:00
.gitignore new makefile, use ctrl+alt+m as hotkey 2022-08-19 13:13:27 +02:00
libwinmenu.c removed spdx header, added local good anonymus 2022-09-03 10:57:01 +02:00
Makefile added CFLAGS += -Wno-error=incompatible-pointer-types 2026-01-04 03:27:19 +01:00
README.md proper enviornment variable instruction 2022-09-03 11:41:53 +02:00

libwinmenu.c will compile to a GTK module (winmenu) that when used, will hide the menubar of GTK2 and GTK3 applications, it also adds a keybinding for toggling the menubar: (Ctrl+Alt+m).

This version can compile to both a GTK2 and GTK3 compatible module. (By setting GTK3_BUILD).

installation

git clone https://github.com/budRich/gtk-libwinmenu.git
cd gtk-libwinmenu
make
sudo make LIBDIR=/usr/lib install # adjust LIBDIR for your distribution

usage

Set the following environment variable for changes to take place: GTK_MODULES=winmenu

to be sure to preserve other set GTK_MODULES, use this: GTK_MODULES="winmenu${GTK_MODULES:+:$GTK_MODULES}"

To have it always apply (NOT recommended):
export GTK_MODULES=winmenu (in ~/.xinitrc or similar).

To apply module on a specific application: GTK_MODULES=winmenu thunar

To use in .desktop files, set the Exec field to:
env GTK_MODULES=winmenu thunar

(thunar is just an example command)

known issues

Might not work properly with all applications (hence not recommended to apply globally). The following applications will always be ignored:
gnome-terminal, gimp-2.10, mousepad, arandr

credits

libwinmenu.c is based on the AUR packages gtk2-libwinmenu and gtk3-libwinmenu, which in turn is based on post at the linux.org.ru forums.
(http://www.linux.org.ru/jump-message.jsp?msgid=5606544&cid=5617512)