tv: add Xresources module

This commit is contained in:
tv 2019-04-24 23:44:37 +02:00
parent c195713bc2
commit f775d3a7e6
4 changed files with 96 additions and 51 deletions

View File

@ -1,58 +1,60 @@
{ config, lib, pkgs, ... }:
with import <stockholm/lib>; with import <stockholm/lib>;
{ config, pkgs, ... }: {
pkgs.writeText "Xresources" /* xdefaults */ '' tv.Xresources = {
URxvt*cutchars: "\\`\"'&()*,;<=>?@[]^{|}" "URxvt*cutchars" = ''"\\`\"'&()*,;<=>?@[]^{|}"'';
URxvt*eightBitInput: false "URxvt*eightBitInput" = "false";
URxvt*font: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 "URxvt*font" = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1";
URxvt*boldFont: -*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1 "URxvt*boldFont" = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1";
URxvt*scrollBar: false "URxvt*scrollBar" = "false";
URxvt*background: #050505 "URxvt*background" = "#050505";
URxvt*foreground: #d0d7d0 "URxvt*foreground" = "#d0d7d0";
URxvt*cursorColor: #f042b0 "URxvt*cursorColor" = "#f042b0";
URxvt*cursorColor2: #f0b000 "URxvt*cursorColor2" = "#f0b000";
URxvt*cursorBlink: off "URxvt*cursorBlink" = "off";
URxvt*jumpScroll: true "URxvt*jumpScroll" = "true";
URxvt*allowSendEvents: false "URxvt*allowSendEvents" = "false";
URxvt*charClass: 33:48,37:48,45-47:48,64:48,38:48,61:48,63:48 "URxvt*charClass" = "33:48,37:48,45-47:48,64:48,38:48,61:48,63:48";
URxvt*cutNewline: False "URxvt*cutNewline" = "False";
URxvt*cutToBeginningOfLine: False "URxvt*cutToBeginningOfLine" = "False";
URxvt*color0: #232342 "URxvt*color0" = "#232342";
URxvt*color3: #c07000 "URxvt*color3" = "#c07000";
URxvt*color4: #4040c0 "URxvt*color4" = "#4040c0";
URxvt*color7: #c0c0c0 "URxvt*color7" = "#c0c0c0";
URxvt*color8: #707070 "URxvt*color8" = "#707070";
URxvt*color9: #ff6060 "URxvt*color9" = "#ff6060";
URxvt*color10: #70ff70 "URxvt*color10" = "#70ff70";
URxvt*color11: #ffff70 "URxvt*color11" = "#ffff70";
URxvt*color12: #7070ff "URxvt*color12" = "#7070ff";
URxvt*color13: #ff50ff "URxvt*color13" = "#ff50ff";
URxvt*color14: #70ffff "URxvt*color14" = "#70ffff";
URxvt*color15: #ffffff "URxvt*color15" = "#ffffff";
URxvt*iso14755: False "URxvt*iso14755" = "False";
URxvt*urgentOnBell: True "URxvt*urgentOnBell" = "True";
URxvt*visualBell: True "URxvt*visualBell" = "True";
! ref https://github.com/muennich/urxvt-perls # ref https://github.com/muennich/urxvt-perls
URxvt*perl-ext: default,url-select "URxvt*perl-ext" = "default,url-select";
URxvt*keysym.M-u: perl:url-select:select_next "URxvt*keysym.M-u" = "perl:url-select:select_next";
URxvt*url-select.launcher: /etc/per-user/${config.krebs.build.user.name}/bin/ff -new-tab "URxvt*url-select.launcher" =
URxvt*url-select.underline: true "/etc/per-user/${config.krebs.build.user.name}/bin/ff -new-tab";
URxvt*colorUL: #4682B4 "URxvt*url-select.underline" = "true";
URxvt.perl-lib: ${pkgs.urxvt_perls}/lib/urxvt/perl "URxvt*colorUL" = "#4682B4";
URxvt*saveLines: 10000 "URxvt.perl-lib" = "${pkgs.urxvt_perls}/lib/urxvt/perl";
"URxvt*saveLines" = "10000";
root-urxvt*background: #230000 "root-urxvt*background" = "#230000";
root-urxvt*foreground: #e0c0c0 "root-urxvt*foreground" = "#e0c0c0";
root-urxvt*BorderColor: #400000 "root-urxvt*BorderColor" = "#400000";
root-urxvt*color0: #800000 "root-urxvt*color0" = "#800000";
fzmenu-urxvt*background: rgb:42/23/42 "fzmenu-urxvt*background" = "rgb:42/23/42";
fzmenu-urxvt*externalBorder: 1 "fzmenu-urxvt*externalBorder" = "1";
fzmenu-urxvt*geometry: 70x9 "fzmenu-urxvt*geometry" = "70x9";
fzmenu-urxvt*internalBorder: 1 "fzmenu-urxvt*internalBorder" = "1";
'' };
}

View File

@ -9,6 +9,10 @@ let
}; };
in { in {
imports = [
./Xresources.nix
];
environment.systemPackages = [ environment.systemPackages = [
pkgs.ff pkgs.ff
pkgs.font-size pkgs.font-size
@ -73,7 +77,6 @@ in {
${pkgs.xorg.xhost}/bin/xhost -LOCAL: ${pkgs.xorg.xhost}/bin/xhost -LOCAL:
} & } &
${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} & ${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} &
${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} &
${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' & ${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
wait wait
''; '';

View File

@ -0,0 +1,39 @@
with import <stockholm/lib>;
{ config, pkgs, ... }: let
cfg = {
enable = config.tv.Xresources != {};
user = config.krebs.build.user;
};
in {
options.tv.Xresources = mkOption {
default = {};
type = types.attrsOf types.str;
};
config = {
nixpkgs.overlays = singleton (self: super: {
tv = super.tv or {} // {
Xresources =
self.writeText "Xresources"
(concatStrings (mapAttrsToList (name: value: /* xdefaults */ ''
${name}: ${value}
'') config.tv.Xresources));
};
});
systemd.services.${if cfg.enable then "Xresources" else null} = {
wantedBy = [ "graphical.target" ];
after = [ "xserver.service" ];
requires = [ "xserver.service" ];
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
};
serviceConfig = {
ExecStart = "${pkgs.xorg.xrdb}/bin/xrdb ${pkgs.tv.Xresources}";
RemainAfterExit = true;
SyslogIdentifier = "Xresources";
Type = "oneshot";
User = cfg.user.name;
WorkingDirectory = cfg.user.home;
};
};
};
}

View File

@ -7,5 +7,6 @@
./iptables.nix ./iptables.nix
./slock.nix ./slock.nix
./x0vncserver.nix ./x0vncserver.nix
./Xresources.nix
]; ];
} }