Skip to content

luisbocanegra/kwin-minimize2tray

Repository files navigation

KWin Minimize2Tray

This is work in progress, don't expect feature parity with other implementations right away

Hide windows to the system tray, similar to KDocker but in the form of a KWin Script that works on Wayland.

preview

Important

Some applications like Google Chrome or Chromium/Electron based may run in Xwayland mode and have issues hiding from taskbar or minimizing on startup, enabling native Wayland support for them can help. Usually setting an environment variable or command-line argument with KDE's kmenuedit is needed, refer to Wayland - ArchWiki or search "linux APP_NAME enable wayland support".

To verify if an application is running on Xwayland instead of Wayland use the KWin Debug Console. wayland

Features

  • Wayland support (X11 hasn't been tested, let me know if it works)
  • Should work with windows from any application as long as they are minimizable
  • Windows are hidden from Task Manager (taskbar), Task Switcher (Alt+Tab), Desktop Pager and restored when clicking on the tray icon
  • Per application visibility can be configured from System Tray widget configuration
  • Application and window status
    • Unity LauncherAPI

      • Counter: Top-right corner (optional dot style can be enabled from KWin script settings)
      • Progress bar: Green bottom bar
      • Urgent: Sets NeedsAttention status of icon

      LauncherAPI doesn't specify a window so all hidden windows from the same application will get the same status

    • Demands attention from KWin also sets NeedsAttention status of icon per window

Installation

No KDE Store this time as the C++ plugin needs to be compiled manually

You will need to install any required dependencies

git clone https://github.com/luisbocanegra/kwin-minimize2tray.git
cd kwin-minimize2tray
./install.sh

Immutable distributions

  1. Run ./install-immutable.sh to install

  2. Add QML_IMPORT_PATH environment variable for the C++ plugin to work:

    Create the file ~/.config/plasma-workspace/env/path.sh (and folders if they don't exist) with the following:

    export QML_IMPORT_PATH="$HOME/.local/lib64/qml:$HOME/.local/lib/qml:$QML_IMPORT_PATH"
  3. Log-out or reboot to apply the change

Configuration/Usage

Enable/disable

  1. Minimize to tray from System Settings > Window Management > KWin Scripts

By default the shortcut is set to Meta+Alt+PgDown, to change it:

  1. System Settings > Keyboard > Shortcuts
  2. From the list on the left select KWin
  3. Search for "Minimize window to tray" and change it to whatever you prefer

Acknowledgements

Unity LauncherAPI implementation is a simplified version of KDE/plasma-desktop/applets/taskmanager/plugin/smartlaunchers

Support the development

If you like what I do consider donating/sponsoring this and my other open source work

GitHub Sponsors Ko-fi "Buy Me A Coffee" Liberapay PayPal

About

Hide windows to the system tray, similar to KDocker but in the form of a KWin Script that works on Wayland

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors