Rainmeter是一款免费开源的、面向 Windows 个人电脑的桌面个性美化程序, 由于其低资源占用和简易的设计方式,强大的可定制性及拓展性,诸多爱好者在原来的基础上开发了成百上千的插件程序和皮肤样式,功能得到极大的扩展。桌面上可显示包含内存,电池,RSS,天气等信息的可定制皮肤,许多皮肤还具有一定的功能:帮用户记录下即将要做的事,发布微博,控制媒体播放器等。
特色
可以显示CPU、内存、硬盘容量、网络连接等系统信息;
可以做到类似于菜单栏和快速启动栏一样(Launchers和Docks)的功能;
可以显示当前播放器播放的音乐媒体;
可以从网络获取如天气、Rss源、邮箱等信息。
Rainmeter遵循GNU宽通用公共许可证(GNU Lesser General Public License v2),支持多语言(包括中文),支持32/64位版本的windows XP/Vista/Win7。
------------------------------------------------------------------
Rainmeter is a desktop customization tool for Windows. For more information and downloads, visit rainmeter.net.
For build instructions, see this.
from https://github.com/rainmeter/rainmeter
--------------------------------------------------------
Building Rainmeter
Get the source code
Use Git to clone the repository:
git clone https://github.com/rainmeter/rainmeter.git
Alternatively, download the repository contents as a ZIP archive.
Building with Visual Studio
Rainmeter can be built using any version of Visual Studio 2022. If you don't already have VS2022, you can download Visual Studio Community 2022 for free.
Building the installer manually
First, download and install NSIS 3 or later.
Then, in the Build directory, run e.g. Build.bat pre 1 2 3 4
to build the pre-release 1.2.3 r4.
If you see any "not found" errors, check that the paths in the set
commands at the top of the file match your environment.
To build a release installer, use Build.bat release 1 2 3 4
.
To digitally sign the installer and the Rainmeter executables, obtain a Windows code signing certificate and create a Certificate.bat file alongside Build.bat with the following contents:
set CERTFILE=/path/to/PFXcert.p12
set CERTKEY=certpassword
from https://github.com/rainmeter/rainmeter/blob/master/Docs/Building.md
-------------------------------------------------------------------------------
C++/C# plugin SDK for Rainmeter
docs.rainmeter.net/developers/The Rainmeter plugin software development kit contains the necessary tools and examples to build plugins in C/C++ and C#. Note that plugins built with the SDK require Rainmeter 2.3 beta or higher.
Download:
- Use git (
git clone git@github.com:rainmeter/rainmeter-plugin-sdk.git
) - Use svn (
svn checkout https://github.com/rainmeter/rainmeter-plugin-sdk/trunk rainmeter-plugin-sdk
) - Download the current snapshot as a .zip archive.
The SDK can be built using any version of Visual Studio 2019. If you don't already have VS2019, you can download the free "Visual Studio Community" version here.
Documentation: The documentation is available at https://docs.rainmeter.net/developers/.
from https://github.com/rainmeter/rainmeter-plugin-sdk
-----------------------------------------------------------------------
it's like Rainmeter, but for CLI!
metacpan.org/module/rainbarfrainbarf - CPU/RAM/battery stats chart bar for tmux (and GNU screen)
VERSION
version 1.4
SYNOPSIS
rainbarf --tmux --width 40 --no-battery
DESCRIPTION
Fancy resource usage charts to put into the tmux status line. The CPU utilization history chart is tinted with the following colors to reflect the system memory allocation:
- green: free memory;
- yellow: active memory;
- blue: inactive memory;
- red: wired memory on Mac OS X / FreeBSD; "unaccounted" memory on Linux;
- cyan: cached memory on Linux, buf on FreeBSD.
- magenta: used swap memory.
If available, battery charge is displayed on the right.
SCREENSHOTS
iTerm2 with tmux-powerline, Solarized theme and Terminus font
rainbarf --battery --remaining --rgb
OSX Terminal with Tomorrow Night theme and Menlo font
rainbarf --battery --remaining --no-bright
Ubuntu Terminal with default theme and Monospace font
rainbarf --battery --bolt --bright
BONUS: an animated zsh prompt!
Proof of concept, use at your own risk!
USAGE
Installation
-
Traditional way:
perl Build.PL ./Build test ./Build install
-
Homebrew way:
brew install rainbarf
-
MacPorts way:
port install rainbarf
-
CPAN way:
cpan -i App::rainbarf
-
Modern Perl way:
cpanm git://github.com/creaktive/rainbarf.git
Configuration
Add the following line to your ~/.tmux.conf
file:
set-option -g status-utf8 on
set -g status-right '#(rainbarf)'
Or, under GNOME Terminal:
set-option -g status-utf8 on
set -g status-right '#(rainbarf --rgb)'
Reload the tmux config by running tmux source-file ~/.tmux.conf
.
CONFIGURATION FILE
~/.rainbarf.conf
can be used to persistently store "OPTIONS":
# example configuration file
width=20 # widget width
bolt # fancy charging character
remaining # display remaining battery
rgb # 256-colored palette
"OPTIONS" specified via command line override that values.
Configuration file can be specified via RAINBARF
environment variable:
RAINBARF=~/.rainbarf.conf rainbarf
OPTIONS
-
--help
This.
-
--[no]battery
Display the battery charge indicator. Enabled by default.
-
--[no]remaining
Display the time remaining until the battery is fully charged/empty. See "CAVEAT". Disabled by default.
-
--[no]bolt
Display even fancier battery indicator
⚡
. Disabled by default. -
--[no]bright
Tricky one. Disabled by default. See "CAVEAT".
-
--[no]rgb
Use the RGB palette instead of the system colors. Also disabled by default, for the same reasons as above.
-
--fg COLOR_NAME
Force chart foreground color.
-
--bg COLOR_NAME
Force chart background color.
-
--[no]loadavg
Use load average metric instead of CPU utilization. You might want to set the
--max
threshold since this is an absolute value and has varying ranges on different systems. Disabled by default. -
--[no]swap
Display the swap usage. Used swap amount is added to the total amount, but the free swap amount is not! Disabled by default.
-
--max NUMBER
Maximum
loadavg
you expect before rescaling the chart. Default is 1. -
--order INDEXES
Specify the memory usage bar order. The default is
fwaic
(free, wired, active, inactive & cached). -
--[no]tmux
Force
tmux
colors mode. By default, rainbarf detects automatically if it is being called fromtmux
or from the interactive shell. -
--screen
-
--width NUMBER
Chart width. Default is 38, so both the chart and the battery indicator fit the
tmux
status line. Higher values may require disabling the battery indicator or raising thestatus-right-length
value in~/.tmux.conf
. -
--datfile FILENAME
Specify the file to log CPU stats to. Default:
$HOME/.rainbarf.dat
-
--skip NUMBER
Do not write CPU stats if file already exists and is newer than this many seconds. Useful if you refresh
tmux
status quite frequently.
CAVEAT
Time remaining
If the --remaining
option is present but you do not see the time in your status bar, you may need to increase the value of status-right-length
to 48.
Color scheme
If you only see the memory usage bars but no CPU utilization chart, that's because your terminal's color scheme need an explicit distinction between foreground and background colors. For instance, "red on red background" will be displayed as a red block on such terminals. Thus, you may need the ANSI bright attribute for greater contrast, or maybe consider switching to the 256-color palette. There are some issues with that, though:
- Other color schemes (notably, solarized) have different meaning for the ANSI bright attribute.
So using it will result in a quite psychedelic appearance.
256-color pallette, activated by the
--rgb
flag, is unaffected by that. - The older versions of Term::ANSIColor dependency do not recognize bright/RGB settings, falling back to the default behavior (plain 16 colors).
However, the whole Term::ANSIColor is optional, it is only required to preview the effects of the "OPTIONS" via command line before actually editing the
~/.tmux.conf
. That is,rainbarf --bright --tmux
is guaranteed to work despite the outdated Term::ANSIColor!
Another option is skipping the system colors altogether and use the RGB palette (rainbarf --rgb
).
This fixes the issue 1, but doesn't affect the issue 2.
It still looks better, though.
Persistent storage
CPU utilization stats are persistently stored in the ~/.rainbarf.dat
file.
Every rainbarf execution will update and rotate that file.
Since tmux
calls rainbarf periodically (every 15 seconds, by default), the chart will display CPU utilization for the last ~9.5 minutes (15 * 38).
Thus, several tmux
instances running simultaneously for the same user will result in a faster chart scrolling.
screen
Stable screen
version unfortunately has a broken UTF-8 handling specifically for the status bar.
Thus, I have only tested the rainbarf with the variant from git://git.savannah.gnu.org/screen.git.
My ~/.screenrc
contents:
backtick 1 15 15 rainbarf --bright --screen
hardstatus string "%1`"
hardstatus lastline
REFERENCES
- top(1) is used to get the CPU/RAM stats if no
/proc
filesystem is available. - ioreg(8) is used to get the battery status on Mac OS X.
- ACPI is used to get the battery status on Linux.
- Battery was a source of inspiration.
- Spark was another source of inspiration.
AUTHOR
Stanislaw Pusep stas@sysd.org
from https://github.com/creaktive/rainbarf
No comments:
Post a Comment