Compare commits
10 commits
35eab89df4
...
95c11fe598
| Author | SHA1 | Date | |
|---|---|---|---|
| 95c11fe598 | |||
| d2d42c4a88 | |||
| dc8cfcabed | |||
| f91da5fd02 | |||
| 056f1d02ec | |||
| def9dc0b3d | |||
| b9b3f6ee48 | |||
| 9daa95b523 | |||
| d2f358beca | |||
| 15150287c8 |
6 changed files with 29 additions and 56 deletions
2
LICENSE
2
LICENSE
|
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) <year> <copyright holders>
|
Copyright (c) 2021 Denis Lehmann
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
||||||
41
README.org
41
README.org
|
|
@ -1,6 +1,6 @@
|
||||||
* rzr
|
* rzr
|
||||||
|
|
||||||
#+begin_src text
|
#+begin_example
|
||||||
_ _ _
|
_ _ _
|
||||||
/\ \ /\ \ /\ \
|
/\ \ /\ \ /\ \
|
||||||
/ \ \ / \ \ / \ \
|
/ \ \ / \ \ / \ \
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
/ / /\ \ \ \ \ \__/\_\ / / /\ \ \
|
/ / /\ \ \ \ \ \__/\_\ / / /\ \ \
|
||||||
/ / / \ \ \ \ \___\/ // / / \ \ \
|
/ / / \ \ \ \ \___\/ // / / \ \ \
|
||||||
\/_/ \_\/ \/___/_/ \/_/ \_\/
|
\/_/ \_\/ \/___/_/ \/_/ \_\/
|
||||||
#+end_src
|
#+end_example
|
||||||
|
|
||||||
*rzr* is a simple command line frontend for [[https://openrazer.github.io/][OpenRazer]].
|
*rzr* is a simple command line frontend for [[https://openrazer.github.io/][OpenRazer]].
|
||||||
It allows to set static lighting profiles of Razer devices, based on configuration files.
|
It allows to set static lighting profiles of Razer devices, based on configuration files.
|
||||||
|
|
@ -28,9 +28,7 @@
|
||||||
|
|
||||||
All you have to do to apply the profile is to execute the following command:
|
All you have to do to apply the profile is to execute the following command:
|
||||||
|
|
||||||
#+begin_src sh
|
: $ rzr fps
|
||||||
rzr fps
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
The WASD keys get now lighted accordingly.
|
The WASD keys get now lighted accordingly.
|
||||||
|
|
||||||
|
|
@ -55,25 +53,19 @@
|
||||||
This project is a [[https://nixos.wiki/wiki/Flakes][Nix flake]].
|
This project is a [[https://nixos.wiki/wiki/Flakes][Nix flake]].
|
||||||
If you are running a recent version of the [[https://nixos.org/][Nix]] package manager and have flakes enabled, you can execute it with:
|
If you are running a recent version of the [[https://nixos.org/][Nix]] package manager and have flakes enabled, you can execute it with:
|
||||||
|
|
||||||
#+begin_src sh
|
: $ nix run github:Deleh/rzr
|
||||||
nix run github:Deleh/rzr
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
On legacy systems you need to make sure the [[https://github.com/openrazer/openrazer/tree/master/pylib][Python libraries]] for OpenRazer are in your path, then clone this repository and execute:
|
On legacy systems you need to make sure the [[https://github.com/openrazer/openrazer/tree/master/pylib][Python libraries]] for OpenRazer are in your path, then clone this repository and execute:
|
||||||
|
|
||||||
#+begin_src sh
|
: $ python setup.py install
|
||||||
python setup.py install
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Or make sure the requirements in =requirements.txt= are fulfilled and call the program directly with:
|
Or make sure the requirements in =requirements.txt= are fulfilled and call the program directly with:
|
||||||
|
|
||||||
#+begin_src sh
|
: $ python bin/rzr
|
||||||
python bin/rzr
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Usage
|
** Usage
|
||||||
|
|
||||||
#+begin_src text
|
#+begin_example
|
||||||
usage: rzr [-h] [-ld LIGHTMAP_DIRECTORY] [-pd PROFILE_DIRECTORY] [COMMAND]
|
usage: rzr [-h] [-ld LIGHTMAP_DIRECTORY] [-pd PROFILE_DIRECTORY] [COMMAND]
|
||||||
|
|
||||||
Set color profiles of your Razer devices.
|
Set color profiles of your Razer devices.
|
||||||
|
|
@ -92,7 +84,7 @@
|
||||||
path to directory with lightmaps (default: ~/.config/rzr/lightmaps)
|
path to directory with lightmaps (default: ~/.config/rzr/lightmaps)
|
||||||
-pd PROFILE_DIRECTORY, --profile-directory PROFILE_DIRECTORY
|
-pd PROFILE_DIRECTORY, --profile-directory PROFILE_DIRECTORY
|
||||||
path to directory with profiles (default: ~/.config/rzr/profiles)
|
path to directory with profiles (default: ~/.config/rzr/profiles)
|
||||||
#+end_src
|
#+end_example
|
||||||
|
|
||||||
If no command is given and the profile =default= exists, it is applied.
|
If no command is given and the profile =default= exists, it is applied.
|
||||||
|
|
||||||
|
|
@ -181,9 +173,7 @@
|
||||||
On the bottom of the /General/ section is a text field, labeled /launch options/.
|
On the bottom of the /General/ section is a text field, labeled /launch options/.
|
||||||
Insert the following command:
|
Insert the following command:
|
||||||
|
|
||||||
#+begin_src sh
|
: rzr my_favourite_game & %command%; rzr
|
||||||
rzr my_favourite_game & %command% && rzr || rzr
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
The first command applies the profile =my_favourite_game= as usual.
|
The first command applies the profile =my_favourite_game= as usual.
|
||||||
=&= ensures that the next command is called even if the first one failed.
|
=&= ensures that the next command is called even if the first one failed.
|
||||||
|
|
@ -191,10 +181,7 @@
|
||||||
|
|
||||||
Steam then substitutes the =%command%= part with the binary of the game and runs it.
|
Steam then substitutes the =%command%= part with the binary of the game and runs it.
|
||||||
|
|
||||||
The =&&= waits until the first command exited correctly, speaking you quit the game.
|
The =;= waits until the game exited and the =rzr= command finally applies your =default= profile.
|
||||||
If this is the case, the command =rzr= applies your =default= profile.
|
|
||||||
|
|
||||||
In the case of a game crash, the =|| rzr= part makes sure your =default= profile gets applied anyway.
|
|
||||||
|
|
||||||
It is neccessary that *rzr* is installed correctly and available in your =$PATH=, otherwise Steam will not be able to call it.
|
It is neccessary that *rzr* is installed correctly and available in your =$PATH=, otherwise Steam will not be able to call it.
|
||||||
|
|
||||||
|
|
@ -204,14 +191,10 @@
|
||||||
|
|
||||||
If this is the case and you still have problems, stop the daemon with the following command:
|
If this is the case and you still have problems, stop the daemon with the following command:
|
||||||
|
|
||||||
#+begin_example sh
|
: $ systemctl --user stop openrazer-daemon.service
|
||||||
systemctl --user stop openrazer-daemon.service
|
|
||||||
#+end_example
|
|
||||||
|
|
||||||
Then run it manually and check the output:
|
Then run it manually and check the output:
|
||||||
|
|
||||||
#+begin_src sh
|
: $ openrazer-daemon -Fv
|
||||||
openrazer-daemon -Fv
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
If it complains about a missing config file, put [[https://github.com/openrazer/openrazer/blob/master/daemon/resources/razer.conf][this]] file in the =~/.config/openrazer= directory and restart the daemon.
|
If it complains about a missing config file, put [[https://github.com/openrazer/openrazer/blob/master/daemon/resources/razer.conf][this]] file in the =~/.config/openrazer= directory and restart the daemon.
|
||||||
|
|
|
||||||
6
bin/rzr
6
bin/rzr
|
|
@ -213,7 +213,7 @@ def list_profiles():
|
||||||
print("No profiles available")
|
print("No profiles available")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def main():
|
||||||
|
|
||||||
global device_manager, lightmap_directory, profile_directory
|
global device_manager, lightmap_directory, profile_directory
|
||||||
|
|
||||||
|
|
@ -295,3 +295,7 @@ if __name__ == "__main__":
|
||||||
iterate_lights()
|
iterate_lights()
|
||||||
elif args.command:
|
elif args.command:
|
||||||
apply_profile(args.command)
|
apply_profile(args.command)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
|
||||||
12
flake.lock
generated
12
flake.lock
generated
|
|
@ -2,11 +2,11 @@
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619345332,
|
"lastModified": 1638122382,
|
||||||
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
|
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
|
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619637108,
|
"lastModified": 1642069818,
|
||||||
"narHash": "sha256-0wlyFJIooxYoA1vgUMeClLkz+OBLbFZZQmzJqyVC3rQ=",
|
"narHash": "sha256-666w6j8wl/bojfgpp0k58/UJ5rbrdYFbI2RFT2BXbSQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "56d46af5d0a7746cf85351536238c1cb0f32a844",
|
"rev": "46821ea01c8f54d2a20f5a503809abfc605269d7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
22
flake.nix
22
flake.nix
|
|
@ -1,55 +1,41 @@
|
||||||
{
|
{
|
||||||
description = "A simple command line frontend for OpenRazer.";
|
description = "A simple command line frontend for OpenRazer";
|
||||||
|
|
||||||
nixConfig.bash-prompt = "\[\\e[1m\\e[32mrzr-develop\\e[0m\]$ ";
|
nixConfig.bash-prompt = "\[\\e[1m\\e[32mrzr-develop\\e[0m\]$ ";
|
||||||
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
|
|
||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
packages.rzr =
|
packages.rzr =
|
||||||
|
|
||||||
pkgs.python3Packages.buildPythonApplication rec {
|
pkgs.python3Packages.buildPythonApplication rec {
|
||||||
|
|
||||||
name = "rzr";
|
name = "rzr";
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = with pkgs; [
|
propagatedBuildInputs = with pkgs; [
|
||||||
python3Packages.colour
|
python3Packages.colour
|
||||||
python3Packages.openrazer
|
python3Packages.openrazer
|
||||||
python3Packages.toml
|
python3Packages.toml
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultPackage = self.packages.${system}.rzr;
|
defaultPackage = self.packages.${system}.rzr;
|
||||||
|
|
||||||
# Development shell
|
# Development shell
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
python3
|
python3
|
||||||
python3Packages.pip
|
|
||||||
python3Packages.virtualenv
|
|
||||||
python3Packages.colour
|
python3Packages.colour
|
||||||
python3Packages.openrazer
|
python3Packages.openrazer
|
||||||
|
python3Packages.pip
|
||||||
|
python3Packages.setuptools
|
||||||
python3Packages.toml
|
python3Packages.toml
|
||||||
|
python3Packages.virtualenv
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
2
setup.py
2
setup.py
|
|
@ -8,7 +8,7 @@ setup(
|
||||||
scripts=["bin/rzr"],
|
scripts=["bin/rzr"],
|
||||||
url="https://git.opaque.tech/denis/rzr",
|
url="https://git.opaque.tech/denis/rzr",
|
||||||
license="LICENSE",
|
license="LICENSE",
|
||||||
description="A simple command line frontend for OpenRazer.",
|
description="A simple command line frontend for OpenRazer",
|
||||||
long_description=open("README.org").read(),
|
long_description=open("README.org").read(),
|
||||||
install_requires=["colour", "openrazer", "toml"],
|
install_requires=["colour", "openrazer", "toml"],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue