From 1a1322934307d2dfda63329515abc2e013811a14 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Mon, 11 Mar 2024 10:18:39 +0100 Subject: [PATCH] Add some details to README.md --- README.md | 23 ++++++++++++++++++++--- flake.nix | 1 + mainwindow.ui | 4 ++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d954053..670f5e6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,14 @@ Planned features and fixes include closing windows from within swaymux without s # Installing -Swaymux is packaged as a nix flake. To install it, add the flake input, e.g. using the following snippet: +## Requirements +This system expects the `$SWAY_SOCK` environment variable to be set and the associated socket to be bindable. If that isn't the case, this program will fail to launch. +Further, on Nix and NixOS the runtime dependencies should already be packaged. For any other system i currently do not have a good way to test, but a valid QT QPA platform plugin should be all that is needed runtime. + +## Nix and NixOS +Swaymux is packaged as a nix flake. It can be tested using `nix run git+https://git.grimmauld.de/Grimmauld/swaymux`, this will build and launch swaymux in a temporary environment that will be removed at next garbage collect in store. + +To install swaymux permanently, add the flake input, e.g. using the following snippet: ```nix swaymux = { url = "git+https://git.grimmauld.de/Grimmauld/swaymux"; @@ -23,11 +30,21 @@ environment.systemPackages = [ inputs.swaymux.packages."${system}".default ]; ``` -Keep in mind you'll need to make the system constant available, e.g. by setting `specialArgs = { inherit inputs system; };` as part of your nixosSystem definition in your systems flake. +If you want to directly copy this, keep in mind you'll need to make the system and inputs constants available, e.g. by setting `specialArgs = { inherit inputs system; };` as part of your nixosSystem definition in your systems flake. +## Other systems +This project uses cmake and requires the [nlohman json library](https://github.com/nlohmann/json) as well as QT6. +Last time I tested, both GCC and clang compilers worked. Therefore, the classic installation process with cmake, make and make install should just work, though I currently do not have a good way to test. + + +## Integrating with sway Once the package is available, it can be made available in sway by keybinding. Setting swaymux to be floating is recommended. ```sway for_window [app_id="swaymux"] floating enable bindsym $mod+c exec swaymux ``` -Available key bindings can be viewed in-App. \ No newline at end of file +Available key bindings can be viewed in-App. + +# Developing +On Nix, the flake makes `nix develop` available, which provides a development environment with all the required dependencies. It does however not provide an IDE by itself. +On any other system, or if you don't like `nix develop`, the standard way of developing cmake based c++ projects should work. Just make sure both compile and runtime dependencies are available. \ No newline at end of file diff --git a/flake.nix b/flake.nix index 609511d..4d3cd20 100644 --- a/flake.nix +++ b/flake.nix @@ -22,6 +22,7 @@ packages = with pkgs; [ # base toolchain gcc12 + clang libgcc qt6.full qtcreator diff --git a/mainwindow.ui b/mainwindow.ui index c0f1d16..8d20a4d 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -39,7 +39,7 @@ 0 - + @@ -58,7 +58,7 @@ 0 - +