Script for creating Application Menu



Hi all,

I made a basic bash-script for creating a desktop menu based on the
stuff from /usr/share/applications/*.desktop. simply run the script, it
will then give you more infos :)

... This script is bash-only and gnu-sed-only. Maybe someone may improve
it. 

Also the original dynamic-menu.jl does not support Menu-entry names with
spaces in it, I've fixed that. Ideally it would support a third string,
which opens a Submenu ... Currently there's only one level, that's not
optimal.

Enjoy your new menu :)
Chris

Attachment: mksawmenu
Description: application/shellscript

(defun read-menu (filename)
	"dynamic menu"
  (setq src-file (open-file filename 'read))
  (setq res '())
  (while (setq line (read-line src-file))
    (if (string-match "^([a-zA-Z0-9\_\ ]+):([a-zA-Z0-9\_\.\"\ \/-]+)\n$" line)
	(let ((entry (substring line (match-start 1) (match-end 1)))
	      (prog (substring line (match-start 2) (match-end 2))))
	  (setq res
		(cons `(,entry (system ,(concat prog " &")))
		      res)))))
  (reverse res))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]