From 15150287c89c5dd2b2a3d31b9f32ce9916d06d23 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Thu, 29 Apr 2021 00:39:46 +0200 Subject: [PATCH 01/10] update description --- flake.nix | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index b820025..7b98b16 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - 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\]$ "; diff --git a/setup.py b/setup.py index 6c3667d..5554b5f 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( scripts=["bin/rzr"], url="https://git.opaque.tech/denis/rzr", license="LICENSE", - description="A simple command line frontend for OpenRazer.", + description="A simple command line frontend for OpenRazer", long_description=open("README.org").read(), install_requires=["colour", "openrazer", "toml"], ) From d2f358beca1f80df9bcb2cf3181b0c7f21eaffd8 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Thu, 29 Apr 2021 00:50:06 +0200 Subject: [PATCH 02/10] update license --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index d449d3e..2324481 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2021 Denis Lehmann Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 9daa95b523d1dfeab34f297175edd7c1da317075 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Sun, 2 May 2021 21:38:05 +0200 Subject: [PATCH 03/10] update README --- README.org | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.org b/README.org index 71e274e..38e731d 100644 --- a/README.org +++ b/README.org @@ -182,7 +182,7 @@ Insert the following command: #+begin_src sh - rzr my_favourite_game & %command% && rzr || rzr + rzr my_favourite_game & %command%; rzr #+end_src The first command applies the profile =my_favourite_game= as usual. @@ -191,10 +191,7 @@ 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. - 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. + 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. From b9b3f6ee48b232ea691022aba65218dfe83befe3 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Fri, 2 Jul 2021 00:59:16 +0200 Subject: [PATCH 04/10] update flake --- flake.lock | 17 ++++++++--------- flake.nix | 5 +++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index c2212f4..7d44aea 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1619345332, - "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=", + "lastModified": 1623875721, + "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", "owner": "numtide", "repo": "flake-utils", - "rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28", + "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", "type": "github" }, "original": { @@ -17,12 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1619637108, - "narHash": "sha256-0wlyFJIooxYoA1vgUMeClLkz+OBLbFZZQmzJqyVC3rQ=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "56d46af5d0a7746cf85351536238c1cb0f32a844", - "type": "github" + "lastModified": 1625037881, + "narHash": "sha256-cRYHArtHYcUQWM231IrAb4GYf6VJj9AoeW7kkShVRfc=", + "path": "/nix/store/q88kyrqnz8iaa83hpnh20x4qcd6xywn1-source", + "rev": "e9148dc1c30e02aae80cc52f68ceb37b772066f3", + "type": "path" }, "original": { "id": "nixpkgs", diff --git a/flake.nix b/flake.nix index 7b98b16..7b47cc8 100644 --- a/flake.nix +++ b/flake.nix @@ -43,11 +43,12 @@ buildInputs = with pkgs; [ python3 - python3Packages.pip - python3Packages.virtualenv python3Packages.colour python3Packages.openrazer + python3Packages.pip + python3Packages.setuptools python3Packages.toml + python3Packages.virtualenv ]; }; From def9dc0b3db5ac4eddf3a05cc7a9ec197830b602 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Sat, 16 Oct 2021 00:18:22 +0200 Subject: [PATCH 05/10] update flake --- flake.lock | 14 +++++++------- flake.nix | 15 --------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/flake.lock b/flake.lock index 7d44aea..6702fbb 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1623875721, - "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", + "lastModified": 1631561581, + "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", "owner": "numtide", "repo": "flake-utils", - "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", + "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", "type": "github" }, "original": { @@ -17,10 +17,10 @@ }, "nixpkgs": { "locked": { - "lastModified": 1625037881, - "narHash": "sha256-cRYHArtHYcUQWM231IrAb4GYf6VJj9AoeW7kkShVRfc=", - "path": "/nix/store/q88kyrqnz8iaa83hpnh20x4qcd6xywn1-source", - "rev": "e9148dc1c30e02aae80cc52f68ceb37b772066f3", + "lastModified": 1634115022, + "narHash": "sha256-K9DZMQ47VRrg9gtTPwex5p0E8LnwM/dDkNe7AQW0qj0=", + "path": "/nix/store/fjn0mcw4wcm7lkcn92bzq11f0mzv3xqv-source", + "rev": "564cb4d81d4f734dd068684adec5a60077397fe9", "type": "path" }, "original": { diff --git a/flake.nix b/flake.nix index 7b47cc8..d2c4c05 100644 --- a/flake.nix +++ b/flake.nix @@ -1,46 +1,32 @@ { 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: let pkgs = nixpkgs.legacyPackages.${system}; in { - # Package - packages.rzr = - pkgs.python3Packages.buildPythonApplication rec { - name = "rzr"; src = self; - nativeBuildInputs = with pkgs; [ wrapGAppsHook ]; - propagatedBuildInputs = with pkgs; [ python3Packages.colour python3Packages.openrazer python3Packages.toml ]; - }; - defaultPackage = self.packages.${system}.rzr; # Development shell - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ python3 python3Packages.colour @@ -50,7 +36,6 @@ python3Packages.toml python3Packages.virtualenv ]; - }; } ); From 056f1d02ecd129296f91f1bc95e740abd8971945 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Wed, 8 Dec 2021 12:15:05 +0100 Subject: [PATCH 06/10] format commands --- README.org | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index 38e731d..3543529 100644 --- a/README.org +++ b/README.org @@ -1,6 +1,6 @@ * 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]]. 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: - #+begin_src sh - rzr fps - #+end_src + : $ rzr fps The WASD keys get now lighted accordingly. @@ -55,25 +53,19 @@ 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: - #+begin_src sh - nix run github:Deleh/rzr - #+end_src + : $ nix run github:Deleh/rzr 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 - #+end_src + : $ python setup.py install Or make sure the requirements in =requirements.txt= are fulfilled and call the program directly with: - #+begin_src sh - python bin/rzr - #+end_src + : $ python bin/rzr ** Usage - #+begin_src text + #+begin_example usage: rzr [-h] [-ld LIGHTMAP_DIRECTORY] [-pd PROFILE_DIRECTORY] [COMMAND] Set color profiles of your Razer devices. @@ -92,7 +84,7 @@ path to directory with lightmaps (default: ~/.config/rzr/lightmaps) -pd PROFILE_DIRECTORY, --profile-directory PROFILE_DIRECTORY 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. @@ -181,9 +173,7 @@ On the bottom of the /General/ section is a text field, labeled /launch options/. Insert the following command: - #+begin_src sh - rzr my_favourite_game & %command%; rzr - #+end_src + : rzr my_favourite_game & %command%; rzr The first command applies the profile =my_favourite_game= as usual. =&= ensures that the next command is called even if the first one failed. @@ -201,14 +191,10 @@ 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 - #+end_example + : $ systemctl --user stop openrazer-daemon.service Then run it manually and check the output: - #+begin_src sh - openrazer-daemon -Fv - #+end_src + : $ openrazer-daemon -Fv 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. From f91da5fd026206a97261a14a5ca6c3208e232fb2 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Wed, 8 Dec 2021 12:16:43 +0100 Subject: [PATCH 07/10] update flake inputs --- flake.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index 6702fbb..606de18 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1631561581, - "narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=", + "lastModified": 1638122382, + "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "owner": "numtide", "repo": "flake-utils", - "rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19", + "rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "type": "github" }, "original": { @@ -17,10 +17,10 @@ }, "nixpkgs": { "locked": { - "lastModified": 1634115022, - "narHash": "sha256-K9DZMQ47VRrg9gtTPwex5p0E8LnwM/dDkNe7AQW0qj0=", - "path": "/nix/store/fjn0mcw4wcm7lkcn92bzq11f0mzv3xqv-source", - "rev": "564cb4d81d4f734dd068684adec5a60077397fe9", + "lastModified": 1638587357, + "narHash": "sha256-2ySMW3QARG8BsRPmwe7clTbdCuaObromOKewykP+UJc=", + "path": "/nix/store/l8f22m6qjwc97id0czn3vmhvrdqw1cdf-source", + "rev": "e34c5379866833f41e2a36f309912fa675d687c7", "type": "path" }, "original": { From dc8cfcabed407da4ba04199d31b30476b28734a5 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Fri, 14 Jan 2022 18:52:06 +0100 Subject: [PATCH 08/10] update flake inputs --- flake.lock | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 606de18..c46589a 100644 --- a/flake.lock +++ b/flake.lock @@ -17,11 +17,12 @@ }, "nixpkgs": { "locked": { - "lastModified": 1638587357, - "narHash": "sha256-2ySMW3QARG8BsRPmwe7clTbdCuaObromOKewykP+UJc=", - "path": "/nix/store/l8f22m6qjwc97id0czn3vmhvrdqw1cdf-source", - "rev": "e34c5379866833f41e2a36f309912fa675d687c7", - "type": "path" + "lastModified": 1642069818, + "narHash": "sha256-666w6j8wl/bojfgpp0k58/UJ5rbrdYFbI2RFT2BXbSQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "46821ea01c8f54d2a20f5a503809abfc605269d7", + "type": "github" }, "original": { "id": "nixpkgs", From d2d42c4a881110becbe7e851d9c1fe836338d392 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Fri, 14 Jan 2022 18:52:33 +0100 Subject: [PATCH 09/10] use main function --- bin/rzr | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/bin/rzr b/bin/rzr index bf2d71e..5800a55 100644 --- a/bin/rzr +++ b/bin/rzr @@ -15,16 +15,16 @@ import sys def print_greeter(): """Print greeter.""" greeter = """ _ _ _ - /\ \ /\ \ /\ \ - / \ \ / \ \ / \ \ - / /\ \ \ __/ /\ \ \ / /\ \ \ - / / /\ \_\/___/ /\ \ \ / / /\ \_\ - / / /_/ / /\___\/ / / / / / /_/ / / - / / /__\/ / / / / / / /__\/ / - / / /_____/ / / / _ / / /_____/ - / / /\ \ \ \ \ \__/\_\ / / /\ \ \ -/ / / \ \ \ \ \___\/ // / / \ \ \ -\/_/ \_\/ \/___/_/ \/_/ \_\/ + /\ \ /\ \ /\ \ + / \ \ / \ \ / \ \ + / /\ \ \ __/ /\ \ \ / /\ \ \ + / / /\ \_\/___/ /\ \ \ / / /\ \_\ + / / /_/ / /\___\/ / / / / / /_/ / / + / / /__\/ / / / / / / /__\/ / + / / /_____/ / / / _ / / /_____/ + / / /\ \ \ \ \ \__/\_\ / / /\ \ \ +/ / / \ \ \ \ \___\/ // / / \ \ \ +\/_/ \_\/ \/___/_/ \/_/ \_\/ """ print(greeter) @@ -213,7 +213,7 @@ def list_profiles(): print("No profiles available") -if __name__ == "__main__": +def main(): global device_manager, lightmap_directory, profile_directory @@ -295,3 +295,7 @@ if __name__ == "__main__": iterate_lights() elif args.command: apply_profile(args.command) + + +if __name__ == "__main__": + main() From 95c11fe59889ad2347d9372cd7a7bdb159575194 Mon Sep 17 00:00:00 2001 From: Denis Lehmann Date: Fri, 14 Jan 2022 18:56:37 +0100 Subject: [PATCH 10/10] fix logo --- bin/rzr | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/rzr b/bin/rzr index 5800a55..c325064 100644 --- a/bin/rzr +++ b/bin/rzr @@ -15,16 +15,16 @@ import sys def print_greeter(): """Print greeter.""" greeter = """ _ _ _ - /\ \ /\ \ /\ \ - / \ \ / \ \ / \ \ - / /\ \ \ __/ /\ \ \ / /\ \ \ - / / /\ \_\/___/ /\ \ \ / / /\ \_\ - / / /_/ / /\___\/ / / / / / /_/ / / - / / /__\/ / / / / / / /__\/ / - / / /_____/ / / / _ / / /_____/ - / / /\ \ \ \ \ \__/\_\ / / /\ \ \ -/ / / \ \ \ \ \___\/ // / / \ \ \ -\/_/ \_\/ \/___/_/ \/_/ \_\/ + /\ \ /\ \ /\ \ + / \ \ / \ \ / \ \ + / /\ \ \ __/ /\ \ \ / /\ \ \ + / / /\ \_\/___/ /\ \ \ / / /\ \_\ + / / /_/ / /\___\/ / / / / / /_/ / / + / / /__\/ / / / / / / /__\/ / + / / /_____/ / / / _ / / /_____/ + / / /\ \ \ \ \ \__/\_\ / / /\ \ \ +/ / / \ \ \ \ \___\/ // / / \ \ \ +\/_/ \_\/ \/___/_/ \/_/ \_\/ """ print(greeter)