Add full Linux support with KDE Plasma compatibility#3
Add full Linux support with KDE Plasma compatibility#3aditzel wants to merge 2 commits intotomups:mainfrom
Conversation
- Add Linux-specific dependencies (PyGObject, pycairo) - Implement KDE StatusNotifier workaround for icon visibility - Resize system tray icons to 64x64 for better compatibility - Add platform-specific settings handling - Fix system tray icon display on Wayland - Split requirements into platform-specific files - Document installation requirements for Linux distributions - Add comprehensive installation instructions in README - Test and verify on Arch Linux with KDE Plasma 6 Fixes system tray visibility issues on Linux desktop environments, particularly KDE Plasma running on Wayland. The application now properly displays in the system tray across all major Linux DEs. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive Linux support to the Watercooler Manager application, focusing on KDE Plasma compatibility and system tray functionality on Linux systems.
- Implements platform-specific system tray handling with special workarounds for KDE Plasma on Wayland
- Adds Linux-specific dependencies and installation instructions for multiple distributions
- Splits requirements into platform-specific files for better dependency management
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/watercooler_manager/tray.py | Implements Linux-specific system tray icon handling with KDE Plasma workarounds and icon resizing |
| src/watercooler_manager/settings.py | Adds conditional Windows-specific imports to prevent errors on Linux |
| src/main.py | Adds documentation comment about harmless deprecation warning on Linux |
| requirements-windows.txt | Creates Windows-specific dependency file |
| requirements-linux.txt | Creates Linux-specific dependency file with system integration requirements |
| README.md | Adds comprehensive installation instructions for Windows and Linux platforms |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if hasattr(self.icon, '_appindicator'): | ||
| self.icon._appindicator.set_icon(self.icon_path.name) | ||
| except: | ||
| pass |
There was a problem hiding this comment.
Using bare except clauses can hide important errors and make debugging difficult. Consider catching specific exceptions like AttributeError or ImportError instead.
| pass | |
| except (AttributeError, OSError): | |
| pass | |
| except Exception as e: | |
| # Optionally log unexpected exceptions for debugging | |
| print(f"Unexpected error in force_icon_update: {e}") |
|
|
||
| # Set the icon to active status | ||
| self.icon._appindicator.set_status(AppIndicator.IndicatorStatus.ACTIVE) | ||
| except: |
There was a problem hiding this comment.
Using bare except clauses can hide important errors and make debugging difficult. Consider catching specific exceptions like ImportError or AttributeError instead.
| except: | |
| except (ImportError, AttributeError, ModuleNotFoundError): |
| if platform.system() == 'Linux' and hasattr(self, 'icon_path'): | ||
| try: | ||
| os.unlink(self.icon_path.name) | ||
| except: |
There was a problem hiding this comment.
Using bare except clauses can hide important errors and make debugging difficult. Consider catching specific exceptions like OSError or FileNotFoundError instead.
| except: | |
| except (OSError, FileNotFoundError): |
| new_image.save(self.icon_path.name, 'PNG') | ||
| if hasattr(self.icon, '_appindicator'): | ||
| self.icon._appindicator.set_icon(self.icon_path.name) | ||
| except: |
There was a problem hiding this comment.
Using bare except clauses can hide important errors and make debugging difficult. Consider catching specific exceptions like OSError or AttributeError instead.
| except: | |
| except (OSError, AttributeError): |
| # For KDE Plasma on Linux, we need to work around pystray's icon path issue | ||
| if platform.system() == 'Linux': | ||
| # Save icon to a temporary file that persists | ||
| self.icon_path = tempfile.NamedTemporaryFile(suffix='.png', delete=False) |
There was a problem hiding this comment.
The temporary file is created but cleanup only happens in the stop() method. If the application crashes or exits unexpectedly, the temporary file will remain. Consider using a context manager or implementing cleanup in del.
| self.auto_start = autostart | ||
|
|
||
| if platform.system() == 'Windows': | ||
| if platform.system() == 'Windows' and 'winshell' in globals() and winshell: |
There was a problem hiding this comment.
The condition 'winshell' in globals() and winshell is redundant since winshell is imported at module level when on Windows. Consider simplifying to just check if winshell is not None.
| if platform.system() == 'Windows' and 'winshell' in globals() and winshell: | |
| if platform.system() == 'Windows' and winshell is not None: |
|
Thanks for the contribution! Would it be possible to add build github actions for Linux, so releases can be automatically generated like for windows? |
|
Absolutely! I’m out of town right now but I’ll add them this weekend.
…-------- Original Message --------
On Wednesday, 08/20/25 at 15:38 Tomás ***@***.***> wrote:
tomups left a comment [(tomups/watercooler-manager#3)](#3 (comment))
Thanks for the contribution! Would it be possible to add build github actions for Linux, so releases can be automatically generated like for windows?
—
Reply to this email directly, [view it on GitHub](#3 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAEUKIDXMA7ABN6OYROMA3L3OTFCVAVCNFSM6AAAAACEAU6VLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTEMBXHAYTSOBSHE).
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
✅ Added build-linux.yml - Linux-only build workflow ✅ Added build-release.yml - Cross-platform build workflow (recommended) ✅ Both workflows trigger on version tags (v*) and create releases ✅ Includes all necessary system dependencies for GTK/AppIndicator support ✅ Tested locally on Arch Linux - builds 149MB working executable ✅ Added test scripts for local validation Addresses request from @tomups for automated Linux release builds. Both Windows and Linux executables will now be built automatically when version tags are pushed. Recommendation: Use build-release.yml for unified cross-platform builds.
|
🚀 GitHub Actions for Linux builds added! I've added the requested GitHub Actions workflows for automated Linux builds: New Workflows Added1.
|
|
📋 Branch Organization Update I've organized the work into separate branches for better maintainability: 🌿 Branch Structure
|
Summary
This PR adds comprehensive Linux support to the Watercooler Manager, with special attention to KDE Plasma compatibility on Wayland systems.
Changes Made
Testing
Tested and verified on:
Installation Instructions Added
The README now includes detailed installation instructions for:
pacmancommands for system dependenciesaptcommands for required packagesdnfcommands for dependenciesEach platform has its own requirements file:
requirements.txt- Core dependencies for all platformsrequirements-linux.txt- Linux-specific Python packagesrequirements-windows.txt- Windows-specific Python packagesKnown Issues Documented
Screenshots
The application successfully runs in the system tray on KDE Plasma with full functionality.
This makes the application fully cross-platform, supporting both Windows and Linux systems!