Skip to content

Commit

Permalink
Merge pull request #11 from AbdeltwabMF/development
Browse files Browse the repository at this point in the history
Update README

Former-commit-id: bbf2b0c0ee81931473bade95119e6494a872c169 [formerly 716cf87]
Former-commit-id: 2be62917b30cc78ed4f04f13a874440955e90263
Former-commit-id: a823133
Former-commit-id: 59116d5
  • Loading branch information
AbdeltwabMF authored Mar 28, 2022
2 parents 7b950f1 + cefb910 commit 7a5b175
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 85 deletions.
17 changes: 0 additions & 17 deletions .SRCINFO

This file was deleted.

7 changes: 3 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
assets
CHANGELOG.md
CPPLINT.cfg
.git
.github
.gitignore
.mypy_cache
next-prayer.png
np_main
PKGBUILD
__pycache__
README.md
*__pycache__*
RELEASE_NOTES
.SRCINFO
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# next-prayer - Next Islamic prayer
.POSIX:

VERSION = $(shell awk '/VERSION\[\] =/ {print $$5}' np_main.cpp | sed "s/\"\|;//g")
VERSION = $(shell awk '/VERSION\[\] =/ {print $$5}' src/np_main.cpp | sed "s/\"\|;//g")

SRC = *.cpp
HDR = *.h
SHELL := /bin/bash
SRC = src/*.cpp
HDR = src/*.h

CC = g++
CFLAGS = -Wall -Wextra -Werror -std=c++20 -pedantic -O3 -DNDEBUG
Expand Down Expand Up @@ -35,19 +36,19 @@ BWHITE=\033[1;37m

np_main: $(SRC)
@printf "%b" "$(YELLOW)Compiling the source code...$(WHITE)\n"
sed -i "s|IAMUName|$(HOME)|" np_main.cpp
sed -i "s|IAMUName|$(HOME)|" src/np_main.cpp
$(CC) $(CFLAGS) -o np_main $(SRC)
sed -i "s|$(HOME)|IAMUName|" np_main.cpp
sed -i "s|$(HOME)|IAMUName|" src/np_main.cpp
@printf "%b" "$(BGREEN)Compilation Done!$(NC)\n\n"

install: np_main
@printf "%b" "$(PURPLE)Fetching API Data...$(WHITE)\n"
python3 np_fetch.py
cp -u np_fetch.py $(LOCAL_PREFIX)/bin/
python3 src/np_fetch.py
cp -u src/np_fetch.py $(LOCAL_PREFIX)/bin/
cp -u np_main $(LOCAL_PREFIX)/bin/
cp -u next-prayer $(LOCAL_PREFIX)/bin/
cp -u src/next-prayer $(LOCAL_PREFIX)/bin/
mkdir -p $(LOCAL_PREFIX)/share/man/man1/
sed "s/VERSION/$(VERSION)/" next-prayer.1 > $(LOCAL_PREFIX)/share/man/man1/next-prayer.1
sed "s/VERSION/$(VERSION)/" src/next-prayer.1 > $(LOCAL_PREFIX)/share/man/man1/next-prayer.1
@printf "%b" "$(BCYAN)next-prayer$(BGREEN) Installed Successfully!$(NC)\n"

uninstall:
Expand Down
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sha1sums=('SKIP')

pkgver() {
cd "${pkgname}"
printf "%s.r%s.%s" "$(awk '/VERSION\[\] =/{print $5}' events.cpp | sed 's/\"\|;//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
printf "%s.r%s.%s" "$(awk '/VERSION\[\] =/{print $5}' src/np_main.cpp | sed 's/\"\|;//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
Expand Down
101 changes: 53 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,85 @@
# next-prayer
<h1 align="center">Next Prayer</h1>
<h4 align="center"> <em>Islamic prayers reminder for your status bar.</em> </h4>

[![GitHub Super-Linter](https://github.com/abdeltwabmf/continuous-id/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/AbdeltwabMF/next-prayer/graphs/commit-activity)
![Maintainer](https://img.shields.io/badge/maintainer-Abdeltwabmf-blue)
[![Linux](https://svgshare.com/i/Zhy.svg)](https://svgshare.com/i/Zhy.svg)
[![Docker](https://badgen.net/badge/icon/docker?icon=docker&label)](https://https://docker.com/)
[![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](http://perso.crans.org/besson/LICENSE.html)
[![GitHub release](https://img.shields.io/github/release/Naereen/StrapDown.js.svg)](https://github.com/AbdeltwabMF/next-prayer/releases/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

Islamic prayers reminder for your status bar.
# Demo
![live demo](./assets/usage.GIF)

---

## Usage & Flags
# Usage

```bash
Usage: next_prayer [options...]

Options:
--next The next prayer and its time.
--prev The previous prayer and its time.
--hybrid The elapsed time since the previous prayer as far as the elapsed time <= THRESHOLD.
--all Show all timings.
--left The time left till the next prayer.
--elapsed The time elapsed since the previous prayer.
--adhan Whether the current time is adhan or not.
--hijri The current hijri date.
--help Display this help message.
--version Display the version.
```

# Installation

This is not the full help, use (man next_prayer) for the manual.
For `Arch, btw based distros` run the following command:
```bash
yay -S next-prayer
```

---
For `Ubuntu, RedHat or any other distro` run the following:
```bash
git clone https://github.com/abdeltwabmf/next-prayer.git
cd next-prayer
make clean install
```

## Setup for status bars
For `windows users or Docker` version

### [dwmblocks](https://github.com/torrinfail/dwmblocks)
Pull the image from [Docker Hub](https://hub.docker.com/repository/docker/abdeltwabmf/next-prayer), and run the following command:
```bash
docker pull abdeltwabmf/next-prayer:latest
```

Verify the install
```bash
docker container run --rm abdeltwabmf/next-prayer np_main --version
```
`Version: v2.0.0`

**How to use next-prayer with Docker**

**In config.h add this 4-element Block to the blocks[] array**
The use is pretty much the same.
```bash
docker container run --rm abdeltwabmf/next-prayer np_main [options...]
```

# Setup for status bars

- [dwmblocks](https://github.com/torrinfail/dwmblocks)

_In config.h add this 4-element Block to the blocks[] array_
``` c
static const Block blocks[] = {
/*Icon*/ /*Command*/ /*Update Interval*/ /*Update Signal*/
{"🕌", "next-prayer --hybrid", 29, 0}
{"🕌 ", "next-prayer --hybrid", 29, 0}
}
```

### [i3blocks](https://github.com/vivien/i3blocks)

**In i3blocks config add this section**
- [i3blocks](https://github.com/vivien/i3blocks)

_In i3blocks config add this section_
```code
[next-prayer]
command=next-prayer --hybrid
Expand All @@ -56,38 +93,6 @@ border_bottom=0
border_left=0
```

---

## Snapshot

![np](next-prayer.png)

---

## Installation

### For Arch based systems

```bash
yay -S next-prayer
```

### For other distros

**Install the dependencies first.**

`python3` `libnotify`

And then do:

``` code
git clone https://github.com/abdeltwabmf/next-prayer.git
cd next-prayer
make clean install
```

---

## [License](LICENSE)
# [License](LICENSE)

Licensed under the GPL-v3 License.
Licensed under the [GPL-v3 License](LICENSE).
File renamed without changes
1 change: 1 addition & 0 deletions assets/usage.GIF.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
64df3583bb24fbf5f05548e7ca53aca320524a57
File renamed without changes.
15 changes: 11 additions & 4 deletions next-prayer.1 → src/next-prayer.1
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ next-prayer \- Next Islamic prayer.
.nf
.fi
.B next-prayer
.RB [ \-\-all ]
.nf
.fi
.B next-prayer
.RB [ \-\-elapsed ]
.nf
.fi
Expand Down Expand Up @@ -56,8 +60,11 @@ The previous prayer and its time.
.BR \-\-hybrid
The elapsed time since the previous prayer as far as the elapsed time <= THRESHOLD.
.TP
.BR \-\-all
Show all timings.
.TP
.BR \-\-elapsed
The elapsed time since the previous prayer.
The time elapsed since the previous prayer.
.TP
.BR \-\-left
The time left until the next prayer.
Expand All @@ -69,7 +76,7 @@ Whether the current time is adhan or not.
The current hijri date.
.TP
.BR \-\-version
The current version.
Display the version.
.TP
.BR \-\-help
Display this help message.
Expand All @@ -80,7 +87,7 @@ FILES
.I $HOME/.local/bin/next-prayer
The executable file.
.TP
.I $HOME/.local/bin/fetch.py
.I $HOME/.local/bin/np_fetch.py
Run manually each time you update the config file.
.TP
.I $HOME/.config/next-prayer/config.py
Expand Down Expand Up @@ -134,7 +141,7 @@ instead of the elapsed time. this applicable only when you use \fB\-\-hybrid \fR
\fBtemporarily moved to the executable file\fR.

.SH CUSTOMIZATION
next-prayer can be customized by editing the python dictionary config file \fI$HOME/.config/next-prayer/config.py \fRand (re)run the \fI'fetch.py' \fRscript.
next-prayer can be customized by editing the python dictionary \fBconfig file\fR \fI$HOME/.config/next-prayer/config.py \fRand (re)run the \fI'python3 np_fetch.py' \fRcommand.

.SH AUTHOR
Abd El-Twab M. Fakhry <\fI[email protected]\fR>
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions np_fetch.py → src/np_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def check_files():
pass
elif os.path.exists(BIN_DIR + "np_config.py"):
os.symlink(BIN_DIR + "np_config.py", CONF_DIR + "np_config.py")
elif current_working_dir != BIN_DIR and os.path.exists("np_config.py"):
os.system(f"cp -u np_config.py {BIN_DIR}")
elif current_working_dir != BIN_DIR and os.path.exists("src/np_config.py"):
os.system(f"cp -u src/np_config.py {BIN_DIR}")
os.symlink(BIN_DIR + "np_config.py", CONF_DIR + "np_config.py")
else:
print(f"{RED}Could not find config file{WHITE}\n")
Expand Down
File renamed without changes.

0 comments on commit 7a5b175

Please sign in to comment.