树莓派常用设置
<h4>1.树莓派修改文件编辑权限</h4>
<pre><code>cd /etc/lightdm
sudo chmod 777 lightdm.conf
ls -al</code></pre>
<h4>2.树莓派禁止休眠</h4>
<h6>(如果遇到 保存时提示权限不足,请操作第1步,修改文件编辑权限步骤)</h6>
<pre><code>打开 /etc/lightdm/lightdm.conf
修改 xserver-command=X -s 0 -dpms</code></pre>
<h4>3.树莓派设置分辨率(树莓派 3B+)</h4>
<pre><code>打开 config.txt
hdmi_group=1 // 1=电视机
hdmi_mode=16 // 1920x1080@60Hz
或
hdmi_group=2 // 2=显示器
hdmi_mode=82 // 1920x1080@60Hz
通常情况下电视机也可以设置为第二种</code></pre>
<h4>4.树莓派开机打开指定页面</h4>
<pre><code>cd /home/pi/.config
mkdir autostart
cd autostart
vi my.desktop
[Desktop Entry]
Type=Application
Exec=chromium-browser --disable-popup-blocking --no-first-run --disable-desktop-notifications --kiosk "http://www.baidu.com"</code></pre>
<h4>4.树莓派固定IP设置</h4>
<pre><code class="language-csharp">打开 /etc/dhcpcd.conf 文件,在末尾增加
# 静态IP设置
# 指定静态IP,192.168.1.20
# 路由器/网关IP地址 192.168.1.1
# 手动自定义DNS服务器 255.255.255.0
interface eth0
static ip_address=192.168.1.20
static routers=192.168.1.1
static domain_name_servers=255.255.255.0
interface wlan0
static ip_address=192.168.1.20
static routers=192.168.1.1
static domain_name_servers=255.255.255.0
保存文件,重启树莓派</code></pre>