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