Python 更改Arch默认启动背景画面
无聊没事干,练习下python,就用来更改Arch默认启动背景吧
准备工作:一张喜欢的背景图片,我用的是Blackarch自带的PNG格式的,其它的格式没试过。运行完成后重启看下效果
#!/usr/bin/env python
import shutil,os,sys
banner = '''\033[2;34m
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Notice: |
| This python script is test SUCCESSFULLY on Archlinux distrubtion |
| for changed the GRUB's default background |
| It will modifield the config file "/etc/defalut/grub" |
| You can choice one favorite IMAGE.PNG replace defalut |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
\033[0m '''
def change_grub_image(image_name):
try:
grub_config_path = '/etc/default/grub'
contents = 'GRUB_THEME="/usr/share/grub/themes/starfield/them