Forum › Forums › antiX-development › Development › desktop-menu update
- This topic has 68 replies, 6 voices, and was last updated Sep 30-6:14 am by anticapitalista.
-
AuthorPosts
-
August 10, 2025 at 9:57 pm #183456
DaveForum AdminSome testing needed.
Have been working on an updated version of desktop-menu that better supports multiple users, allowing different user menus (and updating per user) as well as (hopefully) speeding up / limiting the amount of times the menus / files are parsed. Parsing is once per user and writing can be for all window managers or the single active one.The script is desktop-menu.new found here: https://gitlab.com/antiX-Dave/desktop-menu-antix/-/blob/master/bin/desktop-menu.new?ref_type=heads
There is also a lib file for the strings found here: https://gitlab.com/antiX-Dave/desktop-menu-antix/-/blob/master/desktop-menu-lib/desktop_menu_strings.py?ref_type=heads
This strings file will need to be placed in /usr/lib/desktop-menu/. (Or you can place it anywhere and change the reference on line 19 of desktop-menu to match)The script should build menus for all window managers by default.
–write-out should default to the users home directory based on the template and window manager if run as a user with –write-out option. If this is a symlink to the global location, that location should update.
–global location is per user and defaults to /var/cache/desktop-menu/More options are available; they should be the same or similar to the old options.
Certain options can be set in a configuration file found here: https://gitlab.com/antiX-Dave/desktop-menu-antix/-/blob/master/skel/config_desktop-menu_desktop-menu.cfg?ref_type=heads
This should help specifically when updating and the –global option is used for multiple users.
The configuration file should reside in ~/.config/desktop-menu/desktop-menu.cfg for each user if defaults need changing.Note that the fancy dpkg divergent parts of the old script are not yet in the new script. This should be updated once the new script is tested for current functionality (and I come to full understanding of the dpkg divergent section).
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
August 11, 2025 at 6:14 pm #183523
ileMemberHello Dave
Created the files. put it in place. i don’t have a file /var/cache/desktop-menu/.
it runs and i see no difference in how the menu looks.desktop-menu –global has this Message
Traceback (most recent call last): File "/usr/local/bin/desktop-menu", line 620, in <module> Message.Display(strings.mv2.format(user)) ^^^^^^^^^^^^^^^ AttributeError: type object 'Message' has no attribute 'Display'okay i see difference on menu. it became ngc.
the command desktop-menu –write-out seems connected to the .config file settings of order ngc and filter ngc. i set it to n and n.i changed the Refresh Menu command in fluxbox /menu to
desktop-menu –write-out
and it is all working in antiX fluxbox.is changed the Refresh Menu command in jwm /menu to
desktop-menu –write-out
set .cfg print to ng and n.
and it is all working in antiX jwm.is changed the Refresh Menu command in icewm /menu to
desktop-menu –write-out
set .cfg print to ng and n.
and it is all working in antiX icewm with
one quirk there is an underscore printed with name.
before the name. maybe it is intended beneath the first letter?August 11, 2025 at 9:34 pm #183536
DaveForum AdminThanks ile.
The Message.Display was renamed to Message.Verbose. I had missed that line in the last pushed version. Now updated.
Simple change on line 620.The files in /var/cache/desktop-menu should be generated the first run of using “–global –write-out” as root
Yes the config file overrides the default settings. Any option passed on the command line (Example: –order=gcn) should override the default and the configuration file.
I am not seeing an underscore added to the name text. Can you try without the config file and see if it is the same?
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
August 11, 2025 at 10:24 pm #183537
ileMemberHello Dave
icewm and the underscorename
_a matter of a space before the name./usr/share/desktop-menu/templates/icewm.template
#Template to build IceWM menu #This template should reflect the icewm syntax for the icewm menu #Take care to maintain a space before and after the "=" #File_Start = #File_End = #Menu_ID = 0 / 1 (set 1 if a unique menu id is required) #Menu_Start = menu "%title" %icon { #Menu_End = } #Menu_File = menufile "%title" %icon #Program = prog "%title" %icon %program #Separator = separator File_Start = File_End = Menu_ID = 0 Menu_Start = menu %s "%s" { Menu_End = } Menu_Program = menufile "%s" "%s" Program = prog %s "%s" %s Separator = separatorline15 Menu_Start = menu %s “%s” {
removed double quotes around first %sline18 Program = prog %s “%s” %s
removed double quotes around first %sand it put the underscore beneath the first letter, in icewm menu.
August 11, 2025 at 11:33 pm #183539
ileMemberHello Dave
” try without the config file and see if it is the same?”
not the same.Being without some double quotes had the underscore under the first letter providing keyboard navigation of icewm menu.
it cuts names off at spaces.Was put back the double quotes “%s” in template icewm.
the underscore returned to the space before the name.renamed the .cfg file in home .config to hide it.
desktop-menu –write-out
now no .cfg there is no underscore.in .cfg it is separators = that prints the space as the first character which becomes underlined.
August 12, 2025 at 3:12 pm #183588
ileMemberHello Dave
desktop-menu
This is not offered as a fix. It works outside of desktop-menu after desktop-menu is done.
It is offered for you to observe
the underscore present for keyboard navigation in icewm menu.The icewm menu template /usr/share/desktop-menu/templates/icewm.template
put double quote around “%s” of name.
No other double quotes around icon nor program command.File_Start = File_End = Menu_ID = 0 Menu_Start = menu "%s" %s { Menu_End = } Menu_Program = menufile "%s" %s Program = prog "%s" %s %s Separator = separatoricewm session run
desktop-menu --write-out
evaluate menu. will have underscore as first character of name.Remove the space after the double quote in ” name ” in /usr/share/desktop-menu/.icewm/menu-applications
with run commandsudo sed -i 's/"[[:space:]]*/"/' /usr/share/desktop-menu/.icewm/menu-applicationsevaluate the icewm menu. underscore is beneath the first letter of name.
August 12, 2025 at 6:02 pm #183609
ileMemberdesktop-menu[new]
got rid of the syntax warning on line 112
Find ‘\space’ and delete the \group_mtype.add_argument('--sep-3b=', dest='sep_3b', action='store', default=")", help="(spl:)" + strings.h24.format('--order') + "\n" + strings.h24_a + "{4}{6}\" — \"{8}\" — \" {4}{5}{0} — {1} — {2} {4}{6}\"{3}\"{8}\"{3}\" {4}{5}{0}{3}{1}{3}{2} {4}{6}\" \¦ \"{8}\" \¦ \" {4}{5}{0} ¦ {1} ¦ {2} {4}{6}\" \"{8}\" \" {4}{5}{0} {1} {2} {4}{6}\" „\"{7}\"”\"{8}\" (\" --sep-3b=\")\" {4}{5}{0} „{1}” ({2}) {4}{6}\" {{\"{7}\"}}\"{8}\" \" {4}{5}{0} {{{1}}} {2} {4}{6}\" - /\"{7}\"/\"{8}\" - \" {4}{5}{0} - /{1}/ - {2} {4}--sep-1a=\"[\" --sep-1b=\"]\" {6}\" »\"{7}\"«\"{8}\" \" {4}{5} [{0}] »{1}« {2}".format(strings.h24_b, strings.h24_c, strings.h24_d, ' • ', '\n ', ' → ', '--sep-2a=', ' --sep-2b=' , ' --sep-3a=') + "\n " + strings.h24_e + "\n → " + strings.h24_b + strings.h24_c + strings.h24_d + "\n" +strings.h24_f + "\n" + "[sep-1a + " + strings.h24_b + " + sep-1b] [+ sep-2a + " + strings.h24_c + " + sep-2b] [+ sep-3a + " + strings.h24_d + " + sep-3b]" + "\n" + strings.h24_g)August 12, 2025 at 9:34 pm #183631
DaveForum AdminThanks ile.
I see what you mean by the _.
-> _ is on the leading space when using the configuration file as the first two separator characters are spaces. This has been fix by adding a check so that if a space is found as the first separator it is removed.
-> No _ when disabling the config file and using the defaults is actually there but unseen as there is a zero width space ( \u200b ) included with each separator for some reason. This has been fixed by removing the zero width space ( \u200b )
-> Typo on line 112 showing poor syntax and causing syntax errors has been removedComputers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
August 13, 2025 at 10:14 am #183681
ileMemberHello Dave
Same Page. [new twelve hours ago] The latest version desktop-menu.new
has the underscore icewm menu correctly.
golly goodness great menu, Dave.August 13, 2025 at 4:19 pm #183693
ileMemberdesktop-menu –write-out
returns nothing unusual.sudo desktop-menu –global –write-out
returns this Warning
(desktop-menu:31137): Gtk-WARNING **: 14:11:21.924: Failed to parse /root/.config/gtk-3.0/settings.ini: Permission deniedsu desktop-menu –global –write-out
returns nothing unusual same return as first command by user desktop-menu –write-out.August 13, 2025 at 5:14 pm #183697
DaveForum AdminI am not sure on the sudo gtk warning. I have not used sudo.
What does the following command (adding –debug) show?
sudo desktop-menu --global --write-out --debugI am guessing that this has something to do with the initial import of Gtk…
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
August 13, 2025 at 7:59 pm #183705
ileMemberHello Dave
filters set to ngc and nc.
There is a stray backslash printing in the fluxbox menu.it acts like it does not need these lines(?):
this makes \ not print in the fluxbox menu.
line 435
text=text.replace(')','\\)')
line 436 deleteline 484
text=text.replace(')','\\)')
line 485 deletehope it gives to you some insight about taking the \ away.
or \ is not so bad even if it does not belong there in fluxbox menu.August 13, 2025 at 8:02 pm #183706
ileMembersudo desktop-menu --global --write-out --debug [sudo] password for clue: Debug: Namespace init and agrument parsing ran Debug: Setting global options Debug: Verifying directory: /var/cache/desktop-menu as owner: 0 and group: 100 Debug: 1 users found in users group Building menus for: clue Debug: Home Directory: /home/clue/ Debug: Current UID: 1000 Debug: Current GID: 100 Debug: Setting user options Debug: Setting initial user configuration Debug: Setting user options Debug: Reading configuration file: /home/clue/.config/desktop-menu/desktop-menu.cfg Debug: Locale: en_US.UTF-8 (desktop-menu:19914): Gtk-WARNING **: 18:00:34.546: Failed to parse /root/.config/gtk-3.0/settings.ini: Permission denied Debug: Icon Theme: papirus-antix Debug: Valid Window Managers: ['fluxbox', 'jwm', 'icewm'] Debug: Building menu arrays for clue Debug: Menu File: /etc/xdg/menus/applications.menu Debug: Separators: [' ', ' ', '(', ')', '[', ']'] Debug: Category Filter: 'nc' Debug: Text Order: ['n', 'g', 'c'] Debug: Reading template file: /usr/share/desktop-menu/templates/fluxbox.template Debug: Verifying directory: /var/cache/desktop-menu/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/.fluxbox/ as owner: 1000 and group: 100 Debug: Writing out to: /var/cache/desktop-menu/clue/.fluxbox/menu-applications ──────────────────────────────────────────────────────────────────────────────────────────────────── Debug: Reading template file: /usr/share/desktop-menu/templates/jwm.template Debug: Verifying directory: /var/cache/desktop-menu/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/.jwm/ as owner: 1000 and group: 100 Debug: Writing out to: /var/cache/desktop-menu/clue/.jwm/menu-applications ──────────────────────────────────────────────────────────────────────────────────────────────────── Debug: Reading template file: /usr/share/desktop-menu/templates/icewm.template Debug: Verifying directory: /var/cache/desktop-menu/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/ as owner: 1000 and group: 100 Debug: Verifying directory: /var/cache/desktop-menu/clue/.icewm/ as owner: 1000 and group: 100 Debug: Writing out to: /var/cache/desktop-menu/clue/.icewm/menu-applicationsAugust 13, 2025 at 8:38 pm #183708
DaveForum AdminThanks ile.
These should also be fixed now. Same page/link as before.Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
August 13, 2025 at 9:51 pm #183711Robin
Memberit acts like it does not need these lines(?):
These lines are needed for fluxbox due to a bug in fluxbox, which struggles otherwise on closing round brackets in menu entry texts, which are allowed in .desktop files specs, while fluxbox won’t care about that, so we need to deal with them when writing out the menu files for this environment by escaping all the closing brackets specifically for fluxbox. It has been added in the legacy desktop-menu version already, and should NOT be removed in the upcoming version.
#Version: 3.33 240 if DESKTOP == 'fluxbox': 241 name = name.replace(')',r'\)')Removal of this will break antix23-desktop-files on fluxbox antiX, since there exist closing round braces in many translated menu entries.
Windows is like a submarine. Open a window and serious problems will start.
-
AuthorPosts
- You must be logged in to reply to this topic.