Skip to content
Snippets Groups Projects
Unverified Commit 15474742 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Initial click handler.

parent e100c988
No related branches found
No related tags found
No related merge requests found
...@@ -3,25 +3,42 @@ ...@@ -3,25 +3,42 @@
package bar package bar
import ( import (
"bufio"
"fmt" "fmt"
"os"
"time" "time"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
func handleCommands() {
logger, err := os.Create("/tmp/i3going-on.log")
if err != nil {
panic(err)
}
scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() {
logger.WriteString(scanner.Text())
}
}
// Run is essentially the main program. // Run is essentially the main program.
func Run(cmd *cobra.Command, args []string) { func Run(cmd *cobra.Command, args []string) {
go handleCommands()
fmt.Printf(`{ "version": 1, "stop_signal": %d, "cont_signal": %d, "click_events": true }`+"\n", fmt.Printf(`{ "version": 1, "stop_signal": %d, "cont_signal": %d, "click_events": true }`+"\n",
unix.SignalNum("SIGSTOP"), unix.SignalNum("SIGCONT")) unix.SignalNum("SIGSTOP"), unix.SignalNum("SIGCONT"))
fmt.Println("[") fmt.Println("[")
for { for {
fmt.Printf(` [ fmt.Printf(` [
{ {
"name": "color",
"full_text": "RED", "full_text": "RED",
"color": "#11ff11" "color": "#11ff11"
}, },
{ {
"name": "bland",
"full_text": "default" "full_text": "default"
} }
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment