Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Fixed main package import problem
Browse files Browse the repository at this point in the history
  • Loading branch information
erayaydin committed Jun 21, 2017
1 parent aed6db7 commit dbfe6c4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions xgraphic/__init__.py
Expand Up @@ -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"):
Expand All @@ -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"):
Expand Down

0 comments on commit dbfe6c4

Please sign in to comment.