Skip to content

Commit

Permalink
refactor: use super() without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasva committed Feb 18, 2024
1 parent acf5a02 commit 7fb499e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions notification-center-menubar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import os
import rumps


class NotificationCounter(rumps.App):

def __init__(self):
super(NotificationCounter, self).__init__("NotificationCounter", title="Counting", icon=None)
super().__init__("NotificationCounter", title="Counting", icon=None)

def get_notification_count(self):
user_dir = os.popen("getconf DARWIN_USER_DIR").read().strip()
Expand All @@ -14,15 +16,16 @@ def get_notification_count(self):
return count

@rumps.timer(5)
def a(self, sender):
def a(self, _sender_):
notification_count = self.get_notification_count()
circled_zero = ord("⓿")
circled_one = ord("❶")
if (notification_count == 0):
if notification_count == 0:
circled_number = chr(circled_zero + notification_count)
else:
circled_number = chr(circled_one + notification_count - 1)
self.title = circled_number


if __name__ == "__main__":
NotificationCounter().run()

0 comments on commit 7fb499e

Please sign in to comment.