diff options
author | Coodos | 2021-01-25 19:39:04 +0530 |
---|---|---|
committer | Coodos | 2021-01-25 19:39:04 +0530 |
commit | 1cba575fe2553c30f507b9715fd05f3645f8eebc (patch) | |
tree | 23ecb1bba2416e6e2b8416ec419645c0790a889d | |
download | aur-1cba575fe2553c30f507b9715fd05f3645f8eebc.tar.gz |
release 1
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 31 | ||||
-rw-r--r-- | pymodoro | 1 | ||||
-rw-r--r-- | pymodoro.py | 60 |
4 files changed, 109 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d652c35fe9c5 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = pymodoro + pkgdesc = A very smol podoro timer written in python 3 + pkgver = 1 + pkgrel = 1 + url = https://github.com/coodos/pymodoro/ + arch = any + license = GPL V2 + depends = alsa-utils + depends = dunst + depends = python3 + source = pymodoro.py + source = pymodoro + md5sums = d48b705ec381703cc729a6581125718c + md5sums = 06b6b426e2dd1672fa1091c65f714399 + +pkgname = pymodoro + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..0bc1e997b366 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,31 @@ +pkgname=pymodoro +pkgver=1 +pkgrel=1 +pkgdesc="A very smol podoro timer written in python 3" +arch=('any') +license=('GPL V2') +depends=('alsa-utils' + 'dunst' + 'python3' +) + +url="https://github.com/coodos/pymodoro/" +source=('pymodoro.py' + 'pymodoro' +) + +md5sums=('d48b705ec381703cc729a6581125718c' + '06b6b426e2dd1672fa1091c65f714399' +) + +prepare () { + sudo pip install pyinstaller + pyinstaller --onefile pymodoro.py + cd ./dist/ + rm ../pymodoro + mv pymodoro ../ +} + +package() { + install -D $srcdir/pymodoro $pkgdir/usr/bin/$pkgname +} diff --git a/pymodoro b/pymodoro new file mode 100644 index 000000000000..0b7b2cd5bcc2 --- /dev/null +++ b/pymodoro @@ -0,0 +1 @@ +Dummy pymodoro file diff --git a/pymodoro.py b/pymodoro.py new file mode 100644 index 000000000000..326641c69f96 --- /dev/null +++ b/pymodoro.py @@ -0,0 +1,60 @@ +# add modules here +import time as timemod +import os +import argparse + +class pomodoro(): + + def __init__(self, workTime, breakTime): + self.workTime = workTime + self.breakTime = breakTime + self.startPomodoro() + + def startPomodoro(self): + counter = 1 + while True: + if (counter % 2 == 1): + print(f"Pomodoro Cycle {counter}") + codeUtils.timer(self.workTime, True) + elif (counter % 8 == 0): + codeUtils.timer(self.workTime, True) + else: + codeUtils.timer(self.breakTime, False) + counter += 1 + +class codeUtils(): + + @staticmethod + def timer(time, isWorking): + time *= 60 + while time: + mins, secs = divmod(time, 60) + timer = '{:02d}:{:02d} remain'.format(mins, secs) + print(timer, end='\r ') + timemod.sleep(1) + time -= 1 + print() + # Return the control back + + if (isWorking): + os.system('notify-send " Work over!!! Have smol break ^^"') + else: + os.system('notify-send " Break over, get back to work mate"') + return + + # To Do + # Add Help Functionality + @staticmethod + def getHelp(): + pass + +if __name__ == "__main__": + try: + parser = argparse.ArgumentParser() + parser.add_argument("workTime", help = "Work Time (Minutes), set the work time param to the time you want to work for", type = int) + parser.add_argument("breakTime", help = "Break Time (Minutes), set the break time param to the longevity of your smol break time", type = int) + args = parser.parse_args() + newPomodoroTimer = pomodoro(args.workTime, args.breakTime) + except Exception as error: + print("Some error occured while parsing arguments, defaulting to 25 minutes, 5 minutes pomodoro") + newPomodoroTimer = pomodoro(25, 5) |