mirror of
https://github.com/tmux-plugins/tmux-battery.git
synced 2026-09-10 07:26:19 -04:00
Add Readme and License
This commit is contained in:
parent
79e702ac96
commit
77262d72f6
19
LICENSE.md
Normal file
19
LICENSE.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (C) 2014 Bruno Sutic
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
74
README.md
Normal file
74
README.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# Tmux battery status for OSX
|
||||
|
||||
Displays battery percentage and an icon in Tmux status-right. Plug-n-play
|
||||
installation, enables customization.
|
||||
|
||||
### Manual Installation
|
||||
|
||||
Clone the repo:
|
||||
|
||||
$ git clone https://github.com/bruno-/tmux_battery_osx ~/clone/path
|
||||
|
||||
Add this line to the bottom `.tmux.conf`:
|
||||
|
||||
run-shell ~/clone/path/battery_osx.tmux
|
||||
|
||||
Reload TMUX environment:
|
||||
|
||||
# type this in terminal
|
||||
$ tmux source-file ~/.tmux.conf
|
||||
|
||||
You should now see battery icon and a percentage in Tmux status-right.
|
||||
|
||||
### Installation with [Tmux Plugin Manager](https://github.com/bruno-/tpm)
|
||||
|
||||
Add plugin to the list of TPM plugins in `.tmux.conf`:
|
||||
|
||||
set -g @tpm_plugins " \
|
||||
bruno-/tpm \
|
||||
bruno-/tmux_battery_osx \
|
||||
"
|
||||
|
||||
Hit `prefix + I` to fetch the plugin and source it.
|
||||
|
||||
Battery icon and percentage should now be visible.
|
||||
|
||||
### Configuration
|
||||
|
||||
By default `tmux_battery_osx` just adds battery icon and percentage to the
|
||||
beginning of Tmux status-right.
|
||||
|
||||
If you want to customize the display, 2 new "interpolation values" are added:
|
||||
|
||||
- `&bp` - this string in 'status-right' will display battery percentage
|
||||
- `&bi` - will display battery icon
|
||||
|
||||
Examples:
|
||||
|
||||
set -g status-right "icon: &bi percentage: &bp"
|
||||
# or
|
||||
set -g status-right "Batt: &bi &bp | %a %h-%d %H:%M "
|
||||
|
||||
### Changing icons
|
||||
|
||||
By default, these icons are displayed:
|
||||
|
||||
- charged: ":battery:"
|
||||
- charging: ":zap:"
|
||||
- discharging: (nothing shown)
|
||||
|
||||
You can change these defaults by adding the following to `.tmux.conf` (the
|
||||
following lines are not in the code block so that emojis can be seen):
|
||||
|
||||
- set-option -g @batt_charged_icon ":sunglasses:"
|
||||
- set-option -g @batt_charging_icon ":+1:"
|
||||
- set-option -g @batt_discharging_icon ":thumbsdown:"
|
||||
|
||||
Reminder: OSX allows you to insert various emojis by pressing `Cmd+Ctrl+Space`.
|
||||
|
||||
Don't forget to reload TMUX environment (`$ tmux source-file ~/.tmux.conf`)
|
||||
after you do this.
|
||||
|
||||
### License
|
||||
|
||||
[MIT](LICENSE.md)
|
||||
Loading…
Reference in a new issue