2019-10-24 02:20:38 +02:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
2022-09-08 03:43:54 +02:00
|
|
|
# find all URXVT parameters with
|
|
|
|
# urxvt --help 2>&1| sed -n '/: /s/^ */! URxvt*/gp' | les
|
|
|
|
|
2019-10-24 02:20:38 +02:00
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.custom.urxvt;
|
|
|
|
|
2021-11-01 09:20:42 +01:00
|
|
|
in
|
|
|
|
{
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
options.programs.custom.urxvt = {
|
|
|
|
|
|
|
|
enable = mkEnableOption "configure and enable urxvt";
|
|
|
|
|
|
|
|
fontSize = mkOption {
|
2019-12-20 05:54:26 +01:00
|
|
|
type = types.int;
|
|
|
|
default = 17;
|
2019-10-24 02:20:38 +02:00
|
|
|
description = ''
|
|
|
|
size of the terminal font
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
colorTheme = mkOption {
|
2019-12-20 05:54:26 +01:00
|
|
|
type = types.enum [ "dark" "light" ];
|
2019-10-24 02:20:38 +02:00
|
|
|
default = "dark";
|
|
|
|
description = ''
|
|
|
|
solarized color theme
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
environment.systemPackages = [ pkgs.rxvt_unicode ];
|
|
|
|
|
|
|
|
environment.etc = {
|
|
|
|
|
|
|
|
"X11/Xresource.d/urxvt".source = pkgs.writeText "Xresource-urxvt" ''
|
|
|
|
!! Perl extensions
|
|
|
|
!! ---------------
|
2022-10-13 11:45:50 +02:00
|
|
|
URxvt.perl-ext-common: default,matcher,selection-to-clipboard
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
! Urgency
|
|
|
|
URxvt.urgentOnBell: true
|
|
|
|
|
|
|
|
!! Highlight URLs
|
|
|
|
!! --------------
|
|
|
|
URxvt.url-launcher: /run/current-system/sw/bin/browser-select
|
|
|
|
URxvt.matcher.button: 1
|
|
|
|
|
|
|
|
!! History
|
|
|
|
!! -------
|
|
|
|
URxvt.scrollStyle: rxvt
|
|
|
|
URxvt.scrollBar: false
|
|
|
|
URxvt.saveLines: 1000000
|
|
|
|
|
|
|
|
!! Color Configuration
|
|
|
|
!! -------------------
|
|
|
|
|
|
|
|
!! do not graded out unselected shells
|
|
|
|
!! -----------------------------------
|
|
|
|
URxvt.fading: 0
|
2022-10-13 11:45:50 +02:00
|
|
|
|
|
|
|
!! copy on select
|
|
|
|
!! --------------
|
|
|
|
URxvt.clipboard.autocopy: true
|
2019-10-24 02:20:38 +02:00
|
|
|
'';
|
|
|
|
|
2021-11-01 09:20:42 +01:00
|
|
|
"X11/Xresource.d/urxvt-font".source =
|
|
|
|
let
|
|
|
|
fontFamily = "terminus";
|
|
|
|
normalFont = fontSize:
|
|
|
|
"-*-${fontFamily}-medium-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
|
|
|
boldFont = fontSize:
|
|
|
|
"-*-${fontFamily}-bold-*-*-*-${toString fontSize}-*-*-*-*-*-*-*";
|
|
|
|
italicFont = normalFont;
|
|
|
|
itallicBoldFont = boldFont;
|
|
|
|
backupFont = fontSize:
|
|
|
|
"xft:TerminessTTF Nerd Font:pixelsize=${toString fontSize}";
|
|
|
|
|
|
|
|
fontCommand = key: fontSize: ''
|
2022-10-13 11:45:50 +02:00
|
|
|
URxvt.keysym.M-${key}: command:\033]710;${normalFont fontSize},${backupFont fontSize}\007\033]711;${boldFont fontSize},${backupFont fontSize}\007
|
2021-11-01 09:20:42 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
pkgs.writeText "Xresource-urxvt-font" ''
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
URxvt.allow_bold: true
|
|
|
|
URxvt.xftAntialias: true
|
|
|
|
|
|
|
|
!! use xfontsel or fontmatrix to choose line
|
2022-10-13 11:45:50 +02:00
|
|
|
!URxvt.font: ${normalFont cfg.fontSize},${backupFont cfg.fontSize}
|
|
|
|
!URxvt.boldFont: ${boldFont cfg.fontSize},${backupFont cfg.fontSize}
|
|
|
|
!URxvt.italicFont: ${italicFont cfg.fontSize},${backupFont cfg.fontSize}
|
|
|
|
!URxvt.bolditalicFont: ${itallicBoldFont cfg.fontSize},${backupFont cfg.fontSize}
|
2019-12-20 05:54:26 +01:00
|
|
|
|
|
|
|
URxvt.font: ${normalFont cfg.fontSize}
|
|
|
|
URxvt.boldFont: ${boldFont cfg.fontSize}
|
|
|
|
URxvt.italicFont: ${italicFont cfg.fontSize}
|
2019-10-24 02:20:38 +02:00
|
|
|
URxvt.bolditalicFont: ${itallicBoldFont cfg.fontSize}
|
|
|
|
|
|
|
|
${fontCommand "F1" cfg.fontSize}
|
|
|
|
${fontCommand "F2" (cfg.fontSize + 5)}
|
|
|
|
${fontCommand "F3" (cfg.fontSize + 10)}
|
|
|
|
${fontCommand "F4" (cfg.fontSize + 20)}
|
|
|
|
'';
|
|
|
|
|
2021-11-01 09:20:42 +01:00
|
|
|
"X11/Xresource.d/urxvt-colors".source =
|
|
|
|
let
|
|
|
|
colorTheme =
|
|
|
|
if (cfg.colorTheme == "dark") then ''
|
|
|
|
#define S_base03 #002b36
|
|
|
|
#define S_base02 #073642
|
|
|
|
#define S_base01 #586e75
|
|
|
|
#define S_base00 #657b83
|
|
|
|
#define S_base0 #839496
|
|
|
|
#define S_base1 #93a1a1
|
|
|
|
#define S_base2 #eee8d5
|
|
|
|
#define S_base3 #fdf6e3
|
|
|
|
'' else ''
|
|
|
|
#define S_base03 #fdf6e3
|
|
|
|
#define S_base02 #eee8d5
|
|
|
|
#define S_base01 #93a1a1
|
|
|
|
#define S_base00 #839496
|
|
|
|
#define S_base0 #657b83
|
|
|
|
#define S_base1 #586e75
|
|
|
|
#define S_base2 #073642
|
|
|
|
#define S_base3 #002b36
|
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
pkgs.writeText "Xresource-urxvt-colors" ''
|
2019-10-24 02:20:38 +02:00
|
|
|
|
|
|
|
!! Common
|
|
|
|
!! ------
|
|
|
|
#define S_yellow #b58900
|
|
|
|
#define S_orange #cb4b16
|
|
|
|
#define S_red #dc322f
|
|
|
|
#define S_magenta #d33682
|
|
|
|
#define S_violet #6c71c4
|
|
|
|
#define S_blue #268bd2
|
|
|
|
#define S_cyan #2aa198
|
|
|
|
#define S_green #859900
|
|
|
|
|
|
|
|
!! ColorTheme
|
|
|
|
!! ----------
|
|
|
|
${colorTheme}
|
|
|
|
|
|
|
|
URxvt*background: S_base03
|
|
|
|
URxvt*foreground: S_base0
|
|
|
|
URxvt*fading: 40
|
|
|
|
URxvt*fadeColor: S_base03
|
|
|
|
URxvt*cursorColor: S_base1
|
|
|
|
URxvt*pointerColorBackground: S_base01
|
|
|
|
URxvt*pointerColorForeground: S_base1
|
|
|
|
|
|
|
|
URxvt*color0: S_base02
|
|
|
|
URxvt*color1: S_red
|
|
|
|
URxvt*color2: S_green
|
|
|
|
URxvt*color3: S_yellow
|
|
|
|
URxvt*color4: S_blue
|
|
|
|
URxvt*color5: S_magenta
|
|
|
|
URxvt*color6: S_cyan
|
|
|
|
URxvt*color7: S_base2
|
|
|
|
URxvt*color9: S_orange
|
|
|
|
URxvt*color8: S_base03
|
|
|
|
URxvt*color10: S_base01
|
|
|
|
URxvt*color11: S_base00
|
|
|
|
URxvt*color12: S_base0
|
|
|
|
URxvt*color13: S_violet
|
|
|
|
URxvt*color14: S_base1
|
|
|
|
URxvt*color15: S_base3
|
2022-09-08 03:43:54 +02:00
|
|
|
|
|
|
|
!! fix tasksh gray6 : https://github.com/GothenburgBitFactory/libshared/blob/f1a3cd6bfabfb083fe3c26f580a15c0d60a92ee9/src/Color.cpp#L179
|
|
|
|
URxvt*color232: S_base03
|
|
|
|
URxvt*color233: S_base03
|
|
|
|
URxvt*color234: S_base03
|
|
|
|
URxvt*color235: S_base03
|
|
|
|
URxvt*color236: S_base03
|
|
|
|
URxvt*color237: S_base03
|
|
|
|
URxvt*color238: S_base03
|
|
|
|
URxvt*color239: S_base03
|
|
|
|
URxvt*color240: S_base03
|
|
|
|
URxvt*color241: S_base03
|
|
|
|
URxvt*color242: S_base03
|
2019-10-24 02:20:38 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|