Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down