add cross-platform build and installer support - #201
Draft
asimfarooq5 wants to merge 7 commits into
Draft
Conversation
asimfarooq5
force-pushed
the
add-cross-platform-support
branch
2 times, most recently
from
August 10, 2026 15:12
77f4ef6 to
ba4085f
Compare
asimfarooq5
marked this pull request as draft
August 11, 2026 09:45
Add PHONY markers, go-build/go-run macros, and a build/run target for each binary, plus an install target that dispatches to install.ps1 on Windows and install.sh everywhere else.
Extend the goreleaser build matrix to darwin/windows and package windows archives as zip. install.sh gains OS detection and a launchd agent installer for macOS alongside the existing systemd path; install.ps1 is a new installer for Windows that installs to %LOCALAPPDATA%\deskconn and registers deskconnd as a service via NSSM.
Add MachineID() with linux/darwin/windows implementations (machine-id file, IOPlatformUUID via ioreg, and the MachineGuid registry key respectively) and switch attach.go, mdns.go, and deskconnd's main to use it instead of reading /etc/machine-id directly, which doesn't exist outside Linux.
creack/pty has no real Windows implementation (StartWithSize just returns ErrUnsupported there), so interactive shell/exec sessions failed outright on Windows. go-pty provides a unified pty.Pty interface backed by ConPTY on Windows and a real UnixPty escape hatch (Master().SyscallConn()) for the ioctl-based busy detection shell.go still needs on Unix. Move the foreground-pgid check and the default shell (bash vs powershell.exe) into shell_unix.go/ shell_windows.go, matching the existing per-OS split.
Move the existing GNOME/dconf/GSettings/MATE/Cinnamon/KDE lookup logic into wallpaper_linux.go, guarding readSetting against a nil session bus so it fails cleanly instead of panicking where D-Bus isn't available. Add real wallpaper-path lookups for Windows (WallPaper registry value) and macOS (osascript System Events query). wallpaper.go keeps only the OS-agnostic struct, loading, and HTTP handlers.
Move the existing D-Bus lock-provider based Lock/IsLocked into screen_linux.go. Add real implementations for Windows (LockWorkStation via user32) and macOS (CGSession -suspend); neither platform exposes a lock-state query, so IsLocked returns an explicit unsupported error there. Also guard NewScreen's lock-provider probe and SetBrightness against a nil session/system bus. Fix screen_test.go along the way: TestLock was actually locking the running machine's screen as a side effect on non-Linux platforms during `go test`, and TestIsLocked asserted a Linux-only error message regardless of GOOS.
deskconnd's system/session bus connect calls are now non-fatal on Windows/macOS (previous commits), which left every *dbus.Conn user open to a nil-pointer panic at runtime. Guard mpris.go's object lookups and CaptureScreenshot against a nil conn, returning a descriptive error instead.
asimfarooq5
force-pushed
the
add-cross-platform-support
branch
from
August 11, 2026 13:34
ba4085f to
82d4e0d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.