Nokia N900 >> Easy Debian

分析Easy Debain(LXDE)


在閲讀這篇文章前,請先閲讀司徒的分析Easy Debian(CLI)章節,因為Easy Debian的LXDE執行部份,主要包含:GUI設定和Easy Debian(CLI)命令,司徒目前只會針對GUI設定部份做解說,不再重複解說Easy Debian(CLI)部份。

桌面執行路徑:

$ cat /usr/share/applications/hildon/lxde.desktop 
  [Desktop Entry]
  Encoding=UTF-8
  Name=Debian LXDE
  GenericName=Debian LXDE
  Exec=/usr/bin/debwm
  Icon=deblet
  X-Osso-Type=application/x-executable
  X-HildonDesk-ShowInToolbar=true
  Type=Application
  StartupNotify=true

/usr/bib/debwm內容:

#!/bin/sh

# This script first attempts to raise an existing Debian WM,
# and if that fails, it will start a new Debian WM.

# Thanks again, rebhana!

fixkbdfocus "N/A Easy Debian"
if [ "$?" = 2 ] ; then
  debian-lxde
fi
行數 程式說明
8 如果Easy Debian已經在執行中,則直接使用
10 執行Easy Debian(LXDE)

/usr/bin/fixkbdfocus內容:

#!/bin/sh
#
# A small keyboard focus hack that uses qobi's workaround
#
# Provide the unique name of your window and get keyboard focus in it.
# GPL licenced. Share your code!

if [ "x$1" = "x" ] ; then
  gxmessage "Please specify a window name to focus."
  exit 1
fi

WINLIST=`wmctrl -l`
FOCUSWIN=`echo "$WINLIST" | grep -i "$1" | awk '{print $1}'`

if [ "x$FOCUSWIN" = "x" ] ; then
  # gxmessage "No window found with the name $1"
  echo "No window found with the name $1"
  exit 2
fi

#FOCUSCMD="sudo debian qobi-wmhint-fix $FOCUSWIN ; wmctrl -i -a $FOCUSWIN"
#osso-xterm "$FOCUSCMD"

sudo debian qobi-wmhint-fix $FOCUSWIN
wmctrl -i -a $FOCUSWIN
行數 程式說明
13 取得視窗列表
14 判斷"N/A Easy Debian"視窗是否存在
25 取得鍵盤控制權(參考司徒的Reverse qobi-wmhint-fix章節)
26 Active it

/usr/bin/debian-lxde內容:

#!/bin/sh
##################################
#Change these two variables to the WM of your choice.
WMEXEC="$1"
[ "x$WMEXEC" != x ] ||  WMEXEC="startlxde1"
##################################
export DISPLAY=:0
# export TSLIB_TSDEVICE=/dev/input/event3
debbie-sue 'echo "chroot is now open!"'
debbie-sue '/usr/bin/Xephyr :1 -screen 800x480 -br -ac' &
while [ "x$PARWIN" = "x" ] ; do
  # wait for Xephyr window to appear
  export PARWIN=`wmctrl -l | grep -i "N/A Xephyr" | awk '{print $1}'`
done
echo "Xephyr window ID is ($PARWIN)"
DISPLAY=:1 ; debbie-sue "habak -mf /usr/share/fonts/truetype/DroidSans-Bold.ttf \
     -ht 'Ctrl-back to return to dashboard.'"
DISPLAY=:0 ; wmctrl -i -r $PARWIN -T 'Easy Debian'
wmctrl -i -r $PARWIN -b toggle,fullscreen
zenity --display=:0 --info --title="Information" --text="Welcome to Easy Debian LXDE. This window is needed to gain keyboard focus in LXDE." &
while [ "x$TWOWIN" = "x" ] ; do
  # wait for Zenity dialog to pop up...
  export TWOWIN=`wmctrl -l | grep -i Information | awk '{print $1}'`
done
sudo debian /sbin/qobi-wmhint-fix $PARWIN
debbie-sue /usr/bin/$WMEXEC
killall Xephyr
export DISPLAY=:0
行數 程式說明
7~10 開啟xephyr server並設定解析度為800x480
11~14 等待視窗開啟
16 顯示自訂文字訊息
18~19 全視窗顯示
20~25 透過zenity顯示訊息並透過qobi-wmhint-fix取得鍵盤控制權
26 執行startlxde1

startlxde1內容:

[ "x$GTK_MODULES" != x ] || export GTK_MODULES=libgtkstylus.so
DISPLAY=:1 startlxde

執行startlxde程式,如果使用者安裝的視窗管理程式是xfce4的話,直接更改startxfce4即可。


返回上一頁