You are not logged in.
Intro:
Many people like to use "Start" menus for many reasons (New to Linux from windows, convenience, and NOT wearing out the right clicker on a laptop).
I needed a menu button in my panel for the last reason stated above, but I fif not want to have to install XFCE4 panel, or lxpanel. I wanted something I could use with tint2, such as the existing OpenBox menu. So after an hour or so, I came up with a solution.
Overview:
In order to open the menu, we need to simulate a right click or super key+space.
xdotool does the trick. (less than 200KB)
We create a .desktop file that executes xdotool super+space.
Add launcher (.desktop) to tint2 config.
When you click on the icon, xdotool simulates a super+space, and the menu open up where the mouse cursor is.
Do it:
First we need to install xdotool.
sudo apt-get install xdotoolOnce done, test it. A menu should pop up.
xdotool key super+spaceNow we have to create a . desktop file in /usr/share/applications called menu.desktop.
gksudo geany /usr/share/applications/menu.desktopOnce open, paste the following in and save.
[Desktop Entry]
Encoding=UTF-8
Name=Tint2 Openbox Menu
Comment=Tint2 Openbox Menu Hack
X-GNOME-FullName=Openbox Menu
Exec=xdotool key super+space
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=mousepad
Categories=Menu;
MimeType=
StartupNotify=trueOpen your tint2 config and make sure Launchers are enabled.
...
# Panel
panel_monitor = all
panel_position = bottom center horizontal
#Make sure that "L" is directly below.
panel_items = LTSC
panel_size = 100% 30
panel_margin = 0 -1...
Now locate the Launchers and add:
launcher_item_app = /usr/share/applications/menu.desktopIt should look something like this:
...
# Each launcher_item_app must be a full path to a .desktop file
launcher_item_app = /usr/share/applications/menu.desktop
launcher_item_app = /usr/share/applications/terminator.desktop
launcher_item_app = /usr/share/applications/iceweasel.desktop...
Now restart tint2, and you should see a "diamond with gears."
Ending:
When you click the icon, the Openbox menu will popup, and your set.
Last edited by KF7EEL (2012-05-14 03:16:16)
#!
and there goes Windoze.
Offline
Nice How To KF7EEL...
I have added it to Quick References as Simple "Start" menu button with Tint2
You may want to consider renaming the title of this as the same so that anyone seeing it from that perspective will know it is for tint2..
Thanks!
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Very nice! Thanks, KF7EEL.
Just one tiny suggestion. Could you please replace your command
sudo geany /usr/share/applications/menu.desktop
with
gksudo geany /usr/share/applications/menu.desktop
SUDO should only be used for CLI apps. GKSU or GKSUDO for apps with GUI.
A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.
Offline
Well, to start with, I found a few pieces of this on the arch forums.
#!
and there goes Windoze.
Offline
SUDO should only be used for CLI apps. GKSU or GKSUDO for apps with GUI.
I have always been curious as to why this is so...
I use sudo for everything out of long time habit and have never run into any issues whatsoever ...
Just my thoughts and will give a nickel for any one else's..
VSIDO
If you build it, they will come...
Words That Build Or Destroy
Offline
Well, just `sudo {appname}` from gmrun will get you bubkes; gotta use gksu/gksudo in that case. I think there are some security issues when using sudo to open a GUI application from the terminal, but frankly I never paid much attention to that discussion.
Where's my nickel? 
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
^
Was fully expecting a plug nickel, FWIW...
while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.
Offline
I know this ended months ago but...
Following this tutorial just gave me one really small icon for the "START" which really irritated me for some reason.
I thought of something so I made another tint2rc "tint2rc-start" code/script whatever you call it. I was thinking of running two instances of tint2 since we can run more than one conky.
I just disabled everything with the new tint2rc except the launchers.
I just filled the small tint2rc (just 5% width) with launchers for the menu and placed it on the bottom left part of the screen.
and running it with
tint2 -c /home/jesus/.config/tint2/tint2rc-start
and adding the same line to the autostart
I also followed the auto updating menu tutorial.
Giving me one improvised "START" button!
I just didn't want to make another post because KF7EEL still deserves most of the appreciation.
Well this looks nice.
Offline
Nicely done. I find it hilarious that you use a mouse click to cause a simulated key press, to emulate a mouse click.
hehsusss, I never thought of having two tint2 bars side by side. Neat!
Offline
@hehsusss; screenshot? (or it didn't happen)
Offline
Offline
thanks for this KF7EEL, I followed the instructions however xdotool refused to open the popup menu. I reconfigured xfce keyboard shortcuts and even went so far as to install openbox in case the rc.xml file was required, both xfce and rx.xml pointing to the same keyboard shortcut.
long story short ...
xfce has its own command for a popup menu which doesn't require xdotool "xfce4-popup-applicationsmenu"
therefore, I uninstalled xdotool which was buggy on my system for some reason and my .desktop file looks as such:
[Desktop Entry]
Encoding=UTF-8
Name=menu
Comment=menu launcher
Exec=xfce4-popup-applicationsmenu
Icon=/usr/share/icons/LinuxLex/places/start-here-poseidon.png
Terminal=false
X-MultipleArgs=false
Type=Application
Categories=Menu;
StartupNotify=trueAside: the app menu button is for my wife
... because a right click is "just sooo annoying"
dig +short txt crunchbang.wp.dg.cx
Offline
Offline
Just wanted to add my little menu. It opens on click and closes on a second click. the only problems i have with it ar that it opens directly under the mouse(normal menu would be offset by the panel) and that if you close it by clicking elsewhere it will take two clicks to reopen it the next time.
#! /bin/bash
DISPLAYH=`xdpyinfo | sed 's/^ *dimensions: *[0-9]*x\([0-9]*\).*/\1/;t;d'`
PANELH=`sed -e 's/^panel_size = [0-9]* \([0-9]*\).*/\1/;t;d' ~/.config/tint2/tint2rc`
MOUSEX="0"
MOUSEY=$(($DISPLAYH-$PANELH))
RESTORE=`xdotool getmouselocation 2> /dev/null | sed -e 's/x://' -e 's/y://' -e 's/ screen:.*$//'`
POSITION=`sed -e 's/^panel_position = \([a-z]*\).*/\1/;t;d' ~/.config/tint2/tint2rc`
if [ $POSITION = top ] ; then
MOUSEY=$PANELH
else
MOUSEY=$(($DISPLAYH-$PANELH))
fi
xdotool mousemove $MOUSEX $MOUSEY
xdotool key super+space
xdotool mousemove $RESTORE[Desktop Entry]
Name=Start-here
Exec=$HOME/.config/tint2/start_menu.sh
Icon=/usr/share/icons/Faenza-Dark-CrunchBang/places/24/start-here-debian.png
Type=Application
GenericName=*edit = I was using ~ in the quoted exec path, for some reason this was breaking.
*edit2 = ok even $HOME is inconsistent if it doesnt work just change it to the full path.
*edit3 = I added offsets pulled from tintrc and xdpyinfo
Last edited by tekhertz (2013-02-15 16:26:57)
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.