-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmxfb-sortinit
More file actions
executable file
·94 lines (80 loc) · 2.9 KB
/
mxfb-sortinit
File metadata and controls
executable file
·94 lines (80 loc) · 2.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
#mxfb-sortinit - script to sort fluxbox init file by Melber and i_ri
#version 2503-4
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 = *slit* ]]; then
slit_items+=($item)
elif [[ $item = *iconbar* ]]; then
iconbar_items+=($item)
elif [[ $item = *tooltipDelay* ]]; then
iconbar_items+=($item)
elif [[ $item = *workspace* ]]; then
workspace_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 "### A backup copy of the current init file has been saved in $backup_location/init.bak ###\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
exo-open $target_location
exit 0