Initial Commit - Cat mode for windows.
This commit is contained in:
11
scripts/build_exe.ps1
Normal file
11
scripts/build_exe.ps1
Normal file
@@ -0,0 +1,11 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
python -m pip install -r requirements.txt
|
||||
|
||||
# Generate icon files in project root
|
||||
python scripts/make_icon.py
|
||||
|
||||
# Build single-file exe
|
||||
pyinstaller --noconsole --onefile --name CatMode --icon cat.ico main.py
|
||||
|
||||
Write-Host "Build complete. Find the exe in .\\dist\\CatMode.exe"
|
||||
23
scripts/make_icon.py
Normal file
23
scripts/make_icon.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
|
||||
def create_tray_image(size=256):
|
||||
img = Image.new("RGBA", (size, size), (0, 0, 0, 0))
|
||||
d = ImageDraw.Draw(img)
|
||||
d.ellipse((24, 36, size - 24, size - 12), fill=(255, 224, 189, 255), outline=(40, 40, 40, 255))
|
||||
d.polygon([(48, 48), (24, 8), (88, 36)], fill=(255, 200, 170, 255), outline=(40, 40, 40, 255))
|
||||
d.polygon([(size - 48, 48), (size - 24, 8), (size - 88, 36)], fill=(255, 200, 170, 255), outline=(40, 40, 40, 255))
|
||||
d.ellipse((88, 110, 112, 134), fill=(30, 30, 30, 255))
|
||||
d.ellipse((size - 112, 110, size - 88, 134), fill=(30, 30, 30, 255))
|
||||
d.polygon([(size // 2, 140), (size // 2 - 12, 156), (size // 2 + 12, 156)], fill=(200, 80, 80, 255))
|
||||
d.line((size // 2, 156, size // 2, 176), fill=(40, 40, 40, 255), width=4)
|
||||
d.arc((size // 2 - 30, 168, size // 2, 200), 0, 180, fill=(40, 40, 40, 255), width=4)
|
||||
d.arc((size // 2, 168, size // 2 + 30, 200), 0, 180, fill=(40, 40, 40, 255), width=4)
|
||||
return img
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
img = create_tray_image(256)
|
||||
img.save("cat.png")
|
||||
# For Windows icons, save a multi-size .ico
|
||||
img.save("cat.ico", sizes=[(256, 256), (128, 128), (64, 64), (32, 32), (16, 16)])
|
||||
Reference in New Issue
Block a user