在Linux下使用X
要在啟動X
xwin腳本的清單附後
清單中的行號只是用於閱讀
小技巧:利用此腳本,你還可以同時在一台機子的七號及八號虛擬控制台上運行兩個完全不同的X-Window Manager。
xwin腳本清單:
001 #!/bin/sh
002 #
003 # xwin This script display a text menu and allow you to select
004 # which X-Window Manager you want to use
005 # Author: Lanche , < >
006 #
007 # Backcup your $HOME/.xinirtc file while run this
008 # script first time
009 #
010 if [ -f $HOME/.xinitrc~ ];then
011 echo
012 else
013 cp $HOME/.xinitrc $HOME/.xinitrc~
014 fi
015 #
016 # Functions
017 #
018 writerc( ) {
019 tee $HOME/.xinitrc << RCFILE
020 #!/bin/sh
021 #
022 # This file writed by the xwin script
023 #
024 # Start-up items from ~/Desktop/Autostart
025 #
026 for i in \$(ls \$HOME/Desktop/Autostart/); do
027 if test -x \$HOME/Desktop/Autostart/\$i; then
028 \$HOME/Desktop/Autostart/\$i &
030 fi
031 done
032 #
033 # And launch window manager
034 #
035 RCFILE
036 }
037 #
038 getchose( ) {
039 clear
040 echo
041 echo
042 echo
043 echo
044 echo
045 echo
046 echo ' ################################################'
047 echo ' # #'
048 echo ' # 你想使用哪一個窗口管理器? #'
049 echo ' # #'
050 echo ' # #'
051 echo ' # 1 --- kde #'
052 echo ' # 2 --- xfce #'
053 echo ' # 3 --- icewm #'
054 echo ' # 4 --- mlvwm #'
055 echo ' # 5 --- Fvwm95 #'
056 echo ' # 6 --- AfterStep #'
057 echo ' # #'
058 echo ' # #'
059 echo ' ################################################'
060 echo
061 echo -n ' 請選擇:'
062 }
063 # End of Functions
064 #
065 getchose
066 read CHOSE
067 #
068 #Start the selected X-window manager
069 #
070 case $CHOSE in
071 1)
072 echo 'You chosed kde'
073 if [ -f `which kde` ];then
074 writerc
075 echo 'startkde' >> $HOME/.xinitrc
076 echo 'Starting kde...'
077 startx
078 else
079 echo 'KDE is not installed on your system!'
080 fi
081 ;;
082 2)
083 echo 'You chosed xfce'
084 if [ -f `which xfce` ];then
085 writerc
086 echo 'exec xfwm' >> $HOME/
From:http://tw.wingwit.com/Article/program/Oracle/201311/17287.html