MX-21 MX-Fluxbox

Help for MX Fluxbox
When asking for help, use Quick System Info from MX Tools. It will be properly formatted using the following steps.
1. Click on Quick System Info in MX Tools
2. Right click in your post and paste.
Message
Author
PPC
Posts: 362
Joined: Tue Sep 11, 2018 8:22 am

Re: MX-21 MX-Fluxbox

#101 Post by PPC »

I've been trying to create a hook up to apt to automaticaly update the "all apps" menu every time a package is installed/removed...
I've found out how to create the hooks up, but it tries to generate the config file in the root folder, not in the user's home...
Before I dig deeper into this... Is there any interest from the Dev team to include such kind of hook up? It would make the fluxbox menu more intuitive to use...

P.

User avatar
Jerry3904
Administrator
Posts: 23102
Joined: Wed Jul 19, 2006 6:13 am

Re: MX-21 MX-Fluxbox

#102 Post by Jerry3904 »

Good thought, thanks, but I think we have that already covered in the startup file.

Code: Select all

#update app  menu if it doesn't exist
if [ ! -f $HOME/.fluxbox/submenus/full_menu ]; then
    command -v mxfb-menu-generator && mxfb-menu-generator
fi
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

PPC
Posts: 362
Joined: Tue Sep 11, 2018 8:22 am

Re: MX-21 MX-Fluxbox

#103 Post by PPC »

@Jerry3904 : yes, that script in the startup file creates a full menu, if none is found, but does not automaticaly update it, if the user add/removes some package, that's why I got interested in apt hook ups..., so the "all apps" menu is dynamic...

P.

User avatar
Jerry3904
Administrator
Posts: 23102
Joined: Wed Jul 19, 2006 6:13 am

Re: MX-21 MX-Fluxbox

#104 Post by Jerry3904 »

Give it a shot so we can test it -- thanks.
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

PPC
Posts: 362
Joined: Tue Sep 11, 2018 8:22 am

Re: MX-21 MX-Fluxbox

#105 Post by PPC »

@Jerry3904 .

It took some trial and error and a lot of web searching...
Here is how I got a dynamic "all apps" menu:

1- Add to the startup file this command, to log the user name:

Code: Select all

 whoami > /tmp/current_user.txt 
2- Edit /etc/apt/apt.conf.d/00exectmp and add this hook:

Code: Select all

 DPkg::Post-Invoke {"user=$(cat /tmp/current_user.txt) && su $user /usr/bin/mxfb-menu-generator";}; 
I tested this, using apt to first install "mutt" - the menu updated and the app appeared in my menu > all apps > internet
I purged "mutt" and the app was removed from my "all apps" menu

This seems to work, but, please, do test this extensively before trying to implement it...
Also I would like a better way to store the "regular" user that is in the system before running "sudo", I'm not that confident in using such volatile place as the /tmp/ folder...

(note1: I tried adding DPkg::Pre-Invoke {"whoami > /tmp/current_user.txt";}; that would be ideal- getting the user right before running apt... but it does not work.
note2: If you don't run the post-invoke as a regular user, the menu generator will error out because it's trying to create files in the root home folder...)

P.

User avatar
dolphin_oracle
Developer
Posts: 22099
Joined: Sun Dec 16, 2007 12:17 pm

Re: MX-21 MX-Fluxbox

#106 Post by dolphin_oracle »

should be able to use the "logname" command to get the user name. @PPC

Code: Select all

 DPkg::Post-Invoke {"su $(logname) /usr/bin/mxfb-menu-generator";};
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

PPC
Posts: 362
Joined: Tue Sep 11, 2018 8:22 am

Re: MX-21 MX-Fluxbox

#107 Post by PPC »

@dolphin_oracle
Man... I should have "googled" a bit more! Thanks, DO, the hook up is perfect, no need to add anything to the start up file, now!
If this is implemented, I think MXFB menu + rofi to search for apps are enough for my needs, I can remove xfce's file search, and stick with a more "pure" fluxbox setup

Many thanks for the tip!
And I hope this hook up is approved to be in the final MXFB... it probably is a nice feature, most people expect apps that were installed to magically appear in the menu- they have no idea of the work that's behind that!

P.

PPC
Posts: 362
Joined: Tue Sep 11, 2018 8:22 am

Re: MX-21 MX-Fluxbox

#108 Post by PPC »

I also spiced up the "simple weather" "script" that shows the weather, using wtt.in
This script has to be tested, and needs a fail safe, for when the detected place does not exist in wtt.in database...
This does a better job at finding exactly where you are, and displays the weather in your language:

Code: Select all

#! /bin/bash
geoip="$(wget -O- -q http://geoip.ubuntu.com/lookup)"
area="$(sed -r 's/.*<RegionName>(.*?)<\/RegionName>.*/\1/g' <<< $geoip)"
corrected_area=$(echo "${area// /_}")
echo $corrected_area
langu=$(locale | grep LANG | cut -d= -f2 | cut -d. -f1)
l1=$(echo $langu |cut -d_ -f1)
curl http://wttr.in/$corrected_area?lang=$l1
Enjoy
P,

User avatar
Jerry3904
Administrator
Posts: 23102
Joined: Wed Jul 19, 2006 6:13 am

Re: MX-21 MX-Fluxbox

#109 Post by Jerry3904 »

Thanks, we'll give it all a test!

DO and others may be more use than I will be...
Production: 5.10, MX-23 Xfce, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 16 GB, SSD 120 GB, Data 1TB
Personal: Lenovo X1 Carbon with MX-23 Fluxbox
Other: Raspberry Pi 5 with MX-23 Xfce Raspberry Pi Respin

gennargiu
Posts: 19
Joined: Fri Sep 27, 2019 11:51 am

Re: MX-21 MX-Fluxbox

#110 Post by gennargiu »

Hi i have a problem with fluxbox and application setting manager. it don't work. I used version beta 2 xfce enviroment and switch at fluxbox from exit session. Many thanks for your help me and best regards from Naples (Italy)

gennaro

Post Reply

Return to “MX Fluxbox Official Release”