Compare commits
No commits in common. "bc50f371874a64749209bfb6e650b87c4067b0e2" and "68c90481fcd0c51f1231ca3cfeba7e243042a21b" have entirely different histories.
bc50f37187
...
68c90481fc
2 changed files with 28 additions and 6 deletions
|
@ -30,7 +30,7 @@
|
||||||
default = self.packages.${pkgs.system}.hyprman;
|
default = self.packages.${pkgs.system}.hyprman;
|
||||||
hyprman = pkgs.buildGoModule {
|
hyprman = pkgs.buildGoModule {
|
||||||
pname = "hyprman";
|
pname = "hyprman";
|
||||||
version = "${self.shortRev or "dirty"}";
|
version = "unstable";
|
||||||
src = cleanSource ./.;
|
src = cleanSource ./.;
|
||||||
vendorHash = "sha256-hJwRLVIiWxLbX2tAPVVVLGFk4OaAy5qiFcICEqhVMJM=";
|
vendorHash = "sha256-hJwRLVIiWxLbX2tAPVVVLGFk4OaAy5qiFcICEqhVMJM=";
|
||||||
|
|
||||||
|
|
|
@ -74,20 +74,42 @@ func (hm *Hyprman) generateEwwClasses() {
|
||||||
|
|
||||||
func ewwBar1(cmd string) {
|
func ewwBar1(cmd string) {
|
||||||
time.Sleep(3 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
output, err := exec.Command("eww", cmd, "bar1").CombinedOutput()
|
if err := exec.Command("eww", cmd, "bar1").Run(); err != nil {
|
||||||
if err != nil {
|
log.Fatal(err)
|
||||||
notify(fmt.Sprintf("failed to %s bar 1\n\n%s\n\n%v", cmd, output, err))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hm *Hyprman) handleHyprEvent(line string) {
|
func (hm *Hyprman) handleHyprEvent(line string) {
|
||||||
s := strings.Split(line, ">>")
|
s := strings.Split(line, ">>")
|
||||||
event, _ := s[0], s[1]
|
event, _ := s[0], s[1]
|
||||||
if event == "monitoradded" {
|
switch event {
|
||||||
|
case "monitorremoved":
|
||||||
|
notify("Monitor removed closing bar1")
|
||||||
|
go ewwBar1("close")
|
||||||
|
hm.generateEwwClasses()
|
||||||
|
case "monitoradded":
|
||||||
notify("Monitor added opening bar1")
|
notify("Monitor added opening bar1")
|
||||||
go ewwBar1("open")
|
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() {
|
func (hm *Hyprman) LaunchEww() {
|
||||||
|
|
Loading…
Reference in a new issue