Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I show Xfce's Application menu, i.e. the real one?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Fri May 03, 2013 1:51 pm    Post subject: How do I show Xfce's Application menu, i.e. the real one? Reply with quote

Hi all.

I've always wondered since Xfce 4.8 how to show the Application menu, like version 4.6 had. Since I have Avant Window Manager I would like to add Xfce application menu to a launcher. Currently what they call "Application menu" (the one you have with a right click over the desktop) is an intermediate menu that *has* the real application menu. There is actually a panel plugin that displays the application menu, that's the one I'd like to have in AWN.

Looking at xfce4-popup-applicationmenu I saw that line:
/usr/bin/xfce4-popup-applicationsmenu:
/usr/bin/xfce4-panel --plugin-event=applicationsmenu:popup:bool:$ATPOINTER [...]

so I guess I'd have to do something similar. The fact is I haven't been able to figure it out on my own. Any hint?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
simon_irl
Guru
Guru


Joined: 07 Oct 2004
Posts: 403
Location: New Zealand

PostPosted: Sat May 04, 2013 1:44 am    Post subject: Reply with quote

i don't use awn, but as i understand your post, you're saying that the menu you want is already included in awn's "application menu", nested among other stuff you don't want? in which case, that's where you'll find the procedure for pulling up the menu you want in awn: go through the code for the "intermediate menu that *has* the real application menu", deleting the superfluous stuff and raising the nested applications menu to the top level (if there's no easier way, like simply pointing the plugin to a custom menu file, as you can with xfce4-panel). xfdesktop --menu and the xfce4-panel argument (that you've listed there) to display it above the "applications menu" button may be xfce-specific, but the menu itself is a standard freedesktop menu (at /etc/xdg/menus/xfce-applications.menu) so i imagine a different panel like awn should still be able to parse it, and as i read your post that's exactly what it's doing already, along with a bunch of other stuff you don't want?
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Sat May 04, 2013 11:12 am    Post subject: Reply with quote

Thanks simon_irl.

I'm not sure I understood what you meant however. Actually there's an *Xfce* (not AWN) applet to show Xfce's real application menu. But I guess that doesn't change your reasoning.

This said I expected there'd be a way, e.g. a specific argument to xfce4-panel --plugin-event that would do. What you suggest is to change Xfce's main menu definition, right? If so, well, unless I didn't get it I don't exactly want to do that as I want my changes to be as little intrusive as can be (or not at all if possible).

All in all I took a look at /etc/xdg/menus/xfce-applications.menu and realized that's exactly the application menu I want to display. (It is included into the menu you get by clicking Xfce's desktop.) So how do you do that? (My question was indeed about understanding the syntax of Xfce tools.)
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
simon_irl
Guru
Guru


Joined: 07 Oct 2004
Posts: 403
Location: New Zealand

PostPosted: Sat May 04, 2013 12:26 pm    Post subject: Reply with quote

lol...i'm still not sure that i understand what you want, but here are some more suggestions that may or may not be helpful ;)

regardless of the panel you're using, if you're using xfdesktop then you can make that menu appear with
Code:
xfdesktop --menu
which you could easily launch via a panel launcher (again, regardless of which panel you're using). however i've already mentioned that so i'm assuming you're either wanting to be able to launch the panel menu with a keyboard shortcut too (and want it to pop up from a set position on your panel rather than under the mouse pointer as per normal), or else are really fussy about the aesthetics of it and want the menu to pop up directly in line with the panel rather than a tiny bit lower/higher at the point where your mouse pointer has clicked on the launcher.

well, as soon as the menu appears it responds to keyboard input (menu navigation via the arrows) and stays visible wherever you move the mouse pointer, so a fairly simple and very non-intrusive workaround to make all this seem like a dedicated "menu button" on the panel would be to use xdotool to position the mouse cursor directly above/below the menu launcher and *then* launch xfdesktop --menu. so the script you'd launch with your menu button would (a) grab the cursor position using getmouselocation, (b) move it to where you want the menu to popup, (c) xfdesktop --menu to pop it up, and then (d) return the cursor to its original position. i haven't tested this, but i imagine it would work with just a brief flicker of the mouse cursor when you launched the menu, effectively turning a standard app launcher into a fake panel menu plugin. a potential glitch could be the speed of xfdesktop --menu if you have your menu configured to display icons: loading those icons slows it down a lot, so the cursor shift to the panel menu position and then back again could be slow, obvious and clumsy. if you can live without icons in your popup menu, turn them off and it will appear much more quickly. and if it doesn't work, ah well, you may have to hack on the source of your panel &/or plugins. that doesn't have to be intrusive either, if you patch it properly via a portage overlay in /usr/local/portage or whatever.

on the other hand, if you're only asking about making changes to the contents/structure of that menu, just go ahead: copy /etc/xdg/menus/xfce-applications.menu into ~/.config/menus and edit it to your heart's content. you only have to delete or rename it and xfce will go back to using the system version in /etc/xdg/menus. setting the panel menu to a custom menu file doesn't change the desktop popup menu: that one's always populated from menus/xfce-applications.menu, so if you don't like the default you need to make your own under .config/menus.
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Tue May 07, 2013 2:28 pm    Post subject: Reply with quote

xfdesktop --menu is of course *not* what I want (would have been too simple, ain't it ;-) ) .

Here's what xfdesktop --menu looks like:
xfdesktop --menu:
+------------------------+
| Open in a new window   |
| ---                    |
| Create a launcher ...  |
| Create a URL link ...  |
| Create a folder ...    |
| Create from template > |
| ---                    |
| Open a terminal here   |
| ---                    |
| Paste                  |
| ---                    |
| Arrange desktop icons  |
| Desktop settings ...   |
| Properties ...         |
| ---                    |
| Applications >         |  <== I want this submenu!
+------------------------+


The Application menu I want is actually a submenu from the menu you see above. So the question is: «can that submenu be displayed from the command line» . As a corollary, the submenu I want is indeed described in /etc/xdg/menus/xfce-applications.menu, which is hence not what xfdesktop --menu displays.

Off-topic: xfdesktop --menu is still useful and I don't want to change it as I use it when I right click Xfce's desktop for instance. So the items in that menu have to remain as they are. It's just the submenu the above “Application” pops for wich I'd like to have a command. If it's possible of course.
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4630
Location: Theux (Belgium)

PostPosted: Tue May 28, 2013 10:29 pm    Post subject: Reply with quote

Any ideas?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
GNU/Linux user #369763
“Wow! I feel root”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum