gogetwindow/getwindow/getwindow.go

15 lines
252 B
Go
Raw Normal View History

2022-12-24 21:50:09 +00:00
//go:build linux
// +build linux
package getwindow
import "os/exec"
func GetWindow() (string, error) {
2022-12-24 22:49:30 +00:00
win, err := exec.Command("xdotool", "getactivewindow", "getwindowname").Output()
2022-12-24 21:50:09 +00:00
if err != nil {
return "", err
}
return string(win), nil
}