From e044545a5b91466c9d7e299b818b3097d11394c4 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:33:41 +0200 Subject: [PATCH] chromium autostart should be also working w/o sudo --- cbpi/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cbpi/cli.py b/cbpi/cli.py index 2631ba3..3845ab5 100644 --- a/cbpi/cli.py +++ b/cbpi/cli.py @@ -202,7 +202,7 @@ class CraftBeerPiCli(): if os.path.exists(os.path.join("/etc/xdg/autostart/","chromium.desktop")) is False: srcfile = self.config.get_file_path("chromium.desktop") destfile = os.path.join("/etc/xdg/autostart/") - shutil.copy(srcfile, destfile) + shutil.os.system('sudo cp "{}" "{}"'.format(srcfile,destfile)) print("Copied chromium.desktop to /etc/xdg/autostart/") else: print("chromium.desktop is already located in /etc/xdg/autostart/") @@ -214,7 +214,7 @@ class CraftBeerPiCli(): print("Remove chromium.desktop from /etc/xdg/autostart/") try: if os.path.exists(os.path.join("/etc/xdg/autostart/","chromium.desktop")) is True: - os.remove(os.path.join("/etc/xdg/autostart/","chromium.desktop")) + shutil.os.system('sudo rm -rf "{}"'.format(os.path.join("/etc/xdg/autostart/","chromium.desktop"))) print("Deleted chromium.desktop from /etc/xdg/autostart/") else: print("chromium.desktop is not located in /etc/xdg/autostart/")