From 77262d72f60c2cd5f53096a1a3e1f208287f5ffe Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Mon, 19 May 2014 14:13:25 +0200 Subject: [PATCH] Add Readme and License --- LICENSE.md | 19 ++++++++++++++ README.md | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..40f6ddd --- /dev/null +++ b/LICENSE.md @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..b40a011 --- /dev/null +++ b/README.md @@ -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)