Mostafa-wael / Quran-cli

A simple command line interface for listening to Quran.
https://www.npmjs.com/package/@quran-cli/q-cli
86 stars 2 forks source link

A Way to Pause and Stop mpv #12

Closed BigFish2086 closed 1 year ago

BigFish2086 commented 2 years ago

Provide a way to pause and stop the playing without just brutely killing the process may be like this ~ ❯ ps -ef | grep mpv | grep -v grep | awk '{print $2}' | xargs -n1 kill -9

Mostafa-wael commented 2 years ago

Well, it would be better if there are shortcuts for pausing and resuming. Like, press p to pause and r to resume. What do you think?

BigFish2086 commented 2 years ago

I actually had a very similar idea which is to have the q-cli be runing in a kind of a watching state like if you wish rustlings and user will be able to use commands like pause/stop instead of just seeing Fetching Data statement. Also, I though of another idea which is to have the q-cli --(paus/stop) to pause/stop the current running q-cli process if any. Which do you think is relatively easy to begin implemeting?

GhiathAjam commented 2 years ago

I think passing keystrokes to mpv will do best if possible.

Mostafa-wael commented 2 years ago

I actually had a very similar idea which is to have the q-cli be runing in a kind of a watching state like if you wish rustlings and user will be able to use commands like pause/stop instead of just seeing Fetching Data statement. Also, I though of another idea which is to have the q-cli --(paus/stop) to pause/stop the current running q-cli process if any. Which do you think is relatively easy to begin implemeting?

I think a watching state would be more user-friendly.

BigFish2086 commented 2 years ago

What about showing the actually showing the mpv running app? Then the user can use its GUI to do the job.

Mostafa-wael commented 2 years ago

When we developed the app, we agreed that we wanted it to be as simple and minimal as possible. showing MVP running was against this. we agreed that we wanted all the operations to be done through q-cli directly.

ahmedihabb2 commented 1 year ago

Issue fixed, now you can toggle between pause and resume using p button and also can exist easily using q check this PR #15