Skip to content

Commit

Permalink
Make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Nov 10, 2020
1 parent f5a5fb0 commit b084a17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type DeckConfig struct {
Keys Keys `toml:"keys"`
}

// LoadConfig loads config from filename
// LoadConfig loads config from filename.
func LoadConfig(filename string) (DeckConfig, error) {
config := DeckConfig{}

Expand All @@ -52,7 +52,7 @@ func LoadConfig(filename string) (DeckConfig, error) {
return config, err
}

// Save writes config as json to filename
// Save writes config as json to filename.
func (c DeckConfig) Save(filename string) error {
var b bytes.Buffer
e := toml.NewEncoder(&b)
Expand Down
16 changes: 8 additions & 8 deletions deck.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"github.com/godbus/dbus"
)

// Deck is a set of widgets
// Deck is a set of widgets.
type Deck struct {
Widgets []Widget
}

// LoadDeck loads a deck configuration
// LoadDeck loads a deck configuration.
func LoadDeck(deck string) (*Deck, error) {
d := Deck{}
dc, err := LoadConfig(deck)
Expand All @@ -32,7 +32,7 @@ func LoadDeck(deck string) (*Deck, error) {
return &d, nil
}

// emulates a (multi-)key press
// emulates a (multi-)key press.
func emulateKeyPress(keys string) {
if keyboard == nil {
log.Println("Keyboard emulation is disabled!")
Expand All @@ -55,7 +55,7 @@ func emulateKeyPress(keys string) {
}
}

// emulates a clipboard paste
// emulates a clipboard paste.
func emulateClipboard(text string) {
err := clipboard.WriteAll(text)
if err != nil {
Expand All @@ -66,15 +66,15 @@ func emulateClipboard(text string) {
emulateKeyPress("29-47") // ctrl-v
}

// executes a dbus method
// executes a dbus method.
func executeDBusMethod(object, path, method, args string) {
call := dbusConn.Object(object, dbus.ObjectPath(path)).Call(method, 0, args)
if call.Err != nil {
log.Printf("dbus call failed: %s", call.Err)
}
}

// executes a command
// executes a command.
func executeCommand(cmd string) {
args := strings.Split(cmd, " ")
c := exec.Command(args[0], args[1:]...)
Expand All @@ -87,7 +87,7 @@ func executeCommand(cmd string) {
}
}

// triggerAction triggers an action
// triggerAction triggers an action.
func (d *Deck) triggerAction(index uint8, hold bool) {
for _, w := range d.Widgets {
if w.Key() == index {
Expand Down Expand Up @@ -132,7 +132,7 @@ func (d *Deck) triggerAction(index uint8, hold bool) {
}
}

// updateWidgets updates/repaints all the widgets
// updateWidgets updates/repaints all the widgets.
func (d *Deck) updateWidgets() {
for _, w := range d.Widgets {
w.Update(&dev)
Expand Down
2 changes: 1 addition & 1 deletion desktop_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func (x *Xorg) TrackWindows(ch chan interface{}, timeout time.Duration) {
}()
}

// ActiveWindow returns the currently active window
// ActiveWindow returns the currently active window.
func (x Xorg) ActiveWindow() Window {
return x.activeWindow
}
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ var (
brightness = flag.Uint("brightness", 80, "brightness in percent")
)

func handleActiveWindowChanged(dev streamdeck.Device, event ActiveWindowChangedEvent) {
fmt.Println(fmt.Sprintf("Active window changed to %s (%d, %s)",
event.Window.Class, event.Window.ID, event.Window.Name))
func handleActiveWindowChanged(_ streamdeck.Device, event ActiveWindowChangedEvent) {
fmt.Printf("Active window changed to %s (%d, %s)",
event.Window.Class, event.Window.ID, event.Window.Name)

// remove dupes
i := 0
Expand Down

0 comments on commit b084a17

Please sign in to comment.