Skip to content

Commit

Permalink
Add licenses and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
aisk committed Oct 13, 2018
1 parent 11d9a8c commit 67f9f12
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 70 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>MySensors.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<dict/>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>479D566E1D97A76D00713B6E</key>
Expand Down
29 changes: 15 additions & 14 deletions MySensors/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// AppDelegate.swift
// MySensors
//
// Created by 安龙 on 25/09/2016.
// Copyright © 2016 asaka. All rights reserved.
// Created by An Long on 25/09/2016.
// Copyright © 2016 An Long. All rights reserved.
//

import Cocoa
Expand Down Expand Up @@ -65,31 +65,32 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {

func getSensorsData() -> Array<SensorsData> {
var result: Array<SensorsData> = []


do {
let fans = try SMCKit.allFans()
let temps = try SMCKit.allKnownTemperatureSensors()
var items: Array<(String, String)> = []
for fan in fans {
items.append((fan.name, String(try SMCKit.fanCurrentSpeed(fan.id))))

for temp in temps {
items.append((temp.name, "\(try SMCKit.temperature(temp.code)) °C"))
}
result.append(SensorsData(title: "Fan", items: items))
items = items.sorted(by: {$0.0 < $1.0})
result.append(SensorsData(title: "Temperature", items: items))
} catch {
// pass
}

do {
let temps = try SMCKit.allKnownTemperatureSensors()
let fans = try SMCKit.allFans()
var items: Array<(String, String)> = []

for temp in temps {
items.append((temp.name, "\(try SMCKit.temperature(temp.code)) °C"))
for fan in fans {
items.append((fan.name, String(try SMCKit.fanCurrentSpeed(fan.id))))
}
items = items.sorted(by: {$0.0 < $1.0})
result.append(SensorsData(title: "Temperature", items: items))
result.append(SensorsData(title: "Fan Speed", items: items))
} catch {
// pass
}

return result
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions MySensors/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
"scale" : "2x"
},
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "xxx.png",
"size" : "128x128",
"scale" : "1x"
},
{
Expand All @@ -42,8 +41,9 @@
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"idiom" : "mac",
"filename" : "AppIcon.png",
"scale" : "1x"
},
{
Expand Down
Binary file removed MySensors/Assets.xcassets/AppIcon.appiconset/xxx.png
Binary file not shown.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# MySensors

Show macOS's chip tempratures and fan speeds on menu bar.

## Build

```sh
$ xcodebuild
```

## License

MIT lisence with exceptions:

- The app icon is designed by [nervouna](https://github.com/nervouna) under MIT license.
- The menu bar icon is copied from Google's Material Design under Apache 2.0 license.
- The SMC.swift is copied from [SMCKit project](https://github.com/beltex/SMCKit) under [MIT license](https://github.com/beltex/SMCKit/blob/master/LICENSE).
21 changes: 21 additions & 0 deletions SMCKit-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2017 beltex <https://github.com/beltex>

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.

0 comments on commit 67f9f12

Please sign in to comment.