win10 opencv 项目程序移植到 ubuntu16.04: 3.项目自启动和修改分辨率
2017-05-07 15:27
483 查看
先取消登陆界面(如果ubuntu安装时选择了登陆界面)
打开 系统设置 中的 用户帐户。点击右上角的"解锁"按钮。目前
自动登录 状态是"关闭"状态。改成ON
1、网上说可以修改/etc/rc.local里添加命令来自启动,试验后发现不行。
可用下面方式查看:
systemctl status rc-local.service可查看rc.local会不会自动执行。
如果不会,设置vi /etc/rc.local进行自动执行是没有用的。
当然可以用下面文章的方法解决:
https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd
2、采用systemd的方式自启动,感觉是可行的,程序已经运行,但会出现错误提示,好像是因为有些程序未运行。比如gtk和log等。
参考:
https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux https://www.digitalocean.com/community/questions/convert-run-at-startup-script-from-upstart-to-systemd-for-ubuntu-16 https://askubuntu.com/questions/814/how-to-run-scripts-on-start-up
http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html
3、运行:From terminal or Alt+F2 dialog
run:
Applications"
但均不能存储:
可用下面方式的解决
打开 系统设置 中的 用户帐户。点击右上角的"解锁"按钮。目前
自动登录 状态是"关闭"状态。改成ON
1、网上说可以修改/etc/rc.local里添加命令来自启动,试验后发现不行。
可用下面方式查看:
systemctl status rc-local.service可查看rc.local会不会自动执行。
如果不会,设置vi /etc/rc.local进行自动执行是没有用的。
当然可以用下面文章的方法解决:
https://www.linuxbabe.com/linux-server/how-to-enable-etcrc-local-with-systemd
2、采用systemd的方式自启动,感觉是可行的,程序已经运行,但会出现错误提示,好像是因为有些程序未运行。比如gtk和log等。
参考:
https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux https://www.digitalocean.com/community/questions/convert-run-at-startup-script-from-upstart-to-systemd-for-ubuntu-16 https://askubuntu.com/questions/814/how-to-run-scripts-on-start-up
Systemd 入门教程:实战篇
http://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html3、运行:From terminal or Alt+F2 dialog
run:
gnome-session-properties.或者"Startup
Applications"
但均不能存储:
可用下面方式的解决
down voteaccepted | It sounds like a permission problem, you can try this (from a terminal):sudo chown [username]:[username] -R ~/.config If it doesn't help, try to start the "Startup Application Preferences" from a terminal using this command: gnome-session-properties You might see relevant error messages there. If the output looks useless to you, you might post it here. |
down voteaccepted5、 | It sounds like a permission problem, you can try this (from a terminal):sudo chown [username]:[username] -R ~/.config If it doesn't help, try to start the "Startup Application Preferences" from a terminal using this command: gnome-session-properties You might see relevant error messages there. If the output looks useless to you, you might post it here. 4、分辨率修改: 1,首先输入 cvt 1440 900 显示 # 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz Modeline "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync 2,接着输入 xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync --newmode后面的内容几即1中的红色部分。 3,最后输入 xrandr --addmode VGA-0 "1440x900_60.00" 注意这里的VGA-0为 步骤0中输入指令显示的名字,也可能是VGA1,具体是视机器而定 4,步骤 3完成后可以插上外接显示器,去设置里调整分辨率为 1440*900即可。如果屏幕想做偏移,可调节显示器解决。至此外接显示器的分辨率就正常了,不过为了重启系统后仍能执行我们的设置我们还需要将刚刚的三条指令写进自动执行的脚本中,终端输入 sudo gedit ~/.profile 在文件末尾追加 xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync xrandr --addmode VGA-0 "1440x900_60.00" 重启后提示错误信息: xrandr:output DP1 is not disconnected but has no modes xrandr:output DP1 is not disconnected but has no modes 怎么修改都搞不定,感觉是开机时未检测到显卡就进行配置,所以把配置命令加到自动运行脚本中就OK。最后要加一行:sudo xrandr --output VGA-1 --mode "1920x1080_60.00" |
相关文章推荐
- win10 opencv 项目程序移植到 ubuntu16.04: 1.Opencv开发环境安装
- win10 opencv 项目程序移植到 ubuntu16.04: 2.项目编译
- 修改ubuntu16.04+ win10启动的引导时间
- ubuntu16.04多机安装opencv程序
- Ubuntu 16.04设置rc.local开机启动命令/脚本的方法(通过update-rc.d管理Ubuntu开机启动程序/服务)
- Visual Studio开发Opencv项目遇到“程序无法启动问题”(ntdll.dll)
- ubuntu16.04 程序开机自启动设置及启动优化
- Ubuntu16.04交叉编译OpenCV并移植
- 修改win10和ubuntu双系统启动顺序
- ubuntu gnome 修改屏幕分辨率后无法启动到桌面
- vs2013调用opencv时项目显示 无法启动此程序,因为计算机中丢失opencv_core249.dll。请尝试重新安装改程序
- 关于Ubuntu16.04安装opencv2.4.13及编译运行opencv程序的相关问题
- ubuntu16.04 通过命令,修改屏幕分辨率
- 虚拟机中的Ubuntu16.04启动时自动设置分辨率1920x1080
- ubuntu 16.04安装后只有一个分辨率,无法用xrandr命令也无法修改xorg.conf(已解决)
- Ubuntu16.04 安装eclipse 并配置OpenCV (C/C++项目)
- U盘安装 Ubuntu 16.04 Beta2(与Win10 双启动)听语音
- opencv3.2在ubuntu16.04安装,测试程序错误分析
- 修改win10和ubuntu17.10双系统启动顺序
- ubuntu10.04修改启动画面分辨率