Comments (16)
Yes @LoLei , I was trying on Windows.
Cool let me know if you need any help
from razer-cli.
@LoLei
It can be done using python pip repository.
You have to create the project on pip : Pypi
Then need to add the setup.py file in your code with it's installation steps. Set up project
Let me know if you required info, will work further onto this.
from razer-cli.
Thanks for reaching out @themayurkumbhar!
Yes, I've actually started packaging for PyPI a while ago in this branch, but then I implemented some other features and kinda left it stale.
I already have it in the "Test" PyPI: https://test.pypi.org/project/razercli/, but I couldn't confirm that the installation was working on machines other than mine as well. If you or anyone could test it from there and tell me if the installation is working, that'd be great, as it would tell me I was on the right path.
Keep in mind that this is an outdated version of razer-cli
.
I'd still start over in a new branch I think, since I kinda messed around with various settings in this "Test" PyPI.
from razer-cli.
Hello @LoLei
I was able to install and run the cmd razercli --help
please find the below snapshot.
however i needed to install 2 packages manually
pip install openrazer
pip intall click
it will better if these 2 packages are included as dependency in setup.py
Let me know your thoughts.
(venv) E:\Tech\python> razercli --help
Usage: razercli [OPTIONS] COMMAND [ARGS]...
Razerkeyboard CLI
Options:
--help Show this message and exit.
Commands:
off Set the mode to static, default color ff00ff
static Set the mode to static, default color ff00ff
from razer-cli.
This is very helpful, thanks @themayurkumbhar!
I haven't thought about including the dependencies in setup.py
, I'll do that.
The only thing that confuses me is the click
dependency, as I don't remember using it, and the output of the help text is also vastly different from what it should be. In fact, it has never looked like this.
Did you install it via pip install -i https://test.pypi.org/simple/ razercli
? If I use this installation method, the help text looks like this:
$ razercli --help
usage: razercli [-h] [-e EFFECT] [-v] [-c COLOR [COLOR ...]] [-l] [-ll] [-a]
[-d DEVICE [DEVICE ...]]
optional arguments:
-h, --help show this help message and exit
-e EFFECT, --effect EFFECT
set effect
-v, --verbose increase output verbosity
-c COLOR [COLOR ...], --color COLOR [COLOR ...]
choose color (default: X color1), use one argument for
hex, or three for base10 rgb
-l, --list_devices list available devices and their supported effects
-ll, --list_devices_long
list available devices and all their capabilities
-a, --automatic try to find colors and set them to all devices without
user arguments, uses X or pywal colors
-d DEVICE [DEVICE ...], --device DEVICE [DEVICE ...]
only affect these devices, same name as output of -l
from razer-cli.
Anyway, I updated the package on TestPyPI: https://test.pypi.org/project/razer-cli/
from razer-cli.
@themayurkumbhar I know what happened.
By issuing pip install openrazer
you installed https://pypi.org/project/openrazer/ i.e. https://github.com/daniellawrence/openrazer-python, which is also a Python implementation of the openrazer-pylib, and which can also be run via the command razercli -h
. This produces the same help text output for me.
So my package wasn't actually installed, is was the other one, confusingly named just openrazer
, with the CLI command razercli
.
from razer-cli.
No it's available in the real PyPI: https://pypi.org/project/razer-cli
from razer-cli.
@LoLei what pkg is exactly you released on pypi?
is it this : https://pypi.org/project/razer-cli
or
is it still in test pypi?
which is : pip install -i https://test.pypi.org/simple/razercli
from razer-cli.
i tried to install below one:
(venv) E:\Tech\python>pip install -i https://test.pypi.org/simple/ razer-cli
Looking in indexes: https://test.pypi.org/simple/
Collecting razer-cli Downloading https://test-files.pythonhosted.org/packages/42/14/d1048cacfd26e8ee978358c39065986c6d83c92f8807a9dad4eeaebaf398/razer_cli-0.9.1-py3-none-any.whl
Installing collected packages: razer-cli
Successfully installed razer-cli-0.9.1`
(venv) E:\Tech\python>razer-cli --help
Traceback (most recent call last):
File "C:\Users\snow\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\snow\AppData\Local\Programs\Python\Python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "E:\Tech\python\myeven\Scripts\razer-cli.exe\__main__.py", line 5, in <module>
File "e:\tech\python\myeven\lib\site-packages\razer_cli\razer_cli.py", line 12, in <module>
from openrazer.client import DeviceManager
ModuleNotFoundError: No module named 'openrazer.client'
Let me know what things needs to be tested will try to install.
from razer-cli.
@themayurkumbhar it's okay. You don't need to try again, but if you want to get it running you need to install openrazer via one of the packages of your distribution, not via pip. (See here under downloads.)
Also I just noticed that your file paths look like you're on Windows. Are you? If yes that's on me for not spotting this earlier. Because this tool and openrazer are for Linux only...
from razer-cli.
Hey,
First of all thank you for putting this together! I've been waiting for a Linux Razer CLI for a long time....
I used
pip install razer-cli
and then
pip3 install razer-cli
I also ran -- pip3 install setup.py
When I run razer-cli -h I get
Traceback (most recent call last):
File "/usr/local/bin/razer-cli", line 11, in
load_entry_point('razer-cli==1.2', 'console_scripts', 'razer-cli')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2793, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2411, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2417, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
ImportError: No module named razer_cli.razer_cli
If it matters I'm on Debian and I already have OpenRazer for debian...
from razer-cli.
@jdubz666
Apparently your default Python is 2.7 (as seen in the error message: /usr/lib/python2.7
). Likely the initial pip install
run also used Python 2.7.
In any case, the module does of course not exist in the 2.7 lib directory.
Try uninstalling razer-cli
and only installing via pip3:
pip uninstall razer-cli
pip3 uninstall razer-cli # maybe not needed
pip3 install razer-cli # maybe not needed
It should source the module from the Python 3 lib directory then. The environment is defined in the module (#!/usr/bin/env python3
).
from razer-cli.
Thank you for the help! Much appreciated.
I uninstalled and only installed using pip3. I can not run it with the command "razer-cli". But I can run it with "/home/pi/.local/bin/razer-cli" and I get optional arguments.
However when I run "/home/pi/.local/bin/razer-cli -a" I get the error...
Traceback (most recent call last):
File "/home/pi/.local/bin/razer-cli", line 10, in
sys.exit(main())
File "/home/pi/.local/lib/python3.7/site-packages/razer_cli/razer_cli.py", line 314, in main
color = set_color(args.color)
File "/home/pi/.local/lib/python3.7/site-packages/razer_cli/razer_cli.py", line 67, in set_color
r, g, b = get_x_color()
File "/home/pi/.local/lib/python3.7/site-packages/razer_cli/razer_cli.py", line 48, in get_x_color
r, g, b = util.hex_to_decimal(rgb)
File "/home/pi/.local/lib/python3.7/site-packages/razer_cli/util.py", line 6, in hex_to_decimal
r = int(hex_color[0:2], 16)
ValueError: invalid literal for int() with base 16: ''
from razer-cli.
@jdubz666
You must add /home/pi/.local/bin
to your $PATH
environment variable to be able to run it with just razer-cli
. (Append export PATH=/home/pi/.local/bin:$PATH
to your ~/.bashrc
if you're using bash.)
As for the second issue, can you tell me what the output of xrdb -query | grep "*color1:" | awk -F '#' '{print $2}'
is? It should output the hex color values of the colors stored in Xresources, which is used with the -a
flag. Have you tried the -c
flag to set a color manually? E.g. razer-cli -c ff00ff
. Also, xrdb
needs to be installed manually in some cases, if you haven't, it's a dependency for -a
.
from razer-cli.
Closing this issue as it has been derailed a bit.
@jdubz666 if you still need help feel free to open a new issue.
from razer-cli.
Related Issues (20)
- [Patch] Improve readability of device capabilities HOT 1
- -ll and -llh possible at once HOT 1
- [Patch] Process -l last
- [Patch] Flag for: device_manager.sync_effects = True/False
- Show Brightness for mouse in -l output HOT 13
- [patch] Revise --dpi print & --poll print options HOT 1
- Effect option is very broken on mouse [Razer DeathAdder Elite] HOT 25
- [Patch] Make use of settings file and update color input to support many colors at once HOT 3
- Show current colors, effect, speed, and wave_dir in --list_devices HOT 9
- Code debugging lines should be removed from production copy HOT 1
- This can be cleaner since get_x_color is better [default_color in set_effect_to_device] HOT 1
- Effect is supported by device but not yet implemented - Spectrum HOT 8
- Drop sys from argument_parser.py (optimization patch) HOT 4
- Reactive effect for Razer Mousepad (Firefly) doesn't work HOT 5
- [Feature Request] lights off when @ lock screen HOT 2
- Listing options cause an error and change device settings HOT 16
- Listing options outputs an error HOT 15
- openrazer.client.DaemonNotFound: Could not connect to daemon HOT 1
- Can't Autostart --restore on startup
- Cannot list devices due to getLowBatteryThreshold not being a valid method HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from razer-cli.