diff --git a/linux.go b/linux.go index d39d786..7da6f36 100644 --- a/linux.go +++ b/linux.go @@ -42,7 +42,7 @@ func (t *LinuxTracker) Snap() (*Snapshot, error) { { out, err := exec.Command("bash", "-c", "xdpyinfo | grep dimensions").Output() if err != nil { - return nil, fmt.Errorf("xdpyinfo failed with error: %s. Try running `xdpyinfo | grep dimensions` to diagnose.", err) + return nil, fmt.Errorf("xdpyinfo failed with error: %w. Try running `xdpyinfo | grep dimensions` to diagnose.", err) } matches := dimRx.FindStringSubmatch(string(out)) if len(matches) != 3 { @@ -63,7 +63,7 @@ func (t *LinuxTracker) Snap() (*Snapshot, error) { { out, err := exec.Command("wmctrl", "-l").Output() if err != nil { - return nil, fmt.Errorf("wmctrl failed with error: %s. Try running `wmctrl -l` to diagnose.", err) + return nil, fmt.Errorf("wmctrl failed with error: %w. Try running `wmctrl -l` to diagnose.", err) } lines := strings.Split(string(out), "\n") for _, line := range lines { @@ -115,7 +115,7 @@ func (t *LinuxTracker) Snap() (*Snapshot, error) { for _, window := range windows { out_, err := exec.Command("xwininfo", "-id", fmt.Sprintf("%d", window.ID), "-stats").Output() if err != nil { - return nil, fmt.Errorf("xwininfo failed with error: %s", err) + return nil, fmt.Errorf("xwininfo failed with error: %w", err) } out := string(out_) x, err := parseWinDim(xRx, out, "X") @@ -144,7 +144,7 @@ func (t *LinuxTracker) Snap() (*Snapshot, error) { { out, err := exec.Command("xdotool", "getactivewindow").Output() if err != nil { - return nil, fmt.Errorf("xdotool failed with error: %s. Try running `xdotool getactivewindow` to diagnose.", err) + return nil, fmt.Errorf("xdotool failed with error: %w. Try running `xdotool getactivewindow` to diagnose.", err) } id, err := strconv.ParseInt(strings.TrimSpace(string(out)), 10, 64) if err != nil {