[英]Ubuntu - How to run python script after logging in?
I created a simple python script to change my ubuntu wallpaper. 我创建了一个简单的python脚本来更改我的ubuntu壁纸。 I want to this script run after whenever I logged in.
我想在每次登录后运行此脚本。
python /bin/wallpaper_changer.py
but it doesn't work. python /bin/wallpaper_changer.py
但它不起作用。 ~/.config/autostart/Myscript.desktop
but it also doesn't work. ~/.config/autostart/Myscript.desktop
添加一个桌面条目,但是它也无法正常工作。 sudo crontab -e
@reboot python /bin/wallpaper_changer.py
it also doesn't work. sudo crontab -e
@reboot python /bin/wallpaper_changer.py
在crontab中添加了此文件路径,它也行不通。 python /bin/wallpaper_changer.py
it also doesn't work python /bin/wallpaper_changer.py
条目,它也不起作用 I found solution for this. 我找到了解决方案。 first make your source file executable.
首先使您的源文件可执行。
chmod +x /path/to/your/file
after add it to cron tab. 将其添加到cron选项卡之后。
sudo crontab -e
If it asks for any editor choose editor options. 如果要求任何编辑器,请选择编辑器选项。 after it add your path when # symbols end.
在#符号结束时添加路径。
@reboot /path/to/your/file
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.