summaryrefslogtreecommitdiff
path: root/alacritty
diff options
context:
space:
mode:
authormediocregopher <mediocregopher@gmail.com>2023-08-13 21:34:14 +0200
committermediocregopher <mediocregopher@gmail.com>2023-08-13 21:35:17 +0200
commit1957081c122fe231eb6120192489dd979d214317 (patch)
treeb8cd0812ec3c0452d54cb789ba938e6f0c0e8278 /alacritty
parentef8da74f1ae38d9eceb68846fe9ef402c8e30fcf (diff)
Update branch with all changes which could be brought in from private branches
For a while I was keeping a private branch where there were a lot of non-public things included, and that became the de-facto branch while this one lagged. This one is now up-to-date, all private stuff is dealt with via config files which are not committed.
Diffstat (limited to 'alacritty')
-rw-r--r--alacritty/alacritty.yml193
-rw-r--r--alacritty/default.nix54
-rw-r--r--alacritty/fonts/SourceCodePro-Black.ttfbin120356 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-Bold.ttfbin120504 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-ExtraLight.ttfbin121568 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-Light.ttfbin121284 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-Medium.ttfbin120244 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-Regular.ttfbin120548 -> 0 bytes
-rw-r--r--alacritty/fonts/SourceCodePro-Semibold.ttfbin120252 -> 0 bytes
9 files changed, 151 insertions, 96 deletions
diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml
index d09b2fb..06285c5 100644
--- a/alacritty/alacritty.yml
+++ b/alacritty/alacritty.yml
@@ -101,82 +101,76 @@ env:
# Scrolling distance multiplier.
#multiplier: 3
-## Font configuration
+# Font configuration
font:
- size: 7
-
- #
- #TODO I'd like to restore this font configuration, but I can't cause nix
- #doesn't play nicely with fontconfig
- #font:
- # # Normal (roman) font face
- # normal:
- # # Font family
- # #
- # # Default:
- # # - (macOS) Menlo
- # # - (Linux/BSD) monospace
- # # - (Windows) Consolas
- # family: Source Code Pro
- #
- # # The `style` can be specified to pick a specific face.
- # style: Regular
- #
- # # Bold font face
- # bold:
- # # Font family
- # #
- # # If the bold family is not specified, it will fall back to the
- # # value specified for the normal font.
- # family: Source Code Pro
- #
- # # The `style` can be specified to pick a specific face.
- # style: Bold
- #
- # # Italic font face
- # italic:
- # # Font family
- # #
- # # If the italic family is not specified, it will fall back to the
- # # value specified for the normal font.
- # family: Source Code Pro
- #
- # # The `style` can be specified to pick a specific face.
- # style: Italic
- #
- # # Bold italic font face
- # bold_italic:
- # # Font family
- # #
- # # If the bold italic family is not specified, it will fall back to the
- # # value specified for the normal font.
- # family: Source Code Pro
- #
- # # The `style` can be specified to pick a specific face.
- # style: Bold Italic
- #
- # # Point size
- # size: 6.3
- #
- # # Offset is the extra space around each character. `offset.y` can be thought
- # # of as modifying the line spacing, and `offset.x` as modifying the letter
- # # spacing.
- # #offset:
- # # x: 0
- # # y: 0
- #
- # # Glyph offset determines the locations of the glyphs within their cells with
- # # the default being at the bottom. Increasing `x` moves the glyph to the
- # # right, increasing `y` moves the glyph upward.
- # #glyph_offset:
- # # x: 0
- # # y: 0
- #
- # # Thin stroke font rendering (macOS only)
- # #
- # # Thin strokes are suitable for retina displays, but for non-retina screens
- # # it is recommended to set `use_thin_strokes` to `false`.
- # #use_thin_strokes: true
+ # Normal (roman) font face
+ normal:
+ # Font family
+ #
+ # Default:
+ # - (macOS) Menlo
+ # - (Linux/BSD) monospace
+ # - (Windows) Consolas
+ family: "Source Code Pro"
+
+ # The `style` can be specified to pick a specific face.
+ style: Regular
+
+ # Bold font face
+ bold:
+ # Font family
+ #
+ # If the bold family is not specified, it will fall back to the
+ # value specified for the normal font.
+ family: "Source Code Pro"
+
+ # The `style` can be specified to pick a specific face.
+ style: Bold
+
+ # Italic font face
+ italic:
+ # Font family
+ #
+ # If the italic family is not specified, it will fall back to the
+ # value specified for the normal font.
+ family: "Source Code Pro"
+
+ # The `style` can be specified to pick a specific face.
+ style: Italic
+
+ # Bold italic font face
+ bold_italic:
+ # Font family
+ #
+ # If the bold italic family is not specified, it will fall back to the
+ # value specified for the normal font.
+ family: "Source Code Pro"
+
+ # The `style` can be specified to pick a specific face.
+ style: Bold Italic
+
+ # Point size
+ size: 6.3
+
+ # Offset is the extra space around each character. `offset.y` can be thought
+ # of as modifying the line spacing, and `offset.x` as modifying the letter
+ # spacing.
+ #offset:
+ # x: 0
+ # y: 0
+
+ # Glyph offset determines the locations of the glyphs within their cells with
+ # the default being at the bottom. Increasing `x` moves the glyph to the
+ # right, increasing `y` moves the glyph upward.
+ #glyph_offset:
+ # x: 0
+ # y: 0
+
+ # Thin stroke font rendering (macOS only)
+ #
+ # Thin strokes are suitable for retina displays, but for non-retina screens
+ # it is recommended to set `use_thin_strokes` to `false`.
+ #use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
@@ -855,7 +849,54 @@ colors:
# - Info
# - Debug
# - Trace
- #log_level: Warn
+ #log_level: Trace
# Print all received window events.
#print_events: false
+
+# Hints
+#
+# Terminal hints can be used to find text or hyperlink in the visible part of
+# the terminal and pipe it to other applications.
+#hints:
+ # Keys used for the hint labels.
+ #alphabet: "jfkdls;ahgurieowpq"
+
+ # List with all available hints
+ #
+ # Each hint must have any of `regex` or `hyperlinks` field and either an
+ # `action` or a `command` field. The fields `mouse`, `binding` and
+ # `post_processing` are optional.
+ #
+ # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
+ # highlighted.
+ #
+ # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
+ # `mouse.mods` accept the same values as they do in the `key_bindings` section.
+ #
+ # The `mouse.enabled` field controls if the hint should be underlined while
+ # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
+ #
+ # If the `post_processing` field is set to `true`, heuristics will be used to
+ # shorten the match if there are characters likely not to be part of the hint
+ # (e.g. a trailing `.`). This is most useful for URIs and applies only to
+ # `regex` matches.
+ #
+ # Values for `action`:
+ # - Copy
+ # Copy the hint's text to the clipboard.
+ # - Paste
+ # Paste the hint's text to the terminal or search.
+ # - Select
+ # Select the hint's text.
+ # - MoveViModeCursor
+ # Move the vi mode cursor to the beginning of the hint.
+ #enabled:
+ # - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
+ # hyperlinks: true
+ # command: xdg-open
+ # post_processing: true
+ # mouse:
+ # enabled: true
+ # mods: None
+hints: $HINTS
diff --git a/alacritty/default.nix b/alacritty/default.nix
index c5681b0..213ec86 100644
--- a/alacritty/default.nix
+++ b/alacritty/default.nix
@@ -1,35 +1,49 @@
{
- pkgs ? (import ../pkgs.nix) {},
+ config,
+
+ pkgs ? (import ../pkgs.nix).stable2305 {},
zsh ? pkgs.zsh,
}: rec {
- # TODO figure out a way to provide my font to alacritty at runtime. fontconfig
- # is a hot mess...
- #
- #dataDir = pkgs.stdenv.mkDerivation {
- # name = "alacritty-dataDir";
- # src = ./fonts;
- # buildInputs = [ pkgs.fontconfig ];
- # builder = builtins.toFile "builder.sh" ''
- # source $stdenv/setup
- # mkdir "$out"
- # cp -r "$src" "$out"/fonts
- # chmod -R +w "$out"
+ defaultXDGOpenRules = [
+ {
+ name = "open-url";
+ pattern = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^<>\"\\s{-}\\^⟨⟩`]+";
+ xdgOpen = "$1";
+ }
+ ];
- # env
+ xdgOpenRules = defaultXDGOpenRules ++ config.alacritty.xdgOpenRules;
- # export FONTCONFIG_FILE="$out"/fontconfig
- # fc-cache --verbose "$out"/fonts
+ hints = {
+ enabled = (builtins.map (r:
+ {
+ regex = r.pattern;
+ hyperlinks = true;
+ command = (pkgs.writeShellScript "alacritty-hints-${r.name}" ''
+ xdg-open "${r.xdgOpen}"
+ '');
+ post_processing = true;
+ mouse.enabled = true;
+ }
+ ) xdgOpenRules);
+ };
- # '';
- #};
+ configFile = pkgs.writeText "alacritty-config" (
+ builtins.replaceStrings
+ ["$HINTS"]
+ [(builtins.toJSON hints)]
+ (builtins.readFile ./alacritty.yml)
+ );
alacritty = pkgs.writeScriptBin "alacritty" ''
#!${pkgs.bash}/bin/bash
- exec ${pkgs.nixgl}/bin/nixGLIntel ${pkgs.alacritty}/bin/alacritty \
- --config-file ${./alacritty.yml} \
+
+ exec ${pkgs.nixgl}/bin/nixGL ${pkgs.alacritty}/bin/alacritty \
+ -o font.size=${builtins.toString config.alacritty.fontSize} \
+ --config-file ${configFile} \
-e "${zsh}/bin/zsh"
'';
}
diff --git a/alacritty/fonts/SourceCodePro-Black.ttf b/alacritty/fonts/SourceCodePro-Black.ttf
deleted file mode 100644
index ea73e60..0000000
--- a/alacritty/fonts/SourceCodePro-Black.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-Bold.ttf b/alacritty/fonts/SourceCodePro-Bold.ttf
deleted file mode 100644
index a56f1fa..0000000
--- a/alacritty/fonts/SourceCodePro-Bold.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-ExtraLight.ttf b/alacritty/fonts/SourceCodePro-ExtraLight.ttf
deleted file mode 100644
index f409b71..0000000
--- a/alacritty/fonts/SourceCodePro-ExtraLight.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-Light.ttf b/alacritty/fonts/SourceCodePro-Light.ttf
deleted file mode 100644
index 51eb963..0000000
--- a/alacritty/fonts/SourceCodePro-Light.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-Medium.ttf b/alacritty/fonts/SourceCodePro-Medium.ttf
deleted file mode 100644
index 1ee45eb..0000000
--- a/alacritty/fonts/SourceCodePro-Medium.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-Regular.ttf b/alacritty/fonts/SourceCodePro-Regular.ttf
deleted file mode 100644
index b2cff92..0000000
--- a/alacritty/fonts/SourceCodePro-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/alacritty/fonts/SourceCodePro-Semibold.ttf b/alacritty/fonts/SourceCodePro-Semibold.ttf
deleted file mode 100644
index b425f9c..0000000
--- a/alacritty/fonts/SourceCodePro-Semibold.ttf
+++ /dev/null
Binary files differ