GDMのスクリーンショットを撮る

GDMのスクリーンショットを撮る方法は、GnomeArt/Tutorials/GdmThemesCapturing your GDM screenに解説があるほか、検索すれば日本語で解説されたページもたくさんある。
上に示したリンクにはgdmflexiserverを使用する方法と、ImageMagickのimportコマンドを使って、仮想コンソールから実際のログイン画面を撮る方法が解説されているが、いずれも一工夫が必要だった。
importを使うには、ログイン画面でCtrl+Alt+F1を押して仮想コンソールに移動し、以下のコマンドを打つ。


$ []chvt 7 ; sleep 5 ; XAUTHORITY=/var/gdm/:0.Xauth DISPLAY=:0.0 import -window root ~/gdm.jpg[]((Ubuntuの場合/var/lib/gdm/:0.Xauth。「ps -e -o cmd |grep X」や「pstree -al |lv」などで調べる。))
[]No protocol specified[]
[]import: unable to open X server `:0.0'.[] []エラーが出て失敗する。[]
これを解決するにはsudoを使うか、ユーザーをgdmグループに入れるかしなければならない。gdmグループに入れるには、以下のようにコマンドを入力する。

$ []groups[] []現在の所属グループ[]
[]users wheel[]
$ []sudo usermod -G users,wheel,gdm []yourName

一方、gdmflexiserverを使う方法は、「ログイン画面の設定(gdmsetup)」の全般タブで、「シングル・ユーザが複数回ログインできないようにする」のチェックを外しておく必要がある。別に「gdmthemetester」というプログラムが有り、こちらはそのような制約は無いのでこちらを使うほうが良い。いずれにせよXnestをインストールする必要がある。Fedoraのパッケージ名は「xorg-x11-server-Xnest」、Ubuntuのパッケージ名は「xnest」。以下Fedoraの例。


$ []sudo yum install xorg-x11-server-Xnest[]
$ []gdmthemetester[]

[]GDM Theme Tester[]

[]Be sure to test all the environments:[]
[] console, console-timed, flexi, remote-flexi, xdmcp[]
[]Also be sure to test using caps lock[]


[]Usage: /usr/bin/gdmthemetester []
[]is one of: console, console-timed, flexi, remote-flexi, xdmcp[]
[]is either the path of the theme or the name of an installed theme[]

[]If you set the environment variable XNESTSIZE to []x[] (e.g.800x600)[]
[]you can test the greeter at that resolution[]


$ []XNESTSIZE=1024x768 gdmthemetester console-timed Avio-GDM[]

UbuntuではXNESTSIZEによる指定がうまく動作しなかった。