cleanup
This commit is contained in:
parent
95c11fe598
commit
a8dbaf6157
6 changed files with 38 additions and 75 deletions
|
|
@ -118,7 +118,7 @@
|
|||
t = [2, 6]
|
||||
#+end_src
|
||||
|
||||
The =tab= identifies for example the key in the third row and second colum (counting starts at 0) which is the tabulator key on the keyboard.
|
||||
The =tab= identifies for example the key in the third row and second column (counting starts at 0) which is the tabulator key on the keyboard.
|
||||
Those identifiers can then be used in profiles to set light colors.
|
||||
|
||||
*** Profiles
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
|
||||
The =;= waits until the game exited and the =rzr= command finally applies your =default= profile.
|
||||
|
||||
It is neccessary that *rzr* is installed correctly and available in your =$PATH=, otherwise Steam will not be able to call it.
|
||||
It is necessary that *rzr* is installed correctly and available in your =$PATH=, otherwise Steam will not be able to call it.
|
||||
|
||||
** Troubleshooting
|
||||
|
||||
|
|
|
|||
26
flake.lock
generated
26
flake.lock
generated
|
|
@ -1,28 +1,11 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1638122382,
|
||||
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1642069818,
|
||||
"narHash": "sha256-666w6j8wl/bojfgpp0k58/UJ5rbrdYFbI2RFT2BXbSQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "46821ea01c8f54d2a20f5a503809abfc605269d7",
|
||||
"type": "github"
|
||||
"lastModified": 0,
|
||||
"narHash": "sha256-GFzPxJzTd1rPIVD4IW+GwJlyGwBDV1Tj5FLYwDQQ9sM=",
|
||||
"path": "/nix/store/50yickar04m51aqnc43gxf45g2i0n3k9-source",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
|
|
@ -31,7 +14,6 @@
|
|||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
46
flake.nix
46
flake.nix
|
|
@ -1,42 +1,50 @@
|
|||
{
|
||||
description = "A simple command line frontend for OpenRazer";
|
||||
nixConfig.bash-prompt = "\[\\e[1m\\e[32mrzr-develop\\e[0m\]$ ";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
outputs = { self, nixpkgs }@inputs:
|
||||
let
|
||||
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix;
|
||||
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs {
|
||||
inherit system;
|
||||
});
|
||||
in
|
||||
{
|
||||
packages = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in
|
||||
{
|
||||
# Package
|
||||
packages.rzr =
|
||||
pkgs.python3Packages.buildPythonApplication rec {
|
||||
name = "rzr";
|
||||
rzr =
|
||||
pkgs.python3Packages.buildPythonPackage {
|
||||
pname = "rzr";
|
||||
version = "main";
|
||||
src = self;
|
||||
nativeBuildInputs = with pkgs; [
|
||||
wrapGAppsHook
|
||||
];
|
||||
propagatedBuildInputs = with pkgs; [
|
||||
python3Packages.colour
|
||||
python3Packages.openrazer
|
||||
python3Packages.toml
|
||||
];
|
||||
};
|
||||
defaultPackage = self.packages.${system}.rzr;
|
||||
default = self.packages.${system}.rzr;
|
||||
}
|
||||
);
|
||||
|
||||
# Development shell
|
||||
devShell = pkgs.mkShell {
|
||||
devShells = forAllSystems (system:
|
||||
let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in
|
||||
{
|
||||
rzr = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
python3
|
||||
python3Packages.colour
|
||||
python3Packages.openrazer
|
||||
python3Packages.pip
|
||||
python3Packages.setuptools
|
||||
python3Packages.toml
|
||||
python3Packages.virtualenv
|
||||
|
||||
];
|
||||
};
|
||||
default = self.devShells.${system}.rzr;
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
colour
|
||||
toml
|
||||
28
bin/rzr → rzr
Normal file → Executable file
28
bin/rzr → rzr
Normal file → Executable file
|
|
@ -12,24 +12,6 @@ import toml
|
|||
import sys
|
||||
|
||||
|
||||
def print_greeter():
|
||||
"""Print greeter."""
|
||||
greeter = """ _ _ _
|
||||
/\ \ /\ \ /\ \
|
||||
/ \ \ / \ \ / \ \
|
||||
/ /\ \ \ __/ /\ \ \ / /\ \ \
|
||||
/ / /\ \_\/___/ /\ \ \ / / /\ \_\
|
||||
/ / /_/ / /\___\/ / / / / / /_/ / /
|
||||
/ / /__\/ / / / / / / /__\/ /
|
||||
/ / /_____/ / / / _ / / /_____/
|
||||
/ / /\ \ \ \ \ \__/\_\ / / /\ \ \
|
||||
/ / / \ \ \ \ \___\/ // / / \ \ \
|
||||
\/_/ \_\/ \/___/_/ \/_/ \_\/
|
||||
"""
|
||||
|
||||
print(greeter)
|
||||
|
||||
|
||||
def error(msg, e=True):
|
||||
"""Print error to stderr and exit eventually."""
|
||||
print("ERROR: {}".format(msg), file=sys.stderr)
|
||||
|
|
@ -102,9 +84,9 @@ def apply_device_profile(device_profile):
|
|||
if "lights" in device_profile:
|
||||
for light in device_profile["lights"]:
|
||||
color_tuple = get_color_tuple((device_profile["lights"][light]))
|
||||
device.fx.advanced.matrix[
|
||||
lightmap[light][0], lightmap[light][1]
|
||||
] = color_tuple
|
||||
device.fx.advanced.matrix[lightmap[light][0], lightmap[light][1]] = (
|
||||
color_tuple
|
||||
)
|
||||
else:
|
||||
device.fx.none()
|
||||
|
||||
|
|
@ -214,12 +196,8 @@ def list_profiles():
|
|||
|
||||
|
||||
def main():
|
||||
|
||||
global device_manager, lightmap_directory, profile_directory
|
||||
|
||||
# Print greeter
|
||||
print_greeter()
|
||||
|
||||
# Parse arguments
|
||||
parser = argparse.ArgumentParser(
|
||||
description="A simple command line frontend for OpenRazer.",
|
||||
7
setup.py
7
setup.py
|
|
@ -2,11 +2,8 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name="rzr",
|
||||
version="0.0.1",
|
||||
author="Denis Lehmann",
|
||||
author_email="denis@opaque.tech",
|
||||
scripts=["bin/rzr"],
|
||||
url="https://git.opaque.tech/denis/rzr",
|
||||
scripts=["./rzr"],
|
||||
py_modules=[],
|
||||
license="LICENSE",
|
||||
description="A simple command line frontend for OpenRazer",
|
||||
long_description=open("README.org").read(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue