diff --git a/xgraphic/__init__.py b/xgraphic/__init__.py index 90a129a..4b43b6e 100644 --- a/xgraphic/__init__.py +++ b/xgraphic/__init__.py @@ -5,15 +5,17 @@ from os import * from subprocess import call +stubs = os.path.join(os.path.dirname(os.path.realpath(__file__)), "stubs") + def check_etc_folder(): if not os.path.exists("/etc/xgraphic"): os.makedirs("/etc/xgraphic") def to_nvidia(): check_etc_folder() - copy("stubs/xorg.conf", "/etc/X11/xorg.conf") - copy("stubs/nvidia.conf", "/usr/lib/modprobe.d/nvidia.conf") - copy("stubs/60-xgraphic-nvidia.sh", "/etc/X11/xinit/xinitrc.d/60-xgraphic-nvidia.sh") + copy(stubs+"/xorg.conf", "/etc/X11/xorg.conf") + copy(stubs+"/nvidia.conf", "/usr/lib/modprobe.d/nvidia.conf") + copy(stubs+"/60-xgraphic-nvidia.sh", "/etc/X11/xinit/xinitrc.d/60-xgraphic-nvidia.sh") call(["systemctl", "disable", "bumblebeed"]) if os.path.exists("/usr/lib/modprobe.d/bumblebee.conf"): @@ -23,8 +25,8 @@ def to_nvidia(): def to_bumblebee(): check_etc_folder() - copy("stubs/bumblebee.conf", "/usr/lib/modprobe.d/bumblebee.conf") - copy("stubs/60-xgraphic-bumblebee.sh", "/etc/X11/xinit/xinitrc.d/60-xgraphic-bumblebee.sh") + copy(stubs+"/bumblebee.conf", "/usr/lib/modprobe.d/bumblebee.conf") + copy(stubs+"/60-xgraphic-bumblebee.sh", "/etc/X11/xinit/xinitrc.d/60-xgraphic-bumblebee.sh") call(["systemctl", "enable", "bumblebeed"]) if os.path.exists("/etc/X11/xorg.conf"):