From 6980c0dd280225fd75899280ab661f438848c207 Mon Sep 17 00:00:00 2001 From: Yinux Date: Sun, 4 Dec 2016 01:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90-neofetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...System Information with Distribution Logo.md | 234 ------------------ ...System Information with Distribution Logo.md | 234 ++++++++++++++++++ 2 files changed, 234 insertions(+), 234 deletions(-) delete mode 100644 sources/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md create mode 100644 translated/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md diff --git a/sources/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md b/sources/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md deleted file mode 100644 index 10feaaabd5..0000000000 --- a/sources/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md +++ /dev/null @@ -1,234 +0,0 @@ -@Yinux 翻译中 -Neofetch – Shows Linux System Information with Distribution Logo -============================================================ - -Neoftech is a cross-platform and easy-to-use [system information command line script][3] that collects your Linux system information and display it on the terminal next to an image, it could be your distributions logo or any ascii art of your choice. - -Neoftech is very similar to [ScreenFetch][4] or [Linux_Logo][5] utilities, but highly customizable and comes with some extra features as discussed below. - -Its main features include: it’s fast, prints a full color image – your distributions logo in ASCII alongside your system information, it’s highly customizable in terms of which, where and when information is printed on the terminal and it can take a screenshot of your desktop when closing the script as enabled by a special flag. - -#### Required Dependencies: - -1. Bash 3.0+ with ncurses support. -2. w3m-img (occasionally packaged with w3m) or iTerm2 or Terminology for printing images. -3. [imagemagick][1] – for thumbnail creation. -4. [Linux terminal emulator][2] should support \033[14t [3] or xdotool or xwininfo + xprop or xwininfo + xdpyinfo . -5. On Linux, you need feh, nitrogen or gsettings for wallpaper support. - -Important: You can read more about optional dependencies from the Neofetch Github repository to check if your [Linux terminal emulator][6] actually supports \033[14t or any extra dependencies for the script to work well on your distro. - -### How To Install Neofetch in Linux - -Neofetch can be easily installed from third-party repositories on almost all Linux distributions by following below respective installation instructions as per your distribution. - -#### On Debian - -``` -$ echo "deb http://dl.bintray.com/dawidd6/neofetch jessie main" | sudo tee -a /etc/apt/sources.list -$ curl -L "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" -o Release-neofetch.key && sudo apt-key add Release-neofetch.key && rm Release-neofetch.key -$ sudo apt-get update -$ sudo apt-get install neofetch -``` - -#### On Ubuntu and Linux Mint - -``` -$ sudo add-apt-repository ppa:dawidd0811/neofetch -$ sudo apt-get update -$ sudo apt-get install neofetch -``` - -#### On RHEL, CentOS and Fedora - -You need to have dnf-plugins-core installed on your system, or else install it with the command below: - -``` -$ sudo yum install dnf-plugins-core -``` - -Enable COPR repository and install neofetch package. - -``` -$ sudo dnf copr enable konimex/neofetch -$ sudo dnf install neofetch -``` - -#### On Arch Linux - -You can either install neofetch or neofetch-git from the AUR using packer or Yaourt. - -``` -$ packer -S neofetch -$ packer -S neofetch-git -OR -$ yaourt -S neofetch -$ yaourt -S neofetch-git -``` - -#### On Gentoo - -Install app-misc/neofetch from Gentoo/Funtoo’s official repositories. However, in case you need the git version of the package, you can install =app-misc/neofetch-9999. - -### How To Use Neofetch in Linux - -Once you have installed the package, the general syntax for using it is: - -``` -$ neofetch -``` - -Note: If w3m-img or [imagemagick][7] is not installed on your system, [screenfetch][8] will be enabled by default and neofetch will display your [ASCII art logo][9] as in the image below. - -#### Linux Mint Information - -[ - ![Linux Mint System Information](http://www.tecmint.com/wp-content/uploads/2016/11/Linux-Mint-System-Information.png) -][10] - -Linux Mint System Information - -#### Ubuntu Information - -[ - ![Ubuntu System Information](http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information.png) -][11] - -Ubuntu System Information - -If you want to display the default distribution logo as image, you should install w3m-img or imagemagickon your system as follows: - -``` -$ sudo apt-get install w3m-img [On Debian/Ubuntu/Mint] -$ sudo yum install w3m-img [On RHEL/CentOS/Fedora] -``` - -Then run neofetch again, you will see the default wallpaper of your Linux distributions as the image. - -``` -$ neofetch -``` -[ - ![Ubuntu System Information with Logo](http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information-with-Logo.png) -][12] - -Ubuntu System Information with Logo - -After running neofetch for the first time, it will create a configuration file with all options and settings: `$HOME/.config/neofetch/config`. - -This configuration file will enable you through the `printinfo ()` function to alter the system information that you want to print on the terminal. You can type in new lines of information, modify the information lineup, delete certain lines and also tweak the script it using bash code to manage the information to be printed out. - -You can open the configuration file using your favorite editor as follows: - -``` -$ vi ~/.config/neofetch/config -``` - -Below is an excerpt of the configuration file on my system showing the `printinfo ()` function. - -Neofetch Configuration File -``` -#!/usr/bin/env bash -# vim:fdm=marker -# -# Neofetch config file -# https://github.com/dylanaraps/neofetch - -# Speed up script by not using unicode -export LC_ALL=C -export LANG=C - -# Info Options {{{ - -# Info -# See this wiki page for more info: -# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info -printinfo() { - info title - info underline - - info "Model" model - info "OS" distro - info "Kernel" kernel - info "Uptime" uptime - info "Packages" packages - info "Shell" shell - info "Resolution" resolution - info "DE" de - info "WM" wm - info "WM Theme" wmtheme - info "Theme" theme - info "Icons" icons - info "Terminal" term - info "Terminal Font" termfont - info "CPU" cpu - info "GPU" gpu - info "Memory" memory - - # info "CPU Usage" cpu_usage - # info "Disk" disk - # info "Battery" battery - # info "Font" font - # info "Song" song - # info "Local IP" localip - # info "Public IP" publicip - # info "Users" users - # info "Birthday" birthday - - info linebreak - info cols - info linebreak -} -..... -``` - -Type the command below to view all flags and their configuration values you can use with neofetch script: - -``` -$ neofetch --help -``` - -To launch neofetch with all functions and flags enabled, employ the `--test` flag: - -``` -$ neofetch --test -``` - -You can enable the ASCII art logo again using the `--ascii` flag: - -``` -$ neofetch --ascii -``` - -In this article, we have covered a simple and highly configuration/customizable command line script that gathers your system information and displays it on the terminal. - -Remember to get in touch with us via the feedback form below to ask any questions or give us your thoughts concerning the neofetch script. - -Last but not least, if you know of any similar scripts out there, do not hesitate to let us know, we will be pleased to hear from you. - -Visit the [neofetch Github repository][13]. - --------------------------------------------------------------------------------- - -via: http://www.tecmint.com/neofetch-shows-linux-system-information-with-logo - -作者:[Aaron Kili ][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://www.tecmint.com/author/aaronkili/ -[1]:http://www.tecmint.com/install-imagemagick-in-linux/ -[2]:http://www.tecmint.com/linux-terminal-emulators/ -[3]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ -[4]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ -[5]:http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ -[6]:http://www.tecmint.com/linux-terminal-emulators/ -[7]:http://www.tecmint.com/install-imagemagick-in-linux/ -[8]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ -[9]:http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ -[10]:http://www.tecmint.com/wp-content/uploads/2016/11/Linux-Mint-System-Information.png -[11]:http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information.png -[12]:http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information-with-Logo.png -[13]:https://github.com/dylanaraps/neofetch diff --git a/translated/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md b/translated/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md new file mode 100644 index 0000000000..6346546f11 --- /dev/null +++ b/translated/tech/20161112 Neofetch – Shows Linux System Information with Distribution Logo.md @@ -0,0 +1,234 @@ +Neofetch —— 带发行版 Logo 图像的系统信息显示工具 +============================================================ + +Neofetch 是一个跨平台的易于使用的 [系统信息命令行脚本][3],它收集你的系统信息,并在终端中和图像一起显示出来,这个图像可能是你的发行版的 logo 也可能是你选择的一幅 ascii 艺术字。 + +Neofetch 和 [ScreenFetch][4] 或者 [Linux_Logo][5] 很像,但是它可以高度定制并且还有一些额外的我们要在下面讨论的特点。 + +它的主要特点有:运行速度快,可以显示全色图像 —— 用 ASCII字符显示的发行版 logo 旁边显示系统信息,可以高度定制,可以随时显示系统信息,并且在关闭脚本的时候还可以通过一个特殊的参数来启用桌面截图。 + +#### 系统要求: + +1. Bash 3.0+ 带 ncurses 支持。 +2. w3m-img (有时候会打包成 w3m) 或者 iTerm2 或者 Terminology ——图像显示需要。 +3. [imagemagick][1] —— 缩略图创建需要。 +4. 支持[\033[14t [3] 的 [ Linux 终端模拟器] [2]或者 xdotool 或者 xwininfo + xprop 或者 xwininfo + xdpyinfo 。 +5. Linux 系统中还需要 feh,nitrogen 或者 gsettings 来提供 对墙纸的支持。 + +注意:你可以从 Neofetch 的 Github 页面了解更多关于可选依赖的信息,以检查你的 [Linux 终端模拟器][6] 是不是真的支持 \033[14t 或者是否需要一些额外的依赖来使这个脚本在你的发行版上工作得更好。 + +### 怎样在 Linux 系统上安装 Neofetch + +Neofetch 可以从几乎所有 Linux 发行版的第三方仓库轻松安装,请按照以下各自的安装说明进行安装。 + + +#### Debian + +``` +$ echo "deb http://dl.bintray.com/dawidd6/neofetch jessie main" | sudo tee -a /etc/apt/sources.list +$ curl -L "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" -o Release-neofetch.key && sudo apt-key add Release-neofetch.key && rm Release-neofetch.key +$ sudo apt-get update +$ sudo apt-get install neofetch +``` + +#### Ubuntu 和 Linux Mint + +``` +$ sudo add-apt-repository ppa:dawidd0811/neofetch +$ sudo apt-get update +$ sudo apt-get install neofetch +``` + +#### RHEL, CentOS 和 Fedora + +你的系统里面要安装的有 dnf-plugins-core ,或者用以下命令安装它: + +``` +$ sudo yum install dnf-plugins-core +``` + +启用 COPR 仓库然后安装 neofetch。 + +``` +$ sudo dnf copr enable konimex/neofetch +$ sudo dnf install neofetch +``` + +#### Arch Linux + +你可以用 packer 或 Yaourt 从 AUR 安装 neofetch 或 neofetch-git。 + +``` +$ packer -S neofetch +$ packer -S neofetch-git +OR +$ yaourt -S neofetch +$ yaourt -S neofetch-git +``` + +#### Gentoo + +从 Gentoo/Funtoo 的官方源安装 app-misc/neofetch。如果你要安装这个程序的 git 版的话,你可以安装  app-misc/neofetch-9999。 + +### 怎么在 Linux 中使用 Neofetch + +一旦你安装了 Neofetch ,使用它的一般语法是: + +``` +$ neofetch +``` + +注意: 要是你没有安装 w3m-img 或者 [imagemagick][7] ,[screenfetch][8] 会默认被启用,neofetch 会如下图所示显示你的 [ASCII 艺术 logo]。 + +#### Linux Mint 系统信息 + +[ + ![Linux Mint 系统信息](http://www.tecmint.com/wp-content/uploads/2016/11/Linux-Mint-System-Information.png) +][10] + +Linux Mint 系统信息 + +#### Ubuntu 系统信息 + +[ + ![Ubuntu System Information](http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information.png) +][11] + +Ubuntu 系统信息 + +如果你想用图片显示你的发行版 logo,需要用下面的命令安装 w3m-img 或者 imagemagick 。 +``` +$ sudo apt-get install w3m-img [On Debian/Ubuntu/Mint] +$ sudo yum install w3m-img [On RHEL/CentOS/Fedora] +``` + +然后再次运行 neofetch,你就会看到如下图所示的用你系统的默认墙纸来显示图片。 + +``` +$ neofetch +``` +[ + ![Ubuntu System Information with Logo](http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information-with-Logo.png) +][12] + +Ubuntu 系统信息带 logo + +第一次运行 neofetch 后,它会在这里创建一个配置文件: `$HOME/.config/neofetch/config`. + +这个配置文件可以让你通过 `printinfo ()`  函数来调整你想显示在终端的系统信息。你可以增加,修改,删除,也可以使用 bash 代码去调整你要显示的信息。 + +你可以如下图所示用你喜欢的编辑器打开这个配置文件: + +``` +$ vi ~/.config/neofetch/config +``` + +以下是我系统配置的片段 ,显示了 `printinfo ()` 函数。 + +Neofetch 配置 + +``` +#!/usr/bin/env bash +# vim:fdm=marker +# +# Neofetch config file +# https://github.com/dylanaraps/neofetch + +# Speed up script by not using unicode +export LC_ALL=C +export LANG=C + +# Info Options {{{ + +# Info +# See this wiki page for more info: +# https://github.com/dylanaraps/neofetch/wiki/Customizing-Info +printinfo() { + info title + info underline + + info "Model" model + info "OS" distro + info "Kernel" kernel + info "Uptime" uptime + info "Packages" packages + info "Shell" shell + info "Resolution" resolution + info "DE" de + info "WM" wm + info "WM Theme" wmtheme + info "Theme" theme + info "Icons" icons + info "Terminal" term + info "Terminal Font" termfont + info "CPU" cpu + info "GPU" gpu + info "Memory" memory + + # info "CPU Usage" cpu_usage + # info "Disk" disk + # info "Battery" battery + # info "Font" font + # info "Song" song + # info "Local IP" localip + # info "Public IP" publicip + # info "Users" users + # info "Birthday" birthday + + info linebreak + info cols + info linebreak +} +..... +``` + +下面的命令可以显示所有你能在 neofetch 脚本中用的参数和配置值: + +``` +$ neofetch --help +``` + +要带上所有的函数和参数来运行程序,你可以用 `--test` 参数: + +``` +$ neofetch --test +``` + +要再次显示 ASCII 艺术 logo ,你可以用 `--ascii` 参数 : + +``` +$ neofetch --ascii +``` + +这篇文章中,我们向你介绍了一个可以高度定制的用来收集系统信息并将它显示在终端上的命令行脚本。 + +如果你有什么问题,或者对这个脚本有什么想法,请在下面留言。 + +最后但是同样重要的是,如果你知道有类似的脚本,请毫不犹豫地告诉我们,感谢反馈。 + +访问 [neofetch Github 仓库][13]. + +-------------------------------------------------------------------------------- + +via: http://www.tecmint.com/neofetch-shows-linux-system-information-with-logo + +作者:[Aaron Kili ][a] +译者:[译者Yinux](https://github.com/Yinux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://www.tecmint.com/author/aaronkili/ +[1]:http://www.tecmint.com/install-imagemagick-in-linux/ +[2]:http://www.tecmint.com/linux-terminal-emulators/ +[3]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ +[4]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ +[5]:http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ +[6]:http://www.tecmint.com/linux-terminal-emulators/ +[7]:http://www.tecmint.com/install-imagemagick-in-linux/ +[8]:http://www.tecmint.com/screenfetch-system-information-generator-for-linux/ +[9]:http://www.tecmint.com/linux_logo-tool-to-print-color-ansi-logos-of-linux/ +[10]:http://www.tecmint.com/wp-content/uploads/2016/11/Linux-Mint-System-Information.png +[11]:http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information.png +[12]:http://www.tecmint.com/wp-content/uploads/2016/11/Ubuntu-System-Information-with-Logo.png +[13]:https://github.com/dylanaraps/neofetch