.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.02) .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "fvwm-menu-headlines 1" .TH fvwm-menu-headlines 1 "2009-03-22" "2.5.28 (from cvs)" "Fvwm Utilities" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" fvwm\-menu\-headlines \- builds headlines menu definition for fvwm .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBfvwm-menu-headlines\fR [ \fB\-\-help\fR|\fB\-h\fR|\fB\-?\fR ] [ \fB\-\-version\fR|\fB\-V\fR ] [ \fB\-\-info\fR [site] ] [ \fB\-\-site\fR|\fB\-s\fR site ] [ \fB\-\-name\fR|\fB\-n\fR name ] [ \fB\-\-title\fR|\fB\-t\fR title ] [ \fB\-\-item\fR item ] [ \fB\-\-exec\fR|\fB\-e\fR exec-command ] [ \fB\-\-command\fR|\fB\-e\fR fvwm-command ] [ \fB\-\-icon\-title\fR icon ] [ \fB\-\-icon\-item\fR icon ] [ \fB\-\-icon\-home\fR icon ] [ \fB\-\-icon\-error\fR icon ] [ \fB\-\-wm\-icons\fR ] [ \fB\-\-frontpage\fR [where] ] [ \fB\-\-proxy\fR|\fB\-p\fR host:port ] [ \fB\-\-file\fR [file] ] [ \fB\-\-fake\fR [file] ] [ \fB\-\-timeout\fR seconds ] .SH "DESCRIPTION" .IX Header "DESCRIPTION" This configurable perl script builds an fvwm menu definition for headlines of popular news web sites: FreshMeat, Slashdot, LinuxToday, DaemonNews, GNOME-News, KDE-News, RootPrompt, LinuxFr, ThinkGeek, \s-1CNN\s0, \s-1BBC\s0 and more. .PP It is possible to specify a customized menu item format, change a command (usually launching a browser) and add menu icons (there is a support for the wm-icons package). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" show the help and exit .IP "\fB\-\-version\fR" 4 .IX Item "--version" show the version and exit .IP "\fB\-\-info\fR [site]" 4 .IX Item "--info [site]" if site name is given print the site specific info, otherwise print all site names .IP "\fB\-\-site\fR site" 4 .IX Item "--site site" defile a web site, headlines of which to show, this option also can be used together with \-\-help to get new defaults. Default site: freshmeat. .IP "\fB\-\-name\fR name" 4 .IX Item "--name name" define menu name (default is \*(L"MenuHeadlinesFreshmeat\*(R") .IP "\fB\-\-title\fR title" 4 .IX Item "--title title" define menu title (default is \*(L"Freshmeat Headlines\*(R"). .IP "\fB\-\-item\fR label-format" 4 .IX Item "--item label-format" .PD 0 .IP "\fB\-\-exec\fR command-format" 4 .IX Item "--exec command-format" .PD define format for menu item or command (what is shown and what is executed when the item is chosen). Default label is '%h\et%[(%Y\-%m\-%d \f(CW%H:\fR%M)]'. \s-1TAB\s0 can be specified as '\et', but in .fvwm2rc you should specify a double backslash or a real \s-1TAB\s0. .Sp Format specifiers for a headline format: .Sp .Vb 11 \& %h \- headline \& %u \- url \& %d \- date in the native format (that site backend supplied) \& %[strftime\-argument\-string] \- date/time, see strftime(3) \& the date/time is represented according to the local time; \& date and/or time fields that can\*(Aqt be guessed are stripped \& Example: %[|%d %B %Y| %H:%M %S] \& If site supplied only date \- this becomes %[|%d %B %Y|], \& if site supplied no date \- this becomes an empty string. \& %{name} \- site specific named value, like %{comments} \& %(text) \- arbitrary text, good for escaping or aligning .Ve .Sp These specifiers can receive an optional integer size, positive for right adjusted string or negative for left adjusted, example: \f(CW%8x\fR; and optional *num or *\-num, which means to leave only the first or last (if minus) num of chars, the num must be greater than 3, since the striped part is replaced with \*(L"...\*(R", example: %*30x. Both can be combined: %\-10*\-20x, this instructs to get only the 20 last characters, but if the length is less then 10 \- to fill with up to 10 spaces on the right. .Sp Example: .Sp .Vb 1 \& \-\-exec "iceweasel \-remote \*(AqopenURL(%u, new\-window)\*(Aq || iceweasel \*(Aq%u\*(Aq" .Ve .IP "\fB\-\-command\fR command-format" 4 .IX Item "--command command-format" like \fB\-\-exec\fR above, but enables to specify any fvwm command, for example, \*(L"Function FuncFvwmShowURL '%u'\*(R" not only Exec. .Sp In fact, \-\-exec=\*(L"mozilla '%u'\*(R" is equivalent to \-\-command=\*(L"Exec mozilla '%u'\*(R" .IP "\fB\-\-icon\-title\fR icon" 4 .IX Item "--icon-title icon" .PD 0 .IP "\fB\-\-icon\-item\fR icon" 4 .IX Item "--icon-item icon" .IP "\fB\-\-icon\-home\fR icon" 4 .IX Item "--icon-home icon" .IP "\fB\-\-icon\-error\fR icon" 4 .IX Item "--icon-error icon" .PD define menu icon for title, regular item, frontpage item and error item respectively. Default is no menu icons (equivalent to an empty icon argument). .IP "\fB\-\-wm\-icons\fR" 4 .IX Item "--wm-icons" define icon names suitable for use with wm-icons package. Currently this is equivalent to: \-\-icon\-title '' \-\-icon\-item menu/information.xpm \-\-icon\-home menu/home.xpm \-\-icon\-error menu/choice\-no.xpm. .IP "\fB\-\-frontpage\fR [where]" 4 .IX Item "--frontpage [where]" add the site frontpage item to the menu. Optional value can be used to specify where this item will be placed in the menu \- 'top' or 't', 'bottom' or 'b'. .IP "\fB\-\-proxy\fR host[:port]" 4 .IX Item "--proxy host[:port]" define a proxy to use. Example: \-\-proxy proxy.inter.net:3128 .IP "\fB\-\-file\fR [file]" 4 .IX Item "--file [file]" write the menu output to specified file. If no filename is given with this option (or empty filename), the default filename \s-1WORK_HOME/SITE\s0.menu is used. Without this option or with '\-' filename, the menu output is written to standard output. .IP "\fB\-\-fake\fR [file]" 4 .IX Item "--fake [file]" don't connect to the host using \s-1HTTP\s0 protocol, instead, read from \s-1WORK_HOME/SITE\s0.in file. The following reads input from freshmeat.in (downloaded http://freshmeat.net/backend/recentnews.txt) and saves output to segfault.menu (both files are in \s-1WORK_HOME\s0): fvwm-menu-headlines \-\-site freshmeat \-\-fake \-\-file .IP "\fB\-\-timeout\fR seconds" 4 .IX Item "--timeout seconds" limit a line reading from a socket to this timeout, the default timeout is 20 seconds. .PP \&\s-1WORK_HOME\s0 of this script is ~/.fvwm/.fvwm\-menu\-headlines. It is created if needed. .PP Option parameters can be specified either using '=' or in the next argument. Short options are ok if not ambiguous: \f(CW\*(C`\-h\*(C'\fR, \f(CW\*(C`\-t\*(C'\fR; but be careful with short options, what is now unambiguous, can become ambiguous in the next versions. .SH "USAGE" .IX Header "USAGE" 1. One of the ways to use this script is to define a crontab entry to run the script every hour or so for every monitored site: .PP .Vb 3 \& 0,30 * * * * fvwm\-menu\-headlines \-\-file \-\-site freshmeat \& 1,31 * * * * fvwm\-menu\-headlines \-\-file \-\-site linuxtoday \& 2,32 * * * * fvwm\-menu\-headlines \-\-file \-\-site slashdot .Ve .PP Then add these lines to your fvwm configuration file: .PP .Vb 3 \& DestroyFunc FuncFvwmMenuHeadlines \& AddToFunc FuncFvwmMenuHeadlines \& + I Read "$HOME/.fvwm/.fvwm\-menu\-headlines/$0.menu" \& \& DestroyMenu MenuHeadlines \& AddToMenu MenuHeadlines "Headlines" Title \& + MissingSubmenuFunction FuncFvwmMenuHeadlines \& + "FreshMeat" Popup freshmeat \& + "LinuxToday" Popup linuxtoday \& + "Slashdot" Popup slashdot .Ve .PP 2. Another way to use this script (only if you have fast network/proxy) is to run it every time you want to open your Headlines submenus. (Note, the submenu that is once created is not reloaded, use \*(L"Reset all\*(R".) .PP In this case your fvwm configuration lines could be: .PP .Vb 4 \& DestroyFunc FuncFvwmMenuHeadlines \& AddToFunc FuncFvwmMenuHeadlines \& + I PipeRead "fvwm\-menu\-headlines \-\-site $0" \& #+ I Schedule 900000 DestroyMenu $0 # reset generated menu in 15 minutes \& \& DestroyMenu MenuHeadlines \& AddToMenu MenuHeadlines "Headlines" Title \& + MissingSubmenuFunction FuncFvwmMenuHeadlines \& + "FreshMeat" Popup freshmeat \& + "Slashdot" Popup slashdot \& + "LinuxToday" Popup linuxtoday \& + "GNOME News" Popup gnome\-news \& + "KDE News" Popup kde\-news \& + "" Nop \& + "Reset all" FuncResetHeadlines \& \& DestroyFunc FuncResetHeadlines \& AddToFunc FuncResetHeadlines \& + I DestroyMenu freshmeat \& + I DestroyMenu linuxtoday \& + I DestroyMenu slashdot \& + I DestroyMenu gnome\-news \& + I DestroyMenu kde\-news .Ve .PP And finally, add \*(L"Popup MenuHeadlines\*(R" somewhere. .PP 3. Here is a usual usage. Use FvwmConsole or FvwmCommand to run fvwm commands from a shell script. Every time you want headlines from some site, execute (give any additional options if you want): .PP .Vb 3 \& PipeRead "fvwm\-menu\-headlines \-\-site newsforge \-\-name MenuHeadlinesNewsForge" \& # this may take several seconds, you may use: BusyCursor Read true \& Popup MenuHeadlinesNewsForge .Ve .SH "HOW TO ADD SITE HEADLINES" .IX Header "HOW TO ADD SITE HEADLINES" It is possible to add user defined site headlines without touching the script itself. Put your perl extensions to the file WORK_HOME/extension.pl. For each site add something similar to: .PP .Vb 8 \& $site_info\->{\*(Aqmyslashdot\*(Aq} = { \& \*(Aqname\*(Aq => "MySlashdot", \& \*(Aqhost\*(Aq => "myslashdot.org", \& \*(Aqpath\*(Aq => "/myslashdot.xml", \& \*(Aqfunc\*(Aq => \e&process_my_slashdot, \& # the following string is only used in \-\-info \& \*(Aqflds\*(Aq => \*(Aqtime, title, department, topic, author, url\*(Aq, \& }; \& \& sub process_my_slashdot () { \& return process_xml( \& \*(Aqstory\*(Aq, \& # mandatory \*(Aqh\*(Aq, \*(Aqu\*(Aq and \*(Aqd\*(Aq aliases or undef \& { \*(Aqh\*(Aq => \*(Aqtitle\*(Aq, \*(Aqu\*(Aq => \*(Aqurl\*(Aq, \*(Aqd\*(Aq => \*(Aqtime\*(Aq }, \& sub ($) { # convert \*(Aqd\*(Aq string to (y, m, d, H, M, S) \& $_[0] =~ /(\ed+)\-(\ed+)\-(\ed+) (\ed+):(\ed+):(\ed+)/; \& ($1, ($2 || 0) \- 1, $3, $4, $5, $6); \& }, +0, # timezone offset; already in UTC \& ); \& } \& \& 1; .Ve .SH "AUTHORS" .IX Header "AUTHORS" This script is inspired by WMHeadlines v1.3 by: .PP .Vb 2 \& Jeff Meininger \& (http://rive.boxybutgood.com/WMHeadlines/). .Ve .PP Reimplemented for fvwm and heavily enhanced by: .PP .Vb 1 \& Mikhael Goikhman , 16 Dec 1999. .Ve .SH "COPYING" .IX Header "COPYING" The script is distributed by the same terms as fvwm itself. See \s-1GNU\s0 General Public License for details. .SH "BUGS" .IX Header "BUGS" I try to keep all supported site info up to date, but sites often go down, change their backend formats, change their httpd responses, just stop to post news and so on; the script in the latest cvs may be more up to date. .PP The headline times may be off by one hour or more, since the time is displayed for your local time zone, and the time zone of the original time in the site backend output is often guessed (sometimes incorrectly); similarly it is guessed whether to apply the daylight saving correction. .PP Report bugs to fvwm\-bug@fvwm.org.