From 588b28ffc177b168489a2bfbcfc9d3ccbebb78ef Mon Sep 17 00:00:00 2001 From: ElnuDev Date: Mon, 20 Feb 2023 16:51:44 -0800 Subject: [PATCH] xborders: init --- hosts/home.nix | 1 + modules/i3/default.nix | 2 +- modules/picom/default.nix | 2 +- modules/xborders/default.nix | 7 +++++++ modules/xborders/xborders.nix | 39 +++++++++++++++++++++++++++++++++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 modules/xborders/default.nix create mode 100644 modules/xborders/xborders.nix diff --git a/hosts/home.nix b/hosts/home.nix index feb1704..849904f 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -19,6 +19,7 @@ in ../modules/startpage ../modules/terminal ../modules/todo-txt + ../modules/xborders ]; home.file."./.background-image".source = theme.wallpaper; diff --git a/modules/i3/default.nix b/modules/i3/default.nix index e0c8db1..5da8475 100644 --- a/modules/i3/default.nix +++ b/modules/i3/default.nix @@ -60,7 +60,7 @@ in with theme.colors; { }; startup = [ { - command = "(systemctl --user restart polybar &) && (nm-applet &) && (nextcloud &)"; + command = "(systemctl --user restart polybar &) && (nm-applet &) && (nextcloud &) && (xborders --border-rgb ${builtins.substring 1 6 primary}ff --border-radius 12 --border-width 2 --smart-hide-border)"; always = true; notification = false; } diff --git a/modules/picom/default.nix b/modules/picom/default.nix index 57f8288..41f9b51 100644 --- a/modules/picom/default.nix +++ b/modules/picom/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ pkgs, lib, ... }: { services.picom = { diff --git a/modules/xborders/default.nix b/modules/xborders/default.nix new file mode 100644 index 0000000..f0e721b --- /dev/null +++ b/modules/xborders/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + home.packages = with pkgs; [ + (pkgs.callPackage ./xborders.nix {}) + ]; +} diff --git a/modules/xborders/xborders.nix b/modules/xborders/xborders.nix new file mode 100644 index 0000000..3ec4507 --- /dev/null +++ b/modules/xborders/xborders.nix @@ -0,0 +1,39 @@ +{ lib, pkgs, ... }: + +with pkgs; callPackage python3Packages.buildPythonPackage rec { + pname = "xborders"; + version = "3.4"; # in version.txt + src = fetchFromGitHub { + owner = "deter0"; + repo = "xborder"; + rev = "d840ed649e92b7ad399cdb1a30aeca7d09f2c08f"; + sha256 = "sha256-Q2WWXekUL/OOr/OBqJOZbAHaWURbP+coBVp206uPSNY="; + }; + buildInputs = [ libwnck gtk3 libnotify ]; + nativeBuildInputs = [ wrapGAppsHook gobject-introspection ]; + propagatedBuildInputs = with python3Packages; [ pycairo requests pygobject3 ]; + preBuild = '' + sed '52,58!d' ${pname} + sed -i '51 a\ return ${version}' ${pname} + cat >setup.py <<'EOF' + from setuptools import setup + setup( + name='${pname}', + version='${version}', + author='deter0', + description='${meta.description}', + install_requires=['pycairo', 'requests', 'PyGObject'], + scripts=[ + '${pname}', + ], + ) + EOF + ''; + meta = with lib; { + description = "Active window border replacement for window managers."; + homepage = "https://github.com/deter0/xborder"; + license = licenses.unlicense; + maitainers = with maintainers; [ elnudev ]; + platforms = platforms.linux; + }; +}