Massive commit

This commit is contained in:
Allen
2023-08-01 02:20:48 -05:00
parent 81f2796b9b
commit dedec1c61d
4 changed files with 36 additions and 2 deletions

10
main.go
View File

@ -13,8 +13,14 @@ func main() {
os.Exit(1)
}
conn.BusObject().Call("org.freedesktop.DBus.AddMatch", 0,
"type='signal',path='/org/xmonad/Log',interface='org.xmonad.Log',member='Update'")
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "Missing screen_id argument, rerun as \"xmonad-log screen_id\" ex: xmonad-log 0")
os.Exit(1)
}
args := fmt.Sprintf("type='signal',path='/org/xmonad/Log%s',interface='org.xmonad.Log',member='Update'", os.Args[1])
conn.BusObject().Call("org.freedesktop.DBus.AddMatch", 0, args)
c := make(chan *dbus.Signal, 10)
conn.Signal(c)