个人工具
登录
查看“Fortune”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“Fortune”的源代码
来自Ubuntu中文
←
Fortune
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
Fortunoid is a Plasma Widget that serves as a frontend GUI for the [http://linux.die.net/man/6/fortune fortune] package. Installing the Fortunoid widget package by sudo apt-get install plasma-widget-fortunoid will also install the fortune package. If only the fortune package is desired (which can be run in a command-line terminal), it can be installed by itself: sudo apt-get install fortune The fortune module can be customized. *The quotations themselves are stored in the /usr/share/games/fortunes folders. *There are multiple categories of quotations, and the file for each category can be edited directly. *When using the command-line, categories of quotations can be selected merely by specifying them. Example: fortune ''zippy'' ''science'' *There are many options for the command-line fortune utility (see [http://linux.die.net/man/6/fortune here]). Any or all of these command-line options can be entered as an argument in the Fortunoid widget. == Adding categories of fortunes (fortune modules) == * See [http://fortunes.pbworks.com/ this list] of the original fortune modules (categories). * Other modules can often be found by a Google search for ''fortune-mod''. * [http://en.wikiquote.org Wikiquotes] is an online repository for quotations. A webpage can easily be copied to a text file, for conversion into a fortune data file (see below). An example page is [http://en.wikiquote.org/wiki/Zen_proverbs Wikiquotes -- Zen proverbs]. * See [http://www.jason.mock.ws/wordpress/2007/07/10/creating-fortune-files this brief tutorial]. * Make sure fortune-mod is installed: sudo apt-get install fortune-mod *Change to the fortune directory: cd /usr/share/games/fortunes *Edit a category text file with quotations separated by % symbols: I reject your reality and substitute my own... % This is one of those "What the hell am I doing?" moments, over! % We got a robot in the water, he's stuffed with tuna and it's just another day here at Mythbusters. For example, save this text file as ''newcategory1''. *There is also a UTF-8 file which is merely a symbolic link to the text file: sudo ln -s ''newcategory1'' ''newcategory1.u8'' *Convert the text file into a data file for use by fortune. sudo strfile ''newcategory1'' ''newcategory1.dat'' *Select ''newcategory1'' as a command-line option or as an argument in Fortunoid.
返回至
Fortune
。