diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-04-17 12:37:56 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-04-17 12:53:18 +0000 |
commit | db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a (patch) | |
tree | 7a81d38d738773abc96903e114702dd8cdd5ac21 /modules/workstation/windowing/sway/default.nix | |
parent | 0dfa02be057e7875e21fef874fa8236b894bf3b5 (diff) | |
download | nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar.gz nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar.bz2 nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar.lz nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar.xz nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.tar.zst nixlib-db03ffc0e69656dc688b4d41cdaf64b9ac2ff99a.zip |
modules/sway: rewrite status_command in C++
The execline version was nice, but I think execline is not really suitable for fairly complicated scripts that run once a second. I frequently saw it as one of the most active processes on the system, and it was probably really bad for power consumption! Before rewriting in C++, I tried C, but the string handling was extremely annoying, and Rust, but it can't do time stuff in the standard library. I didn't want to have to pull in a library just for this, so C++ it was. My first C++ program, in fact!
Diffstat (limited to 'modules/workstation/windowing/sway/default.nix')
-rw-r--r-- | modules/workstation/windowing/sway/default.nix | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/workstation/windowing/sway/default.nix b/modules/workstation/windowing/sway/default.nix index 665763f94615..5901639d1baa 100644 --- a/modules/workstation/windowing/sway/default.nix +++ b/modules/workstation/windowing/sway/default.nix @@ -29,11 +29,9 @@ inherit (cfg) extraConfig; }; - status_command = pkgs.substituteAll { - src = ./status_command.in; - isExecutable = true; - inherit (pkgs) execline; - }; + status_command = pkgs.runCommandCC "status" {} '' + c++ -std=c++17 -o $out ${./status.cpp} + ''; choose_workspace = pkgs.substituteAll { src = ./choose_workspace.sh.in; |