diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a8552d5 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +build: clean + xcodebuild clean build + mkdir bin/ + mv build/Release/dshb bin/ +clean: + rm -rf bin build diff --git a/README.md b/README.md index efad35e..48e39aa 100644 --- a/README.md +++ b/README.md @@ -33,18 +33,33 @@ An OS X system monitor in Swift, inspired by Make sure to use the recursive option on clone to auto init all submodules. -```bash +```sh git clone --recursive https://github.com/beltex/dshb ``` Incase you have already cloned the repository. -```bash +```sh # Inside the project directory git submodule update --init --recursive ``` +### Build + +Besides building from inside of Xcode, you can compile dshb from the command +line like so + +```sh +make +``` + +The resulting binary will be found inside the `bin/` directory. If you copy it +to either `/usr/bin/` (requires `sudo`) or `/usr/local/bin/` (assuming it's in +your `PATH` - Homebrew would have done this for you), you can then run `dshb` +from anywhere. + + ### Stack - [ncurses](https://www.gnu.org/software/ncurses/ncurses.html) diff --git a/dshb/main.swift b/dshb/main.swift index 8dfca37..0280bcf 100644 --- a/dshb/main.swift +++ b/dshb/main.swift @@ -195,10 +195,14 @@ draw_all() //------------------------------------------------------------------------------ // TODO: Custom serial attr prop creation is new to 10.10 +// dispatch_queue_attr_make_with_qos_class(DISPATCH_QUEUE_SERIAL, +// QOS_CLASS_USER_INITIATED, 0) + let source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_queue_create("com.beltex.dshb", DISPATCH_QUEUE_SERIAL)) +// TODO: What about dispatch_after? dispatch_source_set_timer(source, dispatch_time(DISPATCH_TIME_NOW, 0), FREQ * NSEC_PER_SEC, 0)