Skip to content

Agzes/ToTray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

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