diff --git a/src/mouseinfo/__init__.py b/src/mouseinfo/__init__.py index c16eaf0..c12233a 100644 --- a/src/mouseinfo/__init__.py +++ b/src/mouseinfo/__init__.py @@ -30,7 +30,7 @@ # by copying the code for the position() and screenshot() functions into this # source code file. import datetime, subprocess - +import platform try: from PIL import Image _PILLOW_INSTALLED = True @@ -188,6 +188,12 @@ def _linuxGetPixel(x, y): RUNNING_PYTHON_2 = sys.version_info[0] == 2 +cond==platform.platform().split('-')[3]=='MANJARO' +EXIT_MSG='NOTE: You must install tkinter on Linux to use MouseInfo. Run the following: ' +if cond: + EXIT_MSG='pacman -S tk' +else: + EXIT_MSG='sudo apt-get install python-tk python-dev' if platform.system() == 'Linux': if RUNNING_PYTHON_2: try: @@ -195,7 +201,7 @@ def _linuxGetPixel(x, y): ttk = tkinter from Tkinter import Event except ImportError: - sys.exit('NOTE: You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python-tk python-dev') + sys.exit(EXIT_MSG) else: # Running Python 3+: try: @@ -203,7 +209,7 @@ def _linuxGetPixel(x, y): from tkinter import ttk from tkinter import Event except ImportError: - sys.exit('NOTE: You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python3-tk python3-dev') + sys.exit(EXIT_MSG) else: # Running Windows or macOS: if RUNNING_PYTHON_2: