Skip to content

Commit

Permalink
Merge pull request #24 from kmchmk/issue-7-Support_for_Ubuntu_and_Mac_OS
Browse files Browse the repository at this point in the history
Change credential cache path to support MacOS and update README
  • Loading branch information
kmchmk authored Aug 18, 2021
2 parents cb84b41 + 100a933 commit 2ca483a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ __pycache__/
*.exe
*.spec
build/*
dist/*
dist/*
.DS_Store
3 changes: 2 additions & 1 deletion SLT_Usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from tkinter import *
import platform
import sys
import os.path

from requests.models import Response

Expand All @@ -31,7 +32,7 @@

class CredentialManager:

CREDENTIALS_FILE_NAME = 'credentials.json'
CREDENTIALS_FILE_NAME = os.path.join(os.path.expanduser("~"), '.slt_usage.cache')
AUTH_URL = "https://omniscapp.slt.lk/mobitelint/slt/sltvasoauth/oauth2/token"

def __init__(self):
Expand Down
25 changes: 18 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ This program can get your SLT data usage and display it in the system tray.
![Summary](https://user-images.githubusercontent.com/12431727/128629535-049ef77a-0754-4616-993e-41b22bf6ff69.png) | ![SLT Usage Report](https://user-images.githubusercontent.com/12431727/128629534-794db86c-1296-46d4-b0c9-106e5fe4d152.png)
_Summary is always visible_ | _Hover over to see the full report_

Tested only on Windows 10.
_For OSX see [@kaveenr](https://gist.github.com/kaveenr/a820616adf2f5d9d82db1b1250bf15f3#file-readme-md)'s script._
Tested on Windows (10) and MacOS (Big Sur).
_For OSX Xbar plugin, see [@kaveenr](https://gist.github.com/kaveenr/a820616adf2f5d9d82db1b1250bf15f3#file-readme-md)'s script._

--------------------------------------

Expand All @@ -16,23 +16,34 @@ _For OSX see [@kaveenr](https://gist.github.com/kaveenr/a820616adf2f5d9d82db1b12
#### How to install to run forever:

Prerequisites:
* Windows 10 machine
* SLT broadband [account](https://internetvas.slt.lk/login) credentials
* Windows 10, Mac computer
* [SLT broadband](https://internetvas.slt.lk/login) account credentials

Steps:
How to install:

## Windows

1. Download the [SLT_Usage_Web_Installer.exe](https://github.com/kmchmk/SLT-Data-Usage/releases/download/v1.3/SLT_Usage_Web_Installer.exe) file. Your browser may hesitate, so you may have to allow it in the Downloads section.
2. Install the downloaded file.
2. App will start automatically after the installation.
3. Save your SLT username (Ex: 94112xxxxxx) and password using the popup window.
4. You will see a system tray icon containing "X" mark. Right click it and "Refresh".
4. You will see a system tray icon containing your data usage summary. Hover over to see the full report.
5. Move it out to the taskbar from system tray, if you want to see it directly all the time.

## MacOS

1. Download the [SLT_Usage.zip](https://github.com/kmchmk/SLT-Data-Usage/releases/latest/download/SLT_Usage) file.
2. Drag the downloaded file to Applications folder.
3. Open launcher and click on the app icon to start.
4. Save your SLT username (Ex: 94112xxxxxx) and password using the popup window.
5. You will see a system tray icon containing your data usage summary. Hover over to see the full report.
6. Set the app to start at login. See here: [Mac OS X: Change Which Apps Start Automatically at Login](https://www.howtogeek.com/206178/mac-os-x-change-which-apps-start-automatically-at-login/)

_Auto refresh interval is 120 secs._

--------------------------------------

### Following instructions are for developers only.
### 🟥 Following instructions are for developers only.

##### If you are running/building from code

Expand Down

0 comments on commit 2ca483a

Please sign in to comment.