XFCEのウィンドウのサイズ変更は、Alt + 右クリック + 矢印が便利

Lin4NeuroはXFCEを採用しています。とても軽量なのでいいのですが、ウィンドウのサイズ変更でウィンドウの端を上手につかむことができず困ることがあります。
いいショートカットを教えていただきました。「Altキーを押しながら右クリックして、マウスを動かす」です。

私はマウスはできるだけ使わない方がうれしい人間なので、マウスを矢印キーで代用できないか試してみたらバッチリでした。

Alt + 右クリック + 矢印キーで、ウィンドウのサイズが比較的簡単に変更できます。

お試しあれ。

UbuntuでXPSファイルをPDFに変換する方法

Windowsでは、PDFに対抗してXPS形式という形式でファイルを出力することができます。
今はMicrosoft OfficeならばPDFに直接書き出すことができますが、それ以外のソフトウェアでは、WindowsではAdobe Acrobatやその他のPDFに出力することができるソフトウェアを使わないと直接PDF出力ができません。その点、XPS形式ならばどんなソフトウェアからも出力することができます。

出張先で、プリンタがなく、アクセスできるWindowsにPDF出力機能がない場合、XPSをとりあえず出力して、
Ubuntu側でXPSをPDFに変えられるのではないだろうか?と思いました。

そうしましたら、見つけました。その名もxpstopdfというコマンドです。
これは、libgxps-utilsというソフトウェアに入っています。

続きを読む

How to install official NVIDIA drivers on Xubuntu 14.04

(I wrote this post originally in Japanese, but this post may be helpful universally, so re-write in English.)

I got a new PC with NVIDIA GeForce GTX 750 Ti in December 2014.

At that time nvidia-current did not support GTX750Ti, so I needed to install drivers from nvidia website. However, some tweaks were needed to get things done, so I drop a note how to install NVIDIA drivers without much pain.

続きを読む

Workaround for Remastersys on Xubuntu 14.04

Remastersys is a very useful remastering tool though developing has ceased now.
Many reported that they could make Remastersys work on Ubuntu 14.04, but I encountered an error with Xubuntu 14.04.

I found workaround for this error.

Short answer: Comment out the line 245 of “/usr/bin/remastersys” beginning with [ “grep lightdm /etc/X11/default-display-manager” != “” ]

Below is the long answer.

  • Installation
  • Installation is simple.

    1. Import GPG key
    2. $ wget -O- http://www.remastersys.com/ubuntu/remastersys.gpg.key | sudo apt-key add -
      
    3. Add sources
    4. Add the line to /etc/apt/sources.list

      deb http://www.remastersys.com/ubuntu precise main

      Please note that you don’t have to replace “precise” with “trusty.”

    5. Installation
    6. $ sudo apt-get update; sudo apt-get install remastersys
      
  • Error with “remastersys dist”
  • “sudo remastersys dist” terminated with error. The below is error message;

    $ sudo remastersys dist
    Distribution Mode Selected
    Enabling remastersys-firstboot
    Adding system startup for /etc/init.d/remastersys-firstboot …
    /etc/rc0.d/K20remastersys-firstboot -> ../init.d/remastersys-firstboot
    ……
    /etc/rc5.d/S20remastersys-firstboot -> ../init.d/remastersys-firstboot
    Checking filesystem type of the Working Folder
    /home/remastersys/remastersys is on a ext4 filesystem
    Making sure popularity contest is not installed
    Installing the Ubiquity GTK frontend
    Lightdm not setup properly. You must set your default desktop with lightdm prior to remastering

    I examined the script /usr/bin/remastersys with the keyword “Lightdm.” Then I found the description below in the line 245

    [ “`grep lightdm /etc/X11/default-display-manager`” != “” ] && [ ! -f /etc/lightdm/lightdm.conf ] && [ ! -f /usr/share/xsessions/ubuntu.desktop ] && echo “Lightdm not setup properly. You must set your default desktop with lightdm prior to remastering” && echo “Lightdm not setup properly. You must set your default desktop with lightdm prior to remastering” >> $WORKDIR/remastersys.log && exit 1

    Though this line checks if the file “/etc/lightdm/lightdm.conf” exists, The latest Xubuntu 14.04 doesn’t have that lightdm.conf file in /etc/lightdm.

    So I commented out this line, just adding “#” to the beginning of the line.

    Then I tried sudo remastersys dist again, with success!

    If you want to use Remastersys in Xubuntu 14.04, it’s worth trying it.

Xubuntu12.04で問題なく動く無線LAN子機WN-G300U

Linuxでつまずきのひとつになるものに無線LAN子機があげられると思います。ネットを探しても情報は限られている印象があります。
動作するものとしないものとあり、動作しないといろいろ設定に苦しんでしまうというところがあります。私自身も以前かなり苦しんでいましたがうまくいかずにあきらめてしまっていました。

今回、オフィスの引越しに伴って自分の机がルーターから離れてしまったため、必要に駆られてXubuntuでも動作する無線LAN子機を探すことにしました。

ググったところ、こちらの記事を見つけました。Linux MintにI-O DATAのWN-G300Uシリーズが「何もせず」に動作したとのこと。

早速入手しました。

製品ホームページはこちら。2014年4月現在Amazonでは1763円で入手可能です。

それで、結果はどうかというと、

【何もせずに】動作しました!

USBにWN-G300を挿した状態でXubuntuを起動し、ネットワークのアイコンをクリックしたところ、普通にWi-fiのSSIDの一覧が表示され、自分がつなげたいSSIDを選択し、パスフレーズを入力するとあっさり接続です。

発売が2010年の機種ですが、現行で販売されていますので、Xubuntuで無駄な労力なくデスクトップで無線LAN環境を構築したい方にはおすすめの一品です。

XubuntuでPlayOnLinux経由でMS Office 2010をインストールし、日本語入力を問題なくする方法

Ubuntuにしてたいていは満足なのですが、職場で利用となると足かせになるのがOfficeの問題です。LibreOfficeでたいていは間に合うのですが、Wordの校閲機能やPowerpointのレイアウトの問題などはいかんともしがたい問題です。これは少しずつストレスになっていきます。

Wine経由でMS Office 2010をインストールできると聞いていましたが、試してみてもエラーが多い状態でした。

その後、調べていたら、PlayOnLinuxを使うとあっさりいけるよという書き込みを複数見ました。やってみたらすんなりできました。

しかし、日本語を入力すると、入力しているのに消えてしまうという問題がありました。これもいろいろ調べて、対処をしてみたのですが、うまく動かず…。
でも、よく考えてみたら、PlayOnLinux経由なのだから、設定ファイルが別なのではないか?と思ったところ、それがあたりでした。

以下に方法をまとめます。

  1. ベースのOS
  2. Xubuntu 12.04です。

  3. MS Officeのバージョン
  4. Office 2010の32bitを準備します。Office 2013は動作しません。また、Office 2010の64bit版も動作しません。

  5. Wineのインストール
  6. PlayOnLinuxはWineのフロントエンドなのでWineが必要です。オフィシャルのWineはバージョンが若干古いので、私は下記でWine-teamのPPAからWineをインストールしました。これでwine 1.6がインストールされます。これを書いている時点での最新版は1.7ですが、1.6で一連の流れに問題はありませんでした。

    sudo add-apt-repository ppa:ubuntu-wine/ppa
    sudo apt-get update
    sudo apt-get install wine
    
  7. PlayOnLinuxのインストール
  8. PlayOnLinux(POL)もUbuntuのデフォルト(4.0.14)では、Office 2010のインストールに対応していません。なので、POLのサイトから、最新版(4.2.2)をダウンロードします。
    詳細はhttp://www.playonlinux.com/en/download.htmlに記載してありますが、とりあえず、12.04の場合は下記のとおりです。

    wget -q "http://deb.playonlinux.com/public.gpg" -O- | sudo apt-key add -
    sudo wget http://deb.playonlinux.com/playonlinux_precise.list -O /etc/apt/sources.list.d/playonlinux.list
    sudo apt-get update
    sudo apt-get install playonlinux
    
  9. PlayOnLinuxの起動
  10. メニューのゲーム→PlayOnLinuxでPlayOnLinuxが起動します。
    そこで、「インストール」をクリックします。

    そうすると、下図のようになりますので、SearchからOffice 2010と入れると候補が出てきますので、選択し、右下の「インストール」をクリックします。

    POL_install01

    その後は私は既にインストールしてしまったので、スクリーンショットは示せませんが、指示された通りに従っていけば、必要なファイルなどを全部ダウンロードしてくれます。なお、インストールする場所は変更するとうまくいかないということですので、とりあえずデフォルトのまま入れてしまうのが無難なようです。

    ひと通り終わると、以下のようになります。

    POL_install02

    これでインストールは完了です。これまでの苦労は何だったんだろうと思うぐらい簡単でした。

  11. 日本語入力の設定
  12. しかし、このままだと、日本語入力の問題があります。様々なサイトが、

    ~/.wine/user.regに

    [Software\\Wine\\X11 Driver]
    “Inputstyle”=”offthespot”

    のように記載しなさい

    と書いてあります。しかし、POLを使用した場合は、それではうまくいきません。

    Officeの日本語設定は、ホームディレクトリの下の以下の場所にあります。

    ~/.PlayOnLinux/wineprefix/Office2010/user.reg

    したがって、適当なエディタでこのファイルを開けます。今はLeafpadにしましょう。(なんでもいいですが)

    leafpad ~/.PlayOnLinux/wineprefix/Office2010/user.reg
    

    そして、このファイルの一番下に以下の記述を追加します。

    [Software\\Wine\\X11 Driver]
    "InputStyle"="root"
    

    (環境によってはバックスラッシュは¥に見えると思います)

    その後、その後、POLを再起動すると、ファイルの設定を読み込み直します。

    これで日本語をうつと、インライン変換まではいかないのですが、日本語変換が画面の左下の方にあらわれ、確定した文字がきちんと表示されます。

これでさらによい環境ができあがりました。

Make battery-life of Ubuntu 12.04 longer on ThinkPad T430s

It’s been months since I swithed completely to Xubuntu 12.04 from MS Windows on my ThinkPad T430s. Basically I’m satisfied with Xubuntu 12.04, but there are some points which need tweaks. They are…

  • Battery Life
  • Somehow battery on ThinkPad T430s lasts only around 2hours on Xubuntu, which is much shorter than Windows.

  • Projector
  • XFCE is not so good at dealing with projectors or external monitors. I’m still struggling with this matter, so I don’t make any comments now.

As of battery life, I found a very good tool, which is TLP.

By installing TLP, the battery life gets longer by one hour without any modification, which is great.

You can find how to install TLP here.

JBL Flip on Xubuntu 12.04

Xubuntu 12.04からJBL FlipをBluetoothで接続しようとしたところ、すぐにはつながりませんでした。
ググったところ、このサイトが参考になりました。

pulseaudio-module-bluetoothがキモでした。

sudo apt-get install pulseaudio-module-bluetooth

これでPulseaudioの設定で音がきちんと出るようになりました。

Ubuntuのキーボードセッティング

Ubuntuではキーボードのレイアウトを簡単に変えることはできますが、「システムデフォルト」はコマンドラインでしか変えられないようです。

keyboard

変えたい時は以下をタイプすれば大丈夫です。

sudo dpkg-reconfigure keyboard-configuration

ちなみに、私はThinkapd 430sの英語キーボードを使っているので、Generic 101に変更しました。

TeX Live 2012 on Ubuntu 12.04

Windows 8.1を試しに使ってみたら、あまりにも不適応を起こしたので、この際、思い切ってメイン環境をLinuxに切り替えることにしました。

OSはXubuntu 12.04ベースのLin4Neuroです。自分が使いやすいようにカスタマイズしているので、一番自分にぴったりあっています。
Latexに関しては、TeX Live 2012を入れたいと思っていたのですが、検索したら、こちらのサイトに非常にわかりやすく解説されていました。やるべきことは下記のとおりです。

sudo apt-add-repository ppa:texlive-backports/ppa
sudo apt-get update; sudo apt-get upgrade; sudo apt-get install texlive-lang-cjk

こんなに簡単にできるのは感動ものです。

Xubuntuで用紙サイズがLetterになってしまうとき…

Xubuntuでいろいろ印刷するときに、用紙をA4と設定しても、プリンターの方で、「Letterになっています。強制印刷しますか?」のような警告が出ることがいつもでした。
原因は何だろうと思っていたら、次の変数でした。

/etc/environment
の中にLC_PAPERというものがあります。

これが、私の場合、

LC_PAPER="en_US.UTF-8"

となっていました。調べたところ、この設定だと用紙サイズのデフォルトは、Letterになること。
なので、これを

LC_PAPER="ja_JP.UTF-8"

と変えたところ、問題がなくなりました。
locale設定が用紙サイズにも影響しているんですね。
Xubuntuだけでなく、Ubuntuでも同じようなことが起こるのだと思います。

Shell color of Xubuntu

I noticed that Xubuntu overrides color of shell.
I looked for the solution and found the colorcode is in ~/.config/Terminal/terminalrc

[Configuration]
ColorForeground=#000000000000
ColorBackground=#ffffffffffff
ColorCursor=#000000000000
ColorSelection=#e3d6e3d6e3d6
ColorSelectionUseDefault=FALSE
ColorPalette2=#66660a3d0a3d
ColorPalette3=#000066661999
ColorPalette4=#4ecf2e2e6666
ColorPalette5=#171734344d4d
ColorPalette6=#800012d38000
ColorPalette7=#000080008000
ColorPalette8=#35357878b3b3
ColorPalette9=#999999999999
ColorPalette10=#80000ccd0ccd
ColorPalette11=#0000a6662999
ColorPalette12=#9d9d5c5ccccc
ColorPalette13=#262656568080
ColorPalette14=#cccc1e6dcccc
ColorPalette15=#0000aaaaaaaa
ColorPalette16=#52529393cccc
FontName=Droid Sans Mono 10
MiscAlwaysShowTabs=FALSE
MiscBell=FALSE
MiscBordersDefault=TRUE
MiscCursorBlinks=FALSE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscDefaultGeometry=80x24
MiscInheritGeometry=FALSE
MiscMenubarDefault=TRUE
MiscMouseAutohide=FALSE
MiscToolbarsDefault=FALSE
MiscConfirmClose=TRUE
MiscCycleTabs=TRUE
MiscTabCloseButtons=TRUE
MiscTabCloseMiddleClick=TRUE
MiscTabPosition=GTK_POS_TOP
MiscHighlightUrls=TRUE
TabActivityColor=#262656568080

By commenting out the items regarding Color, I got the traditional look of shell.

shell

The location of config file of Menu and Panel of Xubuntu

In the process of remastering customized Xubuntu, I spent lots of time to identify the location of config file of Menu and Panel of Xubuntu. Usually files should be located to /etc/skel, but xfce seems to have different policies.

The menu settings is stored in

~/.config/menus/xfce-applications.menu

and the panel settings is stored in

~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml

And the system-wide settings are stored in the locations below.

/etc/xdg/xdg-xubuntu/menus/xfce-applications.menu (menu)
/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml (panel)
/etc/xdg/xfce4/panel/* (panel)

You also need to copy some files in home directory to /etc/skel.

So if you want to reflect your personal customization in system-wide setting, you need to type the following from the terminal.

sudo cp ~/.config/menus/xfce-applications.menu /etc/xdg/xdg-xubuntu/menus/
sudo cp ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml \
  /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
sudo cp -r ~/.config/xfce4/panel /etc/xdg/xfce4/
sudo cp -a .config .gconf .gnome2 .local .bashrc /etc/skel
sudo cp -a ./Desktop /etc/skel/
cd /etc/skel
sudo chown -R root:root .config .gconf .gnome2 .local .bashrc Desktop