diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 0000000..2a90fff --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,38 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Upload Release Asset + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Build project # This would actually build your project, using zip for an example artifact + run: | + zip -r ${{ github.event.repository.name }}.zip . -x ".git/*" ".github/* ${{ github.event.repository.name }}.zip" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./${{ github.event.repository.name }}.zip + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip diff --git a/README.md b/README.md index 7d884ba..65d9271 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,40 @@ # Weather -TBD +A menubar app which shows current weather for a given location: ![screenshot](./screenshots/screenshot.png) ![screenshot](./screenshots/screenshot2.png) +Whem clicked, a menu with more detailed information is shown, it also includes the sunrise and sunset times. + +# Installation + +This app is using [OpenWeather](https://openweathermap.org) as the data provider, so first you need to create an account and get an app id in order to use the API. Then + +- install [Hammerspoon](http://www.hammerspoon.org/) - a powerful automation tool for OS X + - Manually: + + Download the [latest release](https://github.com/Hammerspoon/hammerspoon/releases/latest), and drag Hammerspoon.app from your Downloads folder to Applications. + - Homebrew: + + ```brew install hammerspoon --cask``` + - download [weather.spoon](https://github.com/fork-my-spoons/github-activity.spoon/releases/download/v1.0/github-activity.spoon.zip), unzip and double click on a .spoon file. It will be installed under ~/.hammerspoon/Spoons folder. + - open ~/.hammerspoon/init.lua and add the following snippet: + ```lua -- weather hs.loadSpoon('weather') spoon.weather:setup{ - app_id = 'owm app id', + app_id = '', -- units = 'f', lat = 45.501670, lon = -73.567221, -- city = 'Montreal,QC,CA' } spoon.weather:start() -``` \ No newline at end of file +``` + +By defaul the temperature is in celsius, to change it to fahrenheit add parameter units with value 'f'. For the location you can either use latitude and longtitude, or [city name](https://openweathermap.org/current#name). + +This app uses icons, to properly display them, install a [feather-font](https://github.com/AT-UI/feather-font) by [downloading](https://github.com/AT-UI/feather-font/raw/master/src/fonts/feather.ttf) this .ttf font and installing it. diff --git a/init.lua b/init.lua index 61579ca..9392d9c 100644 --- a/init.lua +++ b/init.lua @@ -5,7 +5,7 @@ obj.__index = obj obj.name = "weather" obj.version = "1.0" obj.author = "Pavel Makhov" -obj.homepage = "https://github.com/fork-my-spoons/jira-issues.spoon" +obj.homepage = "https://fork-my-spoons.github.io/" obj.license = "MIT - https://opensource.org/licenses/MIT" obj.indicator = nil @@ -85,17 +85,15 @@ local function updateMenu() table.insert(menu, {title = '-'}) table.insert(menu, { - disabled = false, - title = - (is_night and sunset_icon or sunrise_icon) - .. hs.styledtext.new(string.rep(' ', c)) - .. (is_night and moon_icon or sun_icon) - .. hs.styledtext.new(string.rep(' ', 40 - c)) - .. (is_night and sunrise_icon or sunset_icon) - .. hs.styledtext.new('\n') - .. hs.styledtext.new(os.date("%H:%M", s)) - .. hs.styledtext.new(string.rep(' ', 38)) - .. hs.styledtext.new(os.date("%H:%M", e), {color = {hex = '#ffffff'}}) + title = (is_night and sunset_icon or sunrise_icon) + .. hs.styledtext.new(string.rep(' ', c)) + .. (is_night and moon_icon or sun_icon) + .. hs.styledtext.new(string.rep(' ', 40 - c)) + .. (is_night and sunrise_icon or sunset_icon) + .. hs.styledtext.new('\n') + .. hs.styledtext.new(os.date("%H:%M", s)) + .. hs.styledtext.new(string.rep(' ', 38)) + .. hs.styledtext.new(os.date("%H:%M", e), {color = {hex = '#ffffff'}}) }) obj.indicator:setMenu(menu)