Skip to content

Commit

Permalink
first release
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliangzhong committed Aug 24, 2023
1 parent 3039aff commit e6811fa
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
19 changes: 11 additions & 8 deletions FocusZen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import tkinter as tk
from datetime import datetime, timedelta, time
from datetime import datetime, timedelta
import os
import re
import platform
Expand Down Expand Up @@ -62,11 +62,11 @@ def __init__(self, root, schedule):
icon_path = os.path.join(os.path.dirname(__file__), 'icon.png')
img = tk.PhotoImage(file=icon_path)
root.tk.call('wm', 'iconphoto', root._w, img)
system = platform.system()
system = platform.system() == 'Linux'

# Set up fonts
big_font = ("Ubuntu Regular", 24) if system == "Linux" else ("Roboto", 24)
small_font = ("Ubuntu Regular", 15) if system == "Linux" else ("Roboto", 15)
big_font = ("Ubuntu Regular", 24) if system else ("Helvetica", 24)
small_font = ("Ubuntu Regular", 15) if system else ("Helvetica", 15)

self.root_ = root
self.schedule_ = schedule
Expand All @@ -82,8 +82,7 @@ def __init__(self, root, schedule):
self.text_widget_.bind('<BackSpace>', lambda _: self.text_widget_.config(height=self.text_widget_.index('end-2c').split('.')[0]))
self.text_widget_.bind('<Button-1>', lambda _: self.text_widget_.config(insertbackground='black'))
self.text_widget_.bind('<FocusOut>', lambda _: self.text_widget_.config(insertbackground='white'))
self.text_widget_.insert("1.0", "Notes:")
self.save_button_ = tk.Button(root, text="\U0001F4BE", width=1, height=1, font=small_font, command=self.save_to_file)
self.save_button_ = tk.Button(root, text="\U0001F4BE", width=1, height=1 if system else 2, font=small_font, command=self.save_to_file)
# if emoji won't show up, $ sudo apt install unifont

self.countdown_checkbox_var_ = tk.IntVar()
Expand Down Expand Up @@ -131,6 +130,9 @@ def __init__(self, root, schedule):
self.label_top_.config(text="Early bird catches the worm! Have a nice day! \U0001F423")
self.time_after_ = self.schedule_[0][0]

# set text widget width as the width of top label
self.text_widget_.config(width=len(self.label_top_.cget("text")))

# other configs
self.current_date_ = datetime.now().date() # assume constant (don't stay up past midnight for your own good)
self.pomodoro_end_time_ = None
Expand Down Expand Up @@ -199,8 +201,9 @@ def save_to_file(self):
content = self.text_widget_.get("1.0", "end-1c")
current_date_and_time = datetime.now().strftime("%d/%m/%Y %H:%M:%S")
with open("notebook.txt", "a") as file:
file.write("[" + current_date_and_time + "] " + content + "\n")

file.write("[" + current_date_and_time + "]\n" + content + "\n")
self.text_widget_.delete("1.0", "end-1c")
self.text_widget_.config(height=1)

def main():
schedule = clean()
Expand Down
1 change: 1 addition & 0 deletions FocusZen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
nohup python3 FocusZen.py &
sleep 0.25
rm nohup.out
exit
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 15 additions & 9 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
![Screenshot from 2023-08-23 11-12-27](https://github.com/yuliangzhong/FocusZen/assets/39910677/6570eec9-105c-4556-9bf0-6c61523f7f1d)
<p align="center">
<img width="444" alt="Screenshot" src="https://github.com/yuliangzhong/FocusZen/assets/39910677/f9f6cba5-b08e-4bb6-aaae-62070a0bbbaf">
</p>

# FocusZen: Boost Your Focus and Get Stuff Done!
# FocusZen: Amplify Your Focus. Amplify Your Productivity.

Attention is key to success. In a world full of distractions, staying focused matters more than ever. That's where FocusZen comes in – your go-to partner for better focus and getting things done.
In a world overflowing with distractions, staying focused matters more than ever. That's where FocusZen comes in – your ultimate tool to conquer tasks.

FocusZen uses **three techniques** to help you focus better:
### FocusZen uses **four techniques** to help you focus better:

1. **Countdown Mastery**: Feel the power of countdowns. See your time visually, feel a rush to finish tasks, and keep your mind on track.
2. **Pomodoro Technique**: Try the famous Pomodoro technique. Work focused, then take short breaks. Stay productive and keep a healthy work-life balance.
3. **Idea Flash Notes**: Even good ideas can be distractions. Capture your bright thoughts effortlessly and put them down before they vanish. This way, FocusZen helps you stay on track while never losing those valuable flashes of insight.
1. **Single Task Spotlight**: Define your daily schedule in .txt or .md files (e.g. example_schedule.md). FocusZen only displays you the current task, so you can focus on one thing at a time.
2. **Countdown Mastery**: Feel the power of countdowns. See your remaining time visually, feel a rush to finish tasks, and keep your mind on track.
3. **Pomodoro Tick**: Try the famous Pomodoro technique. 25 minutes of pure focus, followed by a 5-minute break. Stay productive and keep a healthy work-life balance.
4. **Idea Capture**: Worried of losing inspirations, but feeling distractive of keeping them in mind? With FocusZen, Capture your bright thoughts effortlessly and put them down before they vanish. You can press "save" button to store them in a notebook, or just keep them in the text widget. Now, you stay on track again while never losing those valuable flashes of insight.

### A note from the author:
"Zen," deeply rooted in Chinese culture, represents a philosophy of balance and harmony. Drawing from ancient wisdom, it encapsulates the art of living in the present moment and embracing simplicity to attain a serene mind. Just as a tranquil garden reflects the essence of Zen, FocusZen captures this essence digitally. Rediscover the serenity of Chinese wisdom in a modern context with FocusZen –

**Where Distractions Dissolve, and Zen Emerges.**

## How to install?
## Easy to play!
```git clone [email protected]:yuliangzhong/FocusZen.git```

```cd ~/FocusZen```

```./FocusZen.sh && exit```
```./FocusZen.sh```

Enjoy :)

0 comments on commit e6811fa

Please sign in to comment.