Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Jan 14, 2021
0 parents commit a0b0953
Show file tree
Hide file tree
Showing 7 changed files with 1,170 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin
661 changes: 661 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fan2go

A daemon to control the fans of a computer.
34 changes: 34 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package config

import (
"github.com/spf13/viper"
"log"
)

type Configuration struct {
FanCurves []FanCurve
}

var CurrentConfig Configuration

// one time setup for the configuration file
func init() {
viper.SetConfigName("fan2go")

viper.AddConfigPath(".")
viper.AddConfigPath("/etc/fan2go/")
viper.AddConfigPath("$HOME/.fan2go")

if err := viper.ReadInConfig(); err != nil {
log.Fatalf("Error reading config file, %s", err)
}
err := viper.Unmarshal(&CurrentConfig)
if err != nil {
log.Fatalf("unable to decode into struct, %v", err)
}

setDefaultValues()
}

func setDefaultValues() {
}
13 changes: 13 additions & 0 deletions config/fancurve.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package config

type (
FanCurve struct {
Sensors []string
PlotItems []PlotItem
}

PlotItem struct {
Temp int
Percentage int
}
)
6 changes: 6 additions & 0 deletions fan2go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fan2go:


"/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon4/pwm1":
min: 20
max: 100
Loading

0 comments on commit a0b0953

Please sign in to comment.