aboutsummaryrefslogtreecommitdiff
path: root/source/blog/2014-12-23-mpv-launcher.md
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2015-05-14 20:57:01 -0700
committerZhiming Wang <zmwangx@gmail.com>2015-05-14 20:57:01 -0700
commit862e27c9e40be18fb411193631828b101791943c (patch)
tree6a6bee787c2a8b9342cf055515642f31b4252578 /source/blog/2014-12-23-mpv-launcher.md
parentb6d0d727c5be9a5180fb9baf9565fc1768c0ddfe (diff)
downloadmy_new_personal_website-862e27c9e40be18fb411193631828b101791943c.tar.xz
my_new_personal_website-862e27c9e40be18fb411193631828b101791943c.zip
add source code line numbers
The way I handle line numbers and the pre block in general is inspired by the MDN wiki. See, for instance, https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript a screenshot is here: https://i.imgur.com/982TBDc.png Also tweaked other styles, e.g., changed the primary monospace font to Consolas, and slightly tweaked a few old posts.
Diffstat (limited to 'source/blog/2014-12-23-mpv-launcher.md')
-rw-r--r--source/blog/2014-12-23-mpv-launcher.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blog/2014-12-23-mpv-launcher.md b/source/blog/2014-12-23-mpv-launcher.md
index bc4710e5..c8c2aee2 100644
--- a/source/blog/2014-12-23-mpv-launcher.md
+++ b/source/blog/2014-12-23-mpv-launcher.md
@@ -7,7 +7,9 @@ date-display: December 23, 2014
I just noticed that `daemonize` doesn't play too well with the OS; in particular, when you use dark menu bar on OS X Yosemite, apps launched with `daemonize` won't conform to that. So a native shell solution would be using `/bin/zsh` and run
- mpv "$@" >/dev/null 2>&1 </dev/null &!
+```zsh
+mpv "$@" >/dev/null 2>&1 </dev/null &!
+```
instead.
@@ -17,7 +19,9 @@ instead.
Today I finally gave this issue some serious thought (I've been on a bug report/enhancement request spree these days so it's natural for me to start thinking about enhancements). Turns out that there's a pretty simple workaround. I created an automator app `mpv-launcher.app` that does one thing: "Run Shell Script" (pass input as arguments)
- daemonize /usr/local/bin/mpv "$@"
+```bash
+daemonize /usr/local/bin/mpv "$@"
+```
in the shell of your choice (for me the shell of choice is `zsh` since the env would be readily available from my `zshenv`). `daemonize`, as the name suggests, daemonizes the process so that the process doesn't block; this way, `mpv-launcher.app` immediately quits after launching, making multiple "instances" possible. (`daemonize` can be installed via `brew install daemonize`; note that you need to specify the full path of the command to daemonize, which in my case is `/usr/local/bin/mpv`). And there you go. Associate your video files to `mpv-launcher.app`. Launch as many instances as you want. Enjoy.