Skip to content

Agzes/ToTray

Repository files navigation

⚠️ The utility is under development and may contain errors. ⚠️

🦀 Rust 🪶 GTK4 📂 Open-Source ❄️ Hyprland


ToTray logo

     $\Huge{\textsf{ToTray}}$ v.0.1

An automated application manager and tray utility for Hyprland.


 Installation 

 Build 

 Usage 

 CLI (limited) 

✨ Key Features

  • 🚀 Auto-Start Manager: Manage and delay application startup to ensure a smooth desktop experience.
  • 📥 Hide to Tray: Minimize any application to a ToTray tray icon, keeping your workspace clean.
  • 🪟 Workspace Rules: Automatically move specific applications to designated workspaces on launch.
  • 🛠️ Flexible Actions: Support for Close, Close2 (double-close for apps with splash screens like discord), Workspace, and HideToTray.
  • 🖥️ GUI: Configure everything through a modern GTK4 interface.
  • 🎛️ CLI: Add rules via command line. totray --help
  • 🔔 Notifications: Optional desktop notifications for background actions.
  • 📉 Low Overhead: Written in Rust for maximum performance and minimal resource usage.

📥 Installation

📦 Binary Packages

  • AppImage: Download the latest version from the Releases page. (run chmod +x ToTray-v0.1.0.AppImage and then ./ToTray-v0.1.0.AppImage and see Usage)
  • AUR:
yay -S totray

or

paru -S totray 

🛠️ Manual Installation

If you prefer to build from source, follow the instructions in the Build section.


🚀 Usage

Starting ToTray

To launch the settings GUI:

./totray

Inside the GUI, click the "Install Desktop File" button to register the application and start using ToTray.

Background Mode

To start ToTray in the background (worker mode, usually used for autostart):

./totray --worker

📦 Build

Prerequisites

You will need Rust and GTK4 development headers installed on your system.

Arch Linux

sudo pacman -S --needed base-devel gtk4 pkg-config

Fedora

sudo dnf install gtk4-devel gcc pkg-config

Ubuntu/Debian

sudo apt install build-essential libgtk-4-dev pkg-config

Building from Source

  1. Clone the repository:
    git clone https://github.com/Agzes/totray.git
    cd totray
  2. Build the release version:
    cargo build --release
  3. The binary will be available at target/release/totray.

🛠️ CLI Management

You can add rules directly from your terminal:

# Hide Firefox to tray on launch
totray --add --name "firefox" --exec "firefox" --action "tray"

# Move Spotify to workspace 11
totray --add --name "spotify" --exec "spotify" --action "workspace" --workspace 11

# Close vesktop (double close to close splash and main window)
totray --add --name "vesktop" --exec "vesktop" --action "close2"

Available CLI Arguments

  • --worker: Start only the backend worker (no GUI).
  • --add: Add a new rule via CLI.
    • --name <CLASS>: Window class name (find it via hyprctl clients).
    • --exec <CMD>: Execution command for the application.
    • --action <ACTION>: Action to perform (close, close2, workspace, tray).
    • --workspace <N>: Target workspace number (required for workspace action).
  • --config-json: Print active rules in JSON format.
  • --version-json: Print version info in JSON format.

🗑️ Correct uninstall

AppImage:

  1. Open ToTray and go to "Settings"
  2. Click "Uninstall (Remove all traces)"
  3. Remove the AppImage file.

AUR:

  1. Run yay -Rns totray or paru -Rns totray

⚙️ How it Works

ToTray monitors window events in Hyprland. When a window matching a defined Window Class appears, ToTray executes the assigned action.

  • HideToTray: Moves the window to a special workspace. The tray icon allows you to bring it back to your active workspace.
  • Auto-Start: Triggers the exec-once commands defined in your rules with an optional global delay.

📄 License

Distributed under the MIT License. See LICENSE for more information.


With ❤️ by Agzes
pls ⭐ project!

About

📥 • ToTray • AutoRun utility for hyprland

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages