laughk / archlinux-note

普段使っている ArchLinux に関するメモ置き場です
5 stars 0 forks source link

onedrive-d で Linux 環境でもOneDriveを使う #16

Closed laughk closed 8 years ago

laughk commented 8 years ago

XPS15を購入した際にキャンペーンで Office Personal の無料分をつけたらプロダクトキーがもらえて OneDrive の容量が1T確保できた。せっかくなのでWindows環境だけでなくLinux環境でも使いたいのでそのへんのメモを残しておく。

ちなみに「Linux OneDrive」でググればすぐに onedrive-d にはたどり着くと思う。

laughk commented 8 years ago

ArchLinux の場合は AUR からインストールできる

探せば AUR (en) - onedrive-d-git が見つかる。 ただし、こいつは2016-05-05時点では xybu/onedrive-d: A Microsoft OneDrive client on Linux (IN PROGRESS). ではなく、 xybu/onedrive-d-old: Microsoft OneDrive client on Linux. がインストールされるので注意。

新しい方を入れたほうがいい?

新しい onedrive-d のREADMEには

This repository is still under active development and the program is not yet usable.

記載があるので、実際は -old の方じゃないと使えないっぽい。 ということで AUR にある onedrive-d-old を使う。

laughk commented 8 years ago

onedrive-d-old をインストール

パッケージ名には -git までつく

yaourt -S onedrive-d-git

onedrive-d-old のセットアップ

インストールしただけではだめでちゃんと設定する必要がある。 https://github.com/xybu/onedrive-d-old#install(4) Install onedrive-d# Create settings dir のところからやれば良い。(その前まではAURのパッケージ周りが面倒見てくれる)

あと GNOME3 環境のせいなのかは深追いしてないが、 --ui=gtk オプション付きだとうまく行かない。

laughk commented 8 years ago

onedrive-pref のログ

onedrive-d-old を使うための設定をするコマンド 記録用にログを貼っておく

$ onedrive-pref         
Loading configuration ... OK
[2016-05-05 14:35:02,738] DEBUG: thread_mgr: started.
Setting up onedrive-d...
(STEP 1/4) Do you want to authorize sign in with your OneDrive account? [Y/n] Y

You will need to visit the OneDrive sign-in page in a browser, 
log in and authorize onedrive-d, and then copy and paste the 
callback URL, which should start with 
"https://login.live.com/oauth20_desktop.srf".

The callback URL is the URL where the sign-in page finally goes blank.

Please visit the sign-in URL in your browser:

https://login.live.com/oauth20_authorize.srf?locale=en&scope=wl.skydrive+wl.skydrive_update+wl.offline_access&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf&response_type=code&client_id=xxxxxxxxxxxxxxxxxxxx&display=touch

Please paste the callback URL:
https://login.live.com/oauth20_desktop.srf?code=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&lc=yyyy
/usr/lib/python3.5/site-packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
  InsecureRequestWarning)
[2016-05-05 14:35:45,955] DEBUG: MainThread: config saved.
onedrive-d has been successfully authorized.

(STEP 2/4) Do you want to specify path to local OneDrive repository? [Y/n] Y
Please enter the abs path to sync with your OneDrive (default: /home/laughk/OneDrive): 
The path "/home/laughk/OneDrive" does not exist. Try creating it.
[2016-05-05 14:36:00,931] DEBUG: MainThread: config saved.
Path successfully set.

(STEP 3/4) Do you want to change the numeric settings? [Y/n] y

Files larger than what size (in MiB) will be uploaded blocks by blocks? (current: 4.0)?

When a file is uploaded blocks by blocks, what is the block size (in KiB)? (current: 512.0)?
[2016-05-05 14:36:26,456] DEBUG: MainThread: config saved.

(STEP 4/4) Do you want to edit the ignore list file? [Y/n] n
Skipped. You can manually edit "/home/laughk/.onedrive/ignore_v2.ini" at your convenience.

All steps are finished.
[2016-05-05 14:36:41,441] DEBUG: Dummy-2: config saved.
laughk commented 8 years ago

設定ができたら起動する

デフォルトだと ~/OneDrive に保存される。 Dropbox と一緒。

$ onedrive-d start
laughk commented 8 years ago

ログイン時に自動起動するようにしておく。

GNOMEの場合の例で。

作業ログ

$ cp -v /usr/share/applications/onedrive-d.desktop .config/autostart/ 
'/usr/share/applications/onedrive-d.desktop' -> '.config/autostart/onedrive-d.desktop'

$ vim .config/autostart/onedrive-d.desktop # Exec 部分にサブコマンド start をつける

$ grep Exec .config/autostart/onedrive-d.desktop
Exec=onedrive-d start

tweak-tool の startup applications からも確認できるようになる

laughk commented 8 years ago

普段使いには問題ないところまで来たのでクローズ