sukeesh / Jarvis

Personal Assistant for Linux and macOS
MIT License
2.99k stars 1.03k forks source link

systeminfo plugin doesnt work on macos #387

Closed bsushmith closed 5 years ago

bsushmith commented 5 years ago

Running the command systeminfo on mac gives the below error -

Traceback (most recent call last): File "/Users/Sushmith/GitHub/Jarvis/jarviscli/CmdInterpreter.py", line 143, in try_do do(s) File "/Users/Sushmith/GitHub/Jarvis/jarviscli/plugin.py", line 116, in __run_method run_method(jarvis, s) File "/Users/Sushmith/GitHub/Jarvis/jarviscli/plugins/systemOptions.py", line 36, in systeminfo__PY3 from archey import archey File "/Users/Sushmith/GitHub/Jarvis/env/lib/python3.6/site-packages/archey/archey.py", line 519, in <module> '-o', 'comm', '--no-headers'], universal_newlines=True File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 418, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['ps', '-u501', '-o', 'comm', '--no-headers']' returned non-zero exit status 1.

I tried to resolve it by removing the --no-headers by doing "comm=", but there are more issues as the plugin is trying to find /proc/cpuinfo file and it goes down a rabbithole.

It seems more like the systeminfo plugin should be disabled for mac

pnhofmann commented 5 years ago

Thanks for reporting this bug! Don't have a mac so can't test...

It seems more like the systeminfo plugin should be disabled for mac

We could use screenFetch - if installed. That's available for MacOS. Actually we switched from screenFetch to archey to avoid non-python dependencies - anyway; screenFetch is still used for python 2. If screenFetch not installed, systeminfo should definitly be disabled.

Uploaded patch: #389

bsushmith commented 5 years ago

@pnhofmann I'm trying the understand the project and In the PR #389, shouldnt the updated snippet be


@plugin(python=PYTHON3, plattform=MACOS, native="screenfetch")
def systeminfo__PY3_MAC(jarvis, s):
    """Display system information with distribution logo"""
    os.system("screenfetch")```
pnhofmann commented 5 years ago

Definitely! Shouldn't program 'on the hop'.

HorlogeSkynet commented 2 years ago

Just a quick message to tell you that macOS is now properly supported by Archey since v4.11.0 (maintainer here 👋). Bye 🙇