Compare commits
2 commits
68c90481fc
...
bc50f37187
Author | SHA1 | Date | |
---|---|---|---|
bc50f37187 | |||
95e640c9e8 |
2 changed files with 6 additions and 28 deletions
|
@ -30,7 +30,7 @@
|
|||
default = self.packages.${pkgs.system}.hyprman;
|
||||
hyprman = pkgs.buildGoModule {
|
||||
pname = "hyprman";
|
||||
version = "unstable";
|
||||
version = "${self.shortRev or "dirty"}";
|
||||
src = cleanSource ./.;
|
||||
vendorHash = "sha256-hJwRLVIiWxLbX2tAPVVVLGFk4OaAy5qiFcICEqhVMJM=";
|
||||
|
||||
|
|
|
@ -74,42 +74,20 @@ func (hm *Hyprman) generateEwwClasses() {
|
|||
|
||||
func ewwBar1(cmd string) {
|
||||
time.Sleep(3 * time.Second)
|
||||
if err := exec.Command("eww", cmd, "bar1").Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
output, err := exec.Command("eww", cmd, "bar1").CombinedOutput()
|
||||
if err != nil {
|
||||
notify(fmt.Sprintf("failed to %s bar 1\n\n%s\n\n%v", cmd, output, err))
|
||||
}
|
||||
}
|
||||
|
||||
func (hm *Hyprman) handleHyprEvent(line string) {
|
||||
s := strings.Split(line, ">>")
|
||||
event, _ := s[0], s[1]
|
||||
switch event {
|
||||
case "monitorremoved":
|
||||
notify("Monitor removed closing bar1")
|
||||
go ewwBar1("close")
|
||||
hm.generateEwwClasses()
|
||||
case "monitoradded":
|
||||
if event == "monitoradded" {
|
||||
notify("Monitor added opening bar1")
|
||||
go ewwBar1("open")
|
||||
hm.generateEwwClasses()
|
||||
case "workspace",
|
||||
"focusedmon",
|
||||
"activewindow",
|
||||
"createworkspace",
|
||||
"destroyworkspace",
|
||||
"moveworkspace",
|
||||
"renameworkspace",
|
||||
"openwindow",
|
||||
"closewindow",
|
||||
"movewindow",
|
||||
"movewindowv2",
|
||||
"changefloatingmode",
|
||||
"windowtitle",
|
||||
"togglegroup",
|
||||
"moveintogroup",
|
||||
"moveoutofgroup",
|
||||
"configreloaded":
|
||||
hm.generateEwwClasses()
|
||||
}
|
||||
hm.generateEwwClasses()
|
||||
}
|
||||
|
||||
func (hm *Hyprman) LaunchEww() {
|
||||
|
|
Loading…
Reference in a new issue