Write XFCE desktop menus "on the fly".

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
kjdixo

Write XFCE desktop menus "on the fly".

Post by kjdixo »

Write XFCE desktop menus "on the fly" by configuring launcher icons using the cp command.

Key to this is creating a hidden folder ".menus" in your home folder.
Make it hidden by renaming with a dot as the first character of the filename (so you don't accidently delete it later).

Using the XFCE menu editor, create a menu tailored to a specific category.
It could have all things internet on it, so call it internet_menu.xml and save it in your newly created .menus folder.

Carry on creating menus tailored to specific categories as for the example above.
Remember you can drag and drop items from App Finder to the XFCE menu editor.
You can also right click an item in App Finder to get more information, eg. the command to launch the item.

So you have now created a hidden folder .menus, containing for example :
internet_menu.xml
hobby_menu.xml
music_menu.xml
games_menu.xml
graphics_menu.xml
photo_menu.xml
video_menu.xml
office_menu.xml
system_menu.xml

In your file manager (Thunar) there will an option to show or hide hidden files. Hide them to prevent loss or damage.

To write system_menu.xml to the default XFCE menu use the copy command as shown on the next line.

cp /home/myusername/.menus/system_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml

Any launcher icon (bouncy gdesklets included) can be configured to instantly rewrite your desktop menu.

Select App Finder then Desktop Settings then set XFCE to manage your desktop.
Also if you wish, show desktop menu on mouse right click.

The method described is useful to know about and some people might actually prefer to use it as their main menu controller.
For people who are configuration and tweak obsessed it will give them something to configure and tweak.

The only minus point is that to access a particular item you might need one extra click, to change to a different menu.
However if you are managing your website one day and doing office stuff on another, it will help you to eliminate clutter and focus on current tasks.
I hope this is useful to somebody.
Kevin Dixon
England UK.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Using the method described in my last post it is possible to maintain several menus and use any one of them simply by clicking a correctly configured launch icon.
Now for the beware and caution part.
Every time you edit a menu (using the XFCE menu editor) and then click save, the menu you currently see on the desktop will be saved into the .config default XFCE folder, provided you haven't changed that.
However all those changes will be lost from the XFCE default menu the next time you overwrite it by changing menus again.
You must also remember to navigate to the hidden (unhide it first) .menus folder and save to the correct menu.xml file.
Care must be taken not to save to the wrong menu, in which case you lose a menu.
For this reason it is useful to periodically backup the .menus folder by simply making a copy of it elsewhere.
For good measure and to ease the confusion, make use of the XFCE built in option to add a title to the top of each menu.

To sum up.
1. Take care to save to the correct menu.xml file.
2. Make regular copies of the .menus folder.
3. Use the option available in the XFCE menu editor to add a TITLE to each menu.

There is usually an easier way (maybe put all the menus in the .config folder).
However I have been using this without any problems for a few weeks.

I look forward to an official XFCE for Gloria. I currently use Felicia XFCE.

Have Fun
Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Today I tried out a Live CD of Xubuntu 9.04 that has XFCE 4.6 integrated.
There is unfortunately no XFCE Menu Editor in XFCE 4.6.
I googled the relevant details and found that this is being discussed on some forums.
So stick with XFCE 4.4 if you want to carry out menu editing as described in the last two posts on this topic.
Oh well, never mind.
Regards
Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

To create a really snappy (as in quick) customized XFCE 4.4 menu, do the following.

This is a continuation of my previous posts, please read and understand them first.
Remember this doesn't work in XFCE 4.6. Now continue.

Open the .menus folder described above.
Edit all the .xml menus together by opening them all in SCREEM XML Editor.
Each of your menus will be displayed as text (xml code) under its own tab.

If you had previously added a TITLE to each XFCE menu then the following code will be present:

<title name="YOUR TITLE"/>.

Replace:
<title name="YOUR TITLE"/>

With this:
<menu name="MENU">
<app name="GAMES" cmd="cp /home/myusername/.menus/games_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="GRAPHICS" cmd="cp /home/myusername/.menus/graphics_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="HOBBY" cmd="cp /home/myusername/.menus/hobby_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="INTERNET" cmd="cp /home/myusername/.menus/internet_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="MUSIC" cmd="cp /home/myusername/.menus/music_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="PHOTO" cmd="cp /home/myusername/.menus/photo_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="OFFICE" cmd="cp /home/myusername/.menus/office_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="SYSTEM" cmd="cp /home/myusername/.menus/system_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="VIDEO" cmd="cp /home/myusername/.menus/video_menu.xml /home/myusername/.config/xfce4/desktop/menu.xml"/>
<app name="MENU EDIT" cmd="xfce4-menueditor" icon="xfce4-menueditor"/>
<app name="App Finder" cmd="xfce4-appfinder" icon="gtk-media-record"/>
</menu>

Do this on every tab in SCREEM so all menu.xml files have the same code added.
You need to select each tab and save each one (so the asterisk * on the tab disappears).
Close SCREEM and test the new configuration.
There should now be a submenu called MENU from which you can instantly change categories.
I have added Menu Edit and App Finder to complete the job.

For people who like to right click for their menus and don't like desktop icons everywhere, they can do the following:
Select App Finder then XFCE Desktop Settings then set XFCE to manage your desktop.
Also, show desktop menu on mouse right click.
Check and test the right click gives you what you want.
Now it is safe to remove the XFCE menu launcher icon from the desktop.
I hope this is useful to somebody.
Well I like it and I hope this extreme configurability will be possible in future XFCE releases.

Kevin Dixon
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

Screenshots man, screenshots! :mrgreen:
Image Image
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Thanks for that Zwopper.

3 Screenshots attached.
I am only allowed to upload 3 and there is a filesize limit of about 760k total.
Screenshot4.jpg
Screenshot3.jpg
Screenshot2.jpg
Regards
Kevin Dixon
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

Nice! :mrgreen:
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Zwopper
I think I might use some of your artwork on my desktop in the future.
Thanks for the link.
Best Regards
Kevin Dixon
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

kjdixo wrote:Zwopper
I think I might use some of your artwork on my desktop in the future.
Thanks for the link.
Best Regards
Kevin Dixon
Thank you!
Link?
Ah, the one in my signature?! :oops:
Shameless self promotion... :oops:
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Some people will notice that there is no task bar visible in the screenshots above.

Currently running tasks that would normally appear as a stack of distracting information in the task bar are now viewable on the click of the middle mouse button.
Go to App Finder then Xfce 4 Desktop Preferences and select the Behaviour tab and check the box 'Show window list on middle click'.

Another step in my quest for minimalism was to uncheck the 'Show icons for: home, file system and trash'.
These icons can now found by clicking the 'Places' filing cabinet icon on the right vertical panel.
Leave the 'Show icons for removable devices' checked, it is a useful icon to have on your desktop.
Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Here is a very useful little addition to the XFCE 4.4 menu system I described above.
Visual feedback when you change menus.
Place a big red icon (gtk-media-record) in the MENU submenu next to the relevant selector.

The screenshot001.jpg shows the GRAPHICS menu selected.
Note my mouse cursor is pointing at the GRAPHICS launcher which is highlighted with a red dot.

Think how exciting it would be if that red dot was to move to INTERNET when you select the INTERNET menu
and to PHOTO when you select the PHOTO menu.
This is extremely easy to set up using the XFCE menu editor, or SCREEM xml editor.
The 'gtk-media-record' red dot icon is grouped in the 'action icons' part of the XFCE menu editor icon dialog.

Kevin Dixon
Screenshot001.jpg
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

Super cool, you truly are an Xfce master tweaker! :D 8) :shock:
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

If the menu layout of screenshot001.jpg is adhered to exactly (with the special MENU submenu at the top of the list)
then an added bonus is that when you use the XFCE Menu Editor, a nice red dot is present in the FIRST SUBMENU
near to the XFCE menu editor toolbar, to helpfully remind you which menu.xml file to save to, in the .menus folder.

I have not posted any of this anywhere else and I still think Mint is the best in many ways.
The XFCE team are busy migrating to a freedesktop.org format I read somewhere.
In which case all this will soon become irrelevant, but I am sure many people would like to keep the option.
Zwopper thanks for the encouragement.
Good to get high profile people like yourself interested.
Regards
Kevin Dixon
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

Well, you deserve the attention and the credit, you sure know your way around Xfce! 8)
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

Transfer your new super quick custom right hand click menu to a new computer.

As stated in previous posts these menu settings are for XFCE 4.4 and will not work with XFCE 4.6.

To transfer the .menus folder simply use a usb memory stick or your preferred method.

If your NEW computer username is different from your OLD computer username then more work is required.

Look at, using XFCE menu editor or SCREEM xml editor, one of the menus you just have transferred .

Notice anything? Yes the OLD username is still present in all the menus.

My old username was x1 and the new one x2.

This will obviously stop the menu working as it can't find home/x1 on a new computer that is set up with home/x2.

So you need to change all menus in the .menus folder to reflect the new username.

One final important step to get the whole thing working is to initialize the default desktop menu.xml.

To do this copy one of your new menus, from your home/myusername/.menus folder to the default home/myusername/.config/xfce4/desktop folder.

Delete menu.xml in the desktop folder and rename your new menu to menu.xml.


Kevin Dixon
User avatar
Zwopper
Level 10
Level 10
Posts: 3054
Joined: Fri Nov 30, 2007 12:20 pm
Location: Deep in the Swedish woods
Contact:

Re: Write XFCE desktop menus "on the fly".

Post by Zwopper »

Yet another great elaboration! :D
Image
My artwork at deviantART | My Band - Electric Alchemea
CREA DIEM!

Lenovo U330P | i5 | 16GB | 128GB - SSD | Elemantary OS 0.4
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

To reduce the chances of saving your menu incorrectly, to speed up saving of the new file and to allow it to be done each time without thinking, do the following:
Add an item called 'Menu save' to each menu.xml directly below 'Menu edit'.
Screenshot002.jpg
The command to be added is:

cp /home/myusername/.config/xfce4/desktop/menu.xml /home/myusername/.menus/office_menu.xml

Instead of navigating to the .menus folder to make the crucial decision of which menu to save to, you will now:

1.
In the XFCE menu editor toolbar, click the save icon, it is highlighted if you have edited the menu (see Screenshot002.jpg).
This will save your changes to the current desktop menu.
/home/myusername/.config/xfce4/desktop/menu.xml.

2.
Now click the 'Menu save' that you added to the menu earlier.
This will save your changes into the .menus folder.
/home/myusername/.menus/office_menu.xml.

Obviously the save path for each menu has to be configured.

Internet menu: /home/myusername/.menus/internet_menu.xml.
Photo menu: /home/myusername/.menus/photo_menu.xml.


There is another location where menus are saved, in the /home/myusername/.cache/xfce4/desktop folder, but I advise against tinkering around in there.

Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

The posts in this topic "Write desktop menus on the fly" (for XFCE 4.4 as included in Linux Mint Felicia XFCE Community Edition) have so far have led to a fast and easy to use right click menu with easily accessible Menu Edit and Menu Save.
I am enjoying using this so much that I don't really like going back to using any other menu.
Amongst my collection of PCs I have a mini itx pc that triple boots to Xubuntu 9.04, Mint 6 Felicia and Mint 7 Gloria.
Mint 6 Felicia is currently my favourite due to the XFCE 4.4 menu possibilities.
A Mint 7 Gloria XFCE 4.6 Community Edition is soon to be released, alas without the perfectly sensible XFCE 4.4 menu options.
Sorry for the rant, it is only my opinion on this.
I am sure the new edition will be great and I look forward to trying it out.

I always like to include something useful, so here we go.

If you used SCREEM xml editor to create your initial configuration of menus, be sure to close all tabs that may appear every time you start up SCREEM.
It has a habit of reopening old tabs that you might have been working on a few days before and you didn't close.
The old tabs may have the same names as the new ones you want to edit.
If you're in a hurry you might save old work instead of new.
So be sure to clear away all tabs that are open when you start the program.
Obvious but sometimes forgotten.

Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

MENU SYSTEM for XFCE 4.4 and earlier.
The writing of menus to a .menus folder has already been described in my previous posts on the topic.
It would be best to read and understand all of those before proceeding with this.
In the intervening months since posting on the Linux Mint Forums I have experimented with writing xfce panels 'on the fly'.
This was temperamental and eventually I found myself using Xubuntu Intrepid 8.10 with fixed autohidden panels and no right click menu.
I was not happy, not because of Xubuntu but because my right click urges were still there and I could not launch applications with the speed I was used to in Mint.

Today I went back to the right click menu system that is the subject of this post.

I am using Xubuntu 8.10 but the right click menu will work equally well in Linux Mint 6 Felicia, both are based on Ubuntu Intrepid 8.10.
The main reason for sticking with either of these is they have the magic XFCE 4.4 and not 4.6 which won't work with the menu system here.
I have simplified the menu system, trying to make it quicker to use by removing any unnecessary sub-menus.
I wanted to keep the existing menu given to us by the XFCE team as it is a dynamic menu, so when an application is installed a launcher will appear on the menu categorized in a relevant sub-menu.
It is included as part of the system_menu, please see the attached jpeg image system_menu.jpg.
Two other screenshots are included . . . of the Internet and the Games menus.
These show the Log Out and Screen Lock menu options.
I have found that Geany is good for editing the XML menus in the instances where the XFCE Menu Editor doesn't show you the whole story.
The desktop background is plain white to reduce the file size (there is a filesize limit on forum uploads) and to save everyones expensive printer ink.
Kevin Dixon
kjdixo

Re: Write XFCE desktop menus "on the fly".

Post by kjdixo »

For people who are in too much of a hurry to read my previous posts they will need to do this before the menu system will work.

IMPORTANT INITIALIZATION
One final important step to get the whole thing working is to initialize the default desktop menu.xml.

To do this copy one of your new menus from your home/myusername/.menus folder to the default home/myusername/.config/xfce4/desktop folder.

Delete menu.xml in the desktop folder and rename your new menu to menu.xml.


Kevin Dixon
Locked

Return to “Xfce”