summaryrefslogtreecommitdiff
path: root/showAll.go
diff options
context:
space:
mode:
Diffstat (limited to 'showAll.go')
-rw-r--r--showAll.go46
1 files changed, 46 insertions, 0 deletions
diff --git a/showAll.go b/showAll.go
new file mode 100644
index 0000000..12ff602
--- /dev/null
+++ b/showAll.go
@@ -0,0 +1,46 @@
+package main
+
+import (
+ "bufio"
+ "fmt"
+ "os/exec"
+ "strings"
+)
+
+func main() {
+ cmd := exec.Command("wmctrl", "-lG")
+ stdout, err := cmd.StdoutPipe()
+ if err != nil {
+ fmt.Println("Failed to get stdout pipe:", err)
+ return
+ }
+
+ if err := cmd.Start(); err != nil {
+ fmt.Println("Failed to start wmctrl:", err)
+ return
+ }
+
+ scanner := bufio.NewScanner(stdout)
+ for scanner.Scan() {
+ line := scanner.Text()
+ if strings.Contains(line, "jcarr@framebook") {
+ fields := strings.Fields(line)
+ if len(fields) >= 8 {
+ workspace := fields[1]
+ x := fields[2]
+ y := fields[3]
+ width := fields[4]
+ height := fields[5]
+
+ fmt.Printf("Terminal Window Found:\n")
+ fmt.Printf(" Geometry: X=%s, Y=%s, Width=%s, Height=%s\n", x, y, width, height)
+ fmt.Printf(" Workspace: %s\n", workspace)
+ fmt.Println("---")
+ }
+ }
+ }
+
+ if err := cmd.Wait(); err != nil {
+ fmt.Println("wmctrl command failed:", err)
+ }
+}