linux 常用设置
VGA模式下,新增分辨率
VGA-0是显示器大的名称,自行查询
cvt 1366 768 60
// # 1368x768 59.88 Hz (CVT) hsync: 47.79 kHz; pclk: 85.25 MHz
// Modeline "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --newmode "1368x768_60.00" 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync
xrandr --addmode VGA-0 1368x768_60.00
xrandr -s 1368x768_60.00
cvt 1920 1080 60
// # 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
// Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr -s 1920x1080_60.00
将上述命令写入开机启动
Linux发行版本如CentOs等在etc目录下会有一个rc.local文件,这个文件是启动加载文件,也就是说,在我们开机后,系统会检查一遍这个文件,并且会自动执行里面写入的命令;
需要把想开机自动执行的脚本的执行路径写在这里就可以实现开机自动执行。
rc.local文件需要加上执行权限,>>chmod +x rc.local
如果deepin系统中没有这个rc.local文件,需要用vim自己写一个。文件内容如下,需要执行的放在 exit 0 上边:
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.
exit 0
如遇到创建文件不能写入,需要在vim保存命令中加上强制代码:w !sudo tee %
查询文件权限>>ls -l filename
添加写入权限>>chmod +w filename
如被占用,强制释放文件>>fuser -k filename