diff --git a/README.md b/README.md index 24a25ae..92b43bf 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,21 @@ curl -sL https://raw.githubusercontent.com/huan/docker-wechat/master/dochat.sh \ | DOCHAT_WECHAT_VERSION=3.3.0.115 bash ``` +### `DOCHAT_MOUNT_HOME` + +Mount user's home directory to container path `/home/user/home`, which is accessable from the Choose File Dialog -> My Documents -> home. + +```sh +curl -sL https://raw.githubusercontent.com/huan/docker-wechat/master/dochat.sh \ + | DOCHAT_MOUNT_HOME=true bash +``` + +Or in case you have downloaded `dochat.sh`: + +```sh +DOCHAT_MOUNT_HOME=true ./dochat.sh +``` + ## For Hackers If you want to control everything by yourself, for example, open multiple WeChat PC client on your desktop; then, you might want to inspect the [dochat.sh](https://github.com/huan/docker-wechat/blob/master/dochat.sh) in our repository and try the following docker command: diff --git a/dochat.sh b/dochat.sh index 82d2aec..bcdd725 100755 --- a/dochat.sh +++ b/dochat.sh @@ -94,6 +94,8 @@ function main () { echo '🚀 Starting DoChat /dɑɑˈtʃæt/ ...' echo + VOLUME_ARG=() + # Issue #111 - https://github.com/huan/docker-wechat/issues/111 rm -f "$HOME/DoChat/Applcation Data/Tencent/WeChat/All Users/config/configEx.ini" @@ -103,6 +105,14 @@ function main () { mkdir "$HOST_DIR_HOME_DOCHAT_WECHAT_FILES" -p mkdir "$HOST_DIR_HOME_DOCHAT_APPLICATION_DATA" -p + VOLUME_ARG+=('-v' "$HOST_DIR_HOME_DOCHAT_WECHAT_FILES":'/home/user/WeChat Files/') + VOLUME_ARG+=('-v' "$HOST_DIR_HOME_DOCHAT_APPLICATION_DATA":'/home/user/.wine/drive_c/users/user/Application Data/') + VOLUME_ARG+=('-v' '/tmp/.X11-unix:/tmp/.X11-unix') + VOLUME_ARG+=('-v' "/run/user/$(id -u)/pulse":'/run/pulse') + if [ -n "$DOCHAT_MOUNT_HOME" ]; then + VOLUME_ARG+=('-v' "$HOME":'/home/user/home') + fi + # # --privileged: enable sound (/dev/snd/) # --ipc=host: enable MIT_SHM (XWindows) @@ -113,10 +123,7 @@ function main () { --rm \ -i \ \ - -v "$HOST_DIR_HOME_DOCHAT_WECHAT_FILES":'/home/user/WeChat Files/' \ - -v "$HOST_DIR_HOME_DOCHAT_APPLICATION_DATA":'/home/user/.wine/drive_c/users/user/Application Data/' \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -v "/run/user/$(id -u)/pulse":"/run/pulse" \ + "${VOLUME_ARG[@]}" \ \ -e DISPLAY \ -e DOCHAT_DEBUG \