Skip to content

Commit 279da3d

Browse files
authored
Fix README.md & CHANGELOG.md (#419)
* comply with natural language linter * comply with markdown linter * add linter badge
1 parent 9e5467d commit 279da3d

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- markdownlint-disable no-duplicate-heading -->
12
# Changelog
23
All notable changes to this project will be documented in this file.
34

@@ -14,8 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1415
### Changed
1516
- Improved roll_text function [#390](https://github.com/erikw/tmux-powerline/issues/390)
1617
- Improved segment ifstat [#402](https://github.com/erikw/tmux-powerline/issues/402)
17-
- [WIP] Minor improvements, cleanup & shellcheck compliance
18-
[#392](https://github.com/erikw/tmux-powerline/pull/392), [#395](https://github.com/erikw/tmux-powerline/pull/395), [#396](https://github.com/erikw/tmux-powerline/pull/396), [#400](https://github.com/erikw/tmux-powerline/pull/400), [#401](https://github.com/erikw/tmux-powerline/pull/401), [#403](https://github.com/erikw/tmux-powerline/pull/403), [#407](https://github.com/erikw/tmux-powerline/pull/407), [#406](https://github.com/erikw/tmux-powerline/pull/406), [#409](https://github.com/erikw/tmux-powerline/pull/409)
18+
- [WIP] Minor improvements, cleanup & shellcheck compliance
19+
[#392](https://github.com/erikw/tmux-powerline/pull/392), [#395](https://github.com/erikw/tmux-powerline/pull/395), [#396](https://github.com/erikw/tmux-powerline/pull/396), [#400](https://github.com/erikw/tmux-powerline/pull/400),
20+
[#401](https://github.com/erikw/tmux-powerline/pull/401), [#403](https://github.com/erikw/tmux-powerline/pull/403), [#407](https://github.com/erikw/tmux-powerline/pull/407), [#406](https://github.com/erikw/tmux-powerline/pull/406),
21+
[#409](https://github.com/erikw/tmux-powerline/pull/409)
1922
### Fixed
2023
- Fix vcs segments [#371](https://github.com/erikw/tmux-powerline/issues/371)
2124
- Fix wrong session_info in nested tmux session [#359](https://github.com/erikw/tmux-powerline/issues/359)

README.md

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- markdownlint-disable first-line-heading -->
12
<p align="center">
23
<img alt="log" width="100%" height="100%" src="img/logo.png" />
34
</p>
@@ -9,7 +10,8 @@
910
<img alt="GitHub Forks" src="https://img.shields.io/github/forks/erikw/tmux-powerline?style=social" />
1011
</p>
1112

12-
<!-- [![Lint Code Base](https://github.com/erikw/tmux-powerline/actions/workflows/linter.yml/badge.svg)](https://github.com/erikw/tmux-powerline/actions/workflows/linter.yml) -->
13+
<!-- markdownlint-disable no-empty-links -->
14+
[![Lint Code Base](https://github.com/erikw/tmux-powerline/actions/workflows/linter-full.yml/badge.svg)](https://github.com/erikw/tmux-powerline/actions/workflows/linter-full.yml)
1315
[![SLOC](https://img.shields.io/tokei/lines/github/erikw/tmux-powerline?logo=codefactor&logoColor=lightgrey)](#)
1416
[![Number of programming languages used](https://img.shields.io/github/languages/count/erikw/tmux-powerline)](#)
1517
[![Top programming languages used](https://img.shields.io/github/languages/top/erikw/tmux-powerline)](#)
@@ -20,21 +22,23 @@
2022
[![OSS Lifecycle](https://img.shields.io/osslifecycle/erikw/tmux-powerline)](https://github.com/Netflix/osstracker)
2123
[![Latest tag](https://img.shields.io/github/v/tag/erikw/tmux-powerline)](https://github.com/erikw/tmux-powerline/tags)
2224
<br>
25+
<!-- markdownlint-enable no-empty-links -->
2326

2427
[![Contributors](https://img.shields.io/github/contributors/erikw/tmux-powerline)](https://github.com/erikw/tmux-powerline/graphs/contributors) including these top contributors:
25-
<a href = "https://github.com/erikw/tmux-powerline/graphs/contributors">
26-
<img src = "https://contrib.rocks/image?repo=erikw/tmux-powerline&max=36"/>
28+
<a href="https://github.com/erikw/tmux-powerline/graphs/contributors">
29+
<img alt="Top Contributors" src="https://contrib.rocks/image?repo=erikw/tmux-powerline&max=36"/>
2730
</a>
2831

2932

3033
# Intro
31-
tmux-powerline is a tmux <a title="Tmux Plugin Manager" href="https://github.com/tmux-plugins/tpm">tpm</a> plugin that gives you a slick and hackable powerline status bar consisting of segments. It's easily extensible with custom segments and themes. The plugin itself is implemented purely in bash thus minimizing system requirements. However you can make segments in any language you want (with a shell wrapper).
34+
tmux-powerline is a tmux <a title="Tmux Plugin Manager" href="https://github.com/tmux-plugins/tpm">tpm</a> plugin that gives you a slick and hackable powerline status bar consisting of segments. It's easily extensible with custom segments and themes.
35+
The plugin itself is implemented purely in bash thus minimizing system requirements. However you can make segments in any language you want (with a shell wrapper).
3236

3337
Some examples of segments available that you can add to your tmux status bar are (full list [here](https://github.com/erikw/tmux-powerline/tree/main/segments)):
3438
* LAN & WAN IP addresses
35-
* Now Playing for MPD, Spotify (GNU/Linux native or wine, OS X), iTunes (OS X), Rhythmbox, Banshee, MOC, Audacious, Rdio (OS X), cmus, Pithos and Last.fm (last scrobbled track).
39+
* Now Playing for MPD, Spotify (GNU/Linux native or wine, macOS), iTunes (macOS), Rhythmbox, Banshee, MOC, Audacious, Rdio (macOS), cmus, Pithos and Last.fm (last scrobbled track).
3640
* New mail count for GMail, Maildir, mbox, mailcheck, and Apple Mail
37-
* GNU/Linux and Macintosh OS X battery status (uses [richo/dotfiles/bin/battery](https://github.com/richoH/dotfiles/blob/master/bin/battery))
41+
* GNU/Linux and macOS battery status (uses [richo/dotfiles/bin/battery](https://github.com/richoH/dotfiles/blob/master/bin/battery))
3842
* Weather in Celsius, Fahrenheit and Kelvin using Yahoo Weather
3943
* System load, cpu usage and uptime
4044
* Git, SVN and Mercurial branch in CWD
@@ -101,10 +105,10 @@ Some segments have their own requirements. If you enable them in your theme, mak
101105
* `ifstat.sh`: ifstat (there is a simpler segment not using ifstat but samples /sys/class/net)
102106
* `tmux_mem_cpu_load.sh`: [tmux-mem-cpu-load](https://github.com/thewtex/tmux-mem-cpu-load)
103107
* `rainbarf.sh`: [rainbarf](https://github.com/creaktive/rainbarf)
104-
* `weather.sh`: GNU `grep` with Perl regexp enabled (FreeBSD specific), `jq` for yrno weather API.
108+
* `weather.sh`: GNU `grep` with Perl regular expression enabled (FreeBSD specific), `jq` for yrno weather API.
105109

106110
## FreeBSD specific requirements
107-
Preinstalled `grep` in FreeBSD doesn't support Perl regexp. Solution is rather simple -- you need to use `textproc/gnugrep` port instead. You also need to make sure, that it has support for PCRE and is compiled with `--enable-perl-regexp` flag.
111+
Preinstalled `grep` in FreeBSD doesn't support Perl regular expressions. Solution is rather simple -- you need to use `textproc/gnugrep` port instead. You also need to make sure, that it has support for PCRE and is compiled with `--enable-perl-regexp` flag.
108112

109113

110114
# Installation
@@ -117,7 +121,8 @@ Preinstalled `grep` in FreeBSD doesn't support Perl regexp. Solution is rather s
117121
* The default powerline should already be visible now!
118122
4. Continue to the [Configuration](#configuration) section below.
119123
120-
Note that tpm plugins should be at the bottom of you `tmux.conf`. This plugin will then override some tmux settings like `status-left`, `status-right` etc. If you had already set those in your tmux config, it is a good opportunity to remove or comment those out. Take a look at [main.tmux](https://github.com/erikw/tmux-powerline/blob/main/main.tmux) for exactly which settings are overridden.
124+
Note that tpm plugins should be at the bottom of you `tmux.conf`. This plugin will then override some tmux settings like `status-left`, `status-right` etc. If you had already set those in your tmux config, it is a good opportunity to remove or comment those out.
125+
Take a look at [main.tmux](https://github.com/erikw/tmux-powerline/blob/main/main.tmux) for exactly which settings are overridden.
121126
122127
123128
# Configuration
@@ -163,11 +168,12 @@ $EDITOR ~/.config/tmux-powerline/segments/my-segment.sh
163168

164169
Now you can add `my-segment` to your own theme!
165170

166-
Also see [How to make a segment](#How-to-make-a-segment) below for more details.
171+
Also see [How to make a segment](#how-to-make-a-segment) below for more details.
167172

168173

169174
# Debugging
170-
Some segments might not work on your system for various reasons such as missing programs or different versions not having the same options. To find out which segment is not working it may help to enable the debug setting in `~/.config/tmux-powerline/config.sh`. However this may not be enough to determine the error so you can inspect all executed bash commands (will be a long output) by doing
175+
Some segments might not work on your system for various reasons such as missing programs or different versions not having the same options. To find out which segment is not working it may help to enable the debug setting in `~/.config/tmux-powerline/config.sh`.
176+
However this may not be enough to determine the error so you can inspect all executed bash commands (will be a long output) by doing
171177

172178
```shell
173179
bash -x powerline.sh (left|right)
@@ -192,13 +198,14 @@ tail -f /tmp/tmux-powerline.log # or follow output like this.
192198

193199
You can also enable the debug mode in your config file. Look for the `TMUX_POWERLINE_DEBUG_MODE_ENABLED` environment variable and set it to `true`.
194200

195-
If you can not solve the problems you can post an [issue](https://github.com/erikw/tmux-powerline/issues?state=open) and be sure to include relevant information about your system and script output (from bash -x) and/or screenshots if needed. Be sure to search in the [resolved issues](https://github.com/erikw/tmux-powerline/issues?page=1&state=closed) section for similar problems you're experiencing before posting.
201+
If you can not solve the problems you can post an [issue](https://github.com/erikw/tmux-powerline/issues?state=open) and be sure to include relevant information about your system and script output (from bash -x) and/or screenshots if needed.
202+
Be sure to search in the [resolved issues](https://github.com/erikw/tmux-powerline/issues?page=1&state=closed) section for similar problems you're experiencing before posting.
196203

197204

198205

199206
## Common problems
200207
### Nothing is displayed
201-
You have edited `~/.tmux.conf` but no powerline is displayed. This might be because tmux is not aware of the changes so you have to restart your tmux session or reloaded that file by typing this on the command line (or in tmux command mode with `prefix :`)
208+
You have edited `~/.tmux.conf` but no powerline is displayed. This might be because tmux is not aware of the changes so you have to restart your tmux session or reloaded that file by typing this on the command-line (or in tmux command mode with `prefix :`)
202209

203210
```shell
204211
tmux source-file ~/.tmux.conf
@@ -207,12 +214,17 @@ tmux source-file ~/.tmux.conf
207214
If your tmux looks like [this](https://github.com/erikw/tmux-powerline/issues/125) then you may have to in iTerm uncheck [Unicode East Asian Ambiguous characters are wide] in Preferences -> Settings -> Advanced.
208215

209216
# Hacking
210-
This project can only gain positively from contributions. Fork today and make your own enhancements and segments to share back! If you'd like, add your name and E-mail to AUTHORS before making a pull request so you can get some credit for your work :-)
217+
This project can only gain positively from contributions. Fork today and make your own enhancements and segments to share back! If you'd like, add your name and email to AUTHORS before making a pull request so you can get some credit for your work :-)
211218

212219
## How to make a segment
213-
If you want to (of course you do!) send a pull request for a cool segment you written make sure that it follows the style of existing segments, unless you have good reason for it. Each segment resides in the `segments/` directory with a descriptive and simple name. A segment must have at least one function and that is `run_segment` which is like the main function that is called from the tmux-powerline lib. What ever text is echoed out from this function to stdout is the text displayed in the tmux status bar. If the segment at a certain point does not have anything to show, simply don't echo anything out and the segment will be hidden. A successful execution of the `run_segment` function should return an exit code of 0. If the segment failed to execute in a fatal way return a non-zero exit code so the user can pick up the error and fix it when debug mode is on (e.g. missing program that is needed for the segment).
214-
215-
Usage of helper function to organize the work of a segment is encourage and should be named in the format `__helper_func`. If a segment has settings it should have a function `generate_segmentrc` which outputs default values of all settings and a short explanation of the setting and its values. Study e.g. `segments/now_playing.sh` to see how it is done. A segment having settings should typically call a helper function `__process_settings` as the first statement in `run_segment` that sets default values to the settings that has not been set by the user.
220+
If you want to (of course you do!) send a pull request for a cool segment you written make sure that it follows the style of existing segments, unless you have good reason for it. Each segment resides in the `segments/` directory with a descriptive and simple name.
221+
A segment must have at least one function and that is `run_segment` which is like the main function that is called from the tmux-powerline lib. What ever text is echoed out from this function to stdout is the text displayed in the tmux status bar.
222+
If the segment at a certain point does not have anything to show, simply don't echo anything out and the segment will be hidden. A successful execution of the `run_segment` function should return an exit code of 0.
223+
If the segment failed to execute in a fatal way return a non-zero exit code so the user can pick up the error and fix it when debug mode is on (e.g. missing program that is needed for the segment).
224+
225+
Usage of helper function to organize the work of a segment is encourage and should be named in the format `__helper_func`. If a segment has settings it should have a function `generate_segmentrc` which outputs default values of all settings and a short
226+
explanation of the setting and its values. Study e.g. `segments/now_playing.sh` to see how it is done. A segment having settings should typically call a helper function `__process_settings` as the first statement in `run_segment` that sets default values
227+
to the settings that has not been set by the user.
216228

217229
Also, don't use bash4 features as requiring bash4 complicates installation for macOS user quite a bit. Use tabs for indentation ([discussion](https://github.com/erikw/tmux-powerline/pull/92)),
218230

0 commit comments

Comments
 (0)