Updated 2014-08-29 16:19:08 by wdb

wdb With OS, I prefer Linux over Windows, but I don't mind if it is really comfortable. The most comfortable distribution I know is Ubuntu. But finding an application in startup menu is always an adventure to me.

So I built a startup menu using - suprise - Tk. All the following script Startmenu.tcl does is to puts the command, and all the shell script startmenu is using the output as command:

(2 files because I did not find out how to exit Tcl without finishing the executed application.)

Here it comes:
 package require Tk
 wm geometry . +[winfo pointerx .]+[winfo pointery .]
 set font "Helvetica 11"
 pack [menubutton .button -text Startmenü -font $font]
 .button configure -menu [menu .button.start -tearoff no -font $font]

 proc makeMenu {menu l} {
    global font
    set count 0
    foreach {cmd label cmdOrMenu} $l {
        switch -exact -- $cmd {
            command {
                $menu add command\
                    -label $label\
                    -command "puts {$cmdOrMenu}; exit"
            menu {
                set menu1 [menu $menu.[incr count]\
                               -tearoff no\
                               -font $font]
                $menu add cascade -label $label -menu $menu1
                makeMenu $menu1 $cmdOrMenu
            separator {
                $menu add separator
            default {
                return -code error "unknown command: $cmd"

 makeMenu .button.start {
    menu Büro {
        command LibreOffice soffice
        command Lyx lyx
    menu Multimedia {
        command Video totem
        command Musik rhythmbox
    menu Internet {
        command Heimatseite /home/wolf/onehand/onehand.kit
        command Ressourcen "nautilus /home/wolf/onehand/res"
    menu Entwicklung {
        command Cartoon3 "wish ~/bin/IDE/IDE.tcl"
        command Emacs emacs
    menu System {
        command Editor gedit
        command Terminal gnome-terminal
    separator - -
    command "Startmenü bearbeiten" {emacs ~/bin/Startmenu.tcl}

 tk_popup .button.start [winfo pointerx .] [winfo pointery .]

To place it in the launcher column to the left, create a .desktop file and drag'n'drop it to the other launchers.

[Category Utility]