Coder Social home page Coder Social logo

abdeltwabmf / next-prayer Goto Github PK

View Code? Open in Web Editor NEW
50.0 2.0 10.0 2.82 MB

Islamic prayer reminder for Unix status bars.

License: GNU General Public License v3.0

Shell 0.92% Python 3.82% C++ 15.60% Makefile 1.29% Roff 2.21% Dockerfile 0.51% CMake 2.61% C 73.04%
salat-timings prayer-times muslim-prayer-times cpp python3 linux prayertimes makefile bash docker

next-prayer's Introduction

Next Prayer

Islamic prayers reminder for Linux status bar


Installation

1. Arch-based distributions

yay -S next-prayer

2. Build from source

git clone https://github.com/abdeltwabmf/next-prayer.git
cd next-prayer
make all install

3. Docker image

  1. Use Docker Hub image by running the following commands:
docker pull abdeltwabmf/next-prayer
docker tag abdeltwabmf/next-prayer next-prayer
docker run --rm next-prayer next-prayer --version
  1. Build it yourself by running the following commands:
git clone https://github.com/abdeltwabmf/next-prayer.git
cd next-prayer
docker build -t next-prayer .
docker run --rm next-prayer next-prayer --version

Configuration

  1. After updating your configuration file save it locally and run the following command to fetch API data:
docker run --rm -v /path/to/your/config:/home/nextprayer/.config/next-prayer/np_config.py -v /path/to/your/data:/home/nextprayer/.local/share/next-prayer next-prayer np_fetch.py
  1. Afterword run the following command:
docker run --rm -v /path/to/your/data:/home/nextprayer/.local/share/next-prayer next-prayer next-prayer [options...]

🤔 Usage

Usage: next-prayer [options...]

Options:
  --help       Display this help message.
  --version    Version name.
  --next       Next prayer time.
  --all        All timings.
  --prev       Previous prayer time.
  --left       Time left to next prayer.
  --elapsed    Elapsed time since last prayer.
  --adhan      True if adhan is playing now.
  --hijri      Hijri date.
  --hybrid     The elapsed time since the previous prayer as far as the elapsed time <= THRESHOLD.

Use next-prayer options with docker as follows:

docker run --rm next-prayer next-prayer [options...]

Setup (Status bar)

Here are some examples how to setup the status bar with next-prayer:

1. dwmblocks

🌟 Add this 4-element Block to the blocks[] array in your config.h.

static const Block blocks[] = {
  /*Icon*/  /*Command*/              /*Update Interval*/  /*Update Signal*/
  {"🕌 ",    "next-prayer --hybrid",  29,                  0}
}

2. i3blocks

🌟 Add this section to your i3blocks config file.

[next-prayer]
command=next-prayer --hybrid
interval=29
label=<span>🕌 </span>
color=#FF8105
border=#FF8105
border_top=1
border_right=0
border_bottom=0
border_left=0

👀 If you're using the docker version Add docker run --rm next-prayer at the very beginning of your command.


🐣 Contributors

Abdeltwabmf
Abd El-Twab M. Fakhry
mazzensaadd
Mazen Saad
MustafaAmer-1
Mustafa Amer

⚠️ License

Licensed under the GPL-v3 License.

next-prayer's People

Contributors

abdeltwabmf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

next-prayer's Issues

Wrong times

The program works but gives wrong times.
Also, AUR build doesn't run Artix linux.

Use native c++ notifier

  • Introduce sound notification as an option.
  • Use native c++ notification instead of bash.
  • Read ENV variables to detect if the status bar was clicked (BUTTON_BLOCK).

Warning errors

The build fails due to -Werror parameter used in the Makefile as there is many warnings in src/np_main.cpp file.
here is the make command log output

Cleaning...
rm -f np_main
Cleaning done. 

Compiling the source code...
sed -i "s|IAMUName|/home/mustafa|" src/np_main.cpp
g++ -Wall -Wextra -Werror -std=c++2a -pedantic -O3 -DNDEBUG -o np_main src/*.cpp
src/np_main.cpp: In function ‘void File(const char*)’:
src/np_main.cpp:89:39: error: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Werror=unused-result]
   89 | void File(const char *fread) { freopen(fread, "r", stdin); }
      |                                ~~~~~~~^~~~~~~~~~~~~~~~~~~
src/np_main.cpp: In function ‘void ReadData()’:
src/np_main.cpp:204:11: error: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Werror=unused-result]
  204 |     system("np_fetch.py");
      |     ~~~~~~^~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:40: np_main] Error 1

Accept more than one option

example 1.

next-prayer --hijri --en

for month in English instead of default arabic.

example 2.

next-prayer --next --24

instead of PM/AM system.

kde

can you add this to kde plasma ?

خطأ في التاريخ الهجري

الأمر التالي يرجع التاريخ الهجري خطأ: next-prayer --hijri...
اليوم هو التاسع من الشهر ولكن

╰─➤  next-prayer --hijri
10 جمادى الآخرة 1444
  • OS: Arch linux
  • Version: v0.3.0

np_main: command not found

نزلت البرنامج من خلال yay باستخدام الأمر yay -S next-prayer، لكن عندما حاولت تشغيله لمعرفة كم بقي لي مستع من الوقت حتى أشرب المياة قبل أذان الفجر 😅 هذا ما حصل لي

/home/ms/.local/bin/next-prayer: line 4: np_main: command not found
/home/ms/.local/bin/next-prayer: line 9: np_main: command not found

أولا تفسيري لتكرر الخطأ مرتين أنه كان يجب أن تضع set -e في بداية الملف

ثانيا سبب حدث الخطأ أصلا أن ال PKGBUILD في مستودع ال AUR لا يبني الملفات المطلوبة وهي np_main من ملف الكود np_main.cpp

PKGBUILD

build() {
    cd "${pkgname}"
    make DESTDIR="${pkgdir}" install clean
}

Makefile

all: $(BIN)
	mkdir -p $(LOCAL_PREFIX)/bin
	cp -u $(BIN) $(LOCAL_PREFIX)/bin/

Error when building from source

when tried to build from source:

cp -f np_main /home/amro/.local/bin/
cp: cannot stat 'np_main': No such file or directory
make: *** [Makefile:52: install] Error 1

2022-11-02_00-39

The App Suddenly stopped working giving me "Unable to read data"

Describe the bug
The App Suddenly stopped working giving me The following:
"Unable to read data"
"Run "make all clean install" first!"

I tried running the command:
"Run "make all clean install"
Returned this:
"make: *** No rule to make target 'all'. Stop."

I tried removing the software and installing again, didn't work.

To Reproduce
Steps to reproduce the behavior:
Just run it from the terminal.

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: Arch Linux x86_64
  • Kernel: 6.1.1-arch1-1
  • Version: v0.3.0.r2.a45fa61-1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.