From d2cd69add32811fa51c16445795cab410a5d8650 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sat, 7 Apr 2018 20:57:37 +0200 Subject: [PATCH] nixify compton --- install.sh | 2 +- nix/.config/nixpkgs/home.nix | 55 +++++++++++++++++++++++++++++++++++- x/compton_default.conf | 20 ------------- x/compton_intel.conf | 5 ---- 4 files changed, 55 insertions(+), 27 deletions(-) delete mode 100644 x/compton_default.conf delete mode 100644 x/compton_intel.conf diff --git a/install.sh b/install.sh index 2b21d06..726341a 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash #!nix-shell -i bash -p stow set -e -$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gtk gpg mutt stow rofi +$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix x gpg mutt stow rofi nix build -f. $(hostname -s) diff --git a/nix/.config/nixpkgs/home.nix b/nix/.config/nixpkgs/home.nix index fc6b4d5..6592f09 100644 --- a/nix/.config/nixpkgs/home.nix +++ b/nix/.config/nixpkgs/home.nix @@ -1,4 +1,4 @@ -{ +{ pkgs, ... }: { programs = { home-manager = { enable = true; @@ -54,8 +54,61 @@ initExtra = "eval $(thefuck --alias)"; }; }; + xresources.properties = + let font = "DejaVu Sans Mono"; + fsize = 11; + dpi = 192; in + { + "URxvt.scrollstyle" = "plain"; + "URxvt.scrollBar_right" = "true"; + "URxvt.perl-ext-common" = "default,matcher,font-size,vtwheel"; + "URxvt.url-launcher" = "xdg-open"; + "URxvt.matcher.button" = "1"; + "URxvt.urgentOnBell" = "True"; + "URxvt.depth" = "32"; + "URxvt.borderColor" = "S_base03"; + # "! URxvt.background" = "[95]#202020"; + "*font" = "xft:${font}:size=${toString fsize}:antialias=true:hinting=true"; + "polybar.font" = "${font}:size=${toString fsize}:antialias=true:hinting=true;2"; + "URxvt.geometry" = "100x30"; + "URxvt.scrollColor" = "S_base0"; + + "rofi.font" = "${font} ${toString fsize}"; + "Emacs.font" = "${font}-${toString fsize}"; + + "URxvt.font-size.step" = "4"; + "URxvt.keysym.C-equal" = "perl:font-size:increase"; + "URxvt.keysym.C-minus" = "perl:font-size:decrease"; + + "Xft.dpi" = dpi; + "*dpi" = dpi; + }; + xresources.extraConfig = builtins.readFile ( + pkgs.fetchFromGitHub { + owner = "solarized"; + repo = "xresources"; + rev = "025ceddbddf55f2eb4ab40b05889148aab9699fc"; + sha256 = "0lxv37gmh38y9d3l8nbnsm1mskcv10g3i83j0kac0a2qmypv1k9f"; + } + "/Xresources.light"); xdg.configFile."streamlink/config".text = '' player = mpv --cache 2048 default-stream = best ''; + services = { + compton = { + enable = true; + backend = "glx"; + extraOptions = '' + glx-no-stencil = true; + unredir-if-possible = true; + ''; + # nvidia = '' + # paint-on-overlay = true; + # glx-no-rebind-pixmap = true; + # glx-swap-method = -1; + # xrender-sync-fence = true; + # ''; vsync = "opengl-oml"; + }; + + }; } diff --git a/x/compton_default.conf b/x/compton_default.conf deleted file mode 100644 index 88fa9d4..0000000 --- a/x/compton_default.conf +++ /dev/null @@ -1,20 +0,0 @@ -# compton (https://github.com/chjj/compton) compositor config - -# Latest git master version of compton is recommended. Configuring compton is -# tricky, these settings are what work for me with NVIDIA GeForce GTX 650 Ti, -# and the nvidia-352 driver. - -# Use GLX backend for performance and vsync: -backend = "glx" - -# Various performance optimizations: -paint-on-overlay = true; -glx-no-stencil = true; -glx-no-rebind-pixmap = true; -glx-swap-method = -1; - -# With newer NVIDIA drivers, this option is needed to prevent lags/flickering: -xrender-sync-fence = true; - -unredir-if-possible = true; -vsync = "opengl-oml"; diff --git a/x/compton_intel.conf b/x/compton_intel.conf deleted file mode 100644 index 177f251..0000000 --- a/x/compton_intel.conf +++ /dev/null @@ -1,5 +0,0 @@ -backend = "glx"; -#paint-on-overlay = true; -glx-no-stencil = true; -#glx-swap-method = 4; -unredir-if-possible = true;