From f91944e302901c79aa46916d5c95134de63195a6 Mon Sep 17 00:00:00 2001 From: "Agatha V. Lovelace" Date: Tue, 20 Jun 2023 17:19:03 +0200 Subject: [PATCH] Fix monocle layout transparency --- common/fragments/graphical/bspwm.nix | 9 ++++++--- common/fragments/graphical/default.nix | 1 + common/pkgs/bin.nix | 8 ++++---- common/pkgs/bspm.nix | 21 +++++++++++++++++++++ common/pkgs/pads.nix | 11 +++++------ hosts/ritual/configuration.nix | 5 ++++- 6 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 common/pkgs/bspm.nix diff --git a/common/fragments/graphical/bspwm.nix b/common/fragments/graphical/bspwm.nix index 8e9fd98..e483dd4 100644 --- a/common/fragments/graphical/bspwm.nix +++ b/common/fragments/graphical/bspwm.nix @@ -8,13 +8,16 @@ "setxkbmap" ]; extraConfig = let - startOnce = procs: map (v: "! pgrep ${v} && ${v} &") procs; + startOnce = procs: + map (v: "! pgrep ${builtins.head (lib.splitString " " v)} && ${v} &") + procs; startup = startOnce [ "firefox" "element-desktop" "telegram-desktop" "spotify" "geary" + "bspm -d" ]; in lib.strings.concatStringsSep "\n" ([ "nitrogen --set-zoom-fill ${ @@ -104,8 +107,8 @@ # Close/kill window "super + {_,shift + }w" = "bspc node -{c,k}"; # Monocle layout - "super + m" = - "for node_i in $(bspc query -N -n '.!focused.window' -d focused); bspc node $node_i -g hidden; end; bspc desktop -l next"; + "super + m" = "bspm monocle --toggle"; + "super + shift + m" = "bspm monocle --next"; # Toggle hide all windows "super + d" = "bspc query -N -n .window | xargs -I node_id bspc node node_id -g hidden"; diff --git a/common/fragments/graphical/default.nix b/common/fragments/graphical/default.nix index 1a6ce4d..210212e 100644 --- a/common/fragments/graphical/default.nix +++ b/common/fragments/graphical/default.nix @@ -50,6 +50,7 @@ xdg-utils xdotool yubioath-flutter + bspm ]; # Brightness/volume keys diff --git a/common/pkgs/bin.nix b/common/pkgs/bin.nix index d75528b..337de9d 100644 --- a/common/pkgs/bin.nix +++ b/common/pkgs/bin.nix @@ -1,10 +1,10 @@ -{ rustPlatform, fetchFromGitHub, git }: +{ pkgs }: -rustPlatform.buildRustPackage rec { +pkgs.rustPlatform.buildRustPackage rec { pname = "bin"; version = "3bbd64611f2a5dee91528976f6db17ff9844315a"; - src = fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "WantGuns"; repo = pname; rev = version; @@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec { cargoLock = { lockFile = "${src}/Cargo.lock"; }; - nativeBuildInputs = [ git ]; + nativeBuildInputs = [ pkgs.git ]; meta = { description = "highly opinionated, minimal pastebin"; diff --git a/common/pkgs/bspm.nix b/common/pkgs/bspm.nix new file mode 100644 index 0000000..5da8708 --- /dev/null +++ b/common/pkgs/bspm.nix @@ -0,0 +1,21 @@ +{ pkgs }: +pkgs.buildGoModule rec { + pname = "bspm"; + version = "v0.0.9"; + + src = pkgs.fetchFromGitHub { + owner = "diogox"; + repo = pname; + rev = version; + sha256 = "sha256-ocnvTUANmJ6186Dktr5GaotbkZKZymKiIHICgTIRtjc="; + }; + + vendorSha256 = "sha256-Oj6i4/K0LAubu2aSoXcC6bZtTp8/N0cbvG+KWjA5/nw="; + + doCheck = false; + + meta = { + description = "The bspwm manager"; + homepage = "https://github.com/diogox/bspm"; + }; +} diff --git a/common/pkgs/pads.nix b/common/pkgs/pads.nix index 7a4a4eb..0d3a3ca 100644 --- a/common/pkgs/pads.nix +++ b/common/pkgs/pads.nix @@ -1,10 +1,9 @@ -{ rustPlatform, fetchFromGitHub, libpulseaudio, pkg-config }: - -rustPlatform.buildRustPackage rec { +{ pkgs }: +pkgs.rustPlatform.buildRustPackage rec { pname = "pads"; version = "89d69d4b9b199e08671c947120d5b2e1b6295d68"; - src = fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "dogue"; repo = pname; rev = version; @@ -13,8 +12,8 @@ rustPlatform.buildRustPackage rec { cargoLock = { lockFile = "${src}/Cargo.lock"; }; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libpulseaudio ]; + nativeBuildInputs = [ pkgs.pkg-config ]; + buildInputs = [ pkgs.libpulseaudio ]; meta = { description = diff --git a/hosts/ritual/configuration.nix b/hosts/ritual/configuration.nix index 0815425..74e217a 100644 --- a/hosts/ritual/configuration.nix +++ b/hosts/ritual/configuration.nix @@ -7,7 +7,10 @@ ]; nixpkgs.overlays = [ - (final: prev: { pads = final.callPackage ../../common/pkgs/pads.nix { }; }) + (final: prev: { + pads = final.callPackage ../../common/pkgs/pads.nix { }; + bspm = final.callPackage ../../common/pkgs/bspm.nix { }; + }) ]; # Bootloader.