From 95cd1beb808a37e5438f520a2d37b8728b02062a Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 30 Sep 2020 11:09:26 +0000 Subject: Attempt to enhance the search and replace of default apps in xorg. --- profiles/applications/awesome.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/profiles/applications/awesome.py b/profiles/applications/awesome.py index 1a5bed9d..e1035cac 100644 --- a/profiles/applications/awesome.py +++ b/profiles/applications/awesome.py @@ -5,9 +5,15 @@ installation.add_additional_packages("awesome xorg-server xorg-xrandr xorg-xinit with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'r') as xinitrc: xinitrc_data = xinitrc.read() -xinitrc_data = xinitrc_data.replace('twm &', '# twm &').replace('\nxclock ', '\n# xclock').replace('exec xterm', '# exec xterm') -xinitrc_data += '\nxscreensaver -no-splash &\n' +for line in xinitrc_data.split('\n'): + if 'twm &' in line: xinitrc_data.replace(line, f"# {line}") + if 'xclock' in line: xinitrc_data.replace(line, f"# {line}") + if 'xterm' in line: xinitrc_data.replace(line, f"# {line}") + +xinitrc_data += '\n' +xinitrc_data += 'xscreensaver -no-splash &\n' xinitrc_data += 'exec awesome\n' + with open(f'{installation.mountpoint}/etc/X11/xinit/xinitrc', 'w') as xinitrc: xinitrc.write(xinitrc_data) -- cgit v1.2.3-70-g09d2