Compare commits

...

2 Commits

2 changed files with 39 additions and 10 deletions

View File

@@ -5,6 +5,9 @@
inputs,
...
}:
let
invert_image_avg = pkgs.callPackage ../util/inverse_color.nix;
in
{
imports = [
inputs.niri.homeModules.config
@@ -51,7 +54,9 @@
focus-ring = {
enable = true;
active = {
color = "#bf7778";
color = builtins.readFile (invert_image_avg {
src = ../wallpaper.png;
});
};
};
};
@@ -59,7 +64,7 @@
spawn-at-startup = [
{
command = [
"${lib.getExe config.programs.eww.package}"
(lib.getExe config.programs.eww.package)
"-c"
"${config.programs.eww.configDir}"
"open"
@@ -70,7 +75,7 @@
# swaybg works on more than just sway (sets a wallpaper)
{
command = [
"${lib.getExe pkgs.swaybg}"
(lib.getExe pkgs.swaybg)
"-i"
"${../wallpaper.png}"
];
@@ -79,7 +84,7 @@
# Xwayland on niri via xwayland-satellite
{
command = [
"${lib.getExe pkgs.xwayland-satellite}"
(lib.getExe pkgs.xwayland-satellite)
config.programs.niri.settings.environment.DISPLAY
];
}
@@ -125,14 +130,12 @@
# https://github.com/sodiboo/niri-flake/issues/591
switch-events = with config.lib.niri.actions; {
"lid-close".action = spawn "${pkgs.swaylock}/bin/swaylock";
"lid-close".action = spawn (lib.getExe pkgs.swaylock);
};
binds = with config.lib.niri.actions; {
# Application launcher
"Mod+Space".action = spawn [
"${pkgs.fuzzel}/bin/fuzzel"
];
"Mod+Space".action = spawn (lib.getExe pkgs.fuzzel);
"Mod+O".action = toggle-overview;
@@ -140,7 +143,7 @@
"Mod+T".action = spawn config.home.sessionVariables.TERMINAL;
# lock the screen
"Mod+X".action = spawn "${pkgs.swaylock}/bin/swaylock";
"Mod+X".action = spawn (lib.getExe pkgs.swaylock);
# screenshotting
"Print".action = screenshot;
@@ -180,7 +183,7 @@
# color picker and copies to clipboard
"Mod+Ctrl+Alt+C".action = spawn [
"${pkgs.hyprpicker}/bin/hyprpicker"
(lib.getExe pkgs.hyprpicker)
"-za"
];

View File

@@ -0,0 +1,26 @@
{
stdenv,
imagemagick,
gawk,
src,
}:
stdenv.mkDerivation {
pname = "invert-image-avg";
version = "1.0";
inherit src;
buildInputs = [
imagemagick
gawk
];
# input is a file, not a directory, skip unpackPhase
unpackPhase = "true";
# command taken from: https://old.reddit.com/r/swaywm/comments/oz3t7v/setting_a_blurred_background_with_swaylock_and/
buildPhase = ''
rm -fr $out
magick ${src} -channel RGB -negate -resize 1x1 txt: | awk 'FNR == 2 {print $3}' > $out
'';
}