Created
November 26, 2011 11:17
-
-
Save shellexy/1395472 to your computer and use it in GitHub Desktop.
苏酱要的 chromium.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ~/bin/chromium.sh | |
# 使用内存文件系统加速 chromium 运行 | |
# 启动前和关闭后同步文件 | |
CMD="chromium" | |
RAM_CACHE_DIR="/dev/shm/$USER-chrome-cache/" | |
DISK_CACHE_DIR="$HOME/.cache/chromium/" | |
test -a ~/.config/chromium/SingletonSocket || { | |
rsync -av --delete $DISK_CACHE_DIR $RAM_CACHE_DIR | |
$CMD "$@" --disk-cache-dir="$RAM_CACHE_DIR" | |
rsync -av --delete $RAM_CACHE_DIR $DISK_CACHE_DIR | |
exit 0 | |
} | |
exec $CMD "$@" --disk-cache-dir="$RAM_CACHE_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment