Sort and improve readability of init

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
User avatar
siamhie
Global Moderator
Posts: 3214
Joined: Fri Aug 20, 2021 5:45 pm

Re: Sort and improve readability of init

#51 Post by siamhie »

Jerry3904 wrote: Tue Mar 04, 2025 11:16 am You can keep your menu as it is, right? Any change here will only affect new users. When we go to Trixie, you would just save your existing menu, then after installation paste it back in.
I backup my HOME directory to another drive every 6 months or so. I add/remove a lot of styles/backgrounds/fonts/icons/etc. and like to keep the most recent version available at all times for new installs.
This is my Fluxbox . There are many others like it, but this one is mine. My Fluxbox is my best friend. It is my life.
I must master it as I must master my life. Without me, my Fluxbox is useless. Without my Fluxbox, I am useless.

User avatar
i_ri
Posts: 1070
Joined: Tue Jun 30, 2015 12:26 am

Re: Sort and improve readability of init

#52 Post by i_ri »

search iconbar before search workspace

Make it known to avoid using the case sensitive search keyword sequences in comments, toolbar.button names and labels, workspace names.

Melber Your script is fantastic. You have remained on track to provide Jerry3904's model.
I selfishly have shared my own model ideas both here and in another topic.
If You have Your own model we will like to see it.

User avatar
i_ri
Posts: 1070
Joined: Tue Jun 30, 2015 12:26 am

Re: Sort and improve readability of init

#53 Post by i_ri »

Hello Jerry3904
Got one into a category:

elif [[ $item = *tooltipDelay:* ]]; then
iconbar_items+=($item)

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

Re: Sort and improve readability of init

#54 Post by Jerry3904 »

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

User avatar
i_ri
Posts: 1070
Joined: Tue Jun 30, 2015 12:26 am

Re: Sort and improve readability of init

#55 Post by i_ri »

Hello Jerry3904 and Melber
session.screen0.tabs.intitlebar:
Reason to search tab before search titlebar?

User avatar
i_ri
Posts: 1070
Joined: Tue Jun 30, 2015 12:26 am

Re: Sort and improve readability of init

#56 Post by i_ri »

Hello Jerry3904 and Everyone
Another category has evidenced itself.
The "do not edit" Category.

Observing two lines that report a value not for editing.
session.configVersion:
session.screen0.slit.direction:

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

Re: Sort and improve readability of init

#57 Post by Jerry3904 »

I appreciate your ongoing attention here, but I'm done with structure and am now trying to finish out implementation.

BTW: I'm sorry but I don't understand the point of your question about sort order--maybe @Melber does. And I'm not interested in a category with only 2 entries.
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

User avatar
Melber
Developer
Posts: 1193
Joined: Tue Mar 23, 2021 4:19 pm

Re: Sort and improve readability of init

#58 Post by Melber »

i_ri wrote: Wed Mar 05, 2025 10:34 pm Hello Jerry3904 and Melber
session.screen0.tabs.intitlebar:
Reason to search tab before search titlebar?
Jerry3904 wrote: Thu Mar 06, 2025 10:45 am BTW: I'm sorry but I don't understand the point of your question about sort order--maybe @Melber does.
i_ri means that session.screen0.tabs.intitlebar gets sorted into the titlebar category rather than the tabs category.

This version searches for "tab" before "titlebar", so that line gets sorted into "tabs".
It also sorts session.screen0.tooltipDelay into the iconbar category as per i_ri's Post #53.

Code: Select all

#!/bin/bash
#script to sort fluxbox init file
#version 2503-3

init_location=$HOME/.fluxbox/init
backup_location=$HOME/.restore/fluxbox
target_location=$HOME/.fluxbox/init

OLDIFS=$IFS
IFS="|"

while read -r item; do

    if [[ $item = *toolbar* ]]; then
        toolbar_items+=($item)
    elif [[ $item = *systray* ]]; then
        toolbar_items+=($item)
    elif [[ $item = *time* ]]; then
        toolbar_items+=($item)
    elif [[ $item = *tab* ]]; then
        tab_items+=($item)
    elif [[ $item = *window* ]]; then
        window_items+=($item)
    elif [[ $item = *NewWindows* ]]; then
        window_items+=($item)
    elif [[ $item = *Maximization* ]]; then
        window_items+=($item)
    elif [[ $item = *Deco* ]]; then
        window_items+=($item)
    elif [[ $item = *titlebar* ]]; then
        window_items+=($item)
    elif [[ $item = *workspace* ]]; then
        workspace_items+=($item)
    elif [[ $item = *slit* ]]; then
        slit_items+=($item)
    elif [[ $item = *iconbar* ]]; then
        iconbar_items+=($item)
    elif [[ $item = *tooltipDelay* ]]; then
        iconbar_items+=($item)
    elif [[ $item = *menu* ]]; then
        menu_items+=($item)
    elif [[ $item = *Menu* ]]; then
        menu_items+=($item)
    elif [[ $item = *File* ]]; then
        config_items+=($item)
    elif [[ $item = *Overlay* ]]; then
        config_items+=($item)
    elif [[ $item = *Raise* ]]; then
        window_items+=($item)
    elif [[ $item = *##* ]]; then
        trash_items+=($item)
    else
        misc_items+=($item)
    fi

done < $init_location

#####

if [ ! -d $backup_location ]; then
    mkdir -p $backup_location
fi

cp $init_location $backup_location/init.bak


#####
printf '### HELP: https://fluxboxwiki.github.io/category/howtos/en/Editing_the_init_file.html ###\n' > $target_location
printf "\n### WINDOW ###\n" >> $target_location
printf '%s\n' "${window_items[@]}" >> $target_location
printf "\n### WORKSPACE ###\n" >> $target_location
printf '%s\n' "${workspace_items[@]}" >> $target_location
printf "\n### TOOLBAR ###\n" >> $target_location
printf '%s\n' "${toolbar_items[@]}" >> $target_location
printf "\n### SLIT ###\n" >> $target_location
printf '%s\n' "${slit_items[@]}" >> $target_location
printf "\n### TABS ###\n" >> $target_location
printf '%s\n' "${tab_items[@]}" >> $target_location
printf "\n### ICONBAR ###\n" >> $target_location
printf '%s\n' "${iconbar_items[@]}" >> $target_location
printf "\n### MENU ###\n" >> $target_location
printf '%s\n' "${menu_items[@]}" >> $target_location
printf "\n### CONFIG FILES ###\n" >> $target_location
printf '%s\n' "${config_items[@]}" >> $target_location
printf "\n### MISCELLANEOUS ###\n" >> $target_location
printf '%s\n' "${misc_items[@]}" >> $target_location


IFS=$OLDIFS

exit 0

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

Re: Sort and improve readability of init

#59 Post by Jerry3904 »

Are you ready to upload it to mxfb-accessories? And if yes, how do you want to name it (I have a provisional mxfb-sortinit)?
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

User avatar
i_ri
Posts: 1070
Joined: Tue Jun 30, 2015 12:26 am

Re: Sort and improve readability of init

#60 Post by i_ri »

showing Reason to search iconbar before search workspace.
session.screen0.iconbar.mode: {static groups} (workspace)

Post Reply

Return to “MX Fluxbox Official Release”