3 # Purpose: configuration script for slrn
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 # Latest change: Mon Dez 18 00:31:53 CET 2006 [mika]
8 ################################################################################
10 PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
12 USER=$(grep \`whoami\` /etc/passwd | cut -d: -f5 | cut -d, -f1)
15 [ -z "$EDITOR" ] && EDITOR='vim'
16 [ -z "$NNTPSERVER" ] && NNTPSERVER="news.`hostname`"
18 # some functions used in the interactive part
20 [ -d $HOME/News ] || mkdir $HOME/News
21 [ -f $HOME/.slrn_scoring ] || touch $HOME/.slrn_scoring
27 % Purpose: configuration for newsreader slrn, created by 'grml-slrn'
28 % Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
29 % Bug-Reports: see http://grml.org/bugs/
30 % License: This file is licensed under the GPL v2.
31 % Latest change: Son Nov 28 22:38:30 CET 2004 [mika]
32 %###############################################################################
34 %###############################################################################
36 % TFM: http://slrn.sourceforge.net/manual/slrn-manual.html
37 % Andrew Preater's .slrnrc: http://www.preater.f9.co.uk/slrn/slrnrc.gz
38 % Jurriaan's page: http://www.xs4all.nl/~thunder7/
39 % Emmanuele's page: http://digilander.libero.it/ebassi/slrn.html
40 % Sven's site: http://www.guckes.net/slrn/
41 % tsca's s-lang macros: http://www.geocities.com/tsca.geo/slang.html
42 % Tomasz K³oczko's slrn-stuff: http://cvs.pld.org.pl/slrn-pl/
43 % Tomasz K³oczko's macros: http://cvs.pld.org.pl/slrn-pl/macros
44 % jbn's S-Lang code: http://forestfield.org/slrn/
45 % S-lang regexps: http://www.s-lang.org/doc/html/slang-18.html
46 %###############################################################################
48 % important variables - adjust them if necessary
49 set username "$USERNAME_SLRN"
50 set hostname "$HOSTNAME_SLRN"
51 set realname "$REALNAME_SLRN"
52 set organization "www.grml.org"
53 % set replyto "devnull@grml.org"
55 % set signature "signature_ng"
56 % set signoff_string "-mika-"
58 server "$NEWSSERVER" ".newsrc_$NEWSSERVER"
60 % If a server requires authentication, add a nnrpaccess line for it.
61 % If you leave username and/or password empty, slrn will prompt for it.
62 % nnrpaccess "news.isp.tld" "username" "password"
64 set write_newsrc_flags 0
66 set generate_message_id 0
67 set generate_date_header 1
70 set editor_command "$EDITOR -f +%d '%s'"
71 set mail_editor_command "mutt -H '%s'"
72 set score_editor_command "$EDITOR '%s'" % $HOME/.slrn_scoring"
73 set abort_unmodified_edits 1
74 set metamail_command "metamail"
75 set non_Xbrowser "screen -t 'url' $BROWSER %s"
76 set Xbrowser "screen -t 'url' $BROWSER %s"
78 % Command to use for printing
80 set printer_name "muttprint"
82 % set printer_name "MyPrinter"
85 set save_posts "News/My_Posts"
86 set save_replies "News/My_Replies"
87 set failed_posts_file "~/dead.letter"
89 set scorefile "$HOME/.slrn_scoring"
90 set decode_directory "News"
91 set save_directory "News"
92 set postpone_directory "News/postponed"
93 set followup_string "* %r <%f> wrote:"
94 set followup_strip_signature 0
95 ignore_quotes "^ *[a-zA-Z-]*>" "^ *[\]|)]" "^ *:[^-()^]"
96 set reply_string "* %r <%f> [%n]:
98 set cc_post_string "[This message has also been posted to %n.]"
100 header_display_format 0 "%F%-5S%-5l: [%20r] %t %70s %-12g[%10d]"
101 header_display_format 1 "%F%G%-5l:[%12r]%t%s"
102 header_display_format 2 "%F%-5l:%t%s"
103 header_display_format 3 "%F%-5S%-5l:%t%50s %r"
104 header_display_format 4 "%F%-5S [%10r]:%t%49s %-19g[%17d]"
106 % How to display the groups index
107 group_display_format 0 " %F%-5u %n%45g%d"
108 group_display_format 1 " %F%-5u [%-6t] %n"
109 group_display_format 2 " %F [%-5u|%-6t] %n%45g%d"
110 group_display_format 3 " %F%-5u %n%50g%-8l-%h"
112 set spoiler_display_mode 1
115 % set charset isolatin
116 % set mime_charset "iso-8859-15"
119 set check_new_groups 1 % let slrn check for new newsgroups
120 set unsubscribe_new_groups 1 % new groups are unsubscribed by default
123 set new_subject_breaks_threads 0 % No, no!
125 visible_headers "Subject:,From:,Organization:,Newsgroups:,Date:,Followup-To:,Mail-Copies-To:,Reply-To:,Message-ID:,Supersedes:,User-Agent,Approved,X-Mailer,X-Newsreader:,X-Posting-Agent:,X-Http-User-Agent:,X-,!X-Trace:,!X-Complaints-To:,!X-Face:,!X-MSMail-Priority:,!X-MimeOLE:,!X-Priority:,!X-Accept-Language:"
127 set process_verbatim_marks 1
128 set simulate_graphic_chars 1
129 set display_cursor_bar 0
132 set highlight_unread_subjects 2
134 set confirm_actions 31 % 1 & 2 & 4 & 8 & 16
135 set warn_followup_to 2
136 set emphasized_text_mask 1 % message only
137 set emphasized_text_mode 3 % Display text as text!
138 set query_next_article 0 % Very annoying until I turned it off.
139 set wrap_flags 7 % _Automatically_ wrap quoted material and body
145 cat >> $SLRNRC << EOF
148 color article "blue" "white"
149 color author "red" "white"
150 color boldtext "black" "white"
151 color box "black" "white"
152 color cursor "yellow" "red"
153 color date "brightblue" "black"
154 color description "black" "white"
155 color error "red" "white"
156 color frame "yellow" "blue"
157 color from_myself "brightred" "black"
158 color group "blue" "white"
159 color grouplens_display "yellow" "red"
160 color header_name "green" "white"
161 color header_number "green" "white"
162 color headers "blue" "white"
163 color high_score "brightred" "white"
164 color italicstext "magenta" "white"
165 color menu "yellow" "red"
166 color menu_press "blue" "yellow"
167 color message "black" "white"
168 color neg_score "magenta" "white"
169 color normal "black" "white"
170 color pgpsignature "brown" "white"
171 color pos_score "blue" "white"
172 color quotes "red" "white"
173 color quotes1 "magenta" "white"
174 color quotes2 "brown" "white"
175 color quotes3 "red" "white"
176 color quotes4 "brown" "white"
177 color quotes5 "blue" "white"
178 color quotes6 "black" "white"
179 color quotes7 "brown" "white"
180 color response_char "green" "white"
181 color selection "yellow" "white"
182 color signature "black" "white"
183 color status "yellow" "red"
184 color subject "black" "white"
185 color thread_number "blue" "white"
186 color tilde "green" "white"
187 color tree "red" "white"
188 color underlinetext "cyan" "white"
189 color verbatim "red" "white"
191 % This color object is only used when highlight_unread_subjects is set to 2
192 % (see the reference manual for details)
193 color unread_subject "red" "white"
194 mono unread_subject "bold"
196 % These attributes are for terminals that cannot display color:
200 mono cursor "bold" "reverse"
202 mono description "none"
203 mono error "blink" "bold"
205 mono from_myself "bold"
207 mono grouplens_display "none"
208 mono header_number "none"
210 mono high_score "bold"
211 mono italicstext "bold"
213 mono menu_press "none"
215 mono pgpsignature "none"
216 mono quotes "underline"
217 mono quotes1 "underline"
218 mono quotes2 "underline"
219 mono quotes3 "underline"
220 mono quotes4 "underline"
221 mono quotes5 "underline"
222 mono quotes6 "underline"
223 mono quotes7 "underline"
224 mono response_char "bold"
225 mono selection "bold"
226 mono signature "none"
227 mono status "reverse"
229 mono thread_number "bold"
231 mono underlinetext "underline"
239 cat >> $SLRNRC << EOF
246 dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
248 More information on slrn:
254 www.michael-prokop.at/slrn/
256 #######################################################
258 Report bugs, send wishes and feedback to the grml team:
259 http://www.grml.org/ - contact (at) grml.org
264 dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
266 This script will create a simple base
267 configuration for the newsreader slrn.
269 Report bugs, send wishes and feedback to the grml team:
270 http://www.grml.org/ - contact (at) grml.org
273 GETREALNAME_SLRN=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 65 "$USER" ) || exit 0
274 REALNAME_SLRN=${GETREALNAME_SLRN%/*}
276 GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 65 `whoami`@$HOST ) || exit 0
277 MAILADDR=${GETMAILADDR}
278 USERNAME_SLRN=$(echo "$MAILADDR" | sed "s/@.*//")
279 HOSTNAME_SLRN=$(echo "$MAILADDR" | sed "s/.*@//")
281 GETNEWSSERVER=$(dialog --stdout --title "$PN" --inputbox "What's the newsserver you want to use?
282 (eg 'news."$HOSTNAME_SLRN"'):" 8 65 "$HOST" ) || exit 0
283 NEWSSERVER=${GETNEWSSERVER}
285 GETCOLOR=$(dialog --stdout --title "$PN" \
286 --radiolist "Which color setup do you want to use?" 10 65 2 \
287 dark "dark color setup (default)" on \
288 light "light color setup" off)
291 0) COLOR=$GETCOLOR ;;
296 if [ "$COLOR" == 'light' ] ; then
299 if [ "$COLOR" == 'dark' ] ; then
304 GETSLRNRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 65 "$HOME/.slrnrc") || exit 0
307 WRITESLRNRC=$(dialog --stdout --title "$PN" --yesno "Write $SLRNRC?" 5 65)
312 if [ -f "$SLRNRC" ] ; then
313 dialog --stdout --title "$PN" --yesno "$SLRNRC exists. Overwrite?" 5 65
317 writeslrnrc && writecolors && \
318 dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successful." 7 65 || \
319 dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65
324 writeslrnrc && writecolors && \
325 dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successfull." 7 65 || \
326 dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65
334 ASKRUN=$(dialog --stdout --title "$PN" --yesno "Run slrn now?" 0 0)
339 slrn -create -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC && \
341 echo "Start slrn with taken settings via:
342 $ slrn -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC
344 Thanks for using $PN and have fun with slrn!"
349 ## END OF FILE #################################################################