From 585cc29048be9704a4125feba6f7b5714447c806 Mon Sep 17 00:00:00 2001 From: Ian Keane Date: Thu, 30 Jul 2026 04:40:03 -0400 Subject: [PATCH] First few new slackware configs --- Makefile | 5 +++ config/fish/config.fish | 7 ++++ config/fish/functions/nyxt.fish | 3 ++ config/kanata/kanata.kbd | 43 +++++++++++++++++++++ config/kanata/rc.kanata | 26 +++++++++++++ config/nyxt/config.lisp | 41 ++++++++++++++++++++ config/wezterm/wezterm.lua | 14 ++++++- link.sh | 68 +++++++++++++++++++++++++++++---- todo.org | 17 +++++++++ 9 files changed, 215 insertions(+), 9 deletions(-) create mode 100644 Makefile create mode 100644 config/fish/functions/nyxt.fish create mode 100644 config/kanata/kanata.kbd create mode 100644 config/kanata/rc.kanata create mode 100644 config/nyxt/config.lisp create mode 100755 todo.org diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..faa298a --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +.PHONY: link + +link: + bash link.sh + sudo bash link.sh diff --git a/config/fish/config.fish b/config/fish/config.fish index 509eeea..640112d 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -5,3 +5,10 @@ starship init fish | source # Load aliases if they exist test -f ~/.config/fish/aliases.fish && source ~/.config/fish/aliases.fish + +# Parse Slackware's system locale setup cleanly into Fish configuration +if test -f /etc/profile.d/lang.sh + set -gx LANG (string match -r '(?<=export LANG=).*' < /etc/profile.d/lang.sh | string trim -c '"\'') +end + +set -gx LANG en_US.UTF-8 diff --git a/config/fish/functions/nyxt.fish b/config/fish/functions/nyxt.fish new file mode 100644 index 0000000..a841856 --- /dev/null +++ b/config/fish/functions/nyxt.fish @@ -0,0 +1,3 @@ +function nyxt + flatpak run engineer.atlas.Nyxt $argv +end diff --git a/config/kanata/kanata.kbd b/config/kanata/kanata.kbd new file mode 100644 index 0000000..c125b4e --- /dev/null +++ b/config/kanata/kanata.kbd @@ -0,0 +1,43 @@ +;; Kanata Configuration + +(defcfg + process-unmapped-keys yes +) + +;; Source layout - matches physical key positions +(defsrc + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + caps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + lctl lmet lalt spc ralt rmet rctl up + left down rght +) + +;; Aliases for cleaner configuration +(defalias + ;; Modifiers and special keys + ctl lctl ;; Regular control key + cps (tap-hold 200 150 esc lctl) ;; Caps = Esc on tap, Ctrl on hold + met (layer-toggle meta) ;; Meta (Windows/Command) key with layer +) + +;; Default layer +(deflayer default + grv 1 2 3 4 5 6 7 8 9 0 - = bspc + tab q w e r t y u i o p [ ] \ + @cps a s d f g h j k l ; ' ret + lsft z x c v b n m , . / rsft + @ctl lalt lmet spc rmet ralt rmet _ + _ _ _ +) + +;; Meta (Windows/Command) layer +(deflayer meta + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ left down up rght _ _ _ + _ _ _ _ _ _ _ _ _ _ _ _ + _ _ _ _ _ _ _ _ + _ _ _ +) diff --git a/config/kanata/rc.kanata b/config/kanata/rc.kanata new file mode 100644 index 0000000..7469020 --- /dev/null +++ b/config/kanata/rc.kanata @@ -0,0 +1,26 @@ +#!/bin/bash + +KANATA_BIN="/usr/local/bin/kanata" +KANATA_CFG="/home/green/.config/kanata/kanata.kbd" +PIDFILE="/var/run/kanata.pid" + +case "$1" in + start) + echo "Starting kanata..." + $KANATA_BIN --cfg $KANATA_CFG & + echo $! > $PIDFILE + ;; + stop) + echo "Stopping kanata..." + kill $(cat $PIDFILE) && rm -f $PIDFILE + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac diff --git a/config/nyxt/config.lisp b/config/nyxt/config.lisp new file mode 100644 index 0000000..0194ab6 --- /dev/null +++ b/config/nyxt/config.lisp @@ -0,0 +1,41 @@ +;; Nyxt Configuration + +;; Theme - OceanicNext +(define-configuration browser + ((theme (make-instance 'theme:theme + :dark-p t + :background-color "#1B2B34" + :on-background-color "#CDD3DE" + :primary-color "#6699CC" + :on-primary-color "#1B2B34" + :secondary-color "#4F5B66" + :on-secondary-color "#CDD3DE" + :accent-color "#99C794" + :on-accent-color "#1B2B34")))) + +;; Enable vi keybindings and dark mode globally +(define-configuration web-buffer + ((default-modes (append '(nyxt/mode/vi:vi-normal-mode + nyxt/mode/force-https:force-https-mode) + %slot-value%)) + ;; Request dark mode from sites that support it + (prefers-color-scheme :dark))) + +;; Default search engine +(define-configuration context-buffer + ((search-engines (list (make-instance 'search-engine + :shortcut "ddg" + :search-url "https://duckduckgo.com/?q=~a" + :fallback-url (quri:uri "https://duckduckgo.com")))))) + +;; Send video URLs to mpv +(define-command-global mpv-current-url () + "Open the current page URL in mpv." + (uiop:launch-program (list "mpv" (render-url (url (current-buffer)))))) + +(define-configuration web-buffer + ((context-menu-commands (append %slot-value% + (list (make-instance 'command :name "Open in mpv" + :fn (lambda () + (uiop:launch-program + (list "mpv" (render-url (url (current-buffer))))))))))))) diff --git a/config/wezterm/wezterm.lua b/config/wezterm/wezterm.lua index 474c398..5d4922e 100644 --- a/config/wezterm/wezterm.lua +++ b/config/wezterm/wezterm.lua @@ -2,8 +2,18 @@ local wezterm = require 'wezterm' local config = {} config.color_scheme = 'OceanicNext (base16)' -config.font = wezterm.font 'FiraCode Nerd Font Mono' -config.font_size = 12 +-- config.font = wezterm.font 'FiraCode Nerd Font Mono' + +config.font = wezterm.font_with_fallback { + "FiraCode Nerd Font Mono", + { family = "Noto Color Emoji", assume_emoji_presentation = true }, + } + +config.font_size = 14 config.enable_tab_bar = false +-- Wayland-specific settings +config.enable_wayland = true +config.window_decorations = "NONE" + return config diff --git a/link.sh b/link.sh index 8756c77..b41d031 100755 --- a/link.sh +++ b/link.sh @@ -1,7 +1,61 @@ -ln -s $PWD/config/starship.toml ~/.config -ln -s $PWD/vimrc ~/.vimrc -ln -s $PWD/config/wezterm ~/.config/ -ln -s $PWD/config/fish ~/.config -ln -s $PWD/config/tmux ~/.config -ln -s $PWD/config/senpai ~/.config -ln -s $PWD/config/zed/* ~/.config/zed +#!/bin/bash + +set -e + +DOTFILES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +backup_and_link() { + local src="$1" + local dst="$2" + + if [ -L "$dst" ]; then + echo "already a symlink, skipping: $dst" + return + fi + + if [ -e "$dst" ]; then + echo "backing up: $dst -> $dst.bak" + mv "$dst" "$dst.bak" + fi + + echo "linking: $dst -> $src" + ln -s "$src" "$dst" +} + +backup_and_link "$DOTFILES/config/starship.toml" "$HOME/.config/starship.toml" +backup_and_link "$DOTFILES/vimrc" "$HOME/.vimrc" +backup_and_link "$DOTFILES/config/wezterm" "$HOME/.config/wezterm" +backup_and_link "$DOTFILES/config/fish" "$HOME/.config/fish" +backup_and_link "$DOTFILES/config/tmux" "$HOME/.config/tmux" +backup_and_link "$DOTFILES/config/senpai" "$HOME/.config/senpai" +backup_and_link "$DOTFILES/config/kanata" "$HOME/.config/kanata" +backup_and_link "$DOTFILES/config/nyxt" "$HOME/.var/app/engineer.atlas.Nyxt/config/nyxt" + +# Zed: link individual files to preserve extra live data (themes, backups, etc.) +mkdir -p "$HOME/.config/zed" +for src in "$DOTFILES/config/zed/"*; do + dst="$HOME/.config/zed/$(basename "$src")" + backup_and_link "$src" "$dst" +done + +# System-level links (requires root) +if [ "$EUID" -eq 0 ]; then + echo "" + echo "=== system links ===" + backup_and_link "$DOTFILES/config/kanata/rc.kanata" "/etc/rc.d/rc.kanata" + chmod +x /etc/rc.d/rc.kanata + + if ! grep -q "rc.kanata" /etc/rc.d/rc.local; then + echo "" >> /etc/rc.d/rc.local + echo "# Start kanata key remapper" >> /etc/rc.d/rc.local + echo "if [ -x /etc/rc.d/rc.kanata ]; then" >> /etc/rc.d/rc.local + echo " /etc/rc.d/rc.kanata start" >> /etc/rc.d/rc.local + echo "fi" >> /etc/rc.d/rc.local + echo "added kanata to rc.local" + else + echo "rc.local already has kanata entry, skipping" + fi +else + echo "" + echo "skipping system links (run as root to install /etc/rc.d/rc.kanata and hook into rc.local)" +fi diff --git a/todo.org b/todo.org new file mode 100755 index 0000000..a91d496 --- /dev/null +++ b/todo.org @@ -0,0 +1,17 @@ +* TODO +- bspwm / sxhkd config (separate org file?) +- reconcile vimrc with mac +- get iterm settings from mac +- separate mac-specific tangles +- get pass setup handled +- setup multi-git-push alias +- blog: + - advanced git: + - per-directory identity + - multiple ssh keys + - multi-push + - delta + - aliases + - taskwarrior flow + - lambda connection to EKS + - literate configuration