SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-05-01 02:26:23

KF7EEL
New Member
From: Washington State, USA
Registered: 2012-04-29
Posts: 6

Simple "Start" menu button for tint2

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

Help fund CrunchBang, donate to the project!

#2 2012-05-01 04:07:45

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,723
Website

Re: Simple "Start" menu button for tint2

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

#3 2012-05-11 08:25:47

fog
#! Member
From: Athens, Greece
Registered: 2012-05-11
Posts: 86
Website

Re: Simple "Start" menu button for tint2

Nice howto.
My arch-openbox-netbook thanks you smile


I’m not antisocial, I’m just not user friendly.
photos || blog || dArt

Offline

#4 2012-05-11 10:27:15

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: Simple "Start" menu button for tint2

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

#5 2012-05-14 22:17:13

KF7EEL
New Member
From: Washington State, USA
Registered: 2012-04-29
Posts: 6

Re: Simple "Start" menu button for tint2

Well, to start with, I found a few pieces of this on the arch forums.


#!
and there goes Windoze.

Offline

#6 2012-05-14 23:52:35

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,723
Website

Re: Simple "Start" menu button for tint2

Stanie wrote:

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

#7 2012-05-15 00:27:56

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,017

Re: Simple "Start" menu button for tint2

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? tongue


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Offline

#8 2012-05-15 00:35:21

VastOne
#! Ranger
From: #! Fringe Division
Registered: 2011-04-26
Posts: 9,723
Website

Re: Simple "Start" menu button for tint2

Thanks... big_smile

logo-SM.gif


VSIDO
If you build it, they will come...
Words That Build Or Destroy

Offline

#9 2012-05-15 00:37:24

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,017

Re: Simple "Start" menu button for tint2

^ lol  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

#10 2012-10-24 14:51:08

hehsusss
Member
Registered: 2012-10-20
Posts: 11

Re: Simple "Start" menu button for tint2

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

#11 2012-10-25 06:40:46

AlanD
#! CrunchBanger
Registered: 2011-05-12
Posts: 116

Re: Simple "Start" menu button for tint2

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

#12 2012-10-25 07:18:43

brontosaurusrex
#! Junkie
Registered: 2012-06-15
Posts: 483

Re: Simple "Start" menu button for tint2

@hehsusss; screenshot? (or it didn't happen)

Offline

#13 2012-10-26 10:09:16

hehsusss
Member
Registered: 2012-10-20
Posts: 11

Re: Simple "Start" menu button for tint2

screenshot-wednesday24october2012-104716pht.png

screenshot-wednesday24october2012-104730pht.png

Okay, so the screenshots. smile


Well this looks nice.

Offline

#14 2012-12-04 11:50:54

sevensage
#! CrunchBanger
Registered: 2012-11-10
Posts: 133

Re: Simple "Start" menu button for tint2

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 tongue ... because a right click is "just sooo annoying"


dig +short txt crunchbang.wp.dg.cx

Offline

#15 2013-02-03 21:32:05

thebonvoyage
New Member
Registered: 2013-02-01
Posts: 7

Re: Simple "Start" menu button for tint2

Thanks for this tut! My #! environment is closer to completion thanks to this.

Screenshot2.jpg
in the uper left corner

Screenshot3.jpg
with the menu

Offline

#16 2013-02-10 15:53:53

tekhertz
New Member
Registered: 2013-02-10
Posts: 1

Re: Simple "Start" menu button for tint2

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

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo