-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,11 +200,22 @@ $ ws datetime # 获取当前日期和时间 | |
|
||
如果你本地配置了 mutt 邮件发送,然后安装如下方式配置好你的 Kindle 邮箱即可推送 | ||
|
||
**配置 kindle 接收邮箱** | ||
|
||
```bash | ||
$ echo "[email protected]" > ~/.config/wshell/kindle/kindrc | ||
``` | ||
|
||
**配置 mutt 推送邮箱配置** | ||
|
||
```bash | ||
# 配置邮箱 | ||
$ echo "[email protected]" > ~/.config/wshell/kindle | ||
set smtp_url = "smtp://<your_send_email>@<smtp_url>:<smtp_port>" | ||
set smtp_pass = "<your_send_email_password>" | ||
set from = "<your_send_email>" | ||
``` | ||
|
||
**推送** | ||
|
||
```bash | ||
$ ws kindle push <bookfile> # 推送 | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.5.2 | ||
1.5.8 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# Author: wxnacy([email protected]) | ||
# Description: 将书发布到 https://github.com/wxnacy/book | ||
|
||
filepath=$1 | ||
|
||
publish(){ | ||
book_dir=$1 | ||
goss -r book -p book/${book_dir}/ $2 | ||
} | ||
|
||
if [ -f $filepath ] | ||
then | ||
names=($(ws py parse_filename.py $filepath)) | ||
book_dir=${names[2]} | ||
publish $book_dir $filepath | ||
else | ||
filepath=$(python -c "print('${filepath}'.rstrip('/'))") | ||
book_dir=$(python -c "print('${filepath}'.split('/')[-1])") | ||
|
||
for f in `ls $filepath` | ||
do | ||
fp=$filepath/$f | ||
echo $fp | ||
publish $book_dir $fp | ||
done | ||
|
||
fi | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# Author: wxnacy([email protected]) | ||
# Description: 推送书籍到 kindle | ||
# vim ${HOME}/.config/wshell/kindle | ||
# vim ${HOME}/.config/wshell/kindle/kindrc | ||
# [email protected] | ||
# vim ${HOME}/.config/wshell/kindle/muttrc | ||
# set smtp_url = "smtp://<your_email>@<smtp_url>:<smtp_port>" | ||
# set smtp_pass = "<email_password>" | ||
# set from = "<your_email>" | ||
|
||
. ${HOME}/.config/wshell/kindle | ||
. ${HOME}/.config/wshell/kindle/kindrc | ||
|
||
path=$1 | ||
|
||
|
@@ -14,6 +18,7 @@ then | |
exit 0 | ||
fi | ||
|
||
mutt $email -a $path < /dev/null | ||
echo "Begin push $path" | ||
mutt $email -F ${HOME}/.config/wshell/kindle/muttrc -s $path -a $path < /dev/null | ||
echo 'Success!' | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# Author: wxnacy([email protected]) | ||
# Description: | ||
|
||
|
||
OS=`ws os` | ||
OSS=(${OS}) | ||
SYS=${OSS[0]} | ||
VER=${OSS[1]} | ||
PKG=${OSS[2]} | ||
|
||
case $SYS in | ||
debian|ubuntu|devuan|deepin) | ||
sudo apt update -y | ||
sudo apt install mutt -y | ||
;; | ||
centos|fedora|rhel|amzn) | ||
sudo yum update -y | ||
sudo yum install mutt -y | ||
;; | ||
Darwin) | ||
brew install mutt | ||
;; | ||
*) | ||
echo '暂时不支持该系统' | ||
;; | ||
esac | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# Author: wxnacy([email protected]) | ||
# Description: 解析文件名 | ||
|
||
import os | ||
|
||
def parse(filename): | ||
filedir, name = os.path.split(filename) | ||
names = name.split(".") | ||
result = [filedir or '.', name] | ||
result.extend(names) | ||
return result | ||
|
||
if __name__ == "__main__": | ||
import sys | ||
filename = sys.argv[1] | ||
# filename = '~/Downloads/人间失格/人间失格.mobi' | ||
# filename = '~/Downloads/人间失格/' | ||
a, b, c, d = parse(filename) | ||
print(a, b, c, d) | ||
|
||
|
||
|
This file contains 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