GDMのテーマを改造してログイン画面にHibernateボタンを表示させる
Ubuntu(Hardy)のGDMにはハイバネート(休止)を表示するパッチが当たっており、「アクション」をクリックするかF10を押すとハイバネートを選択する事ができる。しかしほとんどすべてのテーマはハイバネートボタンを用意していないため、グリーターにハイバネートのボタンが表示されない。
そこでテーマを改造して、ハイバネートボタンを表示させてみる。
まず改造するテーマとして、人気のあるAvio-Sunshine-GDMをダウンロードし、AvioSunshineGDM.xmlを書き換える。
$ []wget 'http://www-e.uni-magdeburg.de/oelgarte/gdm/Avio-Sunshine-GDM-0.7.tar.gz'[] $ []tar zxf Avio-Sunshine-GDM-0.7.tar.gz[] $ []cd Avio-Sunshine-GDM[] $ []patch AvioSunshineGDM.xml[] < []../AvioGDM.patch[]
AvioGDM.patch:
--- /usr/share/gdm/themes/Avio-Sunshine-GDM/AvioSunshineGDM.xml.orig +++ /usr/share/gdm/themes/Avio-Sunshine-GDM/AvioSunshineGDM.xml @@ -346,6 +346,35 @@ </item> </box> </item> +<!-- hibernate button --> + <item type="rect" id="hibernate_button" button="true"> + <pos x="0" y="0" width="100%" height="box" anchor="nw"/> + <show type="hibernate"/> + <box> + <item type="pixmap"> + <pos height="box" width="100%"/> + <normal file="selection.png"/> + <prelight file="selection-prelight.png"/> + <active file="selection-active.png"/> + <box spacing="5" xpadding="3" ypadding="2" orientation="horizontal"> + <item type="pixmap"> + <pos y="50%" width="24" height="24" anchor="w"/> + <normal file="hibernate.png"/> + <prelight file="hibernate-prelight.png"/> + <active file="hibernate-active.png"/> + </item> + <item type="label"> + <pos y="50%" width="50" height="20" anchor="w"/> + <normal color="#f0f0f0" font="Bitstream Vera Sans Bold 10"/> + <prelight color="#ffffff" font="Bitstream Vera Sans Bold 10"/> + <active color="#ffffff" font="Bitstream Vera Sans Bold 10"/> + <text>_Hibernate</text> + <text xml:lang="ja">ハイバネート(_H)</text> + </item> + </box> + </item> + </box> + </item> <!-- halt button --> <item type="rect" id="halt_button" button="true"> <pos x="0" y="0" width="100%" height="box" anchor="nw"/>
suspendボタンの画像の色を変換してHibernateボタンの画像を作る。
$ []ls[] ...省略... []suspend-active.png suspend-prelight.png suspend.png[] ...省略... $ []for file in suspend*png ; do convert -modulate 100,100,33 $file hibernate${file##suspend} ;done[] []suspend*pngを緑にしてhibernate*pngに保存[] $ []ls[] ...省略... []hibernate-active.png hibernate-prelight.png hibernate.png[] []suspend-active.png suspend-prelight.png suspend.png[] ...省略... $ []cd ..[] $ []tar zcf Avio-Sunshine-GDM-0.7.tar.gz Avio-Sunshine-GDM[] []tarボールにまとめ直す[] $ []rm -rf Avio-Sunshine-GDM[] []ゴミ掃除[]
後はいつもの通り「ログイン画面(gdmsetup)」からインストールする。
改造前
改造後