Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

azote: init at 1.12.9 #315453

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions pkgs/by-name/az/azote/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
lib,
fetchFromGitHub,
gobject-introspection,
gtk3,
libappindicator-gtk3,
nix-update-script,
python3,
wrapGAppsHook3,

# runtime
bash,
findutils,
gawk,
imagemagick,
procps,

# wayland
waylandSupport ? true,
sway,
swaybg,
wlr-randr,
grim,
slurp,

# x11
x11Support ? true,
feh,
maim,
slop,
xorg,
}:
python3.pkgs.buildPythonApplication rec {
Guanran928 marked this conversation as resolved.
Show resolved Hide resolved
pname = "azote";
version = "1.12.9";
pyproject = true;

src = fetchFromGitHub {
owner = "nwg-piotr";
repo = "azote";
rev = "v${version}";
hash = "sha256-ffymC1pxR6v6Qn0n9W3vENh4IGHZk1WNQog+ohuNI68=";
};

nativeBuildInputs = [
gobject-introspection
python3.pkgs.setuptools
wrapGAppsHook3
];

buildInputs = [
gtk3
libappindicator-gtk3
];

postPatch =
# FIXME: not replacing full lines due to escaping issues
Guanran928 marked this conversation as resolved.
Show resolved Hide resolved
lib.optionalString waylandSupport ''
substituteInPlace ./azote/main.py \
--replace-fail \
"batch_content = ['#!/usr/bin/env bash', 'pkill swaybg']" \
"batch_content = ['#!/usr/bin/env bash', '${lib.getExe' procps "pkill"} swaybg']" \
--replace-fail \
"swaybg -o" \
"${lib.getExe swaybg} -o"
''
+ lib.optionalString x11Support ''
substituteInPlace ./azote/main.py \
--replace-fail \
"command = \"feh --bg-{}\".format(mode)" \
"command = \"${lib.getExe feh} --bg-{}\".format(mode)"
'';

preFixup = ''
gappsWrapperArgs+=(
--prefix PYTHONPATH : ${
python3.pkgs.makePythonPath (
with python3.pkgs;
[
pygobject3
pillow
send2trash
]
)
} \
Guanran928 marked this conversation as resolved.
Show resolved Hide resolved
--prefix PATH : "${
lib.makeBinPath (
[
bash
findutils
gawk
imagemagick
procps
]
++ lib.optionals waylandSupport [
sway
swaybg
wlr-randr
grim
slurp
]
++ lib.optionals x11Support [
feh
maim
slop
xorg.xrandr
]
)
}"
)
'';

pythonImportsCheck = [ "azote" ];

passthru.updateScript = nix-update-script { };

meta = {
description = "Wallpaper manager for wlroots-based compositors and some other WMs";
homepage = "https://github.com/nwg-piotr/azote";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ Guanran928 ];
mainProgram = "azote";
};
}