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 xdotool
Once done, test it. A menu should pop up.
xdotool key super+space
Now we have to create a . desktop file in /usr/share/applications called menu.desktop.
gksudo geany /usr/share/applications/menu.desktop
Once 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=true
Open 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.desktop
It 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!
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..
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?
Offline
^ Was fully expecting a plug nickel, FWIW...
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!
Nerds that build or deploy
Offline
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=true
Aside: 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
Thank for this, useful to ease a couple of friend into #! world.
Offline
Sorry for post necro - I found this very useful, and I'd like to ask how I can change the icon for the resulting 'start menu' (as mine looks like a rather hideous bunch of black and white pixels at the moment).
Offline
In the menu.desktop file change -
Icon=mousepad
to the icon of your choice. For example -
Icon=menu_icon.png
if the icon is not located in the usual place - like /usr/share/pixmaps - you'll need to use the full path.
Last edited by PackRat (2014-06-07 13:47:42)
"It does not require many words to speak the truth." - Chief Joseph, Nez Perce tribe
Offline
In the menu.desktop file change -
Icon=mousepad
to the icon of your choice. For example -
Icon=menu_icon.png
if the icon is not located in the usual place - like /usr/share/pixmaps - you'll need to use the full path.
I did exactly this, but I still have the same problem - my icon looks like a random bunch of black and white pixels and not the #! logo.
EDIT: Never mind, found the issue - I mistyped the path.
Last edited by koz (2014-06-07 22:18:13)
Offline
In the past, I've created a 16x16 transparent .png using gimp and named it do-nothing.png and I move it to /usr/share/pixmaps. Then, I create a do-nothing.desktop file in /usr/share/applications that sets its Icon=/usr/share/pixmaps/do-nothing.png. And, I set its Exec=/bin/true. Then, using tint2's config file, I call /usr/share/applications/do-nothing.desktop to create a space between the menu button this post describes and the rest of my app icons on the tint2 panel bar. Then, you don't need two instances of the tint2 panel running just to separate the menu button from the other icons in the panel. And, if you click the transparent do-nothing.png icon, all that executes is /bin/true, which does nothing in this context.
^@tekhertz has a good .desktop example to use.
Offline
I took a slightly different approach to this:
1. Create/find your preferred menu icon
2. Create a new application .desktop file in /user/share/applications with the exec being: "Exec=xdotool key Super+space" and pointing it at your icon.
3. Add launcher to tint2
No fancy on/off function
Offline
I like ^ idea!
Offline
Is there any way to make the launcher icon wider? I made a wider icon, but it just squishes it into a square when I try to use it. I'm trying to make it this image:
I currently just have 2 side by side. But I would like one uniform button.
Last edited by YellowPudding (2014-10-04 03:03:26)
Offline
@YellowPudding
Tint2 documentation
Looks like task_maximum_size is the variable you need to set, although I haven't tried it
Last edited by damo (2014-10-04 05:51:13)
BunsenLabs Group on deviantArt
damo's gallery on deviantArt
Openbox themes
Forum Moderator
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat