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

Be excellent to each other!

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

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
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 | Words That Build Or Destroy

I dev VSIDO

Offline

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

fog
#! CrunchBanger
From: Athens, Greece
Registered: 2012-05-11
Posts: 179
Website

Re: Simple "Start" menu button for tint2

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


Where there's a shell, there is a way.
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: V-Ger
Registered: 2011-04-26
Posts: 10,165
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 | Words That Build Or Destroy

I dev VSIDO

Offline

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

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

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

Offline

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

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Simple "Start" menu button for tint2

Thanks... big_smile

logo-SM.gif


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

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

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Simple "Start" menu button for tint2

^ lol  Was fully expecting a plug nickel, FWIW...

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: 156

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!


Nerds that build or deploy tongue

Offline

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

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,643

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: 134

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

#17 2013-07-01 07:53:24

GekkoP
#! Junkie
From: Vicenza (Italy)
Registered: 2013-06-17
Posts: 297
Website

Re: Simple "Start" menu button for tint2

Thank for this, useful to ease a couple of friend into #! world.

Offline

#18 2014-06-07 09:45:07

koz
New Member
Registered: 2014-06-07
Posts: 7

Re: Simple "Start" menu button for tint2

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

#19 2014-06-07 13:44:29

PackRat
#! Die Hard
From: USA
Registered: 2011-03-03
Posts: 1,572

Re: Simple "Start" menu button for tint2

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

#20 2014-06-07 22:16:12

koz
New Member
Registered: 2014-06-07
Posts: 7

Re: Simple "Start" menu button for tint2

PackRat wrote:

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

#21 2014-06-22 04:39:36

pressanykey
Member
Registered: 2013-08-28
Posts: 33

Re: Simple "Start" menu button for tint2

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

#22 2014-06-22 08:45:24

Joe90
#! Junkie
Registered: 2013-10-10
Posts: 337

Re: Simple "Start" menu button for tint2

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

#23 2014-06-22 08:58:16

pressanykey
Member
Registered: 2013-08-28
Posts: 33

Re: Simple "Start" menu button for tint2

I like ^ idea!

Offline

#24 2014-10-04 02:43:06

YellowPudding
New Member
Registered: 2014-10-04
Posts: 3

Re: Simple "Start" menu button for tint2

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: menu.png

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

Help fund CrunchBang, donate to the project!

#25 2014-10-04 05:24:13

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 5,433

Re: Simple "Start" menu button for tint2

@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 smile

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.
Server: zapp

Debian Logo