Skip to main content

A customizable PyQt6 notification library based on a Telegram-like design.

Project description

PyQt Custom Notification Library

A highly customizable PyQt6 notification system, inspired by Telegram's desktop notifications.

Features

  • Customizable Appearance: Easily change the background color of notifications.
  • Customizable Buttons: Change the text and action of the 'Reply' button.
  • Customizable Hide All: Change the text and color of the 'Hide all' button.
  • Sound Support: Plays a custom sound (msr.mp3) upon notification display using mpg123 (must be installed separately).
  • Queuing System: Manages multiple notifications gracefully.
  • Animation: Smooth fade-in and fade-out animations.

Installation

Since this is a custom library, you would typically install it from a local source or a private repository.

Dependencies

You must have PyQt6 installed. For sound support, you need the mpg123 player installed on your system.

# Install PyQt6
pip install PyQt6

# Install mpg123 (Linux example)
sudo apt-get install mpg123

Usage

import sys
from PyQt6.QtWidgets import QApplication
from pyqt_custom_notify import get_manager

def main():
    app = QApplication(sys.argv)
    manager = get_manager()

    # 1. Set global customizations
    manager.set_customization(
        default_bg_color="#1E1E1E", # Darker background
        default_reply_text="Action", # Change 'Reply' text
        hide_all_text="Close All", # Change 'Hide all' text
        hide_all_color="#FF5733" # Change 'Hide all' text color to orange
    )

    # 2. Connect to the reply signal
    def handle_reply(title: str, message: str):
        print(f"Custom Action triggered for: {title} Message: {message}")
    
    manager.notificationReplied.connect(handle_reply)

    # 3. Send a custom notification
    manager.sendNotification(
        user_pic_path="userpic1.png", # Image from the resources folder
        title="Custom Title",
        message="This is a fully customized notification!",
        bg_color="#333333", # Override default background for this specific notification
        reply_text="Click Me" # Override default reply text for this specific notification
    )

    # 4. Send a default notification
    manager.sendNotification(
        user_pic_path="userpic2.png",
        title="Default Notification",
        message="This uses the global default settings."
    )

    sys.exit(app.exec())

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biontfy-1.0.0.tar.gz (410.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biontfy-1.0.0-py3-none-any.whl (409.3 kB view details)

Uploaded Python 3

File details

Details for the file biontfy-1.0.0.tar.gz.

File metadata

  • Download URL: biontfy-1.0.0.tar.gz
  • Upload date:
  • Size: 410.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for biontfy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e1fd69fe03391bf79beaec4ee68284960f15e11b976aa17675eb6f67dd741882
MD5 f8a76ddca98b60ea50dfb8f54ab2aa5a
BLAKE2b-256 daf9fbf4e9767ea3a26b9a03430f139aa0d1dcb9bbc743a930144ca790d8e01f

See more details on using hashes here.

File details

Details for the file biontfy-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: biontfy-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 409.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for biontfy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77d1ae632aa718c33f5f93119c3a2fefeb799e9c34e6ebb7e633e3119bfa9d4d
MD5 028e33f6260aa08f4e60c3977e9f3efe
BLAKE2b-256 d38d4c65f1d17ae511633cc1d57062ec8f09f5a3bec5031421a8b1972bade731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page