Skip to content

Commit 1c146e0

Browse files
authored
Merge pull request #381 from razorblade42/B1
Browser Notification Sender
2 parents 30a5b41 + 7294da2 commit 1c146e0

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from tkinter import messagebox, Tk, Label, Text, Button, END
2+
import sender
3+
4+
5+
def run():
6+
window = Tk()
7+
8+
window.title("Send Something Cool!")
9+
10+
window.geometry('420x200')
11+
12+
lbl = Label(window)
13+
14+
lbl.grid(column=0, row=0)
15+
16+
txt = Text(window, width=50, height=5)
17+
18+
txt.grid(column=2, row=2)
19+
20+
def clicked():
21+
message = (txt.get("1.0", END))
22+
sender.send(message)
23+
txt.delete("1.0", END)
24+
25+
messagebox.showinfo("Information",
26+
"Your message sent successfully to all linked Devices!")
27+
28+
btn = Button(window, text="Send", command=clicked, bg="lightgreen", )
29+
30+
btn.grid(column=2, row=4, ipadx=30, ipady=5, pady=10)
31+
32+
window.mainloop()

browser_notification_sender/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Browser Notification Sender
2+
3+
This python program will send sends browser notifications to other linked devices from your device using .
4+
5+
## Installation
6+
7+
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install following dependencies.
8+
9+
```bash
10+
pip install notify2
11+
pip install notify-run
12+
pip install tkinter
13+
```
14+
Now we have to register a channel for it.
15+
To create simply type
16+
17+
```bash
18+
notify-run register
19+
```
20+
in your CLI , you will be getting something like below.
21+
22+
<img width="616" alt="68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f6e6f746966792d72756e2f6e6f746966792e72756e2f6d61737465722f70795f636c69656e742f73637265656e73686f74732f72656769737465722e706e67" src="https://user-images.githubusercontent.com/60290431/130251692-be8f8567-43f2-4792-bc17-01b82100827f.png">
23+
24+
Now open the link which you got in any device you want to link and click "Subscribe on this device" (see below). that's it!
25+
![12](https://user-images.githubusercontent.com/60290431/130252214-b80581a6-2782-4daa-a143-9c0633648385.png)
26+
27+
28+
For more info go to https://pypi.org/project/notify-run/
29+
30+
## Usage
31+
Now to use this application simply execute "main.py",
32+
a GUI will open where you can type your message and this message will be prompt as a browser notification to all linked devices.
33+
34+
![Annotation 2021-08-20 202439](https://user-images.githubusercontent.com/60290431/130252428-dabdf8f5-dcfa-4fc1-9aa2-1cd96d04cf17.jpg)
35+
36+
37+
## License
38+
[MIT](https://choosealicense.com/licenses/mit/)

browser_notification_sender/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import GUI_components
2+
3+
GUI_components.run()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
notify2
2+
notify-run
3+
tkinter

browser_notification_sender/sender.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from notify_run import Notify
2+
3+
notify = Notify()
4+
5+
6+
def send(message):
7+
notify.send(message)

0 commit comments

Comments
 (0)