fvwm-menu-headlines(1)
β¨ fvwm-menu-headlines β¨
okay so bestie, welcome to the fvwm-menu-headlines page, straight outta the Fvwm Utilities manual (section 1, iykyk). this lil script? it builds headlines menu definitions for fvwm. that's literally the whole vibe. let's get into it π
π NAME π
fvwm-menu-headlines β builds headlines menu definition for fvwm
πΈ SYNOPSIS πΈ
fvwm-menu-headlines [ --help|-h|-? ] [ --version|-V ] [ --info [site] ]
[ --site|-s site ] [ --name|-n name ] [ --title|-t title ] [ --item item
] [ --exec|-e exec-command ] [ --command|-e fvwm-command ] [
--icon-title icon ] [ --icon-item icon ] [ --icon-home icon ] [
--icon-error icon ] [ --wm-icons ] [ --frontpage [where] ] [ --proxy|-p
host:port ] [ --file [file] ] [ --fake [file] ] [ --timeout seconds ]
π¦ DESCRIPTION π¦
okay so picture this: this configurable perl script builds an fvwm menu definition out of the headlines from all your fave news sites β we're talking FreshMeat, Slashdot, LinuxToday, DaemonNews, GNOME-News, KDE-News, RootPrompt, LinuxFr, ThinkGeek, CNN, BBC and more. periodt. π°β¨
and the way it's customisable?? you can:
- specify your own custom menu item format
- change the command it runs (usually it's just launching a browser, no biggie)
- add menu icons β and yes bestie, there's support for the wm-icons package π
β¨ OPTIONS β¨
--helpβ shows you the help and then dips, that's it, that's the whole job π--versionβ shows you the version and exits, cute and quick--info[site] β if you give it a site name it prints the info for that specific site; if you don't, it prints all the site names. a little choose-your-own-adventure π«Ά--sitesite β define a web site, and the headlines from that site are the ones getting shown. you can also use this alongside--helpto get new defaults. the default site is:freshmeat.--namename β sets the menu name (default is"MenuHeadlinesFreshmeat")--titletitle β sets the menu title (default is"Freshmeat Headlines")--itemlabel-format--execcommand-format β these two set the format for the menu item and the command (aka: what gets shown, and what gets executed when you pick the item). the default label is'%h\t%[(%Y-%m-%d %H:%M)]'. a TAB can be written as'\t', but heads up bestie β inside.fvwm2rcyou should specify a double backslash or an actual real TAB. no cap.
Format specifiers for a headline format:
%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't 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
these specifiers can also take an optional integer size β positive means right adjusted string, negative means left adjusted. example: %8x. and they can take an optional *num or *-num, which means "leave only the first num chars" (or the last num chars if there's a minus). the num has to be greater than 3, since the stripped part gets replaced with "...". example: %*30x. and bestie, you can combine both: %-10*-20x means grab only the last 20 characters, but if the length is less than 10, fill with up to 10 spaces on the right. the range?? π
Example:
--exec "iceweasel -remote 'openURL(%u, new-window)' || iceweasel '%u'"
--commandcommand-format β same energy as--execabove, but this one lets you specify any fvwm command, not just Exec. for example,"Function FuncFvwmShowURL '%u'".
fr fr, --exec="mozilla '%u'" is equivalent to --command="Exec mozilla '%u'"
--icon-titleicon--icon-itemicon--icon-homeicon--icon-erroricon β these set the menu icon for the title, a regular item, the frontpage item and an error item respectively. default is no menu icons at all (which is the same as an empty icon argument).--wm-iconsβ sets icon names that are suitable for use with the 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. iconic honestly π--frontpage[where] β adds the site frontpage item to the menu. the optional value lets you say where in the menu this item goes β'top'or't','bottom'or'b'.--proxyhost[:port] β sets a proxy to use. Example:--proxy proxy.inter.net:3128--file[file] β writes the menu output to the file you specified. if you give no filename with this option (or an empty filename), the default filenameWORK_HOME/SITE.menuis used. and if you don't use this option at all, or you use a'-'filename, the menu output goes to standard output. β¨--fake[file] β doesn't connect to the host using the HTTP protocol; instead it reads from theWORK_HOME/SITE.infile. the following reads input fromfreshmeat.in(downloaded fromhttp://freshmeat.net/backend/recentnews.txt) and saves output tosegfault.menu(both files are inWORK_HOME):
fvwm-menu-headlines --site freshmeat --fake --file
--timeoutseconds β limits a line reading from a socket to this timeout. the default timeout is 20 seconds.
WORK_HOME for this script is ~/.fvwm/.fvwm-menu-headlines. it gets created if it's needed, don't worry bestie π«Ά
option parameters can be specified either with '=' or in the next argument. short options are fine as long as they're not ambiguous: "-h", "-t". but be careful with short options, because what's unambiguous now can become ambiguous in the next versions. the more you know π
π USAGE π
- one of the ways to use this script is to define a crontab entry that runs the script every hour or so, for every site you're monitoring:
0,30 * * * * fvwm-menu-headlines --file --site freshmeat
1,31 * * * * fvwm-menu-headlines --file --site linuxtoday
2,32 * * * * fvwm-menu-headlines --file --site slashdot
then add these lines to your fvwm configuration file:
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
- another way to use this script (only if you have a fast network or proxy, bestie) is to run it every single time you want to open your Headlines submenus. (note: the submenu that's already been created is not reloaded β use
"Reset all".)
in this case your fvwm configuration lines could be:
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
and finally, add "Popup MenuHeadlines" somewhere. slay π
- here's the 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):
PipeRead "fvwm-menu-headlines --site newsforge --name MenuHeadlinesNewsForge"
# this may take several seconds, you may use: BusyCursor Read true
Popup MenuHeadlinesNewsForge
π HOW TO ADD SITE HEADLINES π
okay so you can totally add user-defined site headlines without touching the script itself. just put your perl extensions into the file WORK_HOME/extension.pl. for each site, add something similar to:
$site_info->{'myslashdot'} = {
'name' => "MySlashdot",
'host' => "myslashdot.org",
'path' => "/myslashdot.xml",
'func' => \&process_my_slashdot,
# the following string is only used in --info
'flds' => 'time, title, department, topic, author, url',
};
sub process_my_slashdot () {
return process_xml(
'story',
# mandatory 'h', 'u' and 'd' aliases or undef
{ 'h' => 'title', 'u' => 'url', 'd' => 'time' },
sub ($) { # convert 'd' string to (y, m, d, H, M, S)
$_[0] =~ /(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/;
($1, ($2 || 0) - 1, $3, $4, $5, $6);
}, +0, # timezone offset; already in UTC
);
}
1;
main character energy fr fr π§
π AUTHORS π
this script is inspired by WMHeadlines v1.3 by:
Jeff Meininger <jeffm@boxybutgood.com>
(http://rive.boxybutgood.com/WMHeadlines/).
reimplemented for fvwm and heavily enhanced by:
Mikhael Goikhman <migo@homemail.com>, 16 Dec 1999.
give them their flowers π
π COPYING π
the script is distributed by the same terms as fvwm itself. see the GNU General Public License for the details. π
π BUGS π
okay so the author tries to keep all supported site info up to date, but bestie β sites go down, they change their backend formats, they change their httpd responses, they just straight up stop posting news, and so on. the script in the latest cvs may be more up to date. it's giving chaos out here π
also, the headline times may be off by one hour or more, since the time gets displayed for your local time zone, and the time zone of the original time in the site backend output is often guessed (sometimes incorrectly). same deal for guessing whether to apply the daylight saving correction. π
report bugs to fvwm-bug@fvwm.org.
aaand that's the whole page bestie π«Ά this was fvwm-menu-headlines from the Fvwm Utilities manual, version 2.5.28 (from cvs), dated 2009-03-22. go forth and populate those submenus, you absolute icon πβ¨
π¦ where this page comes from
- debian bookworm: fvwm 1:2.7.0-2 Β· GPL-2.0-only
- debian trixie: fvwm 1:2.7.0-3 Β· GPL-2.0-or-later
- ubuntu noble: fvwm 1:2.7.0-2build2 Β· GPL-2.0-only
- ubuntu questing: fvwm 1:2.7.0-3
- ubuntu resolute: fvwm 1:2.7.0-3build1 Β· GPL-2.0-or-later
- ubuntu stonking: fvwm 1:2.7.0-3build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms