#!/usr/bin/env python3

import os
from PIL import Image
import pystray


png_file = "/usr/share/breaktime/data/stop.png"

# Load the image
image = Image.open(png_file)

def script1():
    os.popen("pkill -f /usr/share/breaktime/data/notify/Stop & rm -f /tmp/tmp* & pkill -SIGKILL breaktime > /dev/null 2>&1")

# Create a tray icon with mouse-over description
menu_items = [
    pystray.MenuItem("Quit", script1)
]

icon = pystray.Icon("stop", image, menu=pystray.Menu(*menu_items), hover_text="Stop")
icon.run()


