{"action":"created","issue":{"url":"https://api.github.com/repos/gpakosz/.tmux/issues/35","repository_url":"https://api.github.com/repos/gpakosz/.tmux","labels_url":"https://api.github.com/repos/gpakosz/.tmux/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/gpakosz/.tmux/issues/35/comments","events_url":"https://api.github.com/repos/gpakosz/.tmux/issues/35/events","html_url":"https://github.com/gpakosz/.tmux/issues/35","id":186303830,"number":35,"title":"Battery status not working on Ubuntu 16.10","user":{"login":"luisdavim","id":173006,"avatar_url":"https://avatars.githubusercontent.com/u/173006?v=3","gravatar_id":"","url":"https://api.github.com/users/luisdavim","html_url":"https://github.com/luisdavim","followers_url":"https://api.github.com/users/luisdavim/followers","following_url":"https://api.github.com/users/luisdavim/following{/other_user}","gists_url":"https://api.github.com/users/luisdavim/gists{/gist_id}","starred_url":"https://api.github.com/users/luisdavim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisdavim/subscriptions","organizations_url":"https://api.github.com/users/luisdavim/orgs","repos_url":"https://api.github.com/users/luisdavim/repos","events_url":"https://api.github.com/users/luisdavim/events{/privacy}","received_events_url":"https://api.github.com/users/luisdavim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-31T14:53:37Z","updated_at":"2016-10-31T15:55:14Z","closed_at":null,"body":"Hi,\r\n\r\nI've just upgraded my ubuntu installation from 16.04 to 16.10 and the battery status is now missing, running:\r\n\r\n```\r\ncut -c3- ~/.tmux.conf | sh -s _battery\r\n```\r\nReturns:\r\n```\r\nsh: 343: [: Illegal number: %d9.7\r\nsh: 345: Illegal number: %d9.7\r\n```\r\n```\r\ncat /sys/class/power_supply/BAT0/capacity\r\n```\r\nreturns 97."},"comment":{"url":"https://api.github.com/repos/gpakosz/.tmux/issues/comments/257333487","html_url":"https://github.com/gpakosz/.tmux/issues/35#issuecomment-257333487","issue_url":"https://api.github.com/repos/gpakosz/.tmux/issues/35","id":257333487,"user":{"login":"luisdavim","id":173006,"avatar_url":"https://avatars.githubusercontent.com/u/173006?v=3","gravatar_id":"","url":"https://api.github.com/users/luisdavim","html_url":"https://github.com/luisdavim","followers_url":"https://api.github.com/users/luisdavim/followers","following_url":"https://api.github.com/users/luisdavim/following{/other_user}","gists_url":"https://api.github.com/users/luisdavim/gists{/gist_id}","starred_url":"https://api.github.com/users/luisdavim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisdavim/subscriptions","organizations_url":"https://api.github.com/users/luisdavim/orgs","repos_url":"https://api.github.com/users/luisdavim/repos","events_url":"https://api.github.com/users/luisdavim/events{/privacy}","received_events_url":"https://api.github.com/users/luisdavim/received_events","type":"User","site_admin":false},"created_at":"2016-10-31T15:55:14Z","updated_at":"2016-10-31T15:55:14Z","body":"Hi,\r\n\r\nI got it working with these changes:\r\n```diff\r\ndiff --git a/.tmux.conf b/.tmux.conf\r\nindex 2e96dcf..4ae9e5a 100644\r\n--- a/.tmux.conf\r\n+++ b/.tmux.conf\r\n@@ -319,7 +319,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'\r\n #     palette=$(echo \"$palette\" | awk -v n=\"$battery_bar_length\" '{ for (i = 0; i < n; ++i) printf $(1 + (i * NF / n))\" \" }')\r\n #     eval set -- \"$palette\"\r\n #\r\n-#     full=$(awk \"BEGIN { printf \\\"%.0f\\\", ($charge) * $battery_bar_length }\")\r\n+#     full=$(awk 'BEGIN { printf \"%.0f\", ($charge) * $battery_bar_length }')\r\n #     battery_bar=\"#[bg=$battery_bg]\"\r\n #     # shellcheck disable=SC2046\r\n #     [ \"$full\" -gt 0 ] && \\\r\n@@ -337,7 +337,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'\r\n #     battery_empty_fg=$2\r\n #     battery_bg=$3\r\n #\r\n-#     full=$(awk \"BEGIN { print \\\"%d\\\" ($charge) * $battery_bar_length }\")\r\n+#     full=$(awk 'BEGIN { printf \"%d\", ($charge) * $battery_bar_length }')\r\n #     [ x\"$battery_bg\" != x\"none\" ] && \\\r\n #       battery_bar=\"#[bg=$battery_bg]\"\r\n #     [ \"$full\" -gt 0 ] && \\\r\n@@ -348,6 +348,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'\r\n #       battery_bar=\"$battery_bar#[fg=$battery_empty_fg]\"\r\n #   fi\r\n #\r\n+#     battery_vbar_bg='none'\r\n #   if echo \"$battery_vbar_palette\" | grep -q -E '^heat|gradient(,[#a-z0-9]{7,9})?$'; then\r\n #     # shellcheck disable=SC2086\r\n #     { set -f; IFS=,; set -- $battery_vbar_palette; unset IFS; set +f; }\r\ndiff --git a/.tmux.conf.local b/.tmux.conf.local\r\nindex 10c6d5e..ce0a079 100644\r\n--- a/.tmux.conf.local\r\n+++ b/.tmux.conf.local\r\n@@ -206,8 +206,8 @@ tmux_conf_battery_bar_palette='gradient'\r\n #   - gradient (default)\r\n #   - heat\r\n #   - 'colour_low,colour_half,colour_full'\r\n-tmux_conf_battery_vbar_palette='gradient'\r\n-#tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00'  # red, orange, green\r\n+# tmux_conf_battery_vbar_palette='gradient'\r\n+tmux_conf_battery_vbar_palette='#d70000,#ff5f00,#5fff00'  # red, orange, green\r\n \r\n # symbols used to indicate whether battery is charging or discharging\r\n tmux_conf_battery_status_charging='⚡'     # U+26A1\r\n```"}}
{"actor":{"display_login":"luisdavim"}}