怎样让deepin_linux直接启动至终端下
Tofloor
poster avatar
str
deepin
2017-06-12 20:27
Author
如题!
直接在开机的情况下启动至终端页面下,可以省去进入桌面版,也可以减小旧本本的压力
怎样设置,不知道这样行不行,求助
Reply Favorite View the author
All Replies
avatar
152******80
Advanced Packager
2017-06-12 20:49
#1
停了lightdm应该可以吧,没试过,systemctl disable lightdm,试试?
Reply View the author
avatar
DebuggerX
deepin
2017-06-12 22:23
#2
本帖最后由 debuggerx 于 2017-6-12 14:29 编辑

我家里有个老旧的x86平板装了ubuntu平常当服务器用,也是不需要图形界面,所以我写了个脚本开机运行,自动退出图形界面,你可以参考下:

  1. #!/bin/bash
  2. sleep 3
  3. #利用tty号判断机器登录状态,tty7存在说明图形界面还在
  4. tty7=`who | awk '{print $2}' | grep 7`
  5. tty1=`who | awk '{print $2}' | grep 1`

  6. #tty7不在了,说明是ssh登录,直接退出脚本
  7. if [ "$tty7" != "tty7" ]
  8. then
  9.         exit 0
  10. fi

  11. #执行到这里说明是正常开机后手动切到了tty1
  12. if [ "$tty1" = "tty1" ]
  13. then
  14.         sleep 3
  15.         #init 3 关闭图形界面
  16.         echo "passwd" | sudo -S init 3
  17.         sleep 5
  18.         #使用给定配置连接wifi
  19.         echo "passwd" | sudo -S wpa_supplicant -i wlan0 -c wpa.conf -B &
  20.         sleep 1
  21.         echo "passwd" | sudo -S dhclient wlan0 &
  22.         sleep 1
  23.         reset
  24.         sleep 1
  25.         #打开htop实时显示机器运行状态
  26.         bash /home/debuggerx/shell/htop.sh &
  27.         echo inited
  28.         exit 0
  29. fi

  30. #执行到这里说明是正常开机,等待一会后降低屏幕亮度省电
  31. if [ "$tty7" = "tty7" ]
  32. then
  33.         sleep 20
  34.         bash /home/debuggerx/shell/brightness.sh -0.8
  35. fi
Copy the Code


我也试过网上各种修改方法,总归各种问题没能成功,最后还是用了这种很low的方式,需要开机后手动切到tty1,然后脚本会init3 结束图形界面。。
觉得麻烦的话也可以开机后打开终端手动执行sudo init 3……

Reply View the author
avatar
NewYoung
deepin
2017-06-12 23:36
#3
直接装服务端版本不就可以了?
Reply View the author
avatar
159******79
deepin
2017-06-13 03:27
#4
百度怎么修改Linux启动级别
Reply View the author