From 8f525e3c525b2d452a9149e3b07e646a18bb1bdb Mon Sep 17 00:00:00 2001 From: Uyanide Date: Wed, 11 Feb 2026 19:59:01 +0100 Subject: [PATCH] replace ghostty with wezterm --- config-stow | 1 + .../.config/.alt/ghostty-niri/.gitignore | 1 - .../ghostty/.config/.alt/ghostty-niri/config | 27 ---- .../cursor-shaders/cursor-smear.glsl | 120 ------------------ .../ghostty-default => ghostty}/.gitignore | 0 .../{.alt/ghostty-default => ghostty}/config | 2 + .../cursor-shaders/cursor-smear.glsl | 0 config/niri/.config/niri/config/binds.kdl | 6 +- config/niri/.config/niri/config/execs.kdl | 4 +- config/niri/.config/niri/config/rules.kdl | 2 +- .../Modules/Bar/Components/CpuTemp.qml | 2 +- .../Modules/Bar/Components/CpuUsage.qml | 2 +- .../Modules/Bar/Components/MemUsage.qml | 2 +- .../quickshell/Services/LyricsService.qml | 2 +- config/scripts/.local/scripts/config-switch | 4 +- config/scripts/.local/scripts/fzfclip | 7 +- config/scripts/.local/scripts/fzfclip-wrap | 4 +- config/scripts/.local/scripts/sixel-query | 4 +- config/wezterm/.config/wezterm/wezterm.lua | 20 +++ memo/niri-ricing.txt | 3 +- 20 files changed, 47 insertions(+), 166 deletions(-) delete mode 100644 config/ghostty/.config/.alt/ghostty-niri/.gitignore delete mode 100644 config/ghostty/.config/.alt/ghostty-niri/config delete mode 100644 config/ghostty/.config/.alt/ghostty-niri/cursor-shaders/cursor-smear.glsl rename config/ghostty/.config/{.alt/ghostty-default => ghostty}/.gitignore (100%) rename config/ghostty/.config/{.alt/ghostty-default => ghostty}/config (91%) rename config/ghostty/.config/{.alt/ghostty-default => ghostty}/cursor-shaders/cursor-smear.glsl (100%) create mode 100644 config/wezterm/.config/wezterm/wezterm.lua diff --git a/config-stow b/config-stow index 883dbbe..d2cfc90 100755 --- a/config-stow +++ b/config-stow @@ -32,6 +32,7 @@ GUI_BASE_PKGS = [ "wallpaper", # wallpapers & manager "kvantum", # qt theming "nwg-look", # gtk theming + "wezterm", # alternative terminal emulator ] # for Hyprland setup diff --git a/config/ghostty/.config/.alt/ghostty-niri/.gitignore b/config/ghostty/.config/.alt/ghostty-niri/.gitignore deleted file mode 100644 index 4039784..0000000 --- a/config/ghostty/.config/.alt/ghostty-niri/.gitignore +++ /dev/null @@ -1 +0,0 @@ -shaders \ No newline at end of file diff --git a/config/ghostty/.config/.alt/ghostty-niri/config b/config/ghostty/.config/.alt/ghostty-niri/config deleted file mode 100644 index 02a3a7f..0000000 --- a/config/ghostty/.config/.alt/ghostty-niri/config +++ /dev/null @@ -1,27 +0,0 @@ -theme = Catppuccin Mocha - -background-opacity = 0.95 -background-blur = true - -window-padding-x = 10 -window-padding-y = 10 - -keybind = ctrl+shift+r=reload_config - -keybind = ctrl+shift+h=write_screen_file:copy -keybind = ctrl+shift+j=text:ghostty-capture\n -keybind = ctrl+enter=unbind - -command = exec fish - -confirm-close-surface = false - -font-family = monospace -font-size = 10 - -cursor-style = bar -adjust-cursor-thickness = 3 - -custom-shader = cursor-shaders/cursor-smear.glsl - -# quit-after-last-window-closed = false diff --git a/config/ghostty/.config/.alt/ghostty-niri/cursor-shaders/cursor-smear.glsl b/config/ghostty/.config/.alt/ghostty-niri/cursor-shaders/cursor-smear.glsl deleted file mode 100644 index ca748e0..0000000 --- a/config/ghostty/.config/.alt/ghostty-niri/cursor-shaders/cursor-smear.glsl +++ /dev/null @@ -1,120 +0,0 @@ -// https://github.com/KroneCorylus/ghostty-shader-playground/blob/main/shaders/cursor_smear.glsl - -float getSdfRectangle(in vec2 p, in vec2 xy, in vec2 b) -{ - vec2 d = abs(p - xy) - b; - return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); -} - -// Based on Inigo Quilez's 2D distance functions article: https://iquilezles.org/articles/distfunctions2d/ -// Potencially optimized by eliminating conditionals and loops to enhance performance and reduce branching - -float seg(in vec2 p, in vec2 a, in vec2 b, inout float s, float d) { - vec2 e = b - a; - vec2 w = p - a; - vec2 proj = a + e * clamp(dot(w, e) / dot(e, e), 0.0, 1.0); - float segd = dot(p - proj, p - proj); - d = min(d, segd); - - float c0 = step(0.0, p.y - a.y); - float c1 = 1.0 - step(0.0, p.y - b.y); - float c2 = 1.0 - step(0.0, e.x * w.y - e.y * w.x); - float allCond = c0 * c1 * c2; - float noneCond = (1.0 - c0) * (1.0 - c1) * (1.0 - c2); - float flip = mix(1.0, -1.0, step(0.5, allCond + noneCond)); - s *= flip; - return d; -} - -float getSdfParallelogram(in vec2 p, in vec2 v0, in vec2 v1, in vec2 v2, in vec2 v3) { - float s = 1.0; - float d = dot(p - v0, p - v0); - - d = seg(p, v0, v3, s, d); - d = seg(p, v1, v0, s, d); - d = seg(p, v2, v1, s, d); - d = seg(p, v3, v2, s, d); - - return s * sqrt(d); -} - -vec2 normalize(vec2 value, float isPosition) { - return (value * 2.0 - (iResolution.xy * isPosition)) / iResolution.y; -} - -float antialising(float distance) { - return 1. - smoothstep(0., normalize(vec2(2., 2.), 0.).x, distance); -} - -float determineStartVertexFactor(vec2 a, vec2 b) { - // Conditions using step - float condition1 = step(b.x, a.x) * step(a.y, b.y); // a.x < b.x && a.y > b.y - float condition2 = step(a.x, b.x) * step(b.y, a.y); // a.x > b.x && a.y < b.y - - // If neither condition is met, return 1 (else case) - return 1.0 - max(condition1, condition2); -} - -vec2 getRectangleCenter(vec4 rectangle) { - return vec2(rectangle.x + (rectangle.z / 2.), rectangle.y - (rectangle.w / 2.)); -} -float ease(float x) { - return pow(1.0 - x, 3.0); -} -vec4 saturate(vec4 color, float factor) { - float gray = dot(color, vec4(0.299, 0.587, 0.114, 0.)); // luminance - return mix(vec4(gray), color, factor); -} - -vec4 TRAIL_COLOR = iCurrentCursorColor; -const float OPACITY = 0.6; -const float DURATION = 0.3; //IN SECONDS - -void mainImage(out vec4 fragColor, in vec2 fragCoord) -{ - - #if !defined(WEB) - fragColor = texture(iChannel0, fragCoord.xy / iResolution.xy); - #endif - // Normalization for fragCoord to a space of -1 to 1; - vec2 vu = normalize(fragCoord, 1.); - vec2 offsetFactor = vec2(-.5, 0.5); - - // Normalization for cursor position and size; - // cursor xy has the postion in a space of -1 to 1; - // zw has the width and height - vec4 currentCursor = vec4(normalize(iCurrentCursor.xy, 1.), normalize(iCurrentCursor.zw, 0.)); - vec4 previousCursor = vec4(normalize(iPreviousCursor.xy, 1.), normalize(iPreviousCursor.zw, 0.)); - - // When drawing a parellelogram between cursors for the trail i need to determine where to start at the top-left or top-right vertex of the cursor - float vertexFactor = determineStartVertexFactor(currentCursor.xy, previousCursor.xy); - float invertedVertexFactor = 1.0 - vertexFactor; - - // Set every vertex of my parellogram - vec2 v0 = vec2(currentCursor.x + currentCursor.z * vertexFactor, currentCursor.y - currentCursor.w); - vec2 v1 = vec2(currentCursor.x + currentCursor.z * invertedVertexFactor, currentCursor.y); - vec2 v2 = vec2(previousCursor.x + currentCursor.z * invertedVertexFactor, previousCursor.y); - vec2 v3 = vec2(previousCursor.x + currentCursor.z * vertexFactor, previousCursor.y - previousCursor.w); - - float sdfCurrentCursor = getSdfRectangle(vu, currentCursor.xy - (currentCursor.zw * offsetFactor), currentCursor.zw * 0.5); - float sdfTrail = getSdfParallelogram(vu, v0, v1, v2, v3); - - float progress = clamp((iTime - iTimeCursorChange) / DURATION, 0.0, 1.0); - float easedProgress = ease(progress); - // Distance between cursors determine the total length of the parallelogram; - vec2 centerCC = getRectangleCenter(currentCursor); - vec2 centerCP = getRectangleCenter(previousCursor); - float lineLength = distance(centerCC, centerCP); - - vec4 newColor = vec4(fragColor); - - vec4 trail = TRAIL_COLOR; - trail = saturate(trail, 2.5); - // Draw trail - newColor = mix(newColor, trail, antialising(sdfTrail)); - // Draw current cursor - newColor = mix(newColor, trail, antialising(sdfCurrentCursor)); - newColor = mix(newColor, fragColor, step(sdfCurrentCursor, 0.)); - // newColor = mix(fragColor, newColor, OPACITY); - fragColor = mix(fragColor, newColor, step(sdfCurrentCursor, easedProgress * lineLength)); -} \ No newline at end of file diff --git a/config/ghostty/.config/.alt/ghostty-default/.gitignore b/config/ghostty/.config/ghostty/.gitignore similarity index 100% rename from config/ghostty/.config/.alt/ghostty-default/.gitignore rename to config/ghostty/.config/ghostty/.gitignore diff --git a/config/ghostty/.config/.alt/ghostty-default/config b/config/ghostty/.config/ghostty/config similarity index 91% rename from config/ghostty/.config/.alt/ghostty-default/config rename to config/ghostty/.config/ghostty/config index dd609e5..c5aab42 100644 --- a/config/ghostty/.config/.alt/ghostty-default/config +++ b/config/ghostty/.config/ghostty/config @@ -23,3 +23,5 @@ cursor-style = bar adjust-cursor-thickness = 3 custom-shader = cursor-shaders/cursor-smear.glsl + +# quit-after-last-window-closed = false diff --git a/config/ghostty/.config/.alt/ghostty-default/cursor-shaders/cursor-smear.glsl b/config/ghostty/.config/ghostty/cursor-shaders/cursor-smear.glsl similarity index 100% rename from config/ghostty/.config/.alt/ghostty-default/cursor-shaders/cursor-smear.glsl rename to config/ghostty/.config/ghostty/cursor-shaders/cursor-smear.glsl diff --git a/config/niri/.config/niri/config/binds.kdl b/config/niri/.config/niri/config/binds.kdl index e8b7486..030abef 100644 --- a/config/niri/.config/niri/config/binds.kdl +++ b/config/niri/.config/niri/config/binds.kdl @@ -14,9 +14,9 @@ binds { Mod+E { spawn "dolphin" "--new-window"; } Mod+W { spawn-sh "zen || zen-browser"; } Mod+X { spawn "gnome-text-editor" "--new-window"; } - Mod+B { spawn-sh "pkill -x -n btop || ghostty -e btop"; } - Mod+Shift+T { spawn "ghostty" "+new-window"; } - Mod+Shift+Return { spawn "ghostty" "+new-window"; } + Mod+B { spawn-sh "pkill -x -n btop || wezterm -e btop"; } + Mod+Shift+T { spawn "wezterm"; } + Mod+Shift+Return { spawn "wezterm"; } Mod+T { spawn "kitty"; } Mod+Return { spawn "kitty"; } Mod+Shift+W { spawn "wallpaper-carousel"; } diff --git a/config/niri/.config/niri/config/execs.kdl b/config/niri/.config/niri/config/execs.kdl index bc4b399..88bfc48 100644 --- a/config/niri/.config/niri/config/execs.kdl +++ b/config/niri/.config/niri/config/execs.kdl @@ -34,6 +34,6 @@ spawn-at-startup "hypridle" spawn-at-startup "quickshell" // According to (https://ghostty.org/docs/linux/systemd#starting-ghostty-at-login) -spawn-sh-at-startup "systemctl start --user app-com.mitchellh.ghostty.service" +// spawn-sh-at-startup "systemctl start --user app-com.mitchellh.ghostty.service" // No, do not do this, otherwise the envs defined in envs.kdl won't be applied to ghostty. -// Unless you have something like "config/shell/.config/fish/prev.d/niri-env.fish" \ No newline at end of file +// Unless you have something like "config/shell/.config/fish/prev.d/niri-env.fish" diff --git a/config/niri/.config/niri/config/rules.kdl b/config/niri/.config/niri/config/rules.kdl index 9cb22be..9f9c2bb 100644 --- a/config/niri/.config/niri/config/rules.kdl +++ b/config/niri/.config/niri/config/rules.kdl @@ -18,7 +18,7 @@ window-rule { // FLoating terminal window-rule { - match app-id="com.mitchellh.ghostty" + match app-id="org.wezfurlong.wezterm" open-floating true default-column-width { proportion 0.5; } } diff --git a/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuTemp.qml b/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuTemp.qml index ae075a3..63bb532 100644 --- a/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuTemp.qml +++ b/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuTemp.qml @@ -16,7 +16,7 @@ MonitorItem { action.signal(15); return ; } - action.exec(["ghostty", "-e", "btop"]); + action.exec(["wezterm", "start", "--", "btop"]); } Process { diff --git a/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuUsage.qml b/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuUsage.qml index b14102c..f24d37c 100644 --- a/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuUsage.qml +++ b/config/quickshell/.config/quickshell/Modules/Bar/Components/CpuUsage.qml @@ -16,7 +16,7 @@ MonitorItem { action.signal(15); return ; } - action.exec(["ghostty", "-e", "btop"]); + action.exec(["wezterm", "start", "--", "btop"]); } Process { diff --git a/config/quickshell/.config/quickshell/Modules/Bar/Components/MemUsage.qml b/config/quickshell/.config/quickshell/Modules/Bar/Components/MemUsage.qml index 568544c..6fd9459 100644 --- a/config/quickshell/.config/quickshell/Modules/Bar/Components/MemUsage.qml +++ b/config/quickshell/.config/quickshell/Modules/Bar/Components/MemUsage.qml @@ -19,7 +19,7 @@ MonitorItem { action.signal(15); return ; } - action.exec(["ghostty", "-e", "btop"]); + action.exec(["wezterm", "start", "--", "btop"]); } onRightClicked: { _showPercent = !_showPercent; diff --git a/config/quickshell/.config/quickshell/Services/LyricsService.qml b/config/quickshell/.config/quickshell/Services/LyricsService.qml index 5810b5c..e41f73c 100644 --- a/config/quickshell/.config/quickshell/Services/LyricsService.qml +++ b/config/quickshell/.config/quickshell/Services/LyricsService.qml @@ -67,7 +67,7 @@ Singleton { } function showLyricsText() { - action.command = ["sh", "-c", "ghostty -e sh -c 'spotify-lyrics fetch 2>/dev/null | less'"]; + action.command = ["sh", "-c", "wezterm start -- sh -c 'spotify-lyrics fetch 2>/dev/null | less'"]; action.startDetached(); } diff --git a/config/scripts/.local/scripts/config-switch b/config/scripts/.local/scripts/config-switch index 14fd15d..fbf7689 100755 --- a/config/scripts/.local/scripts/config-switch +++ b/config/scripts/.local/scripts/config-switch @@ -9,7 +9,7 @@ else desktop="$1" fi -for item in "kitty" "ghostty" "wlogout"; do +for item in "kitty" "wlogout"; do if [ ! -L "$HOME/.config/$item" ] && [ -e "$HOME/.config/$item" ]; then echo "Error: $HOME/.config/$item exists and is not a symlink." >&2 exit 1 @@ -29,4 +29,4 @@ for item in "kitty" "ghostty" "wlogout"; do else [ -e "$HOME/.config/.alt/${item}-default" ] && ln -svf ".alt/${item}-default" "$HOME/.config/$item" fi -done \ No newline at end of file +done diff --git a/config/scripts/.local/scripts/fzfclip b/config/scripts/.local/scripts/fzfclip index a384816..6b78480 100755 --- a/config/scripts/.local/scripts/fzfclip +++ b/config/scripts/.local/scripts/fzfclip @@ -37,6 +37,9 @@ set -euo pipefail +SHELL=$(command -v bash) +export SHELL + _cleanup() { if [ -n "${CACHE_DIR:-}" ] && [ -d "$CACHE_DIR" ]; then rm -rf "$CACHE_DIR" @@ -407,6 +410,8 @@ copy_selection() { else echo -n "$input" | cliphist decode | wl-copy fi + + echo -n "$input" | cliphist delete || true } export -f copy_selection @@ -444,4 +449,4 @@ $RELOAD_CMD | fzf \ --preview-window=down:60%,wrap \ --preview "preview {}" \ --bind "enter:execute-silent(bash -c 'copy_selection \"\$1\"' -- {})+accept" \ -|| [ $? -eq 141 ] +>/dev/null || [ $? -eq 141 ] diff --git a/config/scripts/.local/scripts/fzfclip-wrap b/config/scripts/.local/scripts/fzfclip-wrap index f272421..8ddf77f 100755 --- a/config/scripts/.local/scripts/fzfclip-wrap +++ b/config/scripts/.local/scripts/fzfclip-wrap @@ -2,7 +2,7 @@ # Description: # Wrapper for fzfclip to ensure only one instance is -# running and to launch it in ghostty. +# running and to launch it in terminal. exec {LOCK_FD}>/tmp/"$(basename "$0")".lock @@ -11,4 +11,4 @@ flock -n "$LOCK_FD" || { exit 1 } -ghostty -e fzfclip "$@" {LOCK_FD}>&- +wezterm start -- fzfclip "$@" {LOCK_FD}>&- diff --git a/config/scripts/.local/scripts/sixel-query b/config/scripts/.local/scripts/sixel-query index 6897ff4..b7e0b36 100755 --- a/config/scripts/.local/scripts/sixel-query +++ b/config/scripts/.local/scripts/sixel-query @@ -34,9 +34,9 @@ done if [[ "$response" =~ $'\x1b'\[\?([0-9;]*)c ]]; then params="${BASH_REMATCH[1]}" - + IFS=';' read -ra codes <<< "$params" - + for code in "${codes[@]}"; do if [[ "$code" == "4" ]]; then exit 0 diff --git a/config/wezterm/.config/wezterm/wezterm.lua b/config/wezterm/.config/wezterm/wezterm.lua new file mode 100644 index 0000000..c8de05f --- /dev/null +++ b/config/wezterm/.config/wezterm/wezterm.lua @@ -0,0 +1,20 @@ +local wezterm = require("wezterm") + +local config = wezterm.config_builder() + +config.initial_cols = 96 +config.initial_rows = 32 + +config.font_size = 12 +config.font = wezterm.font("Maple Mono NF CN") +config.color_scheme = "Catppuccin Mocha" + +config.hide_tab_bar_if_only_one_tab = true + +config.window_background_opacity = 0.95 + +config.default_prog = { "/usr/bin/fish" } + +config.window_close_confirmation = "NeverPrompt" + +return config diff --git a/memo/niri-ricing.txt b/memo/niri-ricing.txt index 617df62..1dc6923 100644 --- a/memo/niri-ricing.txt +++ b/memo/niri-ricing.txt @@ -3,4 +3,5 @@ things I have installed: in addition to everything in `./hyprland-ricing.txt`: xwayland-satellite -wlsunset \ No newline at end of file +wlsunset +wezterm # replaces ghostty