Compare commits

..

No commits in common. "f698f2614e8cadbe0abf18b15f79182ede7f17e7" and "42ac8bee8c3fc78f6a8a2d3aee11a62c63bc556a" have entirely different histories.

7 changed files with 32 additions and 24 deletions

View file

@ -5,13 +5,12 @@ import (
)
var ewwCmd = &cobra.Command{
Use: "eww",
Short: "eww integration",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
hm.LoadConfig(configPath)
},
Use:"eww" ,
Short: "eww integration",
}
func init() {
rootCmd.AddCommand(ewwCmd)
rootCmd.AddCommand(ewwCmd)
}

View file

@ -8,7 +8,7 @@ var startCmd = &cobra.Command{
Use: "start",
Short: "Launch eww",
Run: func(cmd *cobra.Command, args []string) {
hm.LaunchEww()
hm.LaunchEww()
},
}

View file

@ -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()
},
}

View file

@ -8,13 +8,15 @@ 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)
}

View file

@ -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,17 +25,22 @@ func Execute() {
}
}
var (
configPath string
hm = &hyprman.Hyprman{}
)
var configPath string
var hm = &hyprman.Hyprman{}
var rootCmd = &cobra.Command{
Use: "hyprman",
Short: "hyprland companion app",
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")
}

View file

@ -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,3 +277,4 @@ func (hm *Hyprman) Watch() {
hm.handleHyprEvent(line)
}
}

View file

@ -33,3 +33,4 @@ package hyprman
// log.Fatal(err)
// }
// }