summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkj-sh6042024-08-01 03:20:25 -0400
committerkj-sh6042024-08-01 03:20:25 -0400
commit9652a69f4074f670951cc2899e8d3ed8d6a031ad (patch)
tree70be323d45c22a99db4433fdc1723419ba6ec57a
parente07c3082741ded9cdebc1e45d2ced931b5497cce (diff)
feat: add `README.md`
-rw-r--r--README.md109
1 files changed, 109 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..63962f3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,109 @@
1# dateTimeSetter ⌚
2
3*Easily Adjust Date & Time in Standalone Window Managers*
4
5![Image of dateTimeSetter](https://aedrielkylejavier.me/scripts-and-tools/img/dateTimeSetter-tk.png)
6
7## Rationale
8
9I use a standalone Window Manager on Linux (no Desktop Environment) and I missed having a simple GUI to quickly change Timezones and toggle NTP in a settings panel, which is commonly found in Desktop Environments. To address this, I made `dateTimeSetter`, a simple "date & time setter" written in Python and Tk.
10
11## Features
12
13* Simple as possible, so that it just gets out of your way and you can proceed with your life.
14* Can manipulate the following through the interface:
15 * Date
16 * Time
17 * Timezone
18 * Local RTC setting
19 * NTP
20* Automatically sets the Date, Time, and Timezone with a checkbox.
21* `Makefile`
22 * I've also included a Makefile that utilizes `cython3` to create a `.c` file from the `.py` code and then compile with `gcc` into a single binary.
23 * I can't really vouch for the continued reliability of the `Makefile` nor can I promise a significant performance increase with it being compiled as C code, but it's there if you want to give it a go 😌.
24 * You will need to have `cython`, `gcc`, and `make` installed on your system (on top of the dependencies listed below) to utilize the `Makefile`.
25
26
27## Dependencies
28
29To use `dateTimeSetter`, you will need to install the following dependencies. Here are some instructions on how to install them on various Linux distributions:
30
31### Ubuntu / Debian
32```sh
33sudo apt update
34sudo apt install python3-tk python3-pip
35pip3 install pytz requests
36```
37
38### Fedora
39```sh
40sudo dnf install python3-tkinter python3-pip
41pip3 install pytz requests
42```
43
44### Arch Linux
45```sh
46sudo pacman -S tk python-pip python-pytz python-requests
47```
48
49## Usage
50
51```sh
52$ python3 ./dateTimeSetter.py
53```
54
55or simply…
56
57```sh
58$ ./dateTimeSetter.py
59```
60
61### How I Like to Run it On My Machines
62
63As seen on my [dotfiles repo](https://github.com/kj-sh604/dotfiles), I wrap the usage of `dateTimeSetter` in a script:
64
65*I have it named as* `dateTime` *on my system*
66
67```sh
68#!/bin/sh
69
70BIN_PATH=~/.local/share/python-dateTimeSetter/dateTime
71SCRIPT_PATH=~/.local/share/python-dateTimeSetter/dateTime.py
72
73if [ -f "$BIN_PATH" ]; then
74 if command -v lxsudo > /dev/null 2>&1; then
75 lxsudo $BIN_PATH
76 elif command -v gksudo > /dev/null 2>&1; then
77 gksudo $BIN_PATH
78 elif command -v pkexec > /dev/null 2>&1; then
79 pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" $BIN_PATH
80 else
81 echo "No suitable graphical authentication tool found. Running without root privileges."
82 notify-send "No suitable graphical authentication tool found. Running without root privileges."
83 $BIN_PATH
84 fi
85elif [ -f "$SCRIPT_PATH" ]; then
86 if command -v lxsudo > /dev/null 2>&1; then
87 lxsudo python3 $SCRIPT_PATH
88 elif command -v gksudo > /dev/null 2>&1; then
89 gksudo python3 $SCRIPT_PATH
90 elif command -v pkexec > /dev/null 2>&1; then
91 pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" python3 $SCRIPT_PATH
92 else
93 echo "No suitable graphical authentication tool found. Running without root privileges."
94 notify-send "No suitable graphical authentication tool found. Running without root privileges."
95 python3 $SCRIPT_PATH
96 fi
97else
98 echo "dateTime/dateTime.py not found"
99 notify-send "Error!" "dateTime/dateTime.py not found" --urgency critical
100fi
101```
102
103Feel free to implement something similar.
104
105 
106
107I hope that some of you would find this useful 😌
108
109Happy hacking everyone! 🧑‍💻🤙