Closed GM-Script-Writer-62850 closed 3 years ago
You can open a pull request with these changes and I'll gladly accept it.
not sure how to make those, never bothered to figure it out, if you are like me you mat want to change some of the code formatting don't even need this feature, but i was just curious if it was supported and saw it made a error so i looked at that part of the code and was well i am here may as well add it
Well if you want to try it:
Otherwise I can add the changes myself and credit you as the source.
you can do that, still need to be noted in help documentation you can do that now
also added another feature for the sake of scripting
$ .local/bin/razer-cli --dpi print
1000 128
$ .local/bin/razer-cli --dpi print
1200
see lines 9 - 14 here, may change the output format when i make my script to watch for accidental dpi button presses only reason accidents happen is my finger hits the desk and then my finger goes into the dpi button and 4500+DPI is well beyond usable (changing the DPI via the GUI sucks when the DPI is too high or too low)
def set_dpi(device_manager):
# Iterate over each device and set DPI
for device in device_manager.devices:
# If -d argument is set, only set those devices
if (args.device and device.name in args.device) or (not args.device):
if (device.type != "mouse"):
if args.verbose:
print("Device {} is not a mouse".format(device.name))
elif args.dpi == "print":
args.dpi = str(device.dpi)[1:-1].split(', ')
if args.dpi[0] == args.dpi[1]:
print(args.dpi[0])
else:
print(args.dpi[0],args.dpi[1])
else:
if args.verbose:
print("Setting DPI of device {} to {}".format(device.name,
args.dpi))
# Save used settings for this device to a file
util.write_settings_to_file(device, dpi=args.dpi)
# Actually set DPI
args.dpi = args.dpi.split(',')
if len(args.dpi) == 1:
args.dpi.append(int(args.dpi[0]))
device.dpi = (int(args.dpi[0]), int(args.dpi[1]))
EDIT:
There is one thing i would like to complain about: please use tabs not spaces
TabError: inconsistent use of tabs and spaces in indentation
every single time i make a edit i get that annoying error
Done in #37
Proposed change to this part of the script: https://github.com/LoLei/razer-cli/blob/master/razer_cli/razer_cli.py#L140-L142
Example usage:
.local/bin/razer-cli -d "Razer DeathAdder Elite" --dpi 1200
.local/bin/razer-cli -d "Razer DeathAdder Elite" --dpi 1200,1000
It is a niche feature, but adding support is easy so why not?