Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Recreating MX-Fluxbox/antiX menu handling on Debian

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Recreating MX-Fluxbox/antiX menu handling on Debian

#1 Post by Porbeagle »

Hello, good folks of the Debian forum!

I've got something like 7-8 month of Linux experience. What got me hooked, was when I learned to do a cli install of Manjaro the "Arch way", so as to start with a clean blank canvas, where you can then learn one thing at a time in peace and quiet when you add it to your installation. But I always seem to return to Debian and the net iso server base instal, and then build on top. A rolling release just became too much to handle with 6-7 cumputers in the house, when you're still at the learning stage. With Debian, when I've got the entertainement system surround audio set up "perfectly", it stays that way (for the most part), and then I can concentrate on learning other stuff.I can solve problems with a fixed target, as opposed to a moving target with a rolling release.

Now I'm in the process of creating my ideal Debian desktop (in Virtualbox), and I've arrived at Fluxbox. The snappiness and lightness is addictive, and you can set windows to remember position and dimension. That last point is a must to me.

antiX and MX Linux have very good implementation of Fluxbox, especially with menu handling. I'm trying to recreate that on Debian, with all 3 distros loaded in Virtualbox to try to observe and learn. antiX offers a "core" base install, which would be ideal in my case. But I'd like to stay on Debian. I'm not qualified to hold much opinion on systemd, but I like to stay with it because it is easy to find solutions online, and because it just seems the way to go for the majority of Debian-based distros. And Debian is "always there" so to speak, I'd like to stay with the source distro.

What I've done so far, is a Debian base install with no extras - EFi, swap, home and root partitions. I updated, installed sudo and added my user, installed isenkram-cli and ran it, and installed alsa-utils.

For x11 i did:

Code: Select all

sudo apt-get install xserver-xorg x11-xserver-utils xfonts-base x11-utils xinit
and for Fluxbox I did:

Code: Select all

sudo apt-get install lightdm lightdm-gtk-greeter fluxbox pcmanfm gvfs-backends lxpolkit 
Now I'm on a nice, clean, Fluxbox desktop. I have to run apps with the terminal, but it seems quite feasible to learn how to add them to the Fluxbox menu. "Fluxbox-generate_menu" is disabled in Debian, seemingly because it interfers with Debians own menu system. As a beginner, I install new apps and experiement wildly all the time. On Manjaro I had a Clonezilla iso added to to the boot menu, and I plan to do that here as well. But I'm still at the stage where I don't have much idea about where applications go when they are installed, and I easily lose track of what I've installed. I'd love to have "live" menu handling, as on MX Linux and antiX.

So far, I've found this script from MX Fluxbox:
https://github.com/MX-Linux/mxfb-access ... -generator

First I right-clicked the script file in Pcmanfm and set execute permission to "owner". I edited the ~/.fluxbox/init file to point to "my-menu" in Home, and "my-menu" I edited to point to the script with this line:

Code: Select all

[exec] (Update Menu)  {/home/mxfb-menu-generator}
It shows up in the fluxbox menu, but it is not working. I have no idea where to go from here, but I love to learn and I'm not afraid of messing with "under the hood" stuff. I've searched high and low for solutions. Some people experiement with adding MX repos, and seem to have good results. MX Tools seems to be what people want on Debian. I figure most all of those tools functionality I can already achieve in native Debian with some learning, I only want the "live" Fluxbox menu handling, where apps automatically show up, or if need be after having taking steps to generate a menu. So I'm asking if any of you good folks here would be willing to point me in the direction of my next step, how and where I can learn how to set this up?

I'm inserting two images of the functionality of MX Fluxbox I'd like to implement in my Debian:

Image

Image

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#2 Post by Porbeagle »

A small update:
After much googling the package name xdgmenumaker kept popping up. It is on github. I know very little about github.

https://github.com/gapan/xdgmenumaker

After more googling, this app seems to have python3 dependencies, which I installed. And after more googling, I did this:

Code: Select all

sudo apt-get install -y make
git clone https://github.com/gapan/xdgmenumaker.git
cd xdgmenumaker/
make
sudo make install
And then, per instructions on the github site, I edited the fluxbox menu to include xdgmenumaker's auto-generated menu, and I added an entry in the resultin actual fluxbox right-clik menu to auto-generate:

Code: Select all

[exec] (Update Fluxbox Menu) {xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu}
This seems to work flawlessy, and I am much pleased. One small step in the right direction, and I learned about make commands and github cloning to boot.

For the moment is seems like tere's no way around this procedure, but it doesn't leave me entirely with a warm and fuzzy feeling inside. It reminds me of the AUR from my arch installs. I never liked AUR. I'm not competent enough to read aur packages scripts and make informed judgements about security. And AUR apps often broke, because people left their AUR projects, didn't update their scripts, and then the app broke upon Arch updates, or Arch itself got problems. I liked to stick to the official repos if at all possible.

So github seem to function kinda like an AUR for other distros than Arch. How does this work when Debian gets updated? I risk that my xdgmenumaker stops functioning? Are there any steps I can take to prevent this?

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#3 Post by fabien »

I don't know if that will help, but have you the 'menu' package installed? In theory, it is made to meet your needs.
menu package description:
generates programs menu for all menu-aware applications
Debian menu keeps transparently the menus in the different window-managers in sync with the list of installed programs.

Debian menu relies on a list of menu entries provided by programs and a list of menu-methods provided by window-managers and other menu-aware applications.

Menu provides system-level and user-level configuration and overrides for both menu entries and menu-methods.

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#4 Post by Porbeagle »

Thanks!

I tried to read up on the menu package before ending up with xdgmenumaker. There's little info on the web on how it is supposed to work with fluxbox, and I wasn't able to figure it out.

The closest I could find to documentation was this Ubuntu Manpage:
http://manpages.ubuntu.com/manpages/bio ... nus.1.html

When I run update-menus -v, I get:

Code: Select all

update-menus[888]: Update-menus is run by user.
update-menus[888]: Dpkg is not locking dpkg status area, good.
update-menus[888]: Reading installed packages list...
update-menus[888]: Reading translation rules in /etc/menu-methods/translate_menus.
update-menus[888]: Reading menu-entry files in /home/vlad/.menu.
update-menus[888]: 0 menu entries found (0 total).
update-menus[888]: Reading menu-entry files in /etc/menu.
update-menus[888]: 0 menu entries found (0 total).
update-menus[888]: Reading menu-entry files in /usr/lib/menu.
update-menus[888]: 0 menu entries found (0 total).
update-menus[888]: Reading menu-entry files in /usr/share/menu.
update-menus[888]: 14 menu entries found (14 total).
update-menus[888]: Reading menu-entry files in /usr/share/menu/default.
update-menus[888]: 0 menu entries found (14 total).
update-menus[888]: Running menu-methods in /home/vlad/.menu-methods.
update-menus[888]: Running menu-methods in /etc/menu-methods.
update-menus[888]: Running method: /etc/menu-methods/fluxbox
From there, I'm at loss on how I can get that to work with Fluxbox.
Last edited by Porbeagle on 2022-05-12 15:51, edited 1 time in total.

User avatar
Trihexagonal
df -h | participant
df -h | participant
Posts: 149
Joined: 2022-03-29 20:53
Location: The Land of the Dead
Has thanked: 20 times
Been thanked: 16 times
Contact:

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#5 Post by Trihexagonal »

You're making this much harder than it has to be.

I run Fluxbox on my FreeBSD and Kali Linux boxen and am using a Kali box with Fluxbox installed after the build right now.

This is how you do it. Install the programs I suggest and after you hit the desktop you can use what suits you best. This is meant to get you to that point from whatever DE you're using now:

Code: Select all

sudo apt update 
sudo apt install fluxbox && xfe && rxvt-unicode && leafpad
From your current DE, place this Fluxbox menu in your Documents folder where you can find it. It shows you how to call a program that uses the terminal from the menu:

Code: Select all

# Generated by fluxbox-generate_menu
#
# If you read this it means you want to edit this file manually, so here
# are some useful tips:
#
# - You can add your own menu-entries to ~/.fluxbox/usermenu
#
# - If you miss apps please let me know and I will add them for the next
#   release.
#
# - The -r option prevents removing of empty menu entries and lines which
#   makes things much more readable.
#
# - To prevent any other app from overwriting your menu
#   you can change the menu name in ~/.fluxbox/init to:
#     session.menuFile: ~/.fluxbox/my-menu
[begin] (Fluxbox)
[encoding] {UTF-8}
      [exec]   (urxvt) {urxvt}
      [exec]   (Firefox) {firefox}
[submenu] (Files)
      [exec]   (leafpad) {leafpad}
      [exec]   (xfe) {xfe}
      [exec]   (mc) {xterm -e -u mc}
[end]
[submenu] (Multimedia)
      [exec]   (Gimp) {gimp}
      [exec]   (VLC) {vlc}
      [exec]   (mplayer) {mplayer}
      [exec]   (Audacity) {audacity}
      [exec]   (Audacious) {audacious}
[end]
[submenu] (System)
      [exec]   (kismet) {urxvt -e -u kismet}
      [exec]   (gKrellm) {gkrellm}
      [exec]   (Asunder) {asunder}
      [exec]   (ePDFview) {epdfview}
      [exec]   (xclock) {xclock}
      [exec]   (xcalc) {xcalc}
      [exec] (Reload .Xdefaults) {xrdb -load $HOME/.Xdefaults}
[end]
[submenu] (Fluxbox)
      [config] (Configure)
[submenu] (System Styles) {Choose a style...}
      [stylesdir] (/usr/local/share/fluxbox/styles)
[end]
[submenu] (User Styles) {Choose a style...}
      [stylesdir] (~/.fluxbox/styles)
[end]
      [workspaces] (Workspace List)
[submenu] (Tools)
      [exec] (Window name) {xprop WM_CLASS|cut -d \" -f 2|xmessage -file - -center}
[end]
[submenu] (Window Managers)
      [restart] (twm) {twm}
[end]
      [commanddialog] (Fluxbox Command)
      [reconfig] (Reload config)
      [restart] (Restart)
      [exec] (About) {(fluxbox -v; fluxbox -info | sed 1d) | xmessage -file - -center}
      [separator]
      [exit] (Exit)
[end]
[endencoding]
[end]
Now exit your DE and enter a Fluvbox session. I can do this from the log-in screen in Kali. This is going to generate your /home/user/.fluxbox Ditectory. You won't be able to do anything from where you are now so exit and go back to the DE.

Now you should have a hidden Fluxbox directory in your /home/user/ Directory. Copy the body of the menu I gave you into the one that was generated. Now you're ready to run Fluxbox as a WM. Exit the DE and start another Fluxbox session.

It will be a blank desktop with only a cursor, that's what you expect to see right now. Right click and your new menu is there with access to the urxvt terminal and Xfe file manager I suggested you install. I did not suggest you install gkrellm for meters but it's what I use and you'll like it.

It should be looking something like this:
Fluxbox Window Manager
Fluxbox Window Manager
Hypnotic.png (188.28 KiB) Viewed 3180 times
This is where I start from every time I set up a desktop. A text editor, terminal and file manager is all it takes and what you'll be using most. You should be able to take it from here as you sound like you know what you're doing.
When Darkness takes everything embrace what Darkness brings.

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#6 Post by Porbeagle »

Wow, thanks!

There are some great advice here, and I'm gonna recreate the whole process you posted here in virtualbox, and learn from it!

At this moment in time, I'm in that phase where I want it as clean and minimal as possible. I'm aware that most Linux user leave this phase as they progress. I'm 49 years old and still in that phase, hehe, because I'm relatively new to Linux, and as a windows user it was always a wet dream to cut through the clutter. It is also a great way to learn. You can learn one piece at the time, in peace and quiet. Knowledge that will be useful later on, when I've progressed past this phase.

At this point, it means building the whole thing from the bottom up, starting with the command line from a base install.

I'm good at sounding like I know what I'm doing, but my Linux knowledge is a beginning autodidacts mess: some under the hood stuff because I wanted to start from the bottom, and then big holes in basic knowledge. No structure!

Regarding getting Fluxbox to auto-update menus without user intervention, I've tried to look into antiX and MX linux config files. It is my impression that I've started in the wrong end. I need to figure how the registering of new apps are registered at a deeper level in the system in real-time, and then connect Fluxbox with that system.

User-iniated menu generation (as with the use of xdgmenumaker) seems to search in folders like /usr/share/applications/.

What I as a user perceive as "live" generationing and automatic updating of the menu, seems to be triggered by use of the terminal in MX Linux and antiX. When I install an app, at the end of the process I can see a message in the terminal about "generating fluxbox menu".

So I have to find a way to configure the system so that with every install of an app, the system triggers a menu-generating process. First i tried to look into terminal config files. But then it dawned on me that this must be configured at a deeper level. People uninstall and install terminals all the time, but every terminal triggers this menu-generationing. It must be the package manager?

User avatar
Trihexagonal
df -h | participant
df -h | participant
Posts: 149
Joined: 2022-03-29 20:53
Location: The Land of the Dead
Has thanked: 20 times
Been thanked: 16 times
Contact:

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#7 Post by Trihexagonal »

Porbeagle wrote: 2022-05-13 17:05 Wow, thanks!

There are some great advice here, and I'm gonna recreate the whole process you posted here in virtualbox, and learn from it!

At this moment in time, I'm in that phase where I want it as clean and minimal as possible. I'm aware that most Linux user leave this phase as they progress. I'm 49 years old and still in that phase, hehe, because I'm relatively new to Linux, and as a windows user it was always a wet dream to cut through the clutter. It is also a great way to learn. You can learn one piece at the time, in peace and quiet. Knowledge that will be useful later on, when I've progressed past this phase.

At this point, it means building the whole thing from the bottom up, starting with the command line from a base install.
Exemplary. Exactly what I like to hear.

I'm 65 and quit High School in 10th Grade when pocket calculators came out. I am completely self-taught, have never taken a computer course of any kind in my life and taught myself to use every computer and OS I've used from an AppleII to SysV Oracle Solaris.

If you check my profile I have a link to my site where I have a beginner's tutorial on Building a FreeBSD Desktop from Scratch with some colored Fluxbox themes you can use and alter as you like in a text editor and I show how to use icons on the menu in my tutorial.

Install these programs through apt to interactively harden your System:

debsums
apt-listbugs
apt-listchanges
apt-list-versions
needrestart

By interactively I mean apt will check the programs you're going to be installing and check to see if there are bugs, if there are inform you of them, ask if you want to continue the build and when you're finished tell you if any Services are running outdated libraries. Just uncheck the box to restart any Services and reboot to save yourself potential problems.

Try out gkrellm, there are over 100 free skins for it and I have that many skins for Audacious I can make available, if you like.


I don't bother with assisted menu generation. Those are the programs I use on FreeBSD and that menu came right off this Kali box.Things like tkdvd that need to be called from the terminal I just do manually. I have a ton of Kali tools that aren't listed in the menu but I know the commands to bring them up without looking.

I just made this sitting here. It's not my color but I'm not everyone's cup of tea. Grimes as Princess GNU:
Grimes - Princess GNU
Grimes - Princess GNU
Princess_GNU.jpg (189.71 KiB) Viewed 3134 times
When Darkness takes everything embrace what Darkness brings.

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#8 Post by Porbeagle »

Cool, thanks! Thanks for those tips!

At some point I'll have to wet my feet in BSD and try it, thats for sure. I have a few friends who studied IT in the nineties, and they were all about Lionux at the time, Now that I've become interested myself, I ask them what they run, and many of them answer some form of BSD, haha. It is also very interesting to read about all the history,

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#9 Post by Porbeagle »

Setting up a dynamic Fluxbox menu natively in Debian seems rather complex. At least I can't find out how to do it. It looks like my best option at this point is to stay with xdgmenumaker from github, though I'd rather avoid involving non-official packages as far as possible.

But looking into antiX and MX Linux setup and configuration, I at least discovered that it is possible to configure apt to invoke scripts or commands after apt-get operations. These are similar to "pacman hooks" in the Arch sphere. From what I can tell, this is how antiX and MX make their Fluxbox menus dynamic and automatic. I want to set up xdgmenumaker on my system so that it behaves similary, by configuring apt so that xdgmenumaker runs after apt-get operations.

I found this guide online: https://www.cyberciti.biz/faq/debian-ub ... e-command/

But no matter what I try, I can't get this to work in Debian.

The exact steps I've taken after installing Fluxbox are these:

Code: Select all

sudo apt-get install python3-minimal txt2tags python3-xdg python3-gi gobject-introspection gir1.2-gtk-3.0
sudo apt-get install -y make
sudo apt-get install git
git clone https://github.com/gapan/xdgmenumaker.git
cd xdgmenumaker/
make
sudo make install
sudo reboot
This installs Xdgmenumaker on debian, from github.

Per instructions on the github site (https://github.com/gapan/xdgmenumaker), I set up the fluxbox menu system like this:

-first run xdgmenumaker from the terminal, to generate the menu:

Code: Select all

xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu
Then I add thes entries in the fluxbox menu:

Code: Select all

[include] (~/.fluxbox/xdg_menu)
[exec] (Update Fluxbox Menu) {xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu}
This works great.

Now, what I want is for Apt to run that last command (xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu) whenever it installs a package. I create a file like this:

Code: Select all

sudo nano /etc/apt/apt.conf.d/00fluxboxmenu
And I put in:

Code: Select all

DPkg::Post-Invoke {"xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu";};
I know the command (xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu) works in the terminal. But when I install a package with apt, it gives me this message about not being able to execute the command.

So I have to ask what I'm doing wrong? I've searched the net to the best of my abilities, but I cannot figure it out. The closest I can find are Ubuntu folks with this problem, and they remove some libstream package to solve it. This does not seem to apply to my Debian install.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 604
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 141 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#10 Post by fabien »

Porbeagle wrote: 2022-05-18 12:57

Code: Select all

DPkg::Post-Invoke {"xdgmenumaker -f fluxbox > ~/.fluxbox/xdg_menu";};
You should fully report the error message, but:
'~' stands for '/home/user/' directory when logged in as 'user'. You have to replace '~/.fluxbox/xdg_menu' with '/home/user/.fluxbox/xdg_menu'
It is also possible that you have to use full path to your application, i.e. /path/to/xdgmenumaker

Code: Select all

DPkg::Post-Invoke { "/path/to/xdgmenumaker -f fluxbox > /home/user/.fluxbox/xdg_menu"; };
The menu package that I talked about is not a good idea. I think it's an old project superseded by XDG compliant ones. I have it installed on my system and these are the only applications that this method handles:

Code: Select all

ls /usr/share/menu/

aptitude  bash  bc  dash  deborphan  galculator  graphviz  obsession  pavumeter  procps  psmisc  README  tasksel  tcl8.6  telnet  tk8.6  x11-apps  x11-utils  x11-xserver-utils  xscreensaver
You could instead take a look at 'xdg-desktop-menu' from package 'xdg-utils' (you can have a look at the man pages without installing packages by using 'debmany' from 'debian-goodies' package: 'debmany xdg-utils').
'xdg-desktop-menu' uses desktop files in /usr/share/applications/, for instance:

Code: Select all

cat /usr/share/applications/lftp.desktop

[Desktop Entry]
Version=1.0
Name=lftp
Icon=lftp-icon
Type=Application
Terminal=true
Exec=lftp
Categories=Network;
If you have scripting skills (or if you are willing to learn it would be a good occasion), it is possible to imagine a script using this files that would replace xdgmenumaker.

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#11 Post by Porbeagle »

Wow, it worked! Goddamn (if I may be at liberty to say so)!!

I don't know much about where packages actually go when you install them, but a google search told me that if you install with make, they often go into /usr/local/bin, and there it was!

so I changed my Apt config to:

Code: Select all

DPkg::Post-Invoke { "/usr/local/bin/xdgmenumaker -f fluxbox > /home/username/.fluxbox/xdg_menu"; };
...and, Voila!

Many thanks, I've been pondering this for days, digging into antix files and trying to make sense of them!

Now I've got a nice clean Fluxbox desktop with auto-generating dynamic menu, and I can build and configure from there, one thing at a time!

Yes, I've understood as much as that xdg is the way to go with menus. Thanks for the advice about making scripts! Right now I've got a headache from trying to get this to work, scripts seems far off. But I've noticed how extremely helpful small simple scripts can be, and there are many templates online one can tweak. A nice project to learn more about it on rainy days!

Porbeagle
Posts: 14
Joined: 2022-05-12 05:11
Location: Norway
Has thanked: 8 times
Been thanked: 2 times

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#12 Post by Porbeagle »

Many thanks for all the great advice given here by all. Now I'm gonna open a nice cold beer and just look at a nice, naked Fluxbox with htop loaded. It looks so beautiful! The possibilities are endless, and all my own! Thanks!

Image

User avatar
Trihexagonal
df -h | participant
df -h | participant
Posts: 149
Joined: 2022-03-29 20:53
Location: The Land of the Dead
Has thanked: 20 times
Been thanked: 16 times
Contact:

Re: Recreating MX-Fluxbox/antiX menu handling on Debian

#13 Post by Trihexagonal »

I'm happy you got things worked out like you want them, and your way doesn't have to be my way to be right, but it seems you went to a lot of work to automate what I do by hand with leafpad and one line of Copy and Paste in a matter of a few seconds.

if I were to add Audacity to the menu I would make a copy the Audacious line, paste it in above or below and in a few keystrokes to correct spelling to Audacity be using it.

More is not always better and less not always best, but if money can't buy happiness then why is it so fabulous?

P O P P Y I'm Poppy! :)
When Darkness takes everything embrace what Darkness brings.

Post Reply