From 05b641bc97dea610f6fabbbf3a68c007525bcd40 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 31 May 2024 14:59:23 -0500 Subject: [PATCH] gofmt --- cmd/eww.go | 8 +++----- cmd/eww_start.go | 2 +- cmd/eww_watch.go | 2 +- cmd/mako.go | 14 ++++++-------- cmd/root.go | 24 +++++++++++------------- internal/hyprman.go | 5 ++--- internal/mako.go | 1 - 7 files changed, 24 insertions(+), 32 deletions(-) diff --git a/cmd/eww.go b/cmd/eww.go index 6e02195..4d09802 100644 --- a/cmd/eww.go +++ b/cmd/eww.go @@ -5,12 +5,10 @@ import ( ) var ewwCmd = &cobra.Command{ - Use:"eww" , - Short: "eww integration", + Use: "eww", + Short: "eww integration", } func init() { - rootCmd.AddCommand(ewwCmd) + rootCmd.AddCommand(ewwCmd) } - - diff --git a/cmd/eww_start.go b/cmd/eww_start.go index 211a22e..fc27c4d 100644 --- a/cmd/eww_start.go +++ b/cmd/eww_start.go @@ -8,7 +8,7 @@ var startCmd = &cobra.Command{ Use: "start", Short: "Launch eww", Run: func(cmd *cobra.Command, args []string) { - hm.LaunchEww() + hm.LaunchEww() }, } diff --git a/cmd/eww_watch.go b/cmd/eww_watch.go index 5c9ad61..b58680b 100644 --- a/cmd/eww_watch.go +++ b/cmd/eww_watch.go @@ -8,7 +8,7 @@ var watchCmd = &cobra.Command{ Use: "watch", Short: "Watch hyprland events and propagate to eww", Run: func(cmd *cobra.Command, args []string) { - hm.Watch() + hm.Watch() }, } diff --git a/cmd/mako.go b/cmd/mako.go index 13f7fb1..ee0c8fc 100644 --- a/cmd/mako.go +++ b/cmd/mako.go @@ -8,15 +8,13 @@ import ( ) var makoCmd = &cobra.Command{ - Use:"mako" , - Short: "mako integration", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("hahah mako baby") - }, + Use: "mako", + Short: "mako integration", + Run: func(cmd *cobra.Command, args []string) { + fmt.Println("hahah mako baby") + }, } func init() { - rootCmd.AddCommand(makoCmd) + rootCmd.AddCommand(makoCmd) } - - diff --git a/cmd/root.go b/cmd/root.go index 318732e..3d06115 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -2,12 +2,12 @@ package cmd import ( "os" + + "git.dayl.in/daylin/hyprman/internal" cc "github.com/ivanpirog/coloredcobra" - "git.dayl.in/daylin/hyprman/internal" "github.com/spf13/cobra" ) - func Execute() { cc.Init(&cc.Config{ RootCmd: rootCmd, @@ -25,22 +25,20 @@ func Execute() { } } -var configPath string -var hm = &hyprman.Hyprman{} +var ( + configPath string + hm = &hyprman.Hyprman{} +) var rootCmd = &cobra.Command{ Use: "hyprman", Short: "hyprland companion app", - PersistentPreRun: func(cmd *cobra.Command, args []string) { - hm.LoadConfig(configPath) - }, + PersistentPreRun: func(cmd *cobra.Command, args []string) { + hm.LoadConfig(configPath) + }, } - - func init() { - rootCmd.CompletionOptions.HiddenDefaultCmd = true - rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", hyprman.DefaultConfigPath(), "path to config file") + rootCmd.CompletionOptions.HiddenDefaultCmd = true + rootCmd.PersistentFlags().StringVarP(&configPath, "config", "c", hyprman.DefaultConfigPath(), "path to config file") } - - diff --git a/internal/hyprman.go b/internal/hyprman.go index c9a6f40..db0534c 100644 --- a/internal/hyprman.go +++ b/internal/hyprman.go @@ -203,7 +203,7 @@ func (hm *Hyprman) generateEwwClasses() { } func ewwBar1(cmd string) { - time.Sleep(200 * time.Second) + time.Sleep(200 * time.Second) if err := exec.Command("eww", cmd, "bar1").Run(); err != nil { log.Fatal(err) } @@ -263,7 +263,7 @@ func (hm *Hyprman) Watch() { } defer conn.Close() reader := bufio.NewReader(conn) - hm.generateEwwClasses() + hm.generateEwwClasses() for { line, err := reader.ReadString('\n') if err != nil { @@ -277,4 +277,3 @@ func (hm *Hyprman) Watch() { hm.handleHyprEvent(line) } } - diff --git a/internal/mako.go b/internal/mako.go index dfccb24..b6d5a63 100644 --- a/internal/mako.go +++ b/internal/mako.go @@ -33,4 +33,3 @@ package hyprman // log.Fatal(err) // } // } -