{"action":"created","issue":{"url":"https://api.github.com/repos/erikw/tmux-powerline/issues/263","repository_url":"https://api.github.com/repos/erikw/tmux-powerline","labels_url":"https://api.github.com/repos/erikw/tmux-powerline/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/erikw/tmux-powerline/issues/263/comments","events_url":"https://api.github.com/repos/erikw/tmux-powerline/issues/263/events","html_url":"https://github.com/erikw/tmux-powerline/pull/263","id":315564802,"number":263,"title":"Add weather location to tmux-powerlinerc and Change generate_rc.sh","user":{"login":"TakkuMattsu","id":3356758,"avatar_url":"https://avatars1.githubusercontent.com/u/3356758?v=4","gravatar_id":"","url":"https://api.github.com/users/TakkuMattsu","html_url":"https://github.com/TakkuMattsu","followers_url":"https://api.github.com/users/TakkuMattsu/followers","following_url":"https://api.github.com/users/TakkuMattsu/following{/other_user}","gists_url":"https://api.github.com/users/TakkuMattsu/gists{/gist_id}","starred_url":"https://api.github.com/users/TakkuMattsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakkuMattsu/subscriptions","organizations_url":"https://api.github.com/users/TakkuMattsu/orgs","repos_url":"https://api.github.com/users/TakkuMattsu/repos","events_url":"https://api.github.com/users/TakkuMattsu/events{/privacy}","received_events_url":"https://api.github.com/users/TakkuMattsu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-18T17:03:21Z","updated_at":"2018-04-23T08:38:40Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/erikw/tmux-powerline/pulls/263","html_url":"https://github.com/erikw/tmux-powerline/pull/263","diff_url":"https://github.com/erikw/tmux-powerline/pull/263.diff","patch_url":"https://github.com/erikw/tmux-powerline/pull/263.patch"},"body":"## Proposal\r\n\r\nI would like to add **TMUX_POWERLINE_SEG_WEATHER_LOCATION** to *tmux-powerlinerc*.\r\n\r\n```bash\r\n# weather.sh {\r\n        # The data provider to use. Currently only \"yahoo\" is supported.\r\n        export TMUX_POWERLINE_SEG_WEATHER_DATA_PROVIDER=\"yahoo\"\r\n        # What unit to use. Can be any of {c,f,k}.\r\n        export TMUX_POWERLINE_SEG_WEATHER_UNIT=\"c\"\r\n        # How often to update the weather in seconds.\r\n        export TMUX_POWERLINE_SEG_WEATHER_UPDATE_PERIOD=\"600\"\r\n        # Name of GNU grep binary if in PATH, or path to it.\r\n        export TMUX_POWERLINE_SEG_WEATHER_GREP=\"grep\"\r\n        # Your location. Find a code that works for you:\r\n        # 1. Go to Yahoo weather http://weather.yahoo.com/\r\n        # 2. Find the weather for you location\r\n        # 3. Copy the last numbers in that URL. e.g. \"http://weather.yahoo.com/united-states/california/newport-beach-12796587/\" has the numbers \"12796587\"\r\n        TMUX_POWERLINE_SEG_WEATHER_LOCATION=\"XXXXXXXXX\"\r\n# }\r\n```\r\n\r\n## Change point\r\n\r\n- TMUX_POWERLINE_SEG_WEATHER_LOCATION is now added to tmux-powerlinerc when generate_rc.sh is executed.\r\n- Added TMUX_POWERLINE_SEG_WEATHER_LOCATION_DEFAULT to read TMUX POWERLINE SEG_WEATHER_LOCATION of tmux-powerlinerc.\r\n- If the TMUX_POWERLINE_SEG_WEATHER_LOCATION_DEFAULT is empty, \"No weather location specified\" will be displayed."},"comment":{"url":"https://api.github.com/repos/erikw/tmux-powerline/issues/comments/383498737","html_url":"https://github.com/erikw/tmux-powerline/pull/263#issuecomment-383498737","issue_url":"https://api.github.com/repos/erikw/tmux-powerline/issues/263","id":383498737,"user":{"login":"TakkuMattsu","id":3356758,"avatar_url":"https://avatars1.githubusercontent.com/u/3356758?v=4","gravatar_id":"","url":"https://api.github.com/users/TakkuMattsu","html_url":"https://github.com/TakkuMattsu","followers_url":"https://api.github.com/users/TakkuMattsu/followers","following_url":"https://api.github.com/users/TakkuMattsu/following{/other_user}","gists_url":"https://api.github.com/users/TakkuMattsu/gists{/gist_id}","starred_url":"https://api.github.com/users/TakkuMattsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TakkuMattsu/subscriptions","organizations_url":"https://api.github.com/users/TakkuMattsu/orgs","repos_url":"https://api.github.com/users/TakkuMattsu/repos","events_url":"https://api.github.com/users/TakkuMattsu/events{/privacy}","received_events_url":"https://api.github.com/users/TakkuMattsu/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T08:38:40Z","updated_at":"2018-04-23T08:38:40Z","author_association":"CONTRIBUTOR","body":"@erikw \r\nSorry for my late reply.🙇 \r\n\r\n>My point is that a default value for weather location does not makes sense because which location would this be, that works for most people?\r\n\r\nThat makes sense!\r\n\r\n>So I mean that only keeping the TMUX_POWERLINE_SEG_WEATHER_LOCATION which must be set in the rc file should be enough?\r\n\r\nI think so, too.\r\nSo, I thought of two another ways.\r\nHow about it?😃 \r\n\r\n- idea1) **TMUX_POWERLINE_SEG_WEATHER_LOCATION** can be set in *tmux-powerlinerc* and *weather.sh*.( Not Use TMUX_POWERLINE_SEG_WEATHER_LOCATION_DEFAULT )\r\n- idea2) **TMUX_POWERLINE_SEG_WEATHER_LOCATION** can be set only with *tmux-powerlinerc*.\r\n\r\n## idea1) TMUX_POWERLINE_SEG_WEATHER_LOCATIONcan be set in tmux-powerlinerc and weather.sh.( Not Use TMUX_POWERLINE_SEG_WEATHER_LOCATION_DEFAULT )\r\n\r\nweather.sh\r\n```diff\r\ndiff --git a/segments/weather.sh b/segments/weather.sh\r\nindex ce74677..b55f305 100755\r\n--- a/segments/weather.sh\r\n+++ b/segments/weather.sh\r\n@@ -11,7 +11,7 @@ TMUX_POWERLINE_SEG_WEATHER_UPDATE_PERIOD_DEFAULT=\"600\"\r\n # 1. Go to Yahoo weather http://weather.yahoo.com/\r\n # 2. Find the weather for you location\r\n # 3. Copy the last numbers in that URL. e.g. \"http://weather.yahoo.com/united-states/california/newport-beach-12796587/\" has the numbers \"12796587\"\r\n-TMUX_POWERLINE_SEG_WEATHER_LOCATION=\"\"\r\n+TMUX_POWERLINE_SEG_WEATHER_LOCATION=${TMUX_POWERLINE_SEG_WEATHER_LOCATION:=\"\"}\r\n\r\n if shell_is_bsd  && [ -f /user/local/bin/grep  ]; then\r\n        TMUX_POWERLINE_SEG_WEATHER_GREP_DEFAULT=\"/usr/local/bin/grep\"\r\n```\r\n\r\n| tmux-powerlinerc | weather.sh | result |\r\n|:----:|:----:|:---|\r\n| empty | empty | ![image](https://user-images.githubusercontent.com/3356758/39114498-fe369748-4719-11e8-8e11-00b2aa94afd7.png) |\r\n| set | empty | ![image](https://user-images.githubusercontent.com/3356758/39114534-132f649a-471a-11e8-950e-8240bb594a4b.png)|\r\n| empty | set |![image](https://user-images.githubusercontent.com/3356758/39114534-132f649a-471a-11e8-950e-8240bb594a4b.png)|\r\n\r\n## idea2) TMUX_POWERLINE_SEG_WEATHER_LOCATION can be set only with rc file.\r\n\r\nweather.sh\r\n```diff\r\ndiff --git a/segments/weather.sh b/segments/weather.sh\r\nindex ce74677..792c8f5 100755\r\n--- a/segments/weather.sh\r\n+++ b/segments/weather.sh\r\n@@ -7,11 +7,11 @@ TMUX_POWERLINE_SEG_WEATHER_DATA_PROVIDER_DEFAULT=\"yahoo\"\r\n TMUX_POWERLINE_SEG_WEATHER_UNIT_DEFAULT=\"c\"\r\n TMUX_POWERLINE_SEG_WEATHER_UPDATE_PERIOD_DEFAULT=\"600\"\r\n\r\n-# Your location. Find a code that works for you:\r\n-# 1. Go to Yahoo weather http://weather.yahoo.com/\r\n-# 2. Find the weather for you location\r\n-# 3. Copy the last numbers in that URL. e.g. \"http://weather.yahoo.com/united-states/california/newport-beach-12796587/\" has the numbers \"12796587\"\r\n-TMUX_POWERLINE_SEG_WEATHER_LOCATION=\"\"\r\n+# If you want to set your location, set TMUX_POWERLINE_SEG_WEATHER_LOCATION in the tmux-powerlinerc file.\r\n+# 1. You create tmux-powerlinerc file.\r\n+#    $ ./generate_rc.sh\r\n+#    $ mv ~/.tmux-powerlinerc.default ~/.tmux-powerlinerc\r\n+# 2. You set TMUX_POWERLINE_SEG_WEATHER_LOCATION.\r\n\r\n if shell_is_bsd  && [ -f /user/local/bin/grep  ]; then\r\n        TMUX_POWERLINE_SEG_WEATHER_GREP_DEFAULT=\"/usr/local/bin/grep\"\r\n```\r\n\r\n| tmux-powerlinerc | result |\r\n|:----:|:----|\r\n| empty  | ![image](https://user-images.githubusercontent.com/3356758/39114498-fe369748-4719-11e8-8e11-00b2aa94afd7.png) |\r\n| set  | ![image](https://user-images.githubusercontent.com/3356758/39114534-132f649a-471a-11e8-950e-8240bb594a4b.png)|"}}
{"actor":{"display_login":"TakkuMattsu"}}