4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Kobito on Ubuntu 16.04LTS

Last updated at Posted at 2016-11-01

当方環境

Terminal
[ryuta@Shuttle-Corei3-Ryu:~]
> lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial
[ryuta@Shuttle-Corei3-Ryu:~]
> uname -a
Linux Shuttle-Corei3-Ryu 4.4.0-42-generic #62-Ubuntu SMP Fri Oct 7 23:11:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Kobitoを導入する前の下準備

少しばかり調べてみるとどうやらKobitoがElectronによって開発されてる云々がヒットした.

いろいろな方が既にリファレンスとしてインストールガイドに書いてる通り, Electronを導入した後にLinux用にリビルドすることでどうやら使えるらしいとの事.

自分もLinuxでの作業備忘録としてQiitaを使っている(備忘録は今のところ限定公開)ので, どうせならこの際ブラウザインターフェースのエディタ使うんじゃなくてKobitoの導入をしてみようと図った.

と前置きが少し長くなったが環境を作っていくところから記載していく.
まずはNode.jsの導入から

Terminal(Node.js導入)
> sudo apt-get install nodejs
> sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

以上2つのコマンドを実行.
正直2行目のコマンドは自分でも何をしているのかよくわかっていない……

続いてnpmコマンドを使うということだったのでnpmも導入しておく.

自分はJavaScriptについては, 現時点では全くもって使わないのでnodejsやらnpmには関係が今までなかったが, 簡単に言うとnode.jsはJavaScriptをNode.jsに食わせることでスクリプトの実行を可能とし, npmについてはJavaScript関連でのパッケージマネージャだとのこと.
解釈が間違っててもとりあえずここでは気にしない.

Terminal(npm導入)
> sudo apt-get install npm

npmの導入も完了したら続いてElectronの導入に入る.

Terminal(Electron導入)
[ryuta@Shuttle-Corei3-Ryu:~]
> sudo npm install electron-prebuilt -g
npm WARN deprecated electron-prebuilt@1.3.8: electron-prebuilt has been renamed to electron. For more details, see http://electron.atom.io/blog/2016/08/16/npm-install-electron
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js

> electron-prebuilt@1.3.8 postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js

Downloading SHASUMS256.txt
[============================================>] 100.0% of 2.77 kB (2.77 kB/s)
/usr/local/lib
└─┬ electron-prebuilt@1.3.8 
  ├─┬ electron-download@3.0.1 
  │ ├─┬ debug@2.2.0 
  │ │ └── ms@0.7.1 
  │ ├─┬ fs-extra@0.30.0 
  │ │ ├── graceful-fs@4.1.9 
  │ │ ├── jsonfile@2.4.0 
  │ │ ├── klaw@1.3.1 
  │ │ ├── path-is-absolute@1.0.1 
  │ │ └─┬ rimraf@2.5.4 
  │ │   └─┬ glob@7.1.1 
  │ │     ├── fs.realpath@1.0.0 
  │ │     ├─┬ inflight@1.0.6 
  │ │     │ └── wrappy@1.0.2 
  │ │     ├─┬ minimatch@3.0.3 
  │ │     │ └─┬ brace-expansion@1.1.6 
  │ │     │   ├── balanced-match@0.4.2 
  │ │     │   └── concat-map@0.0.1 
  │ │     └── once@1.4.0 
  │ ├── home-path@1.0.3 
  │ ├── minimist@1.2.0 
  │ ├─┬ nugget@2.0.1 
  │ │ ├─┬ pretty-bytes@1.0.4 
  │ │ │ ├── get-stdin@4.0.1 
  │ │ │ └─┬ meow@3.7.0 
  │ │ │   ├─┬ camelcase-keys@2.1.0 
  │ │ │   │ └── camelcase@2.1.1 
  │ │ │   ├── decamelize@1.2.0 
  │ │ │   ├─┬ loud-rejection@1.6.0 
  │ │ │   │ ├─┬ currently-unhandled@0.4.1 
  │ │ │   │ │ └── array-find-index@1.0.2 
  │ │ │   │ └── signal-exit@3.0.1 
  │ │ │   ├── map-obj@1.0.1 
  │ │ │   ├─┬ normalize-package-data@2.3.5 
  │ │ │   │ ├── hosted-git-info@2.1.5 
  │ │ │   │ ├─┬ is-builtin-module@1.0.0 
  │ │ │   │ │ └── builtin-modules@1.1.1 
  │ │ │   │ └─┬ validate-npm-package-license@3.0.1 
  │ │ │   │   ├─┬ spdx-correct@1.0.2 
  │ │ │   │   │ └── spdx-license-ids@1.2.2 
  │ │ │   │   └── spdx-expression-parse@1.0.4 
  │ │ │   ├── object-assign@4.1.0 
  │ │ │   ├─┬ read-pkg-up@1.0.1 
  │ │ │   │ ├── find-up@1.1.2 
  │ │ │   │ └─┬ read-pkg@1.1.0 
  │ │ │   │   ├─┬ load-json-file@1.1.0 
  │ │ │   │   │ ├─┬ parse-json@2.2.0 
  │ │ │   │   │ │ └─┬ error-ex@1.3.0 
  │ │ │   │   │ │   └── is-arrayish@0.2.1 
  │ │ │   │   │ ├── pify@2.3.0 
  │ │ │   │   │ └─┬ strip-bom@2.0.0 
  │ │ │   │   │   └── is-utf8@0.2.1 
  │ │ │   │   └── path-type@1.1.0 
  │ │ │   ├─┬ redent@1.0.0 
  │ │ │   │ ├─┬ indent-string@2.1.0 
  │ │ │   │ │ └─┬ repeating@2.0.1 
  │ │ │   │ │   └── is-finite@1.0.2 
  │ │ │   │ └── strip-indent@1.0.1 
  │ │ │   └── trim-newlines@1.0.0 
  │ │ ├─┬ progress-stream@1.2.0 
  │ │ │ ├── speedometer@0.1.4 
  │ │ │ └─┬ through2@0.2.3 
  │ │ │   ├─┬ readable-stream@1.1.14 
  │ │ │   │ └── isarray@0.0.1 
  │ │ │   └─┬ xtend@2.1.2 
  │ │ │     └── object-keys@0.4.0 
  │ │ ├─┬ request@2.76.0 
  │ │ │ ├── aws-sign2@0.6.0 
  │ │ │ ├── aws4@1.5.0 
  │ │ │ ├── caseless@0.11.0 
  │ │ │ ├─┬ combined-stream@1.0.5 
  │ │ │ │ └── delayed-stream@1.0.0 
  │ │ │ ├── extend@3.0.0 
  │ │ │ ├── forever-agent@0.6.1 
  │ │ │ ├─┬ form-data@2.1.1 
  │ │ │ │ └── asynckit@0.4.0 
  │ │ │ ├─┬ har-validator@2.0.6 
  │ │ │ │ ├─┬ chalk@1.1.3 
  │ │ │ │ │ ├── ansi-styles@2.2.1 
  │ │ │ │ │ ├── escape-string-regexp@1.0.5 
  │ │ │ │ │ ├── has-ansi@2.0.0 
  │ │ │ │ │ └── supports-color@2.0.0 
  │ │ │ │ ├─┬ commander@2.9.0 
  │ │ │ │ │ └── graceful-readlink@1.0.1 
  │ │ │ │ └─┬ is-my-json-valid@2.15.0 
  │ │ │ │   ├── generate-function@2.0.0 
  │ │ │ │   ├─┬ generate-object-property@1.2.0 
  │ │ │ │   │ └── is-property@1.0.2 
  │ │ │ │   ├── jsonpointer@4.0.0 
  │ │ │ │   └── xtend@4.0.1 
  │ │ │ ├─┬ hawk@3.1.3 
  │ │ │ │ ├── boom@2.10.1 
  │ │ │ │ ├── cryptiles@2.0.5 
  │ │ │ │ ├── hoek@2.16.3 
  │ │ │ │ └── sntp@1.0.9 
  │ │ │ ├─┬ http-signature@1.1.1 
  │ │ │ │ ├── assert-plus@0.2.0 
  │ │ │ │ ├─┬ jsprim@1.3.1 
  │ │ │ │ │ ├── extsprintf@1.0.2 
  │ │ │ │ │ ├── json-schema@0.2.3 
  │ │ │ │ │ └── verror@1.3.6 
  │ │ │ │ └─┬ sshpk@1.10.1 
  │ │ │ │   ├── asn1@0.2.3 
  │ │ │ │   ├── assert-plus@1.0.0 
  │ │ │ │   ├── bcrypt-pbkdf@1.0.0 
  │ │ │ │   ├─┬ dashdash@1.14.0 
  │ │ │ │   │ └── assert-plus@1.0.0 
  │ │ │ │   ├── ecc-jsbn@0.1.1 
  │ │ │ │   ├─┬ getpass@0.1.6 
  │ │ │ │   │ └── assert-plus@1.0.0 
  │ │ │ │   ├── jodid25519@1.0.2 
  │ │ │ │   ├── jsbn@0.1.0 
  │ │ │ │   └── tweetnacl@0.14.3 
  │ │ │ ├── is-typedarray@1.0.0 
  │ │ │ ├── isstream@0.1.2 
  │ │ │ ├── json-stringify-safe@5.0.1 
  │ │ │ ├─┬ mime-types@2.1.12 
  │ │ │ │ └── mime-db@1.24.0 
  │ │ │ ├── node-uuid@1.4.7 
  │ │ │ ├── oauth-sign@0.8.2 
  │ │ │ ├── qs@6.3.0 
  │ │ │ ├── stringstream@0.0.5 
  │ │ │ ├─┬ tough-cookie@2.3.2 
  │ │ │ │ └── punycode@1.4.1 
  │ │ │ └── tunnel-agent@0.4.3 
  │ │ ├─┬ single-line-log@1.1.2 
  │ │ │ └─┬ string-width@1.0.2 
  │ │ │   ├─┬ code-point-at@1.0.1 
  │ │ │   │ └── number-is-nan@1.0.1 
  │ │ │   ├── is-fullwidth-code-point@1.0.0 
  │ │ │   └─┬ strip-ansi@3.0.1 
  │ │ │     └── ansi-regex@2.0.0 
  │ │ └── throttleit@0.0.2 
  │ ├─┬ path-exists@2.1.0 
  │ │ └─┬ pinkie-promise@2.0.1 
  │ │   └── pinkie@2.0.4 
  │ ├─┬ rc@1.1.6 
  │ │ ├── deep-extend@0.4.1 
  │ │ ├── ini@1.3.4 
  │ │ └── strip-json-comments@1.0.4 
  │ ├── semver@5.3.0 
  │ └─┬ sumchecker@1.2.0 
  │   └── es6-promise@3.3.1 
  └─┬ extract-zip@1.5.0 
    ├─┬ concat-stream@1.5.0 
    │ ├── inherits@2.0.3 
    │ ├─┬ readable-stream@2.0.6 
    │ │ ├── core-util-is@1.0.2 
    │ │ ├── isarray@1.0.0 
    │ │ ├── process-nextick-args@1.0.7 
    │ │ ├── string_decoder@0.10.31 
    │ │ └── util-deprecate@1.0.2 
    │ └── typedarray@0.0.6 
    ├── debug@0.7.4 
    ├─┬ mkdirp@0.5.0 
    │ └── minimist@0.0.8 
    └─┬ yauzl@2.4.1 
      └─┬ fd-slicer@1.0.1 
        └── pend@1.2.0 

electron-prebuiltがelectronに名前変わりましたよーっとWARNを受けてるが無事インストールが終了したみたいなのでスルー.
インストールされた際にディレクトリ構造がズラーッと並べられると何だかわかんないけど気持ちいいよね.

下準備はこれにて以上.

Kobito for Windowsを落としてくる

Kobito for Windowsをqiitaからダウンロードしてくる.
ダウンロード対象となるファイルはzipでアーカイブされてあるので展開しておく.

Terminal(Kobitの展開)
[ryuta@Shuttle-Corei3-Ryu:~/Downloads]
> unzip kobito-v2.0.2.zip -d kobito
Archive:  kobito-v2.0.2.zip
   creating: kobito/dist/kobito-win32-ia32/
  inflating: kobito/dist/kobito-win32-ia32/content_resources_200_percent.pak  
  inflating: kobito/dist/kobito-win32-ia32/content_shell.pak  
  inflating: kobito/dist/kobito-win32-ia32/d3dcompiler_47.dll  
  inflating: kobito/dist/kobito-win32-ia32/ffmpeg.dll  
  inflating: kobito/dist/kobito-win32-ia32/icudtl.dat  
  inflating: kobito/dist/kobito-win32-ia32/kobito.exe  
  inflating: kobito/dist/kobito-win32-ia32/libEGL.dll  
  inflating: kobito/dist/kobito-win32-ia32/libGLESv2.dll  
  inflating: kobito/dist/kobito-win32-ia32/LICENSE  
  inflating: kobito/dist/kobito-win32-ia32/LICENSES.chromium.html  
   creating: kobito/dist/kobito-win32-ia32/locales/
  inflating: kobito/dist/kobito-win32-ia32/locales/am.pak  
  inflating: kobito/dist/kobito-win32-ia32/locales/ar.pak  
  inflating: kobito/dist/kobito-win32-ia32/locales/bg.pak  
                         .
                         .
                       (中略)
                         .
                         .
  inflating: kobito/dist/kobito-win32-ia32/resources/app/node_modules/semver/test/index.js  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/node_modules/semver/test/ltr.js  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/node_modules/semver/test/major-minor-patch.js  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/node_modules/semver/test/no-module.js  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/package.json  
   creating: kobito/dist/kobito-win32-ia32/resources/app/versions/
 extracting: kobito/dist/kobito-win32-ia32/resources/app/versions/.gitkeep  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/versions/2.0.0.asar  
  inflating: kobito/dist/kobito-win32-ia32/resources/electron.asar  
  inflating: kobito/dist/kobito-win32-ia32/snapshot_blob.bin  
  inflating: kobito/dist/kobito-win32-ia32/ui_resources_200_percent.pak  
 extracting: kobito/dist/kobito-win32-ia32/version  
  inflating: kobito/dist/kobito-win32-ia32/xinput1_3.dll  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/versions/2.0.1.asar  
  inflating: kobito/dist/kobito-win32-ia32/resources/app/versions/2.0.2.asar

展開が終わり次第, 展開したディレクトリに移動.

Terminal(Kobito起動前ですが準備はよろしいですか?)
[ryuta@Shuttle-Corei3-Ryu:~/Downloads/kobito]
> cd ~/Downloads/kobito/dist/kobito-win32-ia32/resources/
[ryuta@Shuttle-Corei3-Ryu:~/Downloads/kobito/dist/kobito-win32-ia32/resources]
> ls
app/  electron.asar

展開したディレクトリを掘り下げていくとappというディレクトリが見つかるので, Electronのターゲットにこのappを指定させると……

Terminal(お待たせしましたKobito起動です)
[ryuta@Shuttle-Corei3-Ryu:~/Downloads/kobito/dist/kobito-win32-ia32/resources]
> electron app/

Screenshot from 2016-11-01 14-00-01.png

無事起動まで辿りつけました.

あとは展開したKobitoのディレクトリをアプリケーションをまとめた自作のディレクトリにでも突っ込んで, そこへaliasを通すなりしてカーレントディレクトリがどこでもKobitoを起動できるようにすれば完璧.

おまけ

ここではKobitoのインストールから起動まで終了した前提で記載していく.
前項の最後で述べた『カーレントディレクトリがどこでもKobitoを起動できる』についての設定を紹介.

Linuxでお馴染みの.bashrcをテキストエディタで開き, 下のコードブロック内に沿ってaliasを通してやる.

.bashrc
# alias for Kobito
if [ -d "${HOME}/Application/Kobito/dist/kobito-win32-ia32/resources/app" ]; then
    alias kobito="electron ${HOME}/Application/Kobito/dist/kobito-win32-ia32/resources/app"
fi

自分はホームディレクトリ配下に「Application」というディレクトリを作成し, ここに展開したKobitoのディレクトリを持ってきてkobitoとシェルに伝えることでElectronでKobitoのappを起動するということにしている.

ここで注意するのは, シェルスクリプト上のパスの指定は個人個人で違うので自分で設定するということである.

Electronの守備範囲が案外広くてびっくりしたこの頃.
以上, 参考サイトの記載を以てインストールガイドの終了となります!

おまけのおまけ

KobitoからQiitaの限定共有見えんやないかーーーいwww
ついでに下書きも見えんやないかーーーいwww

参考サイト

Linux mint17.3 (ubuntu 14.04)にkobitoをインストール

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?