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 ################################################################################
9 PATH=${PATH:-'/bin/:/sbin/:/usr/local/bin:/usr/bin:/usr/sbin'}
11 USER=$(grep \`whoami\` /etc/passwd | cut -d: -f5 | cut -d, -f1)
14 if [ -r /etc/grml/script-functions ] ; then
15 . /etc/grml/script-functions
16 check4progs dialog slrn || { echo "Sorry, can't continue. Exiting.">&2 ; exit 1 ; }
19 [ -z "$EDITOR" ] && EDITOR='vim'
20 [ -z "$NNTPSERVER" ] && NNTPSERVER="news.`hostname`"
22 # some functions used in the interactive part
24 [ -d $HOME/News ] || mkdir $HOME/News
25 [ -f $HOME/.slrn_scoring ] || touch $HOME/.slrn_scoring
31 % Purpose: configuration for newsreader slrn, created by 'grml-slrn'
32 % Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
33 % Bug-Reports: see http://grml.org/bugs/
34 % License: This file is licensed under the GPL v2.
35 %###############################################################################
37 %###############################################################################
39 % TFM: http://slrn.sourceforge.net/manual/slrn-manual.html
40 % Andrew Preater's .slrnrc: http://www.preater.f9.co.uk/slrn/slrnrc.gz
41 % Jurriaan's page: http://www.xs4all.nl/~thunder7/
42 % Emmanuele's page: http://digilander.libero.it/ebassi/slrn.html
43 % Sven's site: http://www.guckes.net/slrn/
44 % tsca's s-lang macros: http://www.geocities.com/tsca.geo/slang.html
45 % Tomasz K³oczko's slrn-stuff: http://cvs.pld.org.pl/slrn-pl/
46 % Tomasz K³oczko's macros: http://cvs.pld.org.pl/slrn-pl/macros
47 % jbn's S-Lang code: http://forestfield.org/slrn/
48 % S-lang regexps: http://www.s-lang.org/doc/html/slang-18.html
49 %###############################################################################
51 % important variables - adjust them if necessary
52 set username "$USERNAME_SLRN"
53 set hostname "$HOSTNAME_SLRN"
54 set realname "$REALNAME_SLRN"
55 set organization "www.grml.org"
56 % set replyto "devnull@grml.org"
58 % set signature "signature_ng"
59 % set signoff_string "-mika-"
61 server "$NEWSSERVER" ".newsrc_$NEWSSERVER"
63 % If a server requires authentication, add a nnrpaccess line for it.
64 % If you leave username and/or password empty, slrn will prompt for it.
65 % nnrpaccess "news.isp.tld" "username" "password"
67 set write_newsrc_flags 0
69 set generate_message_id 0
70 set generate_date_header 1
73 set editor_command "$EDITOR -f +%d '%s'"
74 set mail_editor_command "mutt -H '%s'"
75 set score_editor_command "$EDITOR '%s'" % $HOME/.slrn_scoring"
76 set abort_unmodified_edits 1
77 set metamail_command "metamail"
78 set non_Xbrowser "screen -t 'url' $BROWSER %s"
79 set Xbrowser "screen -t 'url' $BROWSER %s"
81 % Command to use for printing
83 set printer_name "muttprint"
85 % set printer_name "MyPrinter"
88 set save_posts "News/My_Posts"
89 set save_replies "News/My_Replies"
90 set failed_posts_file "~/dead.letter"
92 set scorefile "$HOME/.slrn_scoring"
93 set decode_directory "News"
94 set save_directory "News"
95 set postpone_directory "News/postponed"
96 set followup_string "* %r <%f> wrote:"
97 set followup_strip_signature 0
98 ignore_quotes "^ *[a-zA-Z-]*>" "^ *[\]|)]" "^ *:[^-()^]"
99 set reply_string "* %r <%f> [%n]:
101 set cc_post_string "[This message has also been posted to %n.]"
103 header_display_format 0 "%F%-5S%-5l: [%20r] %t %70s %-12g[%10d]"
104 header_display_format 1 "%F%G%-5l:[%12r]%t%s"
105 header_display_format 2 "%F%-5l:%t%s"
106 header_display_format 3 "%F%-5S%-5l:%t%50s %r"
107 header_display_format 4 "%F%-5S [%10r]:%t%49s %-19g[%17d]"
109 % How to display the groups index
110 group_display_format 0 " %F%-5u %n%45g%d"
111 group_display_format 1 " %F%-5u [%-6t] %n"
112 group_display_format 2 " %F [%-5u|%-6t] %n%45g%d"
113 group_display_format 3 " %F%-5u %n%50g%-8l-%h"
115 set spoiler_display_mode 1
118 % set charset isolatin
119 % set mime_charset "iso-8859-15"
122 set check_new_groups 1 % let slrn check for new newsgroups
123 set unsubscribe_new_groups 1 % new groups are unsubscribed by default
126 set new_subject_breaks_threads 0 % No, no!
128 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:"
130 set process_verbatim_marks 1
131 set simulate_graphic_chars 1
132 set display_cursor_bar 0
135 set highlight_unread_subjects 2
137 set confirm_actions 31 % 1 & 2 & 4 & 8 & 16
138 set warn_followup_to 2
139 set emphasized_text_mask 1 % message only
140 set emphasized_text_mode 3 % Display text as text!
141 set query_next_article 0 % Very annoying until I turned it off.
142 set wrap_flags 7 % _Automatically_ wrap quoted material and body
148 cat >> $SLRNRC << EOF
151 color article "blue" "white"
152 color author "red" "white"
153 color boldtext "black" "white"
154 color box "black" "white"
155 color cursor "yellow" "red"
156 color date "brightblue" "black"
157 color description "black" "white"
158 color error "red" "white"
159 color frame "yellow" "blue"
160 color from_myself "brightred" "black"
161 color group "blue" "white"
162 color grouplens_display "yellow" "red"
163 color header_name "green" "white"
164 color header_number "green" "white"
165 color headers "blue" "white"
166 color high_score "brightred" "white"
167 color italicstext "magenta" "white"
168 color menu "yellow" "red"
169 color menu_press "blue" "yellow"
170 color message "black" "white"
171 color neg_score "magenta" "white"
172 color normal "black" "white"
173 color pgpsignature "brown" "white"
174 color pos_score "blue" "white"
175 color quotes "red" "white"
176 color quotes1 "magenta" "white"
177 color quotes2 "brown" "white"
178 color quotes3 "red" "white"
179 color quotes4 "brown" "white"
180 color quotes5 "blue" "white"
181 color quotes6 "black" "white"
182 color quotes7 "brown" "white"
183 color response_char "green" "white"
184 color selection "yellow" "white"
185 color signature "black" "white"
186 color status "yellow" "red"
187 color subject "black" "white"
188 color thread_number "blue" "white"
189 color tilde "green" "white"
190 color tree "red" "white"
191 color underlinetext "cyan" "white"
192 color verbatim "red" "white"
194 % This color object is only used when highlight_unread_subjects is set to 2
195 % (see the reference manual for details)
196 color unread_subject "red" "white"
197 mono unread_subject "bold"
199 % These attributes are for terminals that cannot display color:
203 mono cursor "bold" "reverse"
205 mono description "none"
206 mono error "blink" "bold"
208 mono from_myself "bold"
210 mono grouplens_display "none"
211 mono header_number "none"
213 mono high_score "bold"
214 mono italicstext "bold"
216 mono menu_press "none"
218 mono pgpsignature "none"
219 mono quotes "underline"
220 mono quotes1 "underline"
221 mono quotes2 "underline"
222 mono quotes3 "underline"
223 mono quotes4 "underline"
224 mono quotes5 "underline"
225 mono quotes6 "underline"
226 mono quotes7 "underline"
227 mono response_char "bold"
228 mono selection "bold"
229 mono signature "none"
230 mono status "reverse"
232 mono thread_number "bold"
234 mono underlinetext "underline"
242 cat >> $SLRNRC << EOF
249 dialog --stdout --title "$PN" --msgbox "Thanks for using $PN!
251 More information on slrn:
257 www.michael-prokop.at/slrn/
259 #######################################################
261 Report bugs, send wishes and feedback to the grml team:
262 http://www.grml.org/ - contact (at) grml.org
267 dialog --stdout --title "$PN" --msgbox "Welcome to $PN!
269 This script will create a simple base
270 configuration for the newsreader slrn.
272 Report bugs, send wishes and feedback to the grml team:
273 http://www.grml.org/ - contact (at) grml.org
276 GETREALNAME_SLRN=$(dialog --stdout --title "$PN" --inputbox "Your real name (eg 'John GRML User'):" 0 65 "$USER" ) || exit 0
277 REALNAME_SLRN=${GETREALNAME_SLRN%/*}
279 GETMAILADDR=$(dialog --stdout --title "$PN" --inputbox "Your main mail address (eg 'joedoe@grml.org'):" 0 65 `whoami`@$HOST ) || exit 0
280 MAILADDR=${GETMAILADDR}
281 USERNAME_SLRN=$(echo "$MAILADDR" | sed "s/@.*//")
282 HOSTNAME_SLRN=$(echo "$MAILADDR" | sed "s/.*@//")
284 GETNEWSSERVER=$(dialog --stdout --title "$PN" --inputbox "What's the newsserver you want to use?
285 (eg 'news."$HOSTNAME_SLRN"'):" 8 65 "$HOST" ) || exit 0
286 NEWSSERVER=${GETNEWSSERVER}
288 GETCOLOR=$(dialog --stdout --title "$PN" \
289 --radiolist "Which color setup do you want to use?" 10 65 2 \
290 dark "dark color setup (default)" on \
291 light "light color setup" off)
294 0) COLOR=$GETCOLOR ;;
299 if [ "$COLOR" = 'light' ] ; then
302 if [ "$COLOR" = 'dark' ] ; then
307 GETSLRNRC=$(dialog --stdout --title "$PN" --inputbox "Choose a filename for this configuration:" 0 65 "$HOME/.slrnrc") || exit 0
310 WRITESLRNRC=$(dialog --stdout --title "$PN" --yesno "Write $SLRNRC?" 5 65)
315 if [ -f "$SLRNRC" ] ; then
316 dialog --stdout --title "$PN" --yesno "$SLRNRC exists. Overwrite?" 5 65
320 writeslrnrc && writecolors && \
321 dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successful." 7 65 || \
322 { dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65 ; exit 1 ; }
326 writeslrnrc && writecolors && \
327 dialog --stdout --title "$PN" --msgbox "Writing $SLRNRC was successfull." 7 65 || \
328 { dialog --stdout --title "$PN" --msgbox "Error $?: writing $SLRNRC failed." 7 65 ; exit 1 ; }
335 ASKRUN=$(dialog --stdout --title "$PN" --yesno "Run slrn now?" 0 0)
340 slrn -create -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC && \
342 Start slrn with taken settings via:
343 % slrn -h $NEWSSERVER -f $HOME/.newsrc_$NEWSSERVER -i $SLRNRC
345 Thanks for using $PN and have fun with slrn!"
350 ## END OF FILE #################################################################