Re: Sort and improve readability of init
Posted: Tue Feb 25, 2025 8:26 pm
I was wondering if a custom version of the file wouldn't get over written as opposed to the stock version but it seems like it does.
Support for MX and antiX Linux distros
http://www.forum.mxlinux.org/
I was wondering if a custom version of the file wouldn't get over written as opposed to the stock version but it seems like it does.
Code: Select all
[submenu] (Configure)
[exec] (Apps) {exo-open ~/.fluxbox/apps}
[exec] (Init) {exo-open ~/.fluxbox/init}
[exec] (Keys) {exo-open ~/.fluxbox/keys}
[submenu] (Menus)
[exec] (Main) {exo-open ~/.fluxbox/menu-mx}
[exec] (Appearance) {exo-open ~/.fluxbox/submenus/appearance}
[exec] (Settings) {exo-open ~/.fluxbox/submenus/settings}
[exec] (Out of sight) {exo-open ~/.fluxbox/submenus/out-of-sight}
[end]
[exec] (Overlay) {exo-open ~/.fluxbox/overlay}
[exec] (Startup) {featherpad ~/.fluxbox/startup}
[exec] (Styles) {thunar ~/.fluxbox/styles/}
[config] (Window)
[workspaces] (Workspaces)
[end]
Code: Select all
target_location=$HOME/.fluxbox/init
Code: Select all
#!/bin/bash
#script to sort fluxbox init file
#version 2502-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 = *window* ]]; then
window_items+=($item)
elif [[ $item = *titlebar* ]]; then
window_items+=($item)
elif [[ $item = *toolbar* ]]; then
toolbar_items+=($item)
elif [[ $item = *time* ]]; then
toolbar_items+=($item)
elif [[ $item = *workspace* ]]; then
workspace_items+=($item)
elif [[ $item = *slit* ]]; then
slit_items+=($item)
elif [[ $item = *tab* ]]; then
tab_items+=($item)
elif [[ $item = *iconbar* ]]; then
iconbar_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 = *###* ]]; 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 "\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
Code: Select all
#### HELP: https://fluxboxwiki.github.io/category/howtos/en/Editing_the_init_file.html ####
### WINDOW ###
session.screen0.tabs.intitlebar: true
session.screen0.window.focus.alpha: 255
session.screen0.window.unfocus.alpha: 255
session.screen0.titlebar.left: Stick
session.screen0.titlebar.right: Minimize Maximize Close
session.screen0.windowMenu: ~/.fluxbox/submenus/windowmenu
session.screen0.showwindowposition: false
session.screen0.windowPlacement: RowMinOverlapPlacement
-----
session.screen0.focusNewWindows: true
session.screen0.fullMaximization: false
session.screen0.defaultDeco: NORMAL
session.screen0.clickRaises: true
session.screen0.autoRaise: true
session.autoRaiseDelay: 250
### WORKSPACE ###
session.screen0.workspacewarpingverticaloffset: 1
session.screen0.workspacewarpingvertical: false
session.screen0.workspaceNames: W-1,W-2,W-3,
session.screen0.workspacewarping: true
session.screen0.workspacewarpinghorizontal: true
session.screen0.workspacewarpinghorizontaloffset: 1
session.screen0.workspaces: 2
### TOOLBAR ###
session.screen0.toolbar.visible: false
session.screen0.toolbar.height: 30
session.screen0.toolbar.onhead: 1
session.screen0.toolbar.alpha: 252
session.screen0.toolbar.autoHide: false
session.screen0.toolbar.tools: workspacename, iconbar, clock
session.screen0.toolbar.widthPercent: 66
session.screen0.toolbar.layer: Normal
session.screen0.toolbar.maxOver: false
session.screen0.toolbar.placement: TopCenter
session.screen0.toolbar.autoRaise: false
session.screen0.strftimeFormat: %I:%M %b %d
-----
session.screen0.systray.pinLeft:
session.screen0.systray.pinRight:
### SLIT ###
session.screen0.slit.layer: Desktop
session.screen0.slit.onhead: 0
session.screen0.slit.autoRaise: true
session.screen0.slit.maxOver: true
session.screen0.slit.acceptKdeDockapps: true
session.screen0.slit.alpha: 255
session.screen0.slit.placement: BottomCenter
session.screen0.slit.autoHide: false
session.slitlistFile: ~/.fluxbox/slitlist
### TABS ###
session.screen0.tab.placement: TopLeft
session.screen0.tab.width: 64
session.screen0.tabs.usePixmap: true
session.screen0.tabs.maxOver: false
session.screen0.tabFocusModel: ClickToTabFocus
session.tabsAttachArea: Window
session.tabPadding: 0
### ICONBAR ###
session.screen0.iconbar.iconWidth: 128
session.screen0.iconbar.mode: {static groups}
session.screen0.iconbar.iconifiedPattern: Left
session.screen0.iconbar.iconTextPadding: 10
session.screen0.iconbar.usePixmap: true
session.screen0.iconbar.alignment: Relative
### MENU ###
session.screen0.menu.alpha: 255
session.screen0.menuDelay: 200
session.menuFile: ~/.fluxbox/menu-mx
session.menuSearch: itemstart
-----
session.screen0.clientMenu.usePixmap: true
### CONFIG FILES ###
session.styleFile: /home/jb/.fluxbox/styles/MX-ease-Dark
session.keyFile: ~/.fluxbox/keys
session.appsFile: ~/.fluxbox/apps
session.styleOverlay: ~/.fluxbox/overlay
### MISCELLANEOUS ###
session.screen0.struts.1: 0,0,0,0
session.screen0.opaqueMove: true
session.screen0.maxDisableResize: false
session.screen0.noFocusWhileTypingDelay: 0
session.screen0.opaqueResize: false
session.screen0.allowRemoteActions: true
session.screen0.edgeResizeSnapThreshold: 0
session.screen0.focusSameHead: false
session.screen0.tooltipDelay: 500
session.screen0.opaqueResizeDelay: 50
session.screen0.maxDisableMove: false
session.screen0.edgeSnapThreshold: 10
session.screen0.colPlacementDirection: TopToBottom
session.screen0.rootCommand: ~/.fehbg -l
session.screen0.struts: 0,0,0,0
session.screen0.rowPlacementDirection: LeftToRight
session.screen0.focusModel: ClickFocus
session.screen0.maxIgnoreIncrement: true
session.cacheLife: 5
session.doubleClickInterval: 250
session.configVersion: 13
session.forcePseudoTransparency: true
session.colorsPerChannel: 4
session.ignoreBorder: false
session.cacheMax: 200
Code: Select all
elif [[ $item = *systray.pin* ]]; then
toolbar_items+=($item)