-rwxr-xr-x | bin/qpe-reorgfiles | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/bin/qpe-reorgfiles b/bin/qpe-reorgfiles new file mode 100755 index 0000000..787f50a --- a/dev/null +++ b/bin/qpe-reorgfiles | |||
@@ -0,0 +1,93 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | APPS=$HOME/Applications | ||
4 | DOCS=$HOME/Documents | ||
5 | |||
6 | if [ -d $APPS -a "$1" != "-f" ] | ||
7 | then | ||
8 | echo "You seem to already have a $APPS directory." | ||
9 | echo "Assuming it is the QPE Applications directory. Exiting." | ||
10 | exit 0 | ||
11 | fi | ||
12 | |||
13 | if [ -d $HOME/Apps ] | ||
14 | then | ||
15 | mv $HOME/Apps $APPS | ||
16 | else | ||
17 | mkdir $APPS | ||
18 | fi | ||
19 | |||
20 | if [ -f $DOCS/addressbook.xml ] | ||
21 | then | ||
22 | if [ -f $APPS/addressbook/addressbook.xml ] | ||
23 | then | ||
24 | echo "$DOCS/addressbook.xml conflicts with $APPS/addressbook/addressbook.xml" | ||
25 | echo "Moving $DOCS/addressbook.xml to $HOME" | ||
26 | mv $DOCS/addressbook.xml $HOME | ||
27 | else | ||
28 | mkdir $APPS/addressbook | ||
29 | mv $DOCS/addressbook.xml $APPS/addressbook | ||
30 | fi | ||
31 | fi | ||
32 | |||
33 | if [ -f $DOCS/datebooksettings.xml ] | ||
34 | then | ||
35 | echo "$DOCS/datebooksettings.xml is obsolete" | ||
36 | echo "Please re-set your datebook preferences" | ||
37 | rm $DOCS/datebooksettings.xml | ||
38 | fi | ||
39 | |||
40 | if [ -f $DOCS/datebook.xml ] | ||
41 | then | ||
42 | mkdir $APPS/databook | ||
43 | mv $DOCS/datebook.xml $APPS/databook | ||
44 | fi | ||
45 | |||
46 | if [ -d $DOCS/qtmail ] | ||
47 | then | ||
48 | mv $DOCS/qtmail $APPS/ | ||
49 | fi | ||
50 | |||
51 | if [ -f $DOCS/todo.xml ] | ||
52 | then | ||
53 | if [ -f $APPS/todolist/todolist.xml ] | ||
54 | then | ||
55 | mv $DOCS/todo.xml $HOME | ||
56 | echo "$DOCS/todo.xml is superceded by $APPS/todolist/todolist.xml" | ||
57 | echo "$DOCS/todo.xml has been moved to $HOME" | ||
58 | else | ||
59 | echo "NOTE: $DOCS/todo.xml is obsolete. It will move to $APPS/todolist/todolist.xml" | ||
60 | echo "when next you run the latest ToDo application." | ||
61 | fi | ||
62 | fi | ||
63 | |||
64 | if [ ! -d $APPS/qimpen ] | ||
65 | then | ||
66 | mkdir $APPS/qimpen | ||
67 | fi | ||
68 | |||
69 | if [ -f $DOCS/asciilower.qpt ] | ||
70 | then | ||
71 | mv $DOCS/asciilower.qpt $APPS/qimpen | ||
72 | fi | ||
73 | |||
74 | if [ -f $DOCS/asciiupper.qpt ] | ||
75 | then | ||
76 | mv $DOCS/asciiupper.qpt $APPS/qimpen | ||
77 | fi | ||
78 | |||
79 | if [ -f $DOCS/numeric.qpt ] | ||
80 | then | ||
81 | mv $DOCS/numeric.qpt $APPS/qimpen | ||
82 | fi | ||
83 | |||
84 | if [ -d "$HOME/.qpe" ] | ||
85 | then | ||
86 | if [ -d "$HOME/Settings" ] | ||
87 | then | ||
88 | mv $HOME/.qpe/* "$HOME/Settings" | ||
89 | rmdir "$HOME/.qpe" | ||
90 | else | ||
91 | mv $HOME/.qpe "$HOME/Settings" | ||
92 | fi | ||
93 | fi | ||