搜索
您的当前位置:首页正文

ubuntu安装xfce桌面

来源:小奈知识网

安装xfce桌面

安装xubuntu-desktop

sudo apt update
sudo apt upgrade
sudo apt install xubuntu-desktop

切换lightdm图形界面

sudo dpkg-reconfigure lightdm

在/etc/lightdm/lightdm.conf中修改配置文件
如果没有lightdm.conf这个文件在/etc/lightdm/lightdm.conf.d路径下,创建自动登录的配置文件

sudo touch  config.conf

设置自动登陆

sudo nano /etc/lightdm/lightdm.conf
[Seat:*]
autologin-session=xubuntu
autologin-user=name #需要登录的账户名
autologin-user-timeout=0

添加下面行隐藏鼠标光标

xserver-command=X -bs -core -nocursor

安装中文字体包,安装后reboot重启

sudo apt-get install fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp fonts-arphic-gkai00mp 
# 安装语言包(前两个中文简体,后面是中文繁体)

xfce更改桌面壁纸

查看可以设置的所有通道

 xfconf-query -l

 xfconf-query -c xfce4-desktop -lv

设置壁纸

xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitorHDMI-1/workspace0/last-image -s ~/xx.jpg

移除桌面图标

xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0

设置屏幕长亮

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-ac -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/blank-on-battery -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-sleep -s 0
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/dpms-on-battery-off -s 0

也可以用这个命令,在~./bashrc中写下面的命令

xset s off -dpms

隐藏任务栏

xfconf-query -c xfce4-panel -p /panels/panel-0/autohide-behavior  -s 2

开机自动执行

方法一
修改rc.local.service

sudo vim /lib/systemd/system/rc-local.service

添加下面命令,这部分配置需要通过 systemctl enable 命令来激活,并且可以通过 systemctl disable 命令禁用。

[Install]
WantedBy=multi-user.target

在/etc/rc.local中添加需要开机启动的脚本,并添加执行权限给rc.local

su orangepi -c 'exec /home/orangepi/pi/python/uav/cmd/start'
exit 0

然后使能rc-local.service

sudo systemctl enable rc-local.service #使能

可以检查状态

sudo systemctl status rc-local.service 

方法2
systemd启动方式
创建启动文件

sudo vim /etc/systemd/system/xrce.service

主要有以下几项,这里设置开机启动MicroXRCEAgent

[Unit]
Description=xrce auto start                    #服务的名称
After=network-online.target
[Service]
Type=simple
ExecStart=MicroXRCEAgent udp4 -p 8888  #需要执行的脚本
[Install]
WantedBy=multi-user.target

使能开机自启

sudo systemctl daemon-reload
sudo systemctl enable xrce.service

可以手动启动看看有没有错误

sudo systemctl start xrce.service
sudo systemctl status xrce.service

自启服务正常开启

方法3
新建一个autorun.desktop文件写入下面内容

[Desktop Entry]
Name=myapp
Exec=python /home/orangepi/pi/python/main.py #需要运行的python程序
Terminal=true 
Type=Application

然后将.desktop文件转移到系统文件夹/etc/xdg/autostart/中, 然后重启。如果不需要了直接删除就可以

使用nohup记录

如果要记录python中输出的内容可以在Exec=的后面加上nohup命令,可以捕获python 的输出到~/nohup.out中,使用tail -f nohup.out查看即可

因篇幅问题不能全部显示,请点此查看更多更全内容

Top