aboutsummaryrefslogtreecommitdiff
path: root/misc/stardict-tools/README.sd
blob: 46eac983fe147732c21bd0bdaedac0826507fe82 (plain)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

sd: the dictionaries collections manager for StarDict


The sd script allows you to use interchangeably any number of the collections of the dictionaries with StarDict. Theoretically the groups or the trees of the dictionaries should serve these purposes but I prefer simpler solutions so I did not try too hard to define these groups or trees. I wrote instead the sd script. 

I use StarDict with 63 different dictionaries, lexicons, and encyclopedias separated into five main groups: German (de), English (en), French (fr), Polish (pl), and Russian (ru). It is not possible to run them all at the same time because it is too much for this program. 

So I prepared five subdirectories in the /usr/share/stardict/ directory:

    dic.de
    dic.en
    dic.fr
    dic.pl
    dic.ru

Each of them contains the dictionaries for the respective languages. 


1. Changing the privileges:

In order to be able to switch your collections as a regular user change the group and the mode of the /usr/share/stardict/ directory using the commands:

    chgrp users /usr/share/stardict
    chmod 775 /usr/share/stardict

These commands are stored at the beginning of the sd script. So uncomment them, run the script as root, and comment these commands back. From now on you may use this script as a regular user. 


2. Preparing the template configuration file:

Make sure that there is no stardict.cfg file in the ~/.stardict directory and there is no dic subdirectory in the /usr/share/stardict/ directory. Then run StarDict for the first time, set all options according to your preferences, and exit StarDict. 

Next prepare the template configuration file using the commands:

    cd ~/.stardict
    mv stardict.cfg stardict.cfg.template


3. Preparing the collections:

Go to the /usr/share/stardict/ directory and make the subdirectories for your collections using the following naming convention:

    dic.NAME1
    dic.NAME2
    dic.NAME3

for example:

    dic.de
    dic.en
    dic.fr

Then copy the appropriate dictionaries into the right subdirectories. Do not use the dic subdirectory at all.


4. Preparing the configuration files:

Use the commands such as:

    sd NAME

to copy the template configuration file to the current configuration file. 

Then run StarDict, sort the dictionaries, and exit StarDict.

Finally move the current configuration file into the right file:

    cd ~/.stardict
    mv stardict.cfg stardict.cfg.NAME

Repeat these steps for all your collections. As a result at the end you should have in the ~/.stardict directory the files such as:

    stardict.cfg.de
    stardict.cfg.en
    stardict.cfg.fr


5. Testing the configuration:

$ sd
dic -> dic.en
dic.de
dic.en
dic.fr

In the above case the dic symbolic link points the dic.en collection.


6. Switching the collection:

$ sd fr
dic -> dic.fr
Dictionnaire Littre, 1877 (Fr-Fr)
Dictionnaire de l'Academie Francaise, 8eme edition, 1935 (Fr-Fr)

In the above case the dic symbolic link was changed to point the dic.fr collection including two dictionaries.


7. Checking the dictionaries:

$ sd de ?
English - German 2.4.2 (En-Ge)
FreeDict English - German 2.4.2 (Ge-En)
FreeDict German - English 2.4.2 (Ge-En)
German - English 2.4.2 (Ge-En)
Neolingus Niemiecko - Polski 2.4.2 (Ge-Pl)
Neolingus Polsko - Niemiecki 2.4.2 (Pl-Ge)

There are six German dictionaries in the dic.de collection.