This is not a matlab based snippet but for the excellent WMII window manager. I use the ruby extension to WMII and have written a plugin to emulate the gnome menu system.
I have seen posts on the net asking how to get gnome panel working with WMII. The main reason for the request seems to be to get access to the system menus. This script will provide that use case.
I have seen posts on the net asking how to get gnome panel working with WMII. The main reason for the request seems to be to get access to the system menus. This script will provide that use case.
Plugin.define "bradphelan@xtargets.com" do author '"Brad Phelan" <bradphelan@xtargets.com>' # This plugin reads the app names and commands from the system # .desktop files using the output from the gnome-menu-test-spec # to group them into the same menus you would see if using the # gnome window manager. # # In your wmiirc-config file place the lines # # from "bradphelan@xtargets.com" do # use_binding "execute-gnome-menu" # end # # # Place this file in the .wmii-3/plugins directory # # By default the menu is activated by MODKEY-Y # # TODO: # # - Write a threaded version that monitors the menus # for change. # ###################################################### menus = {} txt = `gnome-menu-spec-test` txt << "\n" txt << `gnome-menu-spec-test -f /etc/xdg/menus/settings.menu` txt.each_line do |l| l.chomp! # Sample line : # Sound & Video/ gnome-sound-recorder.desktop /usr/share/applications/gnome-sound-recorder.desktop l.scan /^([^\/]*)\/[^\/]*(.*)$/ do |group,app| if group # lower case is easier to work with group.downcase! app.downcase! menus[group] = {} unless menus[group] File.open app do |file| name = '' cmd = '' file.each_line do |line| name = $1 if line =~ /^Name\s*=\s*(.*)$/ cmd = $1.sub(/%\w+/, '') if line =~ /^Exec\s*=\s*(.*)$/ end menus[group][name.downcase] = cmd end if File.exist? app end end end binding("execute-gnome-menu", "MODKEY-y") do |wmii,| Thread.new do wmii.wmiimenu(menus.keys) do |category| wmii.wmiimenu(menus[category].keys) do |name| system menus[category][name] end end end end end