From 473a10c40202f3934c355624d67c82e30b120f13 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 27 Jun 2019 16:40:07 +0200 Subject: Tweak fonts --- modules/services/xserver.nix | 17 ++++++++--------- modules/user-interface.nix | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 13 deletions(-) (limited to 'modules') diff --git a/modules/services/xserver.nix b/modules/services/xserver.nix index 041d10f..34efd50 100644 --- a/modules/services/xserver.nix +++ b/modules/services/xserver.nix @@ -35,15 +35,15 @@ enableDefaultFonts = true; fontconfig = { defaultFonts = { - monospace = [ "Liberation Mono" ]; - sansSerif = [ "Liberation Sans" ]; - serif = [ "Liberation Serif" ]; + monospace = [ "IBM Plex Mono" ]; + sansSerif = [ "Roboto" ]; + serif = [ "Roboto Slab" ]; }; penultimate = { - enable = false; + enable = true; }; ultimate = { - enable = true; + enable = false; preset = "osx"; }; }; @@ -60,15 +60,14 @@ fira-code fira-mono go-font - font-awesome-ttf + font-awesome_5 + ibm-plex liberation_ttf mononoki opensans-ttf roboto roboto-mono - paratype-pt-mono - paratype-pt-sans - paratype-pt-serif + roboto-slab source-code-pro source-sans-pro source-serif-pro diff --git a/modules/user-interface.nix b/modules/user-interface.nix index 3996497..b0d6651 100644 --- a/modules/user-interface.nix +++ b/modules/user-interface.nix @@ -4,6 +4,32 @@ let emacsPackage = import ../packages/emacs.nix { pkgs = pkgs.unstable; }; + editorScript = pkgs.writeScriptBin "edit" '' + #!${pkgs.runtimeShell} + if [ -z "$1" ]; then + exec ${emacsPackage}/bin/emacsclient --create-frame --alternate-editor ${emacsPackage}/bin/emacs + else + exec ${emacsPackage}/bin/emacsclient --alternate-editor ${emacsPackage}/bin/emacs "$@" + fi + ''; + desktopApplicationFile = pkgs.writeTextFile { + name = "emacsclient.desktop"; + destination = "/share/applications/emacsclient.desktop"; + text = '' + [Desktop Entry] + Name=Emacsclient + GenericName=Text Editor + Comment=Edit text + MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; + Exec=emacseditor %F + Icon=emacs + Type=Application + Terminal=false + Categories=Development;TextEditor; + StartupWMClass=Emacs + Keywords=Text;Editor; + ''; + }; in { programs.browserpass.enable = true; documentation.info.enable = true; @@ -58,10 +84,11 @@ in }; }; - services.emacs = { - enable = true; - defaultEditor = true; - package = emacsPackage; + environment.variables = { + # This is required so that GTK applications launched from Emacs + # get properly themed: + GTK_DATA_PREFIX = "${config.system.path}"; + EDITOR = lib.mkOverride 900 "${editorScript}/bin/edit"; }; services.redshift = { -- cgit 1.4.1