Re: Sort and improve readability of init
Posted: Sun Feb 23, 2025 5:05 pm
It is easy, and will not go away.
Support for MX and antiX Linux distros
http://www.forum.mxlinux.org/
No, agree that would be overkill.ceeslans wrote: Tue Feb 25, 2025 9:09 am ...Do we restore the backed-up version every time mx-tweak sets another style? Or when a different toolbar position or transparency-level is selected from fluxbox' own configuration menu?
...
Code: Select all
[separator]
[exec] (Use structured init) {config_init_restore}
Code: Select all
session.screen0.systray.pinLeft:
session.screen0.systray.pinRight:
Code: Select all
#!/bin/bash
#script to sort fluxbox init file
#version 2502-2
init_location=$HOME/.fluxbox/init
backup_location=$HOME/.restore/fluxbox
window_item_1=$(grep 'window.focus.alpha' $init_location)
window_item_2=$(grep 'window.unfocus.alpha' $init_location)
window_item_3=$(grep 'focusNewWindows' $init_location)
window_item_4=$(grep 'windowMenu' $init_location)
window_item_5=$(grep 'titlebar.left' $init_location)
window_item_6=$(grep 'titlebar.right' $init_location)
window_item_7=$(grep 'showwindowposition' $init_location)
window_item_8=$(grep 'windowPlacement' $init_location)
toolbar_item_1=$(grep 'toolbar.tools' $init_location)
toolbar_item_2=$(grep 'toolbar.layer' $init_location)
toolbar_item_3=$(grep 'toolbar.alpha' $init_location)
toolbar_item_4=$(grep 'toolbar.onhead' $init_location)
toolbar_item_5=$(grep 'toolbar.autoRaise' $init_location)
toolbar_item_6=$(grep 'toolbar.visible' $init_location)
toolbar_item_7=$(grep 'toolbar.height' $init_location)
toolbar_item_8=$(grep 'toolbar.placement' $init_location)
toolbar_item_9=$(grep 'toolbar.widthPercent' $init_location)
toolbar_item_10=$(grep 'toolbar.maxOver' $init_location)
toolbar_item_11=$(grep 'toolbar.autoHide' $init_location)
toolbar_item_12=$(grep 'strftimeFormat' $init_location | sed -e 's/%/\%/g')
slit_item_1=$(grep 'slit.acceptKdeDockapps' $init_location)
slit_item_2=$(grep 'slit.layer' $init_location)
slit_item_3=$(grep 'slit.placement' $init_location)
slit_item_4=$(grep 'slit.maxOver' $init_location)
slit_item_5=$(grep 'slit.onhead' $init_location)
slit_item_6=$(grep 'slit.autoRaise' $init_location)
slit_item_7=$(grep 'slit.autoHide' $init_location)
slit_item_8=$(grep 'slit.alpha' $init_location)
slit_item_9=$(grep 'slitlistFile' $init_location)
tab_item_1=$(grep 'tab.placement' $init_location)
tab_item_2=$(grep 'tab.width' $init_location)
tab_item_3=$(grep 'struts:' $init_location)
tab_item_3a=$(grep 'struts.1' $init_location)
tab_item_4=$(grep 'tabs.usePixmap' $init_location)
tab_item_5=$(grep 'tabs.maxOver' $init_location)
tab_item_6=$(grep 'tabs.intitlebar' $init_location)
iconbar_item_1=$(grep 'iconbar.alignment' $init_location)
iconbar_item_2=$(grep 'iconbar.mode' $init_location)
iconbar_item_3=$(grep 'iconbar.usePixmap' $init_location)
iconbar_item_4=$(grep 'iconbar.iconWidth' $init_location)
iconbar_item_5=$(grep 'iconbar.iconifiedPattern' $init_location)
iconbar_item_6=$(grep 'iconbar.iconTextPadding' $init_location)
workspace_item_1=$(grep 'workspaces' $init_location)
workspace_item_2=$(grep 'workspaceNames' $init_location)
workspace_item_3=$(grep 'workspacewarping:' $init_location)
workspace_item_4=$(grep 'workspacewarpinghorizontal:' $init_location)
workspace_item_5=$(grep 'workspacewarpinghorizontaloffset' $init_location)
workspace_item_6=$(grep 'workspacewarpingvertical:' $init_location)
workspace_item_7=$(grep 'workspacewarpingverticaloffset' $init_location)
menu_item_1=$(grep 'clientMenu.usePixmap' $init_location)
menu_item_2=$(grep 'menu.alpha' $init_location)
menu_item_3=$(grep 'menuDelay' $init_location)
menu_item_4=$(grep 'menuFile' $init_location)
menu_item_5=$(grep 'menuSearch' $init_location)
config_item_1=$(grep 'keyFile' $init_location)
config_item_2=$(grep 'appsFile' $init_location)
config_item_3=$(grep 'styleFile' $init_location)
config_item_4=$(grep 'styleOverlay' $init_location)
misc_item_1=$(grep 'colPlacementDirection' $init_location)
misc_item_2=$(grep 'opaqueMove' $init_location)
misc_item_3=$(grep 'allowRemoteActions' $init_location)
misc_item_4=$(grep 'fullMaximization' $init_location)
misc_item_5=$(grep 'noFocusWhileTypingDelay' $init_location)
misc_item_6=$(grep 'opaqueResize:' $init_location)
misc_item_7=$(grep 'edgeResizeSnapThreshold' $init_location)
misc_item_8=$(grep 'maxDisableMove' $init_location)
misc_item_9=$(grep 'opaqueResizeDelay' $init_location)
misc_item_10=$(grep 'focusSameHead' $init_location)
misc_item_11=$(grep 'tabFocusModel' $init_location)
misc_item_12=$(grep 'rootCommand' $init_location)
misc_item_13=$(grep 'defaultDeco' $init_location)
misc_item_14=$(grep 'tooltipDelay' $init_location)
misc_item_15=$(grep 'edgeSnapThreshold' $init_location)
misc_item_16=$(grep 'maxIgnoreIncrement' $init_location)
misc_item_17=$(grep 'maxDisableResize' $init_location)
misc_item_18=$(grep 'session.screen0.autoRaise' $init_location)
misc_item_19=$(grep 'focusModel' $init_location)
misc_item_20=$(grep 'rowPlacementDirection' $init_location)
misc_item_21=$(grep 'clickRaises' $init_location)
misc_item_22=$(grep 'forcePseudoTransparency' $init_location)
misc_item_23=$(grep 'doubleClickInterval' $init_location)
misc_item_24=$(grep 'ignoreBorder' $init_location)
misc_item_25=$(grep 'tabsAttachArea' $init_location)
misc_item_26=$(grep 'autoRaiseDelay' $init_location)
misc_item_27=$(grep 'cacheLife' $init_location)
misc_item_28=$(grep 'tabPadding' $init_location)
misc_item_29=$(grep 'colorsPerChannel' $init_location)
misc_item_30=$(grep 'cacheMax' $init_location)
misc_item_31=$(grep 'configVersion' $init_location)
misc_item_32=$(grep 'systray.pinLeft' $init_location)
misc_item_33=$(grep 'systray.pinRight' $init_location)
#####
if [ ! -d $backup_location ]; then
mkdir -p $backup_location
fi
cp $init_location $backup_location/init.bak
#####
echo "
##### MX-Fluxbox sorted init #####
#####WINDOW#####
$window_item_1
$window_item_2
$window_item_3
$window_item_4
$window_item_5
$window_item_6
$window_item_7
$window_item_8
#####TOOLBAR#####
$toolbar_item_1
$toolbar_item_2
$toolbar_item_3
$toolbar_item_4
$toolbar_item_5
$toolbar_item_6
$toolbar_item_7
$toolbar_item_8
$toolbar_item_9
$toolbar_item_10
$toolbar_item_11
$toolbar_item_12
#####SLIT#####
$slit_item_1
$slit_item_2
$slit_item_3
$slit_item_4
$slit_item_5
$slit_item_6
$slit_item_7
$slit_item_8
$slit_item_9
#####TABS#####
$tab_item_1
$tab_item_2
$tab_item_3
$tab_item_3a
$tab_item_4
$tab_item_5
$tab_item_6
#####ICONBAR#####
$iconbar_item_1
$iconbar_item_2
$iconbar_item_3
$iconbar_item_4
$iconbar_item_5
$iconbar_item_6
#####WORKSPACE#####
$workspace_item_1
$workspace_item_2
$workspace_item_3
$workspace_item_4
$workspace_item_5
$workspace_item_6
$workspace_item_7
#####MENUS#####
$menu_item_1
$menu_item_2
$menu_item_3
$menu_item_4
$menu_item_5
#####CONFIG FILES#####
$config_item_1
$config_item_2
$config_item_3
$config_item_4
#####MISC#####
$misc_item_1
$misc_item_2
$misc_item_3
$misc_item_4
$misc_item_5
$misc_item_6
$misc_item_7
$misc_item_8
$misc_item_9
$misc_item_10
$misc_item_11
$misc_item_12
$misc_item_13
$misc_item_14
$misc_item_15
$misc_item_16
$misc_item_17
$misc_item_18
$misc_item_19
$misc_item_20
$misc_item_21
$misc_item_22
$misc_item_23
$misc_item_24
$misc_item_25
$misc_item_26
$misc_item_27
$misc_item_28
$misc_item_29
$misc_item_30
$misc_item_31
$misc_item_32
$misc_item_33
" > $init_location
exit 0
Code: Select all
fluxbox -rc init2
Melber wrote: Sun Feb 23, 2025 3:04 pm seems like rootMenu --> Settings --> Configure --> anything results in an init rewrite