Skip to content

Commit

Permalink
add option to mount user's home dir
Browse files Browse the repository at this point in the history
  • Loading branch information
gouzhuang committed Oct 27, 2023
1 parent 30a110f commit 4298160
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 11 additions & 4 deletions dochat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
Expand All @@ -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 \
Expand Down

0 comments on commit 4298160

Please sign in to comment.