Generates and manages static html of mpd currently playing music.

git clone git://watertao.xyz/programs/mpdhh.git

README (3725B)


      1 mpdhh
      2 -----
      3 mpd history html
      4 
      5 
      6 Usage
      7 -----
      8     mpdhh.sh 0 > Update data & site
      9     mpdhh.sh 1 > stdout current track
     10     mpdhh.sh 2 > update historia only
     11     mpdhh.sh 3 > update analysis only
     12     mpdhh.sh 4 > initiate directory tree
     13 
     14 
     15 Disable site updates:
     16     export MPDHH_PUBLISH="n" mpdhh.sh
     17 
     18 
     19 Description
     20 -----------
     21 Generates and manages static html of mpd currently playing music.
     22 
     23 Uses mpc to fetch current track from mpd, generates playlist, manages
     24 history and analyses. Static html file generation. With every mpd track
     25 change, db files are modified or generated, and html is rendered.
     26 
     27 By default the html is rendered as hugo content files. This can be
     28 modified by editing the *tmpl.md files.
     29 
     30 Although this program aspires for independence from hugo, it is so far
     31 only a yearning. Some bits in the sh script modify hugo meta. As I
     32 currently seek to migrate away from hugo, this is likely to be
     33 addressed upon that move. In the meatime, this is really a hugo only
     34 situation. It is a work in progress.
     35 
     36 If you are a friend or person who somehow landed on this README file,
     37 and you do not have any idea what the shell I'm talking about with
     38 terms such as awk, sed, grep, shell, or mpd, feel free to explore,
     39 but only if you are bored. If you are a person running unix/linux based
     40 systems and comfortable on the command line, this is for you. I share
     41 this freely, without license, into the domain of the world, for
     42 people to learn from. Perhaps you wish to get your hands dirty with
     43 awk and have only dabbled. I'm one of five very strange people who
     44 write awk scripts as a hobby. I've learned form doing of course, but
     45 I've immensely gained from others sharing their work. That inspires me
     46 a lot. Sharing. Open source.
     47 
     48 The music section of my site is managed entirely with mpdhh/hugo. It is
     49 run mostly from a pinephone running sxmo on postmarketos. It also runs
     50 happily on musl Void in a rather suckless environment.
     51 
     52 
     53 Requirements
     54 ------------
     55 - mpd
     56 - mpc
     57 - posix compliant shell tools: awk/sed/grep/sort
     58 - hugo or full html markup needed
     59 
     60 
     61 
     62 Notes
     63 -----
     64 "example.com" is a hugo project dir. Doesn't have to be hugo
     65 ( actually, it needs to be for now, see Description above ). mpdhh looks
     66 for and runs a 'publish.sh' file in the project dir. It is in this file
     67 one runs all the cms commands to update a website. A simple one-liner
     68 gets it done for a git managed hugo setup:
     69 
     70     hugo && git add . && git commit && git push
     71 
     72 This program assumes the following tree:
     73 (run mpdhh.sh 4 to create the tree)
     74 
     75 ```
     76 project/
     77 ---- content/
     78 -------- music/
     79 ------------ _index.[html|md]
     80 ------------ analysis/
     81 ---------------- _index.[html|md]
     82 ---------------- tracks/
     83 -------------------- _index.[html/md]
     84 -------------------- tracks.db
     85 ---------------- artists/
     86 -------------------- _index.[html|md]
     87 -------------------- artists.db
     88 ------------ db/
     89 ---------------- [date].db
     90 ------------ historia/
     91 ---------------- _index.[html|md]
     92 ---------------- db.index
     93 ---------------- [date_bin]/
     94 -------------------- _index.[html|md]
     95 ```
     96 
     97 Important hugo note:
     98 In light of mpdhh independence from hugo, the following menu bit needs
     99 to be injected into the project's hugo config file (e.g. hugo.yaml) for
    100 the usage of "Analysis" menus:
    101 
    102 ```
    103 menus:
    104  analysis:
    105    - name: Artists
    106      pageRef: /music/analysis/artists
    107    - name: Tracks
    108      pageRef: /music/analysis/tracks
    109  artists:
    110    - name: Artist
    111      pageRef: /music/analysis/artists/by-artist
    112    - name: Play Count
    113      pageRef: /music/analysis/artists/by-play-count
    114  tracks:
    115    - name: Artist
    116      pageRef: /music/analysis/tracks/by-artist
    117    - name: Track
    118      pageRef: /music/analysis/tracks/by-track
    119    - name: Play Count
    120      pageRef: /music/analysis/tracks/by-play-count
    121 ```