Skip to content

Commit

Permalink
add notification sound
Browse files Browse the repository at this point in the history
  • Loading branch information
sharl committed Oct 17, 2024
1 parent 8be870f commit 7553351
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Create executable file with pyinstaller and zip
run: |
pyinstaller ADFmonitor.py --onefile --noconsole --icon .\Assets\sample.ico
pyinstaller ADFmonitor.py --onefile --noconsole --icon Assets/sample.ico --add-data Assets/nc308516.mp3:Assets
pushd dist
Compress-Archive -Path . -DestinationPath ${{ github.event.repository.name }}-${{ env.VERSION }}.zip
popd
Expand Down
9 changes: 8 additions & 1 deletion ADFmonitor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
import os
import sys
import io
import time
import threading
Expand Down Expand Up @@ -120,7 +122,12 @@ def doCheck(self):
print(now, titles[target], 'icon updated')

if target == '19':
notify(TITLE, titles[target])
def resource_path(path):
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS, path)
return os.path.join(os.path.abspath('.'), path)

notify(titles[target], app_id=TITLE, audio=resource_path('Assets/nc308516.mp3'))

def runSchedule(self):
schedule.every().day.at('06:00').do(self.updatePage)
Expand Down
Binary file added Assets/nc308516.mp3
Binary file not shown.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ python ADFmonitor.py
Drawn by Microsoft Copilot

アイコン募集中です

## sound
【効果音】風鈴の音1_チリン - ニコニ・コモンズ
https://commons.nicovideo.jp/works/nc308516

0 comments on commit 7553351

Please sign in to comment.