dpswitch is a lightweight system tray application written in Go that allows you to quickly toggle your monitors on and off. It is particularly useful for multi-monitor setups where you frequently need to enable or disable specific displays without diving into system settings.
- System Tray Integration: Resides in your system tray for quick access.
- Real-time Status: Displays the current state (enabled/disabled) of your connected monitors.
- Quick Toggle: Enable or disable displays with a single click.
- KDE Plasma Support: Currently supports KDE Plasma environments using
kscreen-doctor. - Automatic Updates: Periodically polls for display changes to keep the menu up to date.
- Go: Version 1.16 or higher is recommended.
- KDE Plasma: The application currently targets KDE environments.
- kscreen-doctor: Ensure
kscreen-doctoris installed (usually part of KDE Plasma's display management). - Fyne Dependencies: Since it uses the Fyne toolkit, you may need certain system libraries installed (e.g.,
libgl1-mesa-dev,xorg-devon Linux). See Fyne's Getting Started for details.
-
Clone the repository:
git clone https://github.com/yourusername/dpswitch.git cd dpswitch -
Build and Install: You can use the provided
Makefileto build and install the application as a systemd user service.make install
This will:
- Build the binary.
- Install it to
~/.local/bin/. - Setup a systemd user service in
~/.config/systemd/user/dpswitch.service. - Enable the service.
-
Start the service:
systemctl --user start dpswitch.service
To check the status:
systemctl --user status dpswitch.service
-
Uninstall: To remove the application and the service:
make uninstall
Once launched, an icon will appear in your system tray.
- Click the tray icon to see a list of connected monitors.
- A checkmark indicates the monitor is currently enabled.
- Click on a monitor's name to toggle its state.
- Note: The primary monitor is usually protected from being disabled via the menu to prevent accidental loss of all displays.
The project structure is organized as follows:
main.go: Entry point and tray initialization.cmd/: Core logic for menu handling and display management.cmd/display-tools/: Interfaces and implementations for different display configuration tools (currently supportingkscreen-doctor).assets/: Icons and logos used by the application.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.