added enviorment variables and switched to markdown

This commit is contained in:
Rachel Lambda Samuelsson 2021-01-28 16:09:09 +01:00
parent c2930207df
commit 246ea64e71
3 changed files with 23 additions and 67 deletions

54
README
View File

@ -1,54 +0,0 @@
mpdart
======
A simple mpd client which only displays the cover art for the current song.
depends
-------
libX11
libmpdclient
libim2
pkg-config (optional build time dependency)
building
--------
./configure.sh
make
make install # supports PREFIX and DESTDIR
usage
-----
There are three flags:
mpdart -d musicdir -h host -p port
Though only -d is needed:
mpdart -d ~/music
Once mpdart is running you can press the window to toggle mpd's pause/play.
contributing
------------
pull requests
~~~~~~~~~~~~~
If you like github you can contribute by sending in a pull request at
https://github.com/depsterr/mpdart
patches
~~~~~~~
If you don't like github you can contribute by emailing me at
depsterr at protonmail dot com with the output of
git format-patch
after you've commited your changes to your local tree.
credits
-------
Big thanks to my friend wooosh for helping me debug and develop this :)

View File

@ -1,37 +1,41 @@
mpdart mpdart
====== ======
A simple mpd client which only displays the cover art for the current song. mpdart is a simple X application that displays the album art of the currently playing mpd song and lets you toggle play pause. It spends almost all of it's time idle and according to top it uses `0.0%` of my CPU and `0.1%` of my ram.
depends Depends
------- -------
libX11 libX11
libmpdclient libmpdclient
libim2 libim2
pkg-config (optional build time dependency) pkg-config # optional build time dependency
building Building
-------- --------
./configure.sh ./configure.sh
make make
make install # supports PREFIX and DESTDIR make install # supports PREFIX and DESTDIR
usage Usage
----- -----
There are three flags: There are three flags:
mpdart -d musicdir -h host -p port mpdart -d musicdir -h host -p port -t timeout # timeout is milliseconds
Though only -d is needed: Though only -d is needed:
mpdart -d ~/music mpdart -d ~/music
These options can also be configured in the enviorment variables `MPDART_DIR`, `MPDART_HOST`, `MPDART_PORT`, and `MPDART_TIMEOUT`.
To make these changes persistent, add them to your `~/.profile`.
Once mpdart is running you can press the window to toggle mpd's pause/play. Once mpdart is running you can press the window to toggle mpd's pause/play.
contributing Contributing
------------ ------------
### pull requests ### pull requests
@ -46,7 +50,7 @@ depsterr at protonmail dot com with the output of
after you've commited your changes to your local tree. after you've commited your changes to your local tree.
credits Credits
------- -------
Big thanks to my friend wooosh for helping me debug and develop this :) Big thanks to my friend wooosh for helping me debug and develop this :)

View File

@ -14,7 +14,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
/* let user define a size on compiler the commandline */ /* let user define a size on the compiler command line if they want to */
#ifndef DEFAULTSIZE #ifndef DEFAULTSIZE
#define DEFAULTSIZE 256 #define DEFAULTSIZE 256
#endif #endif
@ -269,6 +269,12 @@ void mpd_check_error(void) {
int main(int argc, char** argv) { int main(int argc, char** argv) {
/* get args from environment */
mpd_db_dir = getenv("MPDART_DIR");
mpd_host = getenv("MPDART_HOST");
mpd_port = getenv("MPDART_PORT");
mpd_timeout = getenv("MPDART_TIMEOUT");
/* parse args */ /* parse args */
while (*++argv) { while (*++argv) {
if (!strcmp(*argv, "-d")) if (!strcmp(*argv, "-d"))
@ -282,7 +288,7 @@ int main(int argc, char** argv) {
} }
if (!mpd_db_dir) if (!mpd_db_dir)
die("Please specify mpd music directory with -d"); die("Please specify mpd music directory with -d, or in the MPDART_DIR environment variable");
/* strip all '/'es from the end of mpd_db_dir */ /* strip all '/'es from the end of mpd_db_dir */
{ {