From 5007fd8c3a07f18e8bd992f1aa343bd99485a406 Mon Sep 17 00:00:00 2001 From: FrozenArcher Date: Sat, 1 Jul 2023 05:47:22 +0800 Subject: [PATCH] install script quit on compile error; update doc --- README.md | 7 +++++-- TODO.md | 6 ++++++ install | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 TODO.md diff --git a/README.md b/README.md index 5be7e82..d3eed31 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,16 @@ A dynamic window manager - FrozenArcher's fork ```bash git clone git@github.com:FrozenArcher/dwm.git $HOME/dwm -cd $HOME/dwm +cd $HOME/dwm/dwmblocks +git submodule init +git submodule update +cd .. sudo ./install ``` ## Launching -Via a display manager or in your `.xinitrc`: +Via a display manager or in your `.xinitrc`, add: ```bash launch_dwm diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..1853a28 --- /dev/null +++ b/TODO.md @@ -0,0 +1,6 @@ +# TODO + +* change install script to makefile +* add systray +* bar modules +* independent configuration diff --git a/install b/install index a87bb0d..f7eadf6 100755 --- a/install +++ b/install @@ -1,10 +1,15 @@ #!/bin/sh +# exit code: +# 0: success +# 1: user's error +# 2: compile error _dwm_dir="./dwm-src" _blks_dir="./dwmblocks-async" if [[ -z "$(ls | grep dwm.desktop)" ]]; then echo "Wrong directory. Please check if you are in the project root directory." + exit 1 fi if [[ "$1" == "clean" ]]; then @@ -28,6 +33,11 @@ if [ -f ./config.h ]; then fi make >> ../make.log +if [ $? -ne 0 ]; then + echo "==> !! DWM compile error. Please see make.log for details." + exit 2 +fi + echo " --- dwm install ---" >> ../make.log make install >> ../make.log cd .. @@ -40,6 +50,10 @@ cp -fv ./config-dwmblocks.c ./dwmblocks-async/config.c cd $_blks_dir echo " --- dwmblocks ---" >> ../make.log make install >> ../make.log +if [ $? -ne 0 ]; then + echo "==> !! dwmblocks compile error. Please see make.log for details." + exit 2 +fi echo " --- DONE --- " >> ../make.log echo "==> Done"