From f2f652595cfd272f0738d7a82cc88b18653822f7 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Sun, 29 Mar 2026 21:54:42 +0200 Subject: [PATCH 01/29] keyd: capslock map work on arch --- dotfiles/keyd/default.conf | 23 +++++++++------------ install/archinstall/packages/x1/pkglist.txt | 1 + 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dotfiles/keyd/default.conf b/dotfiles/keyd/default.conf index e57e6fc..b804fb7 100644 --- a/dotfiles/keyd/default.conf +++ b/dotfiles/keyd/default.conf @@ -1,18 +1,15 @@ [ids] + * +# Include the shipped Swedish layout +# include layouts/se + +# [global] +# default_layout = se + [main] -# Tap space for space, hold space to activate the 'num_layer' -space = overload(num_layer, space) -[num_layer] -u = 7 -i = 8 -o = 9 -j = 4 -k = 5 -l = 6 -m = 1 -, = 2 -. = 3 -n = 0 +# Maps capslock to escape when pressed and control when held. +capslock = overload(control, esc) + diff --git a/install/archinstall/packages/x1/pkglist.txt b/install/archinstall/packages/x1/pkglist.txt index ef48663..4f148cb 100644 --- a/install/archinstall/packages/x1/pkglist.txt +++ b/install/archinstall/packages/x1/pkglist.txt @@ -26,6 +26,7 @@ i3lock intel-media-driver intel-ucode iwd +keyd less lf libpulse From c23d9b9c13f4a2bae58bb5e936dc34d485daaf3f Mon Sep 17 00:00:00 2001 From: holmen1 Date: Sun, 29 Mar 2026 22:29:27 +0200 Subject: [PATCH 02/29] keyd: num-layers work on arch --- dotfiles/keyd/README.md | 40 ++++++++++++++++++++++++++++++++++++++ dotfiles/keyd/default.conf | 22 +++++++++++++++------ 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 dotfiles/keyd/README.md diff --git a/dotfiles/keyd/README.md b/dotfiles/keyd/README.md new file mode 100644 index 0000000..4ec8bc6 --- /dev/null +++ b/dotfiles/keyd/README.md @@ -0,0 +1,40 @@ +# keyd Setup and Usage Guide + +## What is keyd? +keyd is a key remapping daemon for Linux, allowing you to configure custom keyboard layouts, remap keys, and create advanced input workflows. + +## Installation + +### Arch Linux (AUR) +```sh +yay -S keyd +``` + +For other distributions, see the [official keyd repository](https://github.com/rvaiya/keyd). + +## Configuration + +1. **Edit the configuration file:** + - The main config is typically located at `/etc/keyd/default.conf`. + - In this repo, you can find a sample config at `dotfiles/keyd/default.conf`. + - To use this config, link it to `/etc/keyd/default.conf`: + ```sh + sudo ln -s /path/to/dotfiles/keyd/default.conf /etc/keyd/default.conf + ``` + +2. **Reload keyd:** + ```sh + sudo systemctl restart keyd + ``` + +3. **Enable keyd to start on boot:** + ```sh + sudo systemctl enable keyd + ``` + +## Troubleshooting +- Check the status of keyd: + ```sh + keyd check + ``` + diff --git a/dotfiles/keyd/default.conf b/dotfiles/keyd/default.conf index b804fb7..1b33816 100644 --- a/dotfiles/keyd/default.conf +++ b/dotfiles/keyd/default.conf @@ -2,14 +2,24 @@ * -# Include the shipped Swedish layout -# include layouts/se - -# [global] -# default_layout = se - [main] # Maps capslock to escape when pressed and control when held. capslock = overload(control, esc) +# Tap space for space, hold space to activate the 'num_layer' +space = overload(num_layer, space) + +[num_layer] +u = 7 +i = 8 +o = 9 +j = 4 +k = 5 +l = 6 +m = 1 +, = 2 +. = 3 +n = 0 + + From 748537b45d3d246f0f0c501dc3cca8e069d7146a Mon Sep 17 00:00:00 2001 From: holmen1 Date: Mon, 30 Mar 2026 21:18:30 +0200 Subject: [PATCH 03/29] =?UTF-8?q?xmonad:=20dont=20build=20=20=20=20=20Coul?= =?UTF-8?q?d=20not=20find=20module=20=E2=80=98System.Random=E2=80=99=20=20?= =?UTF-8?q?=20=20=20There=20are=20files=20missing=20in=20the=20=E2=80=98ra?= =?UTF-8?q?ndom-1.2.1.3=E2=80=99=20package,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dotfiles/xmonad/xmonad.hs | 38 ++++++++++------------------ install/build/xmonad/build-xmonad.sh | 4 +-- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index eae870c..1064d9c 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -12,7 +12,6 @@ import XMonad.Util.EZConfig (additionalKeys) import XMonad.Util.NamedScratchpad import XMonad.Util.SpawnOnce -myModMask = mod4Mask -- Rebind Mod to the Super key myAppLauncher = "dmenu_run -fn 'JetBrainsMono Nerd Font:size=14' -nb '#222222' -nf '#bbbbbb' -sb '#A300A3' -sf '#eeeeee'" myMagenta = "#A300A3" @@ -52,36 +51,25 @@ myFadeHook = ] myKeys terminal browser = - [ ((myModMask, xK_a), spawn myAppLauncher), - ((myModMask, xK_e), spawn $ terminal ++ " -e lf"), - ((myModMask, xK_Return), spawn terminal), - ((myModMask .|. shiftMask, xK_Return), windows W.swapMaster), - ((myModMask, xK_q), kill), - ((myModMask .|. shiftMask, xK_h), sendMessage Shrink), -- Shrink the master area - ((myModMask .|. shiftMask, xK_l), sendMessage Expand), -- Expand the master area - ((myModMask, xK_Tab), nextWS), -- Cycle to the next workspace + [ ((modMask, xK_a), spawn myAppLauncher), + ((modMask, xK_e), spawn $ terminal ++ " -e lf"), + ((modMask, xK_Return), spawn terminal), + ((modMask .|. shiftMask, xK_Return), windows W.swapMaster), + ((modMask, xK_q), kill), -- screenshots - ((myModMask, xK_s), spawn "scrot ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), - ((myModMask .|. shiftMask, xK_s), unGrab >> spawn "scrot -s ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), + ((modMask, xK_s), spawn "scrot ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), + ((modMask .|. shiftMask, xK_s), unGrab >> spawn "scrot -s ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), -- dmenu scripts - ((myModMask, xK_x), spawn "~/repos/dotfiles/scripts/dmenu-logout.sh"), - ((myModMask, xK_v), spawn "~/repos/dotfiles/scripts/dmenu-mullvad.sh"), - ((myModMask, xK_m), spawn "~/repos/dotfiles/scripts/dmenu-help.sh"), - ((myModMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), - ((myModMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") + ((modMask, xK_x), spawn "~/repos/dotfiles/scripts/dmenu-logout.sh"), + ((modMask, xK_v), spawn "~/repos/dotfiles/scripts/dmenu-mullvad.sh"), + ((modMask, xK_m), spawn "~/repos/dotfiles/scripts/dmenu-help.sh"), + ((modMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), + ((modMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") ] - ++ - -- mod-[1..9], Switch to workspace N - -- mod-shift-[1..9], Move client to workspace N and follow it - [ ((m .|. myModMask, k), windows $ f i) - | (i, k) <- zip myWorkspaces [xK_1 .. xK_9], - (f, m) <- [(W.greedyView, 0), (\i -> \w -> W.greedyView i (W.shift i w), shiftMask)] - ] myConfig terminal browser = def - { modMask = myModMask, - terminal = terminal, + { terminal = terminal, workspaces = myWorkspaces, focusedBorderColor = myMagenta, layoutHook = myLayout, diff --git a/install/build/xmonad/build-xmonad.sh b/install/build/xmonad/build-xmonad.sh index 870a8e8..f689916 100755 --- a/install/build/xmonad/build-xmonad.sh +++ b/install/build/xmonad/build-xmonad.sh @@ -2,8 +2,8 @@ set -e # Exit on error -XMONAD_TAG="v0.18.0" -XMONAD_CONTRIB_TAG="v0.18.1" +XMONAD_TAG="v0.18.1" +XMONAD_CONTRIB_TAG="v0.18.2" # Define directories BUILD_DIR=~/repos/dotfiles/install/build/xmonad From 672b06dfbfabf052c34b97e593368e345089cb27 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Tue, 31 Mar 2026 18:06:05 +0200 Subject: [PATCH 04/29] xmonad: 0.18.1 build and runs on freebsd --- dotfiles/xmonad/xmonad.hs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 1064d9c..0d0d9a2 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -12,6 +12,7 @@ import XMonad.Util.EZConfig (additionalKeys) import XMonad.Util.NamedScratchpad import XMonad.Util.SpawnOnce +myModMask = mod1Mask myAppLauncher = "dmenu_run -fn 'JetBrainsMono Nerd Font:size=14' -nb '#222222' -nf '#bbbbbb' -sb '#A300A3' -sf '#eeeeee'" myMagenta = "#A300A3" @@ -51,20 +52,20 @@ myFadeHook = ] myKeys terminal browser = - [ ((modMask, xK_a), spawn myAppLauncher), - ((modMask, xK_e), spawn $ terminal ++ " -e lf"), - ((modMask, xK_Return), spawn terminal), - ((modMask .|. shiftMask, xK_Return), windows W.swapMaster), - ((modMask, xK_q), kill), + [ ((myModMask, xK_a), spawn myAppLauncher), + ((myModMask, xK_e), spawn $ terminal ++ " -e lf"), + ((myModMask, xK_Return), spawn terminal), + ((myModMask .|. shiftMask, xK_Return), windows W.swapMaster), + ((myModMask, xK_q), kill), -- screenshots - ((modMask, xK_s), spawn "scrot ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), - ((modMask .|. shiftMask, xK_s), unGrab >> spawn "scrot -s ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), + ((myModMask, xK_s), spawn "scrot ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), + ((myModMask .|. shiftMask, xK_s), unGrab >> spawn "scrot -s ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), -- dmenu scripts - ((modMask, xK_x), spawn "~/repos/dotfiles/scripts/dmenu-logout.sh"), - ((modMask, xK_v), spawn "~/repos/dotfiles/scripts/dmenu-mullvad.sh"), - ((modMask, xK_m), spawn "~/repos/dotfiles/scripts/dmenu-help.sh"), - ((modMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), - ((modMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") + ((myModMask, xK_x), spawn "~/repos/dotfiles/scripts/dmenu-logout.sh"), + ((myModMask, xK_v), spawn "~/repos/dotfiles/scripts/dmenu-mullvad.sh"), + ((myModMask, xK_m), spawn "~/repos/dotfiles/scripts/dmenu-help.sh"), + ((myModMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), + ((myModMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") ] myConfig terminal browser = From 8b46fa16a8488f530d39882d07226b715269e0e4 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Tue, 31 Mar 2026 20:35:52 +0200 Subject: [PATCH 05/29] xmonad: 0.18.1 build and runs Remain wrestle with ghc --- dotfiles/xmonad/README.md | 10 ++++++---- install/archinstall/packages/x1/pkglist.txt | 2 -- install/build/xmonad/README.md | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dotfiles/xmonad/README.md b/dotfiles/xmonad/README.md index 454a637..699be95 100644 --- a/dotfiles/xmonad/README.md +++ b/dotfiles/xmonad/README.md @@ -10,20 +10,22 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. | Key Combination | Action | |------------------------|----------------------------------------| | `Mod + Enter` | Launch terminal | -| `Mod + H` | Help menu | +| `Mod + M` | Help menu | | `Mod + Q` | Close the focused window | | `Mod + Space` | Rotate through available layouts | | `Mod + Shift + Space` | Reset the layout to default | | `Mod + N` | Resize/refresh windows | -| `Mod + Tab` | Move to the next workspace | +| `Mod + Tab` | Move to the next workspace TODO | | `Mod + Shift + Tab` | Move focus to the previous window | +| `Mod + H` | Shrink the master area | | `Mod + J` | Move focus to the next window | | `Mod + K` | Move focus to the previous window | +| `Mod + L` | Expand the master area | | `Mod + Shift + Return` | Swap the focused window with master | | `Mod + ,` | Increment master windows | | `Mod + .` | Decrement master windows | | `Mod + X` | Logout menu | -| `Mod + M` | VPN menu | +| `Mod + V` | VPN menu | | `Mod + S` | Screenshot to `~/Downloads` | | `Mod + Shift + S` | Capture a selected area screenshot to `~/Downloads` | | `Mod + W` | Launch browser | @@ -32,7 +34,7 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. ## Requirements -- [Xmobar](https://xmobar.org/) +- [Xmobar](https://xmobar.org/) NOT USING - [st - simple terminal](https://st.suckless.org/) - [Brave](https://brave.com/linux/) - thunar fileexplorer diff --git a/install/archinstall/packages/x1/pkglist.txt b/install/archinstall/packages/x1/pkglist.txt index 4f148cb..7389ae6 100644 --- a/install/archinstall/packages/x1/pkglist.txt +++ b/install/archinstall/packages/x1/pkglist.txt @@ -16,11 +16,9 @@ fastfetch fd feh gdb -ghc-static git grub gst-plugin-pipewire -haskell-language-server htop i3lock intel-media-driver diff --git a/install/build/xmonad/README.md b/install/build/xmonad/README.md index ea75bd1..c5fc9c2 100644 --- a/install/build/xmonad/README.md +++ b/install/build/xmonad/README.md @@ -42,11 +42,29 @@ Note: [Static linking](https://wiki.archlinux.org/title/Haskell#Static_linking) Instead of GHCup, you can use Pacman to install pre-built Haskell tools: + ```bash # Install GHC and Cabal from official Arch repositories pacman -S ghc-static cabal-install ``` +**Troubleshooting: Could not find module ‘System.Random’** + +After a system upgrade, you may encounter the following error when building: + + Could not find module ‘System.Random’ + There are files missing in the ‘random-1.2.1.3’ package + +This can be resolved by installing the official binary GHC package. For example: + +```bash +wget https://downloads.haskell.org/~ghc/9.12.4/ghc-9.12.4-x86_64-alpine3_12-linux-static-int_native.tar.gz +tar -xvf ghc-9.12.4-x86_64-alpine3_12-linux-static-int_native.tar.gz +# Follow the README or INSTALL instructions in the extracted directory to install GHC +``` + +This provides a complete set of libraries and resolves missing module errors. + **Advantages:** - No need to manage a separate Haskell installer - XMonad builds fine without additional setup From 518c0c201fbbe5711d9fb0451ccb400a24e39554 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 17:01:12 +0200 Subject: [PATCH 06/29] begin xkb --- dotfiles/keyd/README.md | 7 +- dotfiles/x/.config/xkb/symbols/local | 34 +++++ dotfiles/x/.local/bin/apply-keys.sh | 38 ++++++ dotfiles/x/.xinitrc | 9 +- dotfiles/x/README.md | 181 +++++++++++++++++++++++++++ 5 files changed, 266 insertions(+), 3 deletions(-) create mode 100644 dotfiles/x/.config/xkb/symbols/local create mode 100755 dotfiles/x/.local/bin/apply-keys.sh create mode 100644 dotfiles/x/README.md diff --git a/dotfiles/keyd/README.md b/dotfiles/keyd/README.md index 4ec8bc6..86b89e6 100644 --- a/dotfiles/keyd/README.md +++ b/dotfiles/keyd/README.md @@ -1,6 +1,11 @@ # keyd Setup and Usage Guide -## What is keyd? +> **Note:** keyd is Linux-only and does not work on FreeBSD. +> This repo now uses **XKB + xcape** for portable, daemon-free key remapping. +> See [`dotfiles/x/README.md`](../x/README.md) for the current setup. + +The configuration in `default.conf` is kept for reference (Arch Linux only). + keyd is a key remapping daemon for Linux, allowing you to configure custom keyboard layouts, remap keys, and create advanced input workflows. ## Installation diff --git a/dotfiles/x/.config/xkb/symbols/local b/dotfiles/x/.config/xkb/symbols/local new file mode 100644 index 0000000..f1851ff --- /dev/null +++ b/dotfiles/x/.config/xkb/symbols/local @@ -0,0 +1,34 @@ +// ~/.config/xkb/symbols/local +// +// Partial XKB symbols: numspace layer +// Space bar → ISO_Level3_Shift (level-3 activator) +// xcape fires 'space' when Space is tapped alone +// +// Numpad cluster (Space held): +// u i o → 7 8 9 +// j k l → 4 5 6 +// m , . → 1 2 3 +// n → 0 + +partial alphanumeric_keys modifier_keys +xkb_symbols "numspace" { + + // Space as level-3 shift; xcape restores tap=space behaviour + key { + type = "ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + + // Numpad layer — inherit levels 1 and 2 from the active layout, + // add digit at level 3 (Space held). + key { type = "THREE_LEVEL", symbols[Group1] = [ u, U, 7 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ i, I, 8 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ o, O, 9 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ j, J, 4 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ k, K, 5 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ l, L, 6 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ m, M, 1 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ comma, semicolon, 2 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ period, colon, 3 ] }; + key { type = "THREE_LEVEL", symbols[Group1] = [ n, N, 0 ] }; +}; diff --git a/dotfiles/x/.local/bin/apply-keys.sh b/dotfiles/x/.local/bin/apply-keys.sh new file mode 100755 index 0000000..8cac963 --- /dev/null +++ b/dotfiles/x/.local/bin/apply-keys.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# apply-keys.sh — portable X11 keyboard customisation (XKB + xcape) +# +# Key behaviour +# CapsLock : hold = Control, tap = Escape +# Space : hold = num-layer, tap = Space +# +# Num-layer (Space held) +# u i o → 7 8 9 +# j k l → 4 5 6 +# m , . → 1 2 3 +# n → 0 +# +# Requires: setxkbmap, xkbcomp, xcape +# Portable: Arch Linux and FreeBSD with Xlibre/Xorg + +# ── 1. Merge layout ──────────────────────────────────────────────────────── +# setxkbmap -print emits an XKB keymap description without applying it. +# sed appends +local(numspace) to the symbols include line. +# xkbcomp compiles the merged keymap and pushes it to the X server. +# -I points xkbcomp at the user XKB directory (~/.config/xkb/). +if ! setxkbmap se -option ctrl:nocaps -print \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numspace)"|' \ + | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY"; then + echo "apply-keys.sh: xkb merge failed — applying base layout only" >&2 + setxkbmap se -option ctrl:nocaps +fi + +# ── 2. xcape — synthesise key event when modifier is tapped alone ────────── +# Control_L (CapsLock remapped) → Escape +# ISO_Level3_Shift (Space remapped) → space +if command -v xcape >/dev/null 2>&1; then + pkill -x xcape 2>/dev/null || true + sleep 0.1 + xcape -e 'Control_L=Escape;ISO_Level3_Shift=space' & +else + echo "apply-keys.sh: xcape not found — tap behaviour unavailable" >&2 +fi diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index fccdaa7..e506495 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -35,8 +35,13 @@ case "$(uname -s)" in ;; esac -# Set keymap (don't background - fast and should complete before apps start) -setxkbmap se +# Apply keyboard customisations: XKB (layout + num-layer) + xcape (tap events) +# See dotfiles/x/README.md for full documentation. +if [ -x "$HOME/.local/bin/apply-keys.sh" ]; then + "$HOME/.local/bin/apply-keys.sh" +else + setxkbmap se +fi # Set the default X cursor to the usual pointer xsetroot -cursor_name left_ptr & diff --git a/dotfiles/x/README.md b/dotfiles/x/README.md new file mode 100644 index 0000000..550d652 --- /dev/null +++ b/dotfiles/x/README.md @@ -0,0 +1,181 @@ +# X + +Portable X11 keyboard customisation using **XKB** and **xcape**. +Works on Arch Linux and FreeBSD (Xlibre/Xorg) without any daemon or root config. + +--- + +## Key behaviour + +| Key | Tap | Hold | +|----------|-------|--------------------------| +| CapsLock | Esc | Control | +| Space | Space | Num-layer (see below) | + +### Num-layer (Space held) + +``` + u i o → 7 8 9 + j k l → 4 5 6 + m , . → 1 2 3 + n → 0 +``` + +--- + +## Files + +| Path (relative to `$HOME` after stow) | Purpose | +|------------------------------------------|-----------------------------------------| +| `.config/xkb/symbols/local` | XKB partial symbols — num-layer mapping | +| `.local/bin/apply-keys.sh` | Setup script — applies XKB + xcape | +| `.xinitrc` | X startup script — calls apply-keys.sh | + +Source locations in this repo mirror the stow layout under `dotfiles/x/`. + +--- + +## Installation + +### 1. Install dependencies + +**Arch Linux** +```sh +sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape +``` + +**FreeBSD** +```sh +pkg install xkbcomp xcape # setxkbmap ships with xlibre/xorg-minimal +``` + +### 2. Stow the `x` package + +```sh +cd ~/repos/dotfiles +stow -d dotfiles -t ~ x +``` + +This creates the symlinks: +``` +~/.config/xkb/symbols/local → dotfiles/x/.config/xkb/symbols/local +~/.local/bin/apply-keys.sh → dotfiles/x/.local/bin/apply-keys.sh +~/.xinitrc → dotfiles/x/.xinitrc +``` + +### 3. Start X + +```sh +startx # .xinitrc calls apply-keys.sh automatically +``` + +To reload without restarting X: + +```sh +~/.local/bin/apply-keys.sh +``` + +--- + +## How it works + +### CapsLock → Control / Escape + +```sh +setxkbmap se -option ctrl:nocaps +``` + +The standard XKB option `ctrl:nocaps` replaces the `CapsLock` key with +`Control_L`. + +```sh +xcape -e 'Control_L=Escape' +``` + +xcape watches for `Control_L` being released without another key having been +pressed in between; when it is, xcape synthesises an `Escape` keystroke. + +> **Note:** `ctrl:nocaps` maps CapsLock to the same symbol (`Control_L`) as +> the physical left Ctrl key. xcape therefore also fires `Escape` when the +> real left Ctrl is tapped alone. In practice this is harmless — Ctrl is +> almost always used in combination with another key. + +--- + +### Space → Space / Num-layer + +#### XKB symbols — `~/.config/xkb/symbols/local` + +The `numspace` section does two things: + +1. **Remaps Space to `ISO_Level3_Shift`.** + `ISO_Level3_Shift` is the standard XKB level-3 modifier — the same + mechanism used by AltGr. Holding Space now activates level 3 for all + keys, exactly like holding AltGr. + +2. **Assigns digits at level 3 for the numpad cluster keys.** + All other keys keep their existing level-3 symbols (Swedish AltGr + characters) unchanged. + +#### xcape restores tap = space + +```sh +xcape -e 'ISO_Level3_Shift=space' +``` + +When Space is tapped without another key, xcape synthesises a `space` +keystroke, giving back normal space-bar behaviour. + +--- + +### How `apply-keys.sh` merges the keymap + +```sh +setxkbmap se -option ctrl:nocaps -print \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numspace)"|' \ + | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY" +``` + +1. `setxkbmap … -print` emits the XKB keymap description without applying it. +2. `sed` appends `+local(numspace)` to the `xkb_symbols` include line, e.g.: + ``` + include "pc+se+inet(evdev)+ctrl(nocaps)+local(numspace)" + ``` +3. `xkbcomp` compiles the merged keymap and pushes it to the X server. + `-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. + +If the merge fails (symbol file missing, xkbcomp error), the script falls +back to `setxkbmap se -option ctrl:nocaps` so CapsLock remapping still works. + +--- + +## Debugging + +```sh +# Show current XKB settings +setxkbmap -query + +# Dump the compiled keymap; grep for a key definition +xkbcomp -xkb "$DISPLAY" - | grep -A5 'key ' +xkbcomp -xkb "$DISPLAY" - | grep -A5 'key ' + +# Reload keyboard at any time +~/.local/bin/apply-keys.sh + +# Watch raw key events (press keys in the xev window) +xev | grep -A2 'KeyPress' +``` + +--- + +## Comparison with keyd + +| Feature | keyd (Linux-only) | XKB + xcape (portable) | +|--------------------------|----------------------|------------------------| +| CapsLock → Ctrl / Esc | ✓ | ✓ | +| Space num-layer | ✓ | ✓ | +| FreeBSD support | ✗ | ✓ | +| Requires daemon | ✓ (systemd service) | ✗ | +| Requires root config | ✓ (`/etc/keyd/`) | ✗ (user `~/.config/`) | +| Dependency count | 1 (keyd) | 3 (setxkbmap, xkbcomp, xcape) | + From 85ba5b7a47a4ef92c5b00fc75a5e20158798f5b8 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 17:20:12 +0200 Subject: [PATCH 07/29] ctd --- dotfiles/x/.config/xkb/symbols/local | 39 +++---- dotfiles/x/.local/bin/apply-keys.sh | 49 +++------ dotfiles/x/README.md | 155 ++++++--------------------- 3 files changed, 63 insertions(+), 180 deletions(-) diff --git a/dotfiles/x/.config/xkb/symbols/local b/dotfiles/x/.config/xkb/symbols/local index f1851ff..1e7310d 100644 --- a/dotfiles/x/.config/xkb/symbols/local +++ b/dotfiles/x/.config/xkb/symbols/local @@ -1,34 +1,21 @@ // ~/.config/xkb/symbols/local // -// Partial XKB symbols: numspace layer -// Space bar → ISO_Level3_Shift (level-3 activator) -// xcape fires 'space' when Space is tapped alone -// -// Numpad cluster (Space held): +// Num-layer activated by Super (lv3:lwin_switch): // u i o → 7 8 9 // j k l → 4 5 6 // m , . → 1 2 3 // n → 0 -partial alphanumeric_keys modifier_keys -xkb_symbols "numspace" { - - // Space as level-3 shift; xcape restores tap=space behaviour - key { - type = "ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - - // Numpad layer — inherit levels 1 and 2 from the active layout, - // add digit at level 3 (Space held). - key { type = "THREE_LEVEL", symbols[Group1] = [ u, U, 7 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ i, I, 8 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ o, O, 9 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ j, J, 4 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ k, K, 5 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ l, L, 6 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ m, M, 1 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ comma, semicolon, 2 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ period, colon, 3 ] }; - key { type = "THREE_LEVEL", symbols[Group1] = [ n, N, 0 ] }; +partial alphanumeric_keys +xkb_symbols "numpad" { + key { [ u, U, 7 ] }; + key { [ i, I, 8 ] }; + key { [ o, O, 9 ] }; + key { [ j, J, 4 ] }; + key { [ k, K, 5 ] }; + key { [ l, L, 6 ] }; + key { [ m, M, 1 ] }; + key { [ comma, semicolon, 2 ] }; + key { [ period, colon, 3 ] }; + key { [ n, N, 0 ] }; }; diff --git a/dotfiles/x/.local/bin/apply-keys.sh b/dotfiles/x/.local/bin/apply-keys.sh index 8cac963..ed53682 100755 --- a/dotfiles/x/.local/bin/apply-keys.sh +++ b/dotfiles/x/.local/bin/apply-keys.sh @@ -1,38 +1,21 @@ #!/bin/sh -# apply-keys.sh — portable X11 keyboard customisation (XKB + xcape) +# apply-keys.sh — X11 keyboard customisation (XKB + xcape) # -# Key behaviour -# CapsLock : hold = Control, tap = Escape -# Space : hold = num-layer, tap = Space +# CapsLock : hold = Control, tap = Escape +# Super : hold = num-layer +# u i o → 7 8 9 +# j k l → 4 5 6 +# m , . → 1 2 3 +# n → 0 # -# Num-layer (Space held) -# u i o → 7 8 9 -# j k l → 4 5 6 -# m , . → 1 2 3 -# n → 0 -# -# Requires: setxkbmap, xkbcomp, xcape -# Portable: Arch Linux and FreeBSD with Xlibre/Xorg +# Deps: setxkbmap, xkbcomp, xcape -# ── 1. Merge layout ──────────────────────────────────────────────────────── -# setxkbmap -print emits an XKB keymap description without applying it. -# sed appends +local(numspace) to the symbols include line. -# xkbcomp compiles the merged keymap and pushes it to the X server. -# -I points xkbcomp at the user XKB directory (~/.config/xkb/). -if ! setxkbmap se -option ctrl:nocaps -print \ - | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numspace)"|' \ - | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY"; then - echo "apply-keys.sh: xkb merge failed — applying base layout only" >&2 - setxkbmap se -option ctrl:nocaps -fi +# Apply layout: Swedish + ctrl:nocaps + lv3:lwin_switch (Super = level-3) +# Merge user symbol file local(numpad) for the digit layer. +setxkbmap se -option ctrl:nocaps,lv3:lwin_switch -print \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)"|' \ + | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY" -# ── 2. xcape — synthesise key event when modifier is tapped alone ────────── -# Control_L (CapsLock remapped) → Escape -# ISO_Level3_Shift (Space remapped) → space -if command -v xcape >/dev/null 2>&1; then - pkill -x xcape 2>/dev/null || true - sleep 0.1 - xcape -e 'Control_L=Escape;ISO_Level3_Shift=space' & -else - echo "apply-keys.sh: xcape not found — tap behaviour unavailable" >&2 -fi +# xcape: synthesise Escape when CapsLock (Control_L) is tapped alone +pkill -x xcape 2>/dev/null || true +xcape -e 'Control_L=Escape' & diff --git a/dotfiles/x/README.md b/dotfiles/x/README.md index 550d652..9389640 100644 --- a/dotfiles/x/README.md +++ b/dotfiles/x/README.md @@ -1,18 +1,17 @@ # X -Portable X11 keyboard customisation using **XKB** and **xcape**. -Works on Arch Linux and FreeBSD (Xlibre/Xorg) without any daemon or root config. +X11 keyboard customisation using **XKB** and **xcape**. --- ## Key behaviour -| Key | Tap | Hold | -|----------|-------|--------------------------| -| CapsLock | Esc | Control | -| Space | Space | Num-layer (see below) | +| Key | Tap | Hold | +|----------|---------|-------------| +| CapsLock | Escape | Control | +| Super | — | Num-layer | -### Num-layer (Space held) +### Num-layer (Super held) ``` u i o → 7 8 9 @@ -25,157 +24,71 @@ Works on Arch Linux and FreeBSD (Xlibre/Xorg) without any daemon or root config. ## Files -| Path (relative to `$HOME` after stow) | Purpose | -|------------------------------------------|-----------------------------------------| -| `.config/xkb/symbols/local` | XKB partial symbols — num-layer mapping | -| `.local/bin/apply-keys.sh` | Setup script — applies XKB + xcape | -| `.xinitrc` | X startup script — calls apply-keys.sh | - -Source locations in this repo mirror the stow layout under `dotfiles/x/`. +| Path | Purpose | +|-------------------------------|------------------------------------------| +| `.config/xkb/symbols/local` | XKB partial symbols — num-layer digits | +| `.local/bin/apply-keys.sh` | Applies XKB + starts xcape | +| `.xinitrc` | Calls `apply-keys.sh` on X startup | --- -## Installation - -### 1. Install dependencies +## Installation (Arch Linux) -**Arch Linux** ```sh sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape ``` -**FreeBSD** -```sh -pkg install xkbcomp xcape # setxkbmap ships with xlibre/xorg-minimal -``` - -### 2. Stow the `x` package - -```sh -cd ~/repos/dotfiles -stow -d dotfiles -t ~ x -``` - -This creates the symlinks: -``` -~/.config/xkb/symbols/local → dotfiles/x/.config/xkb/symbols/local -~/.local/bin/apply-keys.sh → dotfiles/x/.local/bin/apply-keys.sh -~/.xinitrc → dotfiles/x/.xinitrc -``` - -### 3. Start X - -```sh -startx # .xinitrc calls apply-keys.sh automatically -``` - -To reload without restarting X: +Copy or symlink the files to `$HOME`, then reload: ```sh ~/.local/bin/apply-keys.sh ``` +`~/.xinitrc` calls this automatically on `startx`. + --- ## How it works ### CapsLock → Control / Escape -```sh -setxkbmap se -option ctrl:nocaps -``` - -The standard XKB option `ctrl:nocaps` replaces the `CapsLock` key with -`Control_L`. +`ctrl:nocaps` (built-in XKB option) replaces CapsLock with `Control_L`. +xcape then synthesises `Escape` when `Control_L` is released without a chord: ```sh xcape -e 'Control_L=Escape' ``` -xcape watches for `Control_L` being released without another key having been -pressed in between; when it is, xcape synthesises an `Escape` keystroke. - -> **Note:** `ctrl:nocaps` maps CapsLock to the same symbol (`Control_L`) as -> the physical left Ctrl key. xcape therefore also fires `Escape` when the -> real left Ctrl is tapped alone. In practice this is harmless — Ctrl is -> almost always used in combination with another key. - ---- +### Super → Num-layer -### Space → Space / Num-layer +`lv3:lwin_switch` (built-in XKB option) makes the left Super key the +**level-3 activator** — the same mechanism as AltGr. +`~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. -#### XKB symbols — `~/.config/xkb/symbols/local` - -The `numspace` section does two things: - -1. **Remaps Space to `ISO_Level3_Shift`.** - `ISO_Level3_Shift` is the standard XKB level-3 modifier — the same - mechanism used by AltGr. Holding Space now activates level 3 for all - keys, exactly like holding AltGr. - -2. **Assigns digits at level 3 for the numpad cluster keys.** - All other keys keep their existing level-3 symbols (Swedish AltGr - characters) unchanged. +### How `apply-keys.sh` merges the keymap -#### xcape restores tap = space +`setxkbmap -print` emits the XKB description without applying it: -```sh -xcape -e 'ISO_Level3_Shift=space' +``` +xkb_symbols { include "pc+se+inet(evdev)+ctrl(nocaps)+level3(lwin_switch)+..." }; ``` -When Space is tapped without another key, xcape synthesises a `space` -keystroke, giving back normal space-bar behaviour. - ---- +`sed` appends `+local(numpad)` to that include line: -### How `apply-keys.sh` merges the keymap - -```sh -setxkbmap se -option ctrl:nocaps -print \ - | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numspace)"|' \ - | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY" +``` +xkb_symbols { include "...+level3(lwin_switch)+local(numpad)" }; ``` -1. `setxkbmap … -print` emits the XKB keymap description without applying it. -2. `sed` appends `+local(numspace)` to the `xkb_symbols` include line, e.g.: - ``` - include "pc+se+inet(evdev)+ctrl(nocaps)+local(numspace)" - ``` -3. `xkbcomp` compiles the merged keymap and pushes it to the X server. - `-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. - -If the merge fails (symbol file missing, xkbcomp error), the script falls -back to `setxkbmap se -option ctrl:nocaps` so CapsLock remapping still works. +`xkbcomp` compiles the result and loads it into the X server. +`-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. --- ## Debugging ```sh -# Show current XKB settings -setxkbmap -query - -# Dump the compiled keymap; grep for a key definition -xkbcomp -xkb "$DISPLAY" - | grep -A5 'key ' -xkbcomp -xkb "$DISPLAY" - | grep -A5 'key ' - -# Reload keyboard at any time -~/.local/bin/apply-keys.sh - -# Watch raw key events (press keys in the xev window) -xev | grep -A2 'KeyPress' +setxkbmap -query # current options +xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check Super mapping +xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check u/7 mapping +xev | grep -A2 KeyPress # watch raw events ``` - ---- - -## Comparison with keyd - -| Feature | keyd (Linux-only) | XKB + xcape (portable) | -|--------------------------|----------------------|------------------------| -| CapsLock → Ctrl / Esc | ✓ | ✓ | -| Space num-layer | ✓ | ✓ | -| FreeBSD support | ✗ | ✓ | -| Requires daemon | ✓ (systemd service) | ✗ | -| Requires root config | ✓ (`/etc/keyd/`) | ✗ (user `~/.config/`) | -| Dependency count | 1 (keyd) | 3 (setxkbmap, xkbcomp, xcape) | - From 1fa18ec2477b667dbc43a7e1b117802703740255 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 18:26:03 +0200 Subject: [PATCH 08/29] xkb: runs on arch --- dotfiles/x/.xinitrc | 10 +- dotfiles/x/README.md | 93 +++--------------- dotfiles/{x => xkb}/.config/xkb/symbols/local | 0 dotfiles/xkb/README.md | 94 +++++++++++++++++++ dotfiles/{x/.local/bin => xkb}/apply-keys.sh | 0 install/archinstall/packages/x1/pkglist.txt | 3 +- 6 files changed, 113 insertions(+), 87 deletions(-) rename dotfiles/{x => xkb}/.config/xkb/symbols/local (100%) create mode 100644 dotfiles/xkb/README.md rename dotfiles/{x/.local/bin => xkb}/apply-keys.sh (100%) diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index e506495..ccbf36d 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -35,13 +35,9 @@ case "$(uname -s)" in ;; esac -# Apply keyboard customisations: XKB (layout + num-layer) + xcape (tap events) -# See dotfiles/x/README.md for full documentation. -if [ -x "$HOME/.local/bin/apply-keys.sh" ]; then - "$HOME/.local/bin/apply-keys.sh" -else - setxkbmap se -fi +# Apply basic keyboard layout. For full XKB + xcape customisation run +# ~/.local/bin/apply-keys.sh manually (see dotfiles/xkb/README.md). +setxkbmap se # Set the default X cursor to the usual pointer xsetroot -cursor_name left_ptr & diff --git a/dotfiles/x/README.md b/dotfiles/x/README.md index 9389640..a63d499 100644 --- a/dotfiles/x/README.md +++ b/dotfiles/x/README.md @@ -1,94 +1,29 @@ # X -X11 keyboard customisation using **XKB** and **xcape**. - ---- - -## Key behaviour - -| Key | Tap | Hold | -|----------|---------|-------------| -| CapsLock | Escape | Control | -| Super | — | Num-layer | - -### Num-layer (Super held) - -``` - u i o → 7 8 9 - j k l → 4 5 6 - m , . → 1 2 3 - n → 0 -``` +X11 session startup via `~/.xinitrc`. --- ## Files -| Path | Purpose | -|-------------------------------|------------------------------------------| -| `.config/xkb/symbols/local` | XKB partial symbols — num-layer digits | -| `.local/bin/apply-keys.sh` | Applies XKB + starts xcape | -| `.xinitrc` | Calls `apply-keys.sh` on X startup | +| Path | Purpose | +|------------|----------------------------------| +| `.xinitrc` | X session startup — env, apps | --- -## Installation (Arch Linux) - -```sh -sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape -``` - -Copy or symlink the files to `$HOME`, then reload: - -```sh -~/.local/bin/apply-keys.sh -``` - -`~/.xinitrc` calls this automatically on `startx`. - ---- - -## How it works - -### CapsLock → Control / Escape - -`ctrl:nocaps` (built-in XKB option) replaces CapsLock with `Control_L`. -xcape then synthesises `Escape` when `Control_L` is released without a chord: - -```sh -xcape -e 'Control_L=Escape' -``` - -### Super → Num-layer - -`lv3:lwin_switch` (built-in XKB option) makes the left Super key the -**level-3 activator** — the same mechanism as AltGr. -`~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. - -### How `apply-keys.sh` merges the keymap - -`setxkbmap -print` emits the XKB description without applying it: - -``` -xkb_symbols { include "pc+se+inet(evdev)+ctrl(nocaps)+level3(lwin_switch)+..." }; -``` - -`sed` appends `+local(numpad)` to that include line: - -``` -xkb_symbols { include "...+level3(lwin_switch)+local(numpad)" }; -``` +## Startup sequence -`xkbcomp` compiles the result and loads it into the X server. -`-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. +1. Check essential programs (`xmonad`, `xterm`) +2. Set `EDITOR`, `TERMINAL`, `BROWSER` +3. Apply base keyboard layout (`setxkbmap se`) +4. Start `xsetroot`, `feh`, `dunst`, `xcompmgr`, `xbindkeys` +5. `exec xmonad` --- -## Debugging +## Keyboard customisation -```sh -setxkbmap -query # current options -xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check Super mapping -xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check u/7 mapping -xev | grep -A2 KeyPress # watch raw events -``` +Extended key behaviour (CapsLock→Control/Escape, Super→num-layer) lives in +`dotfiles/xkb/` and is applied by running `~/.local/bin/apply-keys.sh` manually. +See [xkb/README.md](../xkb/README.md) for details. diff --git a/dotfiles/x/.config/xkb/symbols/local b/dotfiles/xkb/.config/xkb/symbols/local similarity index 100% rename from dotfiles/x/.config/xkb/symbols/local rename to dotfiles/xkb/.config/xkb/symbols/local diff --git a/dotfiles/xkb/README.md b/dotfiles/xkb/README.md new file mode 100644 index 0000000..02a5250 --- /dev/null +++ b/dotfiles/xkb/README.md @@ -0,0 +1,94 @@ +# XKB + +X11 keyboard customisation using **XKB** and **xcape**. + +--- + +## Key behaviour + +| Key | Tap | Hold | +|----------|---------|-------------| +| CapsLock | Escape | Control | +| Super | — | Num-layer | + +### Num-layer (Super held) + +``` + u i o → 7 8 9 + j k l → 4 5 6 + m , . → 1 2 3 + n → 0 +``` + +--- + +## Files + +| Path | Purpose | +|-------------------------------|----------------------------------------| +| `.config/xkb/symbols/local` | XKB partial symbols — num-layer digits | +| `.local/bin/apply-keys.sh` | Applies XKB + starts xcape | + +--- + +## Installation (Arch Linux) + +```sh +sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape +``` + +Symlink the files to `$HOME`, then apply manually: + +```sh +~/.local/bin/apply-keys.sh +``` + +> `~/.xinitrc` applies only `setxkbmap se` on startup. Run `apply-keys.sh` +> manually after login to get the full key behaviour. + +--- + +## How it works + +### CapsLock → Control / Escape + +`ctrl:nocaps` (built-in XKB option) replaces CapsLock with `Control_L`. +xcape then synthesises `Escape` when `Control_L` is released without a chord: + +```sh +xcape -e 'Control_L=Escape' +``` + +### Super → Num-layer + +`lv3:lwin_switch` (built-in XKB option) makes the left Super key the +**level-3 activator** — the same mechanism as AltGr. +`~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. + +### How `apply-keys.sh` merges the keymap + +`setxkbmap -print` emits the XKB description without applying it: + +``` +xkb_symbols { include "pc+se+inet(evdev)+ctrl(nocaps)+level3(lwin_switch)+..." }; +``` + +`sed` appends `+local(numpad)` to that include line: + +``` +xkb_symbols { include "...+level3(lwin_switch)+local(numpad)" }; +``` + +`xkbcomp` compiles the result and loads it into the X server. +`-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. + +--- + +## Debugging + +```sh +setxkbmap -query # current options +xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check Super mapping +xkbcomp -xkb "$DISPLAY" - | grep -A4 'key ' # check u/7 mapping +xev | grep -A2 KeyPress # watch raw events +``` diff --git a/dotfiles/x/.local/bin/apply-keys.sh b/dotfiles/xkb/apply-keys.sh similarity index 100% rename from dotfiles/x/.local/bin/apply-keys.sh rename to dotfiles/xkb/apply-keys.sh diff --git a/install/archinstall/packages/x1/pkglist.txt b/install/archinstall/packages/x1/pkglist.txt index 7389ae6..697dbcf 100644 --- a/install/archinstall/packages/x1/pkglist.txt +++ b/install/archinstall/packages/x1/pkglist.txt @@ -24,7 +24,6 @@ i3lock intel-media-driver intel-ucode iwd -keyd less lf libpulse @@ -55,8 +54,10 @@ unzip viu wireplumber xbindkeys +xcape xclip xcompmgr +xorg-xev xorg-xinit xorg-xsetroot xterm From 234bd9e912cf2fea8fc9f5773d2f1f097ae8b0d9 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 19:15:49 +0200 Subject: [PATCH 09/29] ctd --- dotfiles/x/.xinitrc | 10 +++-- dotfiles/xkb/.config/xkb/keymap.xkb | Bin 0 -> 13696 bytes dotfiles/xkb/README.md | 39 +++++++++--------- dotfiles/xkb/apply-keys.sh | 13 +++--- install/archinstall/links/x1/links.config | 2 +- install/build/xkb/build-xkb.sh | 22 ++++++++++ .../build}/xkb/symbols/local | 0 7 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 dotfiles/xkb/.config/xkb/keymap.xkb create mode 100755 install/build/xkb/build-xkb.sh rename {dotfiles/xkb/.config => install/build}/xkb/symbols/local (100%) diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index ccbf36d..d62ad3e 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -35,9 +35,13 @@ case "$(uname -s)" in ;; esac -# Apply basic keyboard layout. For full XKB + xcape customisation run -# ~/.local/bin/apply-keys.sh manually (see dotfiles/xkb/README.md). -setxkbmap se +# Apply keyboard customisations: compiled XKB keymap + xcape (tap events). +# Build the keymap first with: apply-keys.sh build (see dotfiles/xkb/README.md) +if [ -x "$HOME/.local/bin/apply-keys.sh" ]; then + "$HOME/.local/bin/apply-keys.sh" +else + setxkbmap se +fi # Set the default X cursor to the usual pointer xsetroot -cursor_name left_ptr & diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb b/dotfiles/xkb/.config/xkb/keymap.xkb new file mode 100644 index 0000000000000000000000000000000000000000..b99bbe4091a3b417cef8ce201a2450bde32806c2 GIT binary patch literal 13696 zcmcJWdvs&PeaGisNw%zgzkmSkaUg+Rj6n}ew%RmBmSkHi*%p$#-rW#fuUD*<_1Z@E z?y?Cj+n%1Bo}NB(npdC6rb(NVgi;_I3Tc2o2qpg!PD9cjPTI7DB!p1tAxT40+|O_B zTq`oYVo8nOg=Us#HH! zpR3I_>-CVTo?NUqRhJVs)HqeAywUpdv{E58az^4JsyfqLn46PqTwC_2`l+M!Q$5pj zjp?QO(%#!o*PF{{_NnknffAI;SF9B$7h9VBD zk}gZSEa|eO%f@20QZ8Q_s*X@*DKkjALDCJ9Zjf|?q#GpNAn684H%Pj{ShP~BjugwI z6QxY4RxM}q*-W`QRE)-uIFdm6kR*~q`jG)7JyeWE$3{!VYPM7?mitw)JbO`^J z2PTmelF1dzF))rKkSLNXl@62=hw~$uQgygSUX&NZ)>y2VsbxkAmCQ(ftTWr&J@a(@$$r2ZhWXRR?Ci;4~=72Ia93-6~=PeiJBV8m&%1$Uq3>Aed$6h z8AW1997!O3ND@gQ@RIP7@KW$n@KW$n@KW$n@KW$n@KW$n@cQBP!|R9F53e6yKfHc; z{qXwX^}`#0Hvn${-T=G-cmwbT;0?eVfHwdy9i{E*=NSDQqn~5+bBunD(a$mZIZk|> z{)yucad`1Q`YuWHtI>QdQ=KSRMh=xLg?MxTNf+X=C=x^BNCN3Yl1K{aN8rWa#o@)_ z#o@)_#o@)_#o@)_(I4?Ryac=iyac=iyac=iyac=iyac=iygqn+@cQ8O!Rv$92d@tv z{Sl`>;`B$H{)p2barz@pf5hpJcrvNSOqOv+#WJPgiuCzter!U<)X3r5u=ql0w3ZQn zsDPB29G|F_!BnwO8wUG}1^f+riiHVAR84#?CjJJ-#pl3;_#N11d@pHyuV4JG5KBbG z_duCD=(9vz$^{crF4!k_f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c0qY$3_ zw!y(s>LPkoqu3)n`JDyfmi*Sj!L-3lE}}MT-w-?G_ZLol(qKxX^re$e%!JG6m;4e2 z^Vq#v*GFbwnSCN^6Y)9i3t`S&94$}J*Lj}W>KXNU20%cZk;}U_2r~D+uyrdZB%RB< zo(S4a>$z?1IRDxq7-(A0Z*RwMc7N+rnm!`s27<4u$0+x4byR1r%Z)ha;$H9bbc{V*cM5sEWo+~O-pEu%1v*|;4>Gy_jw#1&3sW8TIbYxUK;{PK Mg{c1hP$nAvKj0Q>xBvhE literal 0 HcmV?d00001 diff --git a/dotfiles/xkb/README.md b/dotfiles/xkb/README.md index 02a5250..2c01530 100644 --- a/dotfiles/xkb/README.md +++ b/dotfiles/xkb/README.md @@ -24,10 +24,12 @@ X11 keyboard customisation using **XKB** and **xcape**. ## Files -| Path | Purpose | -|-------------------------------|----------------------------------------| -| `.config/xkb/symbols/local` | XKB partial symbols — num-layer digits | -| `.local/bin/apply-keys.sh` | Applies XKB + starts xcape | +| Path | Purpose | +|-------------------------------------------|----------------------------------------| +| `dotfiles/xkb/.config/xkb/keymap.xkb` | Compiled keymap (generated by build) | +| `dotfiles/xkb/apply-keys.sh` | Loads keymap + starts xcape | +| `install/build/xkb/symbols/local` | XKB partial symbols — num-layer digits | +| `install/build/xkb/build-xkb.sh` | Builds keymap.xkb from symbols/local | --- @@ -37,15 +39,16 @@ X11 keyboard customisation using **XKB** and **xcape**. sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape ``` -Symlink the files to `$HOME`, then apply manually: +Symlink `dotfiles/xkb/` files to `$HOME`, then build the keymap once: ```sh +# Once (or whenever symbols/local changes) +install/build/xkb/build-xkb.sh + +# On every X startup — called automatically by ~/.xinitrc ~/.local/bin/apply-keys.sh ``` -> `~/.xinitrc` applies only `setxkbmap se` on startup. Run `apply-keys.sh` -> manually after login to get the full key behaviour. - --- ## How it works @@ -65,22 +68,20 @@ xcape -e 'Control_L=Escape' **level-3 activator** — the same mechanism as AltGr. `~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. -### How `apply-keys.sh` merges the keymap +### Build (`install/build/xkb/build-xkb.sh`) -`setxkbmap -print` emits the XKB description without applying it: +Run once, or after changing `install/build/xkb/symbols/local`: -``` -xkb_symbols { include "pc+se+inet(evdev)+ctrl(nocaps)+level3(lwin_switch)+..." }; -``` +1. `setxkbmap -print` emits the base keymap description to stdout +2. `sed` appends `+local(numpad)` to the `xkb_symbols` include line +3. `xkbcomp` compiles the result into `dotfiles/xkb/.config/xkb/keymap.xkb` -`sed` appends `+local(numpad)` to that include line: +### Load (`apply-keys.sh`) -``` -xkb_symbols { include "...+level3(lwin_switch)+local(numpad)" }; -``` +Run on every X startup via `.xinitrc`: -`xkbcomp` compiles the result and loads it into the X server. -`-I"$HOME/.config/xkb"` tells xkbcomp where to find `symbols/local`. +1. `xkbcomp keymap.xkb $DISPLAY` loads the pre-compiled keymap — no setxkbmap, no sed +2. `xcape` is restarted to synthesise Escape on CapsLock tap --- diff --git a/dotfiles/xkb/apply-keys.sh b/dotfiles/xkb/apply-keys.sh index ed53682..26ca9cb 100755 --- a/dotfiles/xkb/apply-keys.sh +++ b/dotfiles/xkb/apply-keys.sh @@ -1,5 +1,5 @@ #!/bin/sh -# apply-keys.sh — X11 keyboard customisation (XKB + xcape) +# apply-keys.sh — load compiled XKB keymap + start xcape # # CapsLock : hold = Control, tap = Escape # Super : hold = num-layer @@ -8,14 +8,11 @@ # m , . → 1 2 3 # n → 0 # -# Deps: setxkbmap, xkbcomp, xcape +# Deps: xkbcomp, xcape +# To rebuild keymap.xkb: install/build/xkb/build-xkb.sh -# Apply layout: Swedish + ctrl:nocaps + lv3:lwin_switch (Super = level-3) -# Merge user symbol file local(numpad) for the digit layer. -setxkbmap se -option ctrl:nocaps,lv3:lwin_switch -print \ - | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)"|' \ - | xkbcomp -w0 -I"$HOME/.config/xkb" - "$DISPLAY" +KEYMAP="$HOME/.config/xkb/keymap.xkb" -# xcape: synthesise Escape when CapsLock (Control_L) is tapped alone +xkbcomp -w0 "$KEYMAP" "$DISPLAY" pkill -x xcape 2>/dev/null || true xcape -e 'Control_L=Escape' & diff --git a/install/archinstall/links/x1/links.config b/install/archinstall/links/x1/links.config index cb1725c..6a09b9d 100644 --- a/install/archinstall/links/x1/links.config +++ b/install/archinstall/links/x1/links.config @@ -4,7 +4,7 @@ DOTFILES_DIR="$BASE_DIR/dotfiles" # Space-separated list of packages to stow # Each package should be a directory in DOTFILES_DIR with files/dirs structured # to mirror the target location relative to $HOME -packages="vim bash nvim x dunst systemd lf vscode brave gdb" +packages="vim bash nvim x xkb dunst systemd lf vscode brave gdb" # Example package structures: # - dotfiles/zsh/.zshrc -> ~/.zshrc diff --git a/install/build/xkb/build-xkb.sh b/install/build/xkb/build-xkb.sh new file mode 100755 index 0000000..817ce5e --- /dev/null +++ b/install/build/xkb/build-xkb.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# build-xkb.sh — compile XKB keymap for X11 keyboard customisation +# +# Produces: dotfiles/xkb/.config/xkb/keymap.xkb +# +# Re-run this whenever dotfiles/xkb/.config/xkb/symbols/local changes. +# +# Deps: setxkbmap, xkbcomp + +set -e + +DOTFILES="${HOME}/repos/dotfiles" +SYMBOLS_DIR="${DOTFILES}/install/build/xkb" +KEYMAP="${DOTFILES}/dotfiles/xkb/.config/xkb/keymap.xkb" + +mkdir -p "$(dirname "$KEYMAP")" + +setxkbmap se -option ctrl:nocaps,lv3:lwin_switch -print \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)"|' \ + | xkbcomp -w0 -I"${SYMBOLS_DIR}" - -o "${KEYMAP}" + +echo "Keymap written to ${KEYMAP}" diff --git a/dotfiles/xkb/.config/xkb/symbols/local b/install/build/xkb/symbols/local similarity index 100% rename from dotfiles/xkb/.config/xkb/symbols/local rename to install/build/xkb/symbols/local From e8e19f16c26c0d47c0f927616469309b072a89b5 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 19:39:53 +0200 Subject: [PATCH 10/29] ctd --- dotfiles/x/.xinitrc | 10 +++++-- dotfiles/xkb/README.md | 22 +++++--------- dotfiles/xkb/apply-keys.sh | 18 ----------- .../configure_build_install_link.sh | 9 ++++++ install/build/xkb/README.md | 30 +++++++++++++++++++ 5 files changed, 53 insertions(+), 36 deletions(-) delete mode 100755 dotfiles/xkb/apply-keys.sh create mode 100644 install/build/xkb/README.md diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index d62ad3e..83520b2 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -36,9 +36,13 @@ case "$(uname -s)" in esac # Apply keyboard customisations: compiled XKB keymap + xcape (tap events). -# Build the keymap first with: apply-keys.sh build (see dotfiles/xkb/README.md) -if [ -x "$HOME/.local/bin/apply-keys.sh" ]; then - "$HOME/.local/bin/apply-keys.sh" +# CapsLock: hold = Control, tap = Escape +# Super: hold = num-layer (u/i/o=7/8/9, j/k/l=4/5/6, m/,/.=1/2/3, n=0) +# Build the keymap first with: install/build/xkb/build-xkb.sh +if [ -f "$HOME/.config/xkb/keymap.xkb" ]; then + xkbcomp -w0 "$HOME/.config/xkb/keymap.xkb" "$DISPLAY" + pkill -x xcape 2>/dev/null || true + xcape -e 'Control_L=Escape' & else setxkbmap se fi diff --git a/dotfiles/xkb/README.md b/dotfiles/xkb/README.md index 2c01530..78e68c9 100644 --- a/dotfiles/xkb/README.md +++ b/dotfiles/xkb/README.md @@ -24,12 +24,12 @@ X11 keyboard customisation using **XKB** and **xcape**. ## Files -| Path | Purpose | -|-------------------------------------------|----------------------------------------| -| `dotfiles/xkb/.config/xkb/keymap.xkb` | Compiled keymap (generated by build) | -| `dotfiles/xkb/apply-keys.sh` | Loads keymap + starts xcape | -| `install/build/xkb/symbols/local` | XKB partial symbols — num-layer digits | -| `install/build/xkb/build-xkb.sh` | Builds keymap.xkb from symbols/local | +| Path | Purpose | +|----------------------------------------|--------------------------------------| +| `.config/xkb/keymap.xkb` | Compiled keymap (generated by build) | +| `apply-keys.sh` | Loads keymap + starts xcape | + +See [install/build/xkb/README.md](../../install/build/xkb/README.md) for build details. --- @@ -39,7 +39,7 @@ X11 keyboard customisation using **XKB** and **xcape**. sudo pacman -S xorg-setxkbmap xorg-xkbcomp xcape ``` -Symlink `dotfiles/xkb/` files to `$HOME`, then build the keymap once: +Symlink `dotfiles/xkb/` files to `$HOME`, build the keymap once, then `apply-keys.sh` runs on every X startup via `~/.xinitrc`: ```sh # Once (or whenever symbols/local changes) @@ -68,14 +68,6 @@ xcape -e 'Control_L=Escape' **level-3 activator** — the same mechanism as AltGr. `~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. -### Build (`install/build/xkb/build-xkb.sh`) - -Run once, or after changing `install/build/xkb/symbols/local`: - -1. `setxkbmap -print` emits the base keymap description to stdout -2. `sed` appends `+local(numpad)` to the `xkb_symbols` include line -3. `xkbcomp` compiles the result into `dotfiles/xkb/.config/xkb/keymap.xkb` - ### Load (`apply-keys.sh`) Run on every X startup via `.xinitrc`: diff --git a/dotfiles/xkb/apply-keys.sh b/dotfiles/xkb/apply-keys.sh deleted file mode 100755 index 26ca9cb..0000000 --- a/dotfiles/xkb/apply-keys.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# apply-keys.sh — load compiled XKB keymap + start xcape -# -# CapsLock : hold = Control, tap = Escape -# Super : hold = num-layer -# u i o → 7 8 9 -# j k l → 4 5 6 -# m , . → 1 2 3 -# n → 0 -# -# Deps: xkbcomp, xcape -# To rebuild keymap.xkb: install/build/xkb/build-xkb.sh - -KEYMAP="$HOME/.config/xkb/keymap.xkb" - -xkbcomp -w0 "$KEYMAP" "$DISPLAY" -pkill -x xcape 2>/dev/null || true -xcape -e 'Control_L=Escape' & diff --git a/install/archinstall/configure_build_install_link.sh b/install/archinstall/configure_build_install_link.sh index 86e7eea..653f981 100755 --- a/install/archinstall/configure_build_install_link.sh +++ b/install/archinstall/configure_build_install_link.sh @@ -10,6 +10,7 @@ LINK_SCRIPT=$SCRIPTS_DIR/link_config.sh XMONAD_DIR=$DOTFILES_DIR/install/build/xmonad ST_DIR=$DOTFILES_DIR/install/build/st +XKB_DIR=$DOTFILES_DIR/install/build/xkb COMPUTERNAME=$(hostnamectl --static 2>/dev/null || hostname -s) PKGPROFILE=${COMPUTERNAME} @@ -117,6 +118,14 @@ case "$ans" in ;; esac +read -p "Build xkb keymap? [y/N] " ans +case "$ans" in + [Yy]*) + $XKB_DIR/build-xkb.sh + echo "Built xkb keymap" + ;; +esac + read -p "Link dotfiles? [y/N] " ans case "$ans" in [Yy]*) diff --git a/install/build/xkb/README.md b/install/build/xkb/README.md new file mode 100644 index 0000000..8011de6 --- /dev/null +++ b/install/build/xkb/README.md @@ -0,0 +1,30 @@ +# build/xkb + +Compiles the XKB keymap used by `dotfiles/xkb`. + +## Files + +| Path | Purpose | +|-------------------|------------------------------------------------------| +| `build-xkb.sh` | Compiles keymap into `dotfiles/xkb/.config/xkb/keymap.xkb` | +| `symbols/local` | XKB partial symbols — num-layer digit assignments | + +## Usage + +```sh +install/build/xkb/build-xkb.sh +``` + +Re-run whenever `symbols/local` changes. + +## Dependencies + +```sh +sudo pacman -S xorg-setxkbmap xorg-xkbcomp +``` + +## How it works + +1. `setxkbmap -print` emits the base keymap description to stdout +2. `sed` appends `+local(numpad)` to the `xkb_symbols` include line +3. `xkbcomp` compiles the result into `dotfiles/xkb/.config/xkb/keymap.xkb` From f9cf41b878f511cb1238a27c2ef7fd818b5d36d9 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 23:06:45 +0200 Subject: [PATCH 11/29] xkb: runs on freebsd --- dotfiles/keyd/README.md | 45 ------------- dotfiles/keyd/default.conf | 25 -------- dotfiles/nvim/README.md | 81 ------------------------ dotfiles/xkb/.config/xkb/keymap.xkb | Bin 13696 -> 13212 bytes dotfiles/xkb/.config/xkb/keymap.xkb.bak | Bin 0 -> 13696 bytes 5 files changed, 151 deletions(-) delete mode 100644 dotfiles/keyd/README.md delete mode 100644 dotfiles/keyd/default.conf create mode 100644 dotfiles/xkb/.config/xkb/keymap.xkb.bak diff --git a/dotfiles/keyd/README.md b/dotfiles/keyd/README.md deleted file mode 100644 index 86b89e6..0000000 --- a/dotfiles/keyd/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# keyd Setup and Usage Guide - -> **Note:** keyd is Linux-only and does not work on FreeBSD. -> This repo now uses **XKB + xcape** for portable, daemon-free key remapping. -> See [`dotfiles/x/README.md`](../x/README.md) for the current setup. - -The configuration in `default.conf` is kept for reference (Arch Linux only). - -keyd is a key remapping daemon for Linux, allowing you to configure custom keyboard layouts, remap keys, and create advanced input workflows. - -## Installation - -### Arch Linux (AUR) -```sh -yay -S keyd -``` - -For other distributions, see the [official keyd repository](https://github.com/rvaiya/keyd). - -## Configuration - -1. **Edit the configuration file:** - - The main config is typically located at `/etc/keyd/default.conf`. - - In this repo, you can find a sample config at `dotfiles/keyd/default.conf`. - - To use this config, link it to `/etc/keyd/default.conf`: - ```sh - sudo ln -s /path/to/dotfiles/keyd/default.conf /etc/keyd/default.conf - ``` - -2. **Reload keyd:** - ```sh - sudo systemctl restart keyd - ``` - -3. **Enable keyd to start on boot:** - ```sh - sudo systemctl enable keyd - ``` - -## Troubleshooting -- Check the status of keyd: - ```sh - keyd check - ``` - diff --git a/dotfiles/keyd/default.conf b/dotfiles/keyd/default.conf deleted file mode 100644 index 1b33816..0000000 --- a/dotfiles/keyd/default.conf +++ /dev/null @@ -1,25 +0,0 @@ -[ids] - -* - -[main] - -# Maps capslock to escape when pressed and control when held. -capslock = overload(control, esc) - -# Tap space for space, hold space to activate the 'num_layer' -space = overload(num_layer, space) - -[num_layer] -u = 7 -i = 8 -o = 9 -j = 4 -k = 5 -l = 6 -m = 1 -, = 2 -. = 3 -n = 0 - - diff --git a/dotfiles/nvim/README.md b/dotfiles/nvim/README.md index 792c383..fbfebb9 100644 --- a/dotfiles/nvim/README.md +++ b/dotfiles/nvim/README.md @@ -349,85 +349,4 @@ bear -- make :LspStart ``` -## TODO: Home-Row Digits (Linux & FreeBSD) -Explore setting up a "Num Layer" to type digits without reaching for the top row on a standard Swedish layout. The goal is to use the Spacebar as a dual-function "Tap-Hold" key: tap it for a normal `Space`, but hold it down with the thumb to activate a temporary number layer (e.g., mapping `j, k, l` to `4, 5, 6` like a physical numpad). - -**Using `keyd` (Linux & FreeBSD)** - -`keyd` intercepts input at the kernel level (`evdev`) and works identically on both platforms with the same config file. - -Install: -```bash -# Arch -sudo pacman -S keyd -sudo systemctl enable --now keyd - -# FreeBSD -sudo pkg install keyd -sudo sysrc keyd_enable=YES -sudo service keyd start -``` - -Config file: -- Linux: `/etc/keyd/default.conf` -- FreeBSD: `/usr/local/etc/keyd/default.conf` - -```ini -[ids] -* - -[main] -# Tap space for space, hold space to activate the 'num_layer' -space = overload(num_layer, space) - -[num_layer] -u = 7 -i = 8 -o = 9 -j = 4 -k = 5 -l = 6 -m = 1 -, = 2 -. = 3 -n = 0 -``` - -Reload after editing: -```bash -sudo keyd reload -``` - -> Note: VT switching is not supported on FreeBSD with `keyd`. - ---- - -## FreeBSD Keyboard Recovery (if you lose input at login) - -If you cannot type at the FreeBSD login prompt (before X11), you may have a misconfigured keyboard layout or key remapping daemon (e.g., keyd). To recover: - -1. **Reboot and enter single-user mode** from the boot menu. -2. At the prompt, remount filesystems: - ``` - mount -u / - mount -a - ``` -3. Check `/etc/rc.conf` for any `keymap` lines. Comment them out or set to a known working value (e.g., `keymap="us"`). -4. Check for recent changes to `/etc/sysctl.conf` or `/etc/ttys` that might affect keyboard input. -5. If you enabled keyd at the system level, disable it: - ``` - service keyd stop - sysrc keyd_enable=NO - ``` -6. Reboot and test keyboard input at the login prompt. - -Once you regain access, reapply changes one at a time to identify the cause. If you use a non-US layout, set it only after confirming basic input works. - -**How to proceed after recovery:** - -1. Confirm you can log in and type at the console. -2. Re-enable your desired keyboard layout (e.g., Swedish) in X11 only (e.g., via `setxkbmap se` in `.xinitrc`). -3. If using keyd, test its config with the default US layout first, then add custom mappings for your layout as needed. -4. Make incremental changes and reboot or restart X to test each step. -5. Document any changes that cause issues for future reference. diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb b/dotfiles/xkb/.config/xkb/keymap.xkb index b99bbe4091a3b417cef8ce201a2450bde32806c2..b3e2f26a9969cf78bee06490ff83ddc2ad21b0dd 100644 GIT binary patch delta 1230 zcmbVLOGs2v82-<>_s-lI?~LQ4W}E~K6CKBQZdycBshN&xDlS3{(IG5t245>NX)C32 zpiKoXqk@n-OQ}Vh7J&#sWQ$se6-u;l5iXj(bMKveEIXIO;XD8Tf8YN&cmB?kTT7*9 zQr=w`BSu^9fjo|LHV`XPaCWn`h=y}XH=@hU)u%iZPs}97T1RIRq*7;MYKTaq-sx0g zVs+sGQwhr~<{#8N$*9wCay&Jbm`V_Z1arU5iE$z(cZ|fkyIfT2O*NY4B2|MrBjR9H zK%=Uhbh_Nv6OUeu_rYHhV==L6l!*G=fao?1bIMcCP2Ff`5rf=1tcMv8uQ8om1RFCb zhgz;)Y3mb_J{s3aRStaJ+#r`?&`Gfo2#R`tziNfy62g20u!N+Wn+5A?Lx9L4XBj&T*dov3 zQX-4|A2v5bUF>w09oI+Lfo*ot9zI)$Jm#I9edaN-9B%TDC5MN`D(_B@r-nu%WbTBY zGB4UgI_l6f=JVnkE)U0Z`T_jS^pq{2b}VzP{JnzrEFMO}hOBZmqa$Hl>_uu>Oq5k! zxBSFx)s`5EUgB#J^I7y7<3?2cu72$yO5@{R5^rjPK(ow7Un~@IQ053KsSTc!68NVe z7-AEwk>pO}CQU9cQ6YIrWpWR)R+4)KcPo}ovR3M}JIsr7%Q6n-;1yIwg-vo)V%h!c$)lJTw?Fy63s&=a3`5cSkkIENew|$Q|?1%=N^KsZ;(+tz4(;wWq&$ z|2-zoCzoUPIKLx&iov9{>SnD{Zj_0}B=dYfK-?t82@Iy(^PG5&b#-P^kh1Y&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T10i)c0l}*eH+gDb7#x>=ZNaE<@X7KGGg#aOU`MFF6W{J<*c^W zO}b8%KiXK5^061H-wlW^zbA0w zbCjj*91Iy8^1B1k#b)8l?+o*b!;@t{5c0qY$3_ zw!y(s>LPkoqu3)n`JDyfmi*Sj!L-3lE}}MT-w-?G_ZLol(qKxX^re$e%!JG6m;4e2 z^Vq#v*GFbwnSCN^6Y)9i3t`S&94$}J*Lj}W>KXNU20%cZk;}U_2r~D+uyrdZB%RB< zo(S4a>$z?1IRDxq7-(A0Z*RwMc7N+rnm!`s27<4u$0+x4byR1r%Z)ha;$H9bbc{V*cM5sEWo+~O-pEu%1v*|;4>Gy_jw#1&3sW8TIbYxUK;{PK Mg{c1hP$nAvKj0Q>xBvhE literal 0 HcmV?d00001 From d3e01ac6100ff3a82077c626313434141f09e999 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Wed, 1 Apr 2026 23:27:23 +0200 Subject: [PATCH 12/29] xkb: runs on freebsd --- install/bsdinstall/README.md | 20 ++++++++++++++----- .../configure_build_install_link.sh | 17 +++++++--------- .../bsdinstall/links/suckless_links.config | 2 +- install/bsdinstall/packages/besk/pkglist.txt | 1 + 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/install/bsdinstall/README.md b/install/bsdinstall/README.md index faf3aa3..cd58f4c 100644 --- a/install/bsdinstall/README.md +++ b/install/bsdinstall/README.md @@ -12,6 +12,21 @@ Wifi: ETSI otherwise my choice, see [user_configuration_x1.json](../archinstall/log/user_configuration_x1.json) +## Diaster recovery + +1. **Reboot and enter single-user mode** from the boot menu. +2. At the prompt, remount filesystems: + ``` + mount -u / + mount -a + ``` +3. Check `/etc/rc.conf` +4. Check for recent changes to `/etc/sysctl.conf` or `/etc/ttys` +5. If you enabled xxx at the system level, disable it: + ``` + service xxx stop + sysrc xxx_enable=NO + ``` ## Post-installation ### Shell, also need adding hostname if used in scripts @@ -308,8 +323,3 @@ sudo pkg install xlibre-minimal xlibre-xf86-video-intel - GNU make vs BSD make — Use `gmake` for GNU Makefiles; FreeBSD's default `make` is BSD make with different syntax - Header ordering in C network programming — On FreeBSD, include `` before `` and other network headers to avoid compilation errors - - - - - diff --git a/install/bsdinstall/configure_build_install_link.sh b/install/bsdinstall/configure_build_install_link.sh index a8fcd0e..9ebfe40 100755 --- a/install/bsdinstall/configure_build_install_link.sh +++ b/install/bsdinstall/configure_build_install_link.sh @@ -88,30 +88,27 @@ case "$ans" in sudo cp -f $ST_DIR/bin/st-0.9.[0-9] /opt/st/ echo "Installed st to /opt/st/" sudo ln -sf /opt/st/st-0.9.* /usr/local/bin/st + sudo -k echo "Created symlink for st" ;; esac sudo -k -read -p "Link dotfiles? [y/N] " ans +read -p "Build xkb keymap? [y/N] " ans case "$ans" in [Yy]*) - # Link dotfiles - $LINK_SCRIPT $LINKS + $XKB_DIR/build-xkb.sh + echo "Built xkb keymap" ;; esac -read -p "Enable keyd num layer? [y/N] " ans +read -p "Link dotfiles? [y/N] " ans case "$ans" in [Yy]*) - sudo mkdir -p /usr/local/etc/keyd - sudo ln -sf $DOTFILES_DIR/dotfiles/keyd/default.conf /usr/local/etc/keyd/default.conf - sudo sysrc keyd_enable=YES - sudo service keyd onerestart - echo "keyd num layer enabled" + # Link dotfiles + $LINK_SCRIPT $LINKS ;; esac -sudo -k read -p "Enable system monitoring? [y/N] " ans case "$ans" in diff --git a/install/bsdinstall/links/suckless_links.config b/install/bsdinstall/links/suckless_links.config index d0d3fce..bf51b4a 100644 --- a/install/bsdinstall/links/suckless_links.config +++ b/install/bsdinstall/links/suckless_links.config @@ -6,5 +6,5 @@ DOTFILES_DIR="$BASE_DIR/dotfiles" # Space-separated list of packages to stow # Each package should be a directory in DOTFILES_DIR with files/dirs structured # to mirror the target location relative to $HOME -packages="vim bash nvim x dunst lf brave gdb" +packages="vim bash nvim x xkb dunst lf brave gdb" diff --git a/install/bsdinstall/packages/besk/pkglist.txt b/install/bsdinstall/packages/besk/pkglist.txt index 1239db7..c02d071 100644 --- a/install/bsdinstall/packages/besk/pkglist.txt +++ b/install/bsdinstall/packages/besk/pkglist.txt @@ -41,6 +41,7 @@ sysutils/tree graphics/viu ftp/wget x11/xbindkeys +x11/xcape x11/xclip x11-wm/xcompmgr x11/xlibre-minimal From 184c2e65e37cbf6b9a2e04120398395330173467 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Thu, 2 Apr 2026 16:56:04 +0200 Subject: [PATCH 13/29] runs --- dotfiles/xmonad/.gitignore | 1 - dotfiles/xmonad/README.md | 12 +++++++----- dotfiles/xmonad/xmonad.hs | 4 +++- scripts/dmenu-help.sh | 17 ++++++++++++----- 4 files changed, 22 insertions(+), 12 deletions(-) delete mode 100644 dotfiles/xmonad/.gitignore diff --git a/dotfiles/xmonad/.gitignore b/dotfiles/xmonad/.gitignore deleted file mode 100644 index d3a727a..0000000 --- a/dotfiles/xmonad/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.ghc.* diff --git a/dotfiles/xmonad/README.md b/dotfiles/xmonad/README.md index 699be95..2f51707 100644 --- a/dotfiles/xmonad/README.md +++ b/dotfiles/xmonad/README.md @@ -12,11 +12,10 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. | `Mod + Enter` | Launch terminal | | `Mod + M` | Help menu | | `Mod + Q` | Close the focused window | +| `Mod + Shift + Q` | Quit xmonad | | `Mod + Space` | Rotate through available layouts | -| `Mod + Shift + Space` | Reset the layout to default | -| `Mod + N` | Resize/refresh windows | -| `Mod + Tab` | Move to the next workspace TODO | -| `Mod + Shift + Tab` | Move focus to the previous window | +| `Mod + Tab` | Next workspace | +| `Mod + Shift + Tab` | Previous workspace | | `Mod + H` | Shrink the master area | | `Mod + J` | Move focus to the next window | | `Mod + K` | Move focus to the previous window | @@ -28,7 +27,10 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. | `Mod + V` | VPN menu | | `Mod + S` | Screenshot to `~/Downloads` | | `Mod + Shift + S` | Capture a selected area screenshot to `~/Downloads` | -| `Mod + W` | Launch browser | +| `Mod + W` | Browser scratchpad toggle | +| `Mod + P` | htop scratchpad toggle | +| `Mod + B` | Launch browser | +| `Mod + E` | Launch file manager (lf) | | `Mod + A` | Launch dmenu | diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index 0d0d9a2..ed48f1a 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -5,7 +5,6 @@ import XMonad.Actions.CycleWS import XMonad.Hooks.EwmhDesktops (ewmh, ewmhFullscreen) import XMonad.Hooks.FadeWindows import XMonad.Layout.NoBorders -import XMonad.ManageHook import XMonad.Operations (unGrab) import qualified XMonad.StackSet as W import XMonad.Util.EZConfig (additionalKeys) @@ -55,7 +54,10 @@ myKeys terminal browser = [ ((myModMask, xK_a), spawn myAppLauncher), ((myModMask, xK_e), spawn $ terminal ++ " -e lf"), ((myModMask, xK_Return), spawn terminal), + ((myModMask, xK_b), spawn browser), ((myModMask .|. shiftMask, xK_Return), windows W.swapMaster), + ((myModMask, xK_Tab), nextWS), + ((myModMask .|. shiftMask, xK_Tab), prevWS), ((myModMask, xK_q), kill), -- screenshots ((myModMask, xK_s), spawn "scrot ~/Downloads/screenshot_%Y-%m-%d_%H-%M-%S.png"), diff --git a/scripts/dmenu-help.sh b/scripts/dmenu-help.sh index deb33e6..e9e193c 100755 --- a/scripts/dmenu-help.sh +++ b/scripts/dmenu-help.sh @@ -1,21 +1,28 @@ #!/bin/sh # Show xmonad keybindings in dmenu -cat < Date: Thu, 2 Apr 2026 17:23:42 +0200 Subject: [PATCH 14/29] xmonad: restore follow --- dotfiles/xmonad/README.md | 2 ++ dotfiles/xmonad/xmonad.hs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/dotfiles/xmonad/README.md b/dotfiles/xmonad/README.md index 2f51707..8dfd120 100644 --- a/dotfiles/xmonad/README.md +++ b/dotfiles/xmonad/README.md @@ -16,6 +16,8 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. | `Mod + Space` | Rotate through available layouts | | `Mod + Tab` | Next workspace | | `Mod + Shift + Tab` | Previous workspace | +| `Mod + [1..4]` | Switch to workspace N | +| `Mod + Shift + [1..4]` | Move window to workspace N and follow | | `Mod + H` | Shrink the master area | | `Mod + J` | Move focus to the next window | | `Mod + K` | Move focus to the previous window | diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index ed48f1a..f227d30 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -69,6 +69,13 @@ myKeys terminal browser = ((myModMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), ((myModMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") ] + ++ + -- mod-[1..9], Switch to workspace N + -- mod-shift-[1..9], Move client to workspace N and follow it + [ ((m .|. myModMask, k), windows $ f i) + | (i, k) <- zip myWorkspaces [xK_1 .. xK_9], + (f, m) <- [(W.greedyView, 0), (\i -> \w -> W.greedyView i (W.shift i w), shiftMask)] + ] myConfig terminal browser = def From 566859800fb33c7ba369f9470d59e244f8ce626f Mon Sep 17 00:00:00 2001 From: holmen1 Date: Thu, 2 Apr 2026 18:53:47 +0200 Subject: [PATCH 15/29] xkb: remap swedish --- dotfiles/x/.xinitrc | 12 +----------- dotfiles/xkb/.config/xkb/keymap.xkb | Bin 13212 -> 13672 bytes dotfiles/xkb/.config/xkb/keymap.xkb.bak | Bin 13696 -> 0 bytes dotfiles/xkb/README.md | 10 ++++++++++ install/build/xkb/build-xkb.sh | 2 +- install/build/xkb/symbols/local | 18 ++++++++++++++++-- scripts/apply-xkb.sh | 16 ++++++++++++++++ scripts/dmenu-help.sh | 2 +- 8 files changed, 45 insertions(+), 15 deletions(-) delete mode 100644 dotfiles/xkb/.config/xkb/keymap.xkb.bak create mode 100755 scripts/apply-xkb.sh diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index 83520b2..8fafeea 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -35,17 +35,7 @@ case "$(uname -s)" in ;; esac -# Apply keyboard customisations: compiled XKB keymap + xcape (tap events). -# CapsLock: hold = Control, tap = Escape -# Super: hold = num-layer (u/i/o=7/8/9, j/k/l=4/5/6, m/,/.=1/2/3, n=0) -# Build the keymap first with: install/build/xkb/build-xkb.sh -if [ -f "$HOME/.config/xkb/keymap.xkb" ]; then - xkbcomp -w0 "$HOME/.config/xkb/keymap.xkb" "$DISPLAY" - pkill -x xcape 2>/dev/null || true - xcape -e 'Control_L=Escape' & -else - setxkbmap se -fi +setxkbmap se # Set the default X cursor to the usual pointer xsetroot -cursor_name left_ptr & diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb b/dotfiles/xkb/.config/xkb/keymap.xkb index b3e2f26a9969cf78bee06490ff83ddc2ad21b0dd..fa89e0fd65ff2eec9548abfff3d5f36f2b69c6fa 100644 GIT binary patch delta 1876 zcmbVMO>7%Q6n-;1Yp5CRSykOHU`;e-SgYDEPX4xDPf*|lRQ5)opo_1pKp z_rCWtGkbmM?rWPv!=H8BcQImg$9==cA<4VZt3jsOMns3)G z8i3AC655^vxjE|6{BozW49Cf?!Q&3WK|dG#-0-{D_2KCN9WnM#^FUe*iJ=UJGIW%I zv&6jUIDk$Aa`DJV>jCQj{|xro;v9RY2@>c>SN%BkK}Ti{nK?3R$jp(MBeNEuM=3r( zJD1BRikIjNkCd^WOJP!B6cU*4;W$9kEUQcU#A;XyEr9T}FJ9VRdp4ViNft zAnHv)TyylJ4PB{ZTGxC#;?z)soYkE$=r(y%$4=Vhd%AV)Sc-+3>@e?RhwiXT9(>%7 zG?yDs^CmCJ`QQ^1wPJN;d9_e0h8JtqQoc~C*c|lj6EX*p+WYnoCv*$b7Igv>)p^>JghGNVK@FZO8KB}nAY&{x7xaz{&%n_ z`6;YQDpbjjAr;%dd~fI$;%0r0&wt6t*bsTKs~p9ub+1k`67FLpXT#4MD&zO2Van^_ zJ3=Y)^2jvbh*)2bEHJ)1D*chq*EwzD$35!GduR(kT$XU014FUL3ur_%En1O+puht%fn@Pv=1eY+a6VXA){02 zY>WC#Tk0q6)XACbTnqoLt+gNQ)-t(v+~BR&{<7nrOT`Yhw%(YH(_0oEhb73SqwyC0 zm}n*F6WBf+8lhn{@~w$6gH4H RY}U;aKjJ`G?~HY6{{U*fM3Vpj delta 1432 zcmbVLO=uHA6n-*aST&l~RL0R4ujjB(117 z5i5h9L_ByA6|E}>QoX3)K`0gRrwSISe<-3LB0U(t-E7>o2M^9Nym|A@``&xs%zoH= zZr5n((tht}7b8Y9?(GE}_HZD!NPA@Z% zg_1-4>4C8mCz(tbdNF?@7Z{8x^&Z&Q-?vdl@Prc_rv+7M6Syg`h?#F!Qqb@>62&@_F}Q^$2xYhw|O+$vBf1L75? zl8b;bjq<2v1Gg{c_4!iGWf*h{A(jV zD*k^4Q*6#5ssvHdred^d)hcsjmXMhvvxLkXnK?2`KB~y}u_La(2uw1*y+B-Rs+f}Lzhjvd>7vBS@@i?+~;`KaTFHFM8ACQgS|`uYy^_ViWm zAKKU7vooU4hR!oD)FBmZs2Tls@f#+VmJ};*QRf5w>f+Z-94`s_f53f;`4jUwiQ$sP z$_$qG^*g1v7+WKT%ED~5I8(OO!|@b9g6zHit?UGJ!_Y65Kawhql_AfKj2bZPCCgs7 z>=>+ZM!bsDu$aiJ+H3}komDd;9&O~~5q&heiE%9|rmOFc5Z%Pby+rfLOBe9T)YzU( z;MdAPQ0yOOHolt~c&eeX-Nu6sTsCpU$Nz|t%~>BnlHapuvtE%!;k0T<=^w*UYD diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb.bak b/dotfiles/xkb/.config/xkb/keymap.xkb.bak deleted file mode 100644 index b99bbe4091a3b417cef8ce201a2450bde32806c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13696 zcmcJWdvs&PeaGisNw%zgzkmSkaUg+Rj6n}ew%RmBmSkHi*%p$#-rW#fuUD*<_1Z@E z?y?Cj+n%1Bo}NB(npdC6rb(N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-pEu%1v*|;4>Gy_jw#1&3sW8TIbYxUK;{PK Mg{c1hP$nAvKj0Q>xBvhE diff --git a/dotfiles/xkb/README.md b/dotfiles/xkb/README.md index 78e68c9..3df0123 100644 --- a/dotfiles/xkb/README.md +++ b/dotfiles/xkb/README.md @@ -20,6 +20,16 @@ X11 keyboard customisation using **XKB** and **xcape**. n → 0 ``` +### Persistent remaps (Swedish keys) + +| Key | Unshifted | Shifted | +|-----|-----------|---------| +| å | `=` | `~` | +| ö | `:` | `;` | +| ä | `/` | `\|` | +| `,` | `,` | `<` | +| `.` | `.` | `>` | + --- ## Files diff --git a/install/build/xkb/build-xkb.sh b/install/build/xkb/build-xkb.sh index 817ce5e..77993e9 100755 --- a/install/build/xkb/build-xkb.sh +++ b/install/build/xkb/build-xkb.sh @@ -16,7 +16,7 @@ KEYMAP="${DOTFILES}/dotfiles/xkb/.config/xkb/keymap.xkb" mkdir -p "$(dirname "$KEYMAP")" setxkbmap se -option ctrl:nocaps,lv3:lwin_switch -print \ - | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)"|' \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)+local(remaps)"|' \ | xkbcomp -w0 -I"${SYMBOLS_DIR}" - -o "${KEYMAP}" echo "Keymap written to ${KEYMAP}" diff --git a/install/build/xkb/symbols/local b/install/build/xkb/symbols/local index 1e7310d..39f812f 100644 --- a/install/build/xkb/symbols/local +++ b/install/build/xkb/symbols/local @@ -15,7 +15,21 @@ xkb_symbols "numpad" { key { [ k, K, 5 ] }; key { [ l, L, 6 ] }; key { [ m, M, 1 ] }; - key { [ comma, semicolon, 2 ] }; - key { [ period, colon, 3 ] }; key { [ n, N, 0 ] }; }; + +// Persistent remaps (always active, independent of layers): +// å → = Å → ~ +// ö → : Ö → ; +// ä → / Ä → | +// , → , ; → < (Super → 2) +// . → . : → > (Super → 3) + +partial alphanumeric_keys +xkb_symbols "remaps" { + key { [ equal, asciitilde ] }; + key { [ colon, semicolon ] }; + key { [ slash, bar ] }; + key { [ comma, less, 2 ] }; + key { [ period, greater, 3 ] }; +}; diff --git a/scripts/apply-xkb.sh b/scripts/apply-xkb.sh new file mode 100755 index 0000000..59465a7 --- /dev/null +++ b/scripts/apply-xkb.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# apply-xkb.sh — apply compiled XKB keymap and restart xcape +# +# CapsLock: hold = Control, tap = Escape +# Super: hold = num-layer (u/i/o=7/8/9, j/k/l=4/5/6, m/,/.=1/2/3, n=0) +# Remaps: å= ö: ä/ ,< .> +# +# Build the keymap first with: install/build/xkb/build-xkb.sh + +if [ -f "$HOME/.config/xkb/keymap.xkb" ]; then + xkbcomp -w0 "$HOME/.config/xkb/keymap.xkb" "$DISPLAY" + pkill -x xcape 2>/dev/null || true + xcape -e 'Control_L=Escape' & +else + echo "Warning: $HOME/.config/xkb/keymap.xkb not found. Run install/build/xkb/build-xkb.sh first." >&2 +fi diff --git a/scripts/dmenu-help.sh b/scripts/dmenu-help.sh index e9e193c..c014471 100755 --- a/scripts/dmenu-help.sh +++ b/scripts/dmenu-help.sh @@ -1,6 +1,6 @@ #!/bin/sh # Show xmonad keybindings in dmenu -cat < Date: Thu, 2 Apr 2026 20:08:36 +0200 Subject: [PATCH 16/29] xmonad: xkb demu --- dotfiles/xmonad/README.md | 1 + dotfiles/xmonad/xmonad.hs | 1 + scripts/apply-xkb.sh | 1 + scripts/dmenu-help.sh | 3 ++- scripts/dmenu-xkb.sh | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100755 scripts/dmenu-xkb.sh diff --git a/dotfiles/xmonad/README.md b/dotfiles/xmonad/README.md index 8dfd120..0c2d1f2 100644 --- a/dotfiles/xmonad/README.md +++ b/dotfiles/xmonad/README.md @@ -34,6 +34,7 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. | `Mod + B` | Launch browser | | `Mod + E` | Launch file manager (lf) | | `Mod + A` | Launch dmenu | +| `Mod + Z` | XKB layout menu | ## Requirements diff --git a/dotfiles/xmonad/xmonad.hs b/dotfiles/xmonad/xmonad.hs index f227d30..25f4a22 100644 --- a/dotfiles/xmonad/xmonad.hs +++ b/dotfiles/xmonad/xmonad.hs @@ -66,6 +66,7 @@ myKeys terminal browser = ((myModMask, xK_x), spawn "~/repos/dotfiles/scripts/dmenu-logout.sh"), ((myModMask, xK_v), spawn "~/repos/dotfiles/scripts/dmenu-mullvad.sh"), ((myModMask, xK_m), spawn "~/repos/dotfiles/scripts/dmenu-help.sh"), + ((myModMask, xK_z), spawn "~/repos/dotfiles/scripts/dmenu-xkb.sh"), ((myModMask, xK_w), namedScratchpadAction (myScratchpads terminal browser) "browser"), ((myModMask, xK_p), namedScratchpadAction (myScratchpads terminal browser) "htop") ] diff --git a/scripts/apply-xkb.sh b/scripts/apply-xkb.sh index 59465a7..f6536f8 100755 --- a/scripts/apply-xkb.sh +++ b/scripts/apply-xkb.sh @@ -11,6 +11,7 @@ if [ -f "$HOME/.config/xkb/keymap.xkb" ]; then xkbcomp -w0 "$HOME/.config/xkb/keymap.xkb" "$DISPLAY" pkill -x xcape 2>/dev/null || true xcape -e 'Control_L=Escape' & + echo "custom" > "$HOME/.cache/xkb-layout" else echo "Warning: $HOME/.config/xkb/keymap.xkb not found. Run install/build/xkb/build-xkb.sh first." >&2 fi diff --git a/scripts/dmenu-help.sh b/scripts/dmenu-help.sh index c014471..fa23606 100755 --- a/scripts/dmenu-help.sh +++ b/scripts/dmenu-help.sh @@ -1,6 +1,6 @@ #!/bin/sh # Show xmonad keybindings in dmenu -cat </dev/null || echo "se") + +choice=$(printf "custom\nse" | dmenu -p "xkb[$current]" -nb "#222222" -nf "#ffffff" -sb "#A300A3" -sf "#ffffff" \ + -fn "$FONT") + +[ -z "$choice" ] && exit 0 + +case "$choice" in + custom) + xkbcomp -w0 "$KEYMAP" "$DISPLAY" + pkill -x xcape 2>/dev/null || true + xcape -e 'Control_L=Escape' & + ;; + se) + pkill -x xcape 2>/dev/null || true + setxkbmap se + ;; +esac + +echo "$choice" > "$STATE" From 637f82f435a4c9f87fd287796852fc07fd347946 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Thu, 2 Apr 2026 20:25:26 +0200 Subject: [PATCH 17/29] ctd --- install/build/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/build/README.md b/install/build/README.md index 5de7151..548f73d 100644 --- a/install/build/README.md +++ b/install/build/README.md @@ -11,4 +11,7 @@ A lightweight tiling window manager for X11 written in Haskell Fork of X.Org that must be built from AUR on Arch (available via `pkg` on FreeBSD) [neovim](https://github.com/holmen1/dotfiles/tree/master/install/build/neovim) -Neovim 0.12 - built from source on FreeBSD (not yet available via `pkg` or ports as of March 2026) \ No newline at end of file +Neovim 0.12 - built from source on FreeBSD (not yet available via `pkg` or ports as of March 2026) + +[xkb](https://github.com/holmen1/dotfiles/tree/master/install/build/xkb) +Custom XKB keymap for X11 — Swedish layout with programmer remaps and Super num-layer. Built with `build-xkb.sh`, applied via `scripts/apply-xkb.sh` \ No newline at end of file From 16b7cfc1be1f36baddbf63b401cd763ab3b9fe91 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Thu, 2 Apr 2026 22:41:25 +0200 Subject: [PATCH 18/29] freeebsd run --- dotfiles/xkb/.config/xkb/keymap.xkb | Bin 13672 -> 13184 bytes .../configure_build_install_link.sh | 1 + install/bsdinstall/sanity_check.sh | 10 ++-------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb b/dotfiles/xkb/.config/xkb/keymap.xkb index fa89e0fd65ff2eec9548abfff3d5f36f2b69c6fa..d3133d25b751357223e34dc37e180ddbabfa4eb4 100644 GIT binary patch delta 1361 zcmbVLO-vI}5T5sTx80U)DL>KDl7L161>{fS#TZ-uL|UNIhKmF>+NcC0smRFy(IYWJ zUgF6E2QNkw#pUF|ix&?j1Y=@EV>l4RNDL;Ph_QaV-MT9W55CQ2cHZ~qo0)IkZjH@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$zeXjM3O9s)fyPtdpbBJQ8r0^G+90q?nccm z7iY%C-BP$Yf`Z;mnpj#~YN8Sm@pDK?m-2zKiJwgjk6W|IZl2umubdlCQF?4w6R zhskXc#$EtLICL3FwcFi5;AqdWBLTsKaTekth+FIV^w|_0k_UJ5fwI^n1{n-8Ovu1p zVsUhwLZ>OUaOku36b<};2LEnxjhj8_r*?*>>oiP4<4twtmzQJ?)ss7vhya9?&+S2yq@o$ZFy;t91McXg1 zs;%~F`#G#;`-fi#x{kb)i6G{`RAekmahw5%U_I`%NyT#gjFgjmLF$U%+tOAWxm!X5 zb#`c+Z#v$`L#G+PnOA>3@#RCDcJRleTz%!Ff!<^R`q@XlA!;8$$MWfC@N0q53)WuN zWFw^K4pw%^it5K6CBgK3nN5ooGZ&Z&_3y?lC!)31RBKko;`37V@`rqEa$ zw+MWa`>K5ZpG^CoFHg+u`$L^!UG1+RVBa6|t5_jD#OX<~&(^mMPQY6o?lJxb(n}Ls diff --git a/install/bsdinstall/configure_build_install_link.sh b/install/bsdinstall/configure_build_install_link.sh index 9ebfe40..c8dc368 100755 --- a/install/bsdinstall/configure_build_install_link.sh +++ b/install/bsdinstall/configure_build_install_link.sh @@ -10,6 +10,7 @@ LINKS=$DOTFILES_DIR/install/bsdinstall/links/suckless_links.config XMONAD_DIR=$DOTFILES_DIR/install/build/xmonad ST_DIR=$DOTFILES_DIR/install/build/st +XKB_DIR=$DOTFILES_DIR/install/build/xkb COMPUTERNAME=$(hostname -s) PKGPROFILE=${COMPUTERNAME} diff --git a/install/bsdinstall/sanity_check.sh b/install/bsdinstall/sanity_check.sh index fd39a8e..bf2f749 100755 --- a/install/bsdinstall/sanity_check.sh +++ b/install/bsdinstall/sanity_check.sh @@ -124,17 +124,11 @@ check_command "notify-send" "Desktop notifications" print_header "Key Bindings & Input" check_command "xbindkeys" "Key binding daemon" check_file "$HOME/.xbindkeysrc" "xbindkeys configuration" +check_file "$HOME/.config/xkb/keymap.xkb" "XKB configuration" check_command "backlight" "Brightness control (FreeBSD)" check_command "mixer" "Audio mixer (OSS)" -# keyd num layer (optional, warn only) -if ! service keyd status >/dev/null 2>&1; then - print_warn "keyd not running - num layer inactive (run: sudo service keyd start)" -elif [ ! -L /usr/local/etc/keyd/default.conf ]; then - print_warn "keyd running but config not symlinked from dotfiles" -else - print_pass "keyd num layer active" -fi +# XKB (optional, warn only) TODO # Screenshot functionality print_header "Screenshots" From aebc17aaa259539d784b901a5a2959152a987089 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Thu, 2 Apr 2026 23:52:04 +0200 Subject: [PATCH 19/29] xkb: support OS-specific keymap (linux/bsd) --- .../xkb/{keymap.xkb => keymap-linux.xkb} | Bin 13184 -> 13672 bytes install/build/xkb/build-xkb.sh | 8 ++++++-- scripts/apply-xkb.sh | 11 ++++++++--- scripts/dmenu-xkb.sh | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) rename dotfiles/xkb/.config/xkb/{keymap.xkb => keymap-linux.xkb} (63%) diff --git a/dotfiles/xkb/.config/xkb/keymap.xkb b/dotfiles/xkb/.config/xkb/keymap-linux.xkb similarity index 63% rename from dotfiles/xkb/.config/xkb/keymap.xkb rename to dotfiles/xkb/.config/xkb/keymap-linux.xkb index d3133d25b751357223e34dc37e180ddbabfa4eb4..fa89e0fd65ff2eec9548abfff3d5f36f2b69c6fa 100644 GIT binary patch delta 1651 zcmbVMO>7%Q6n-;1yB?gRUb{AqleBf92#2*%8n|$PC~=%7%~FTh<-h?eq*fG2>&P(@ zQjijHiV%XdBOxR>gJ$|L@uEmJat;nSWho$&tp8-3|HXRdoOWw?1n8-_$DzC59n{;92 z;mhy7&BRNksWESWUl(!BAZej-Ze_XNsuT4q7P;C*ToU612B~%{I4lwZTVY~BSa4dPMkj*Q zsLT|Q;}_HxT>j|T`+eFW)S&Gs+12fB$zeXjM3O9s)fyPtdpbBJQ8r0^G+90q?nccm z7iY%C-BP$Yf`Z;mnpj#~YN8Sm@pDK?m-2zKiJwgjk6W|IZl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R1~k~^yigrE)T~Y`U3y6{{7$_8phHe)V!AJj4z|FXE`-s*oT&VYS|@Ncx8Fiy5M2JlsoEPF`BXBU48_mBc@hgA&-k$!z>G zGw^h*BW~kC2QHg9;uHVEhtfj>L{g693V2CWHH8_8V@+Wc(}v1}EQ?>UGnP!*Bz=w~ zN6jROo>Z@m?>d^;G@BSoJMkZm_;oYBf3VBZgx|ntEERT5f)q~J2{s)G-sJIQXSa=y z$+k+v@*;*GPqv_$f{Iy30i$LC@np=wzf4)yY>#0S3M9I_pa3(*0HSaF6-cp%Z);D# O-TaO-kA9}jC;bMgPUUw1 diff --git a/install/build/xkb/build-xkb.sh b/install/build/xkb/build-xkb.sh index 77993e9..1180d9a 100755 --- a/install/build/xkb/build-xkb.sh +++ b/install/build/xkb/build-xkb.sh @@ -1,7 +1,7 @@ #!/bin/sh # build-xkb.sh — compile XKB keymap for X11 keyboard customisation # -# Produces: dotfiles/xkb/.config/xkb/keymap.xkb +# Produces: dotfiles/xkb/.config/xkb/keymap-linux.xkb or keymap-bsd.xkb # # Re-run this whenever dotfiles/xkb/.config/xkb/symbols/local changes. # @@ -11,7 +11,11 @@ set -e DOTFILES="${HOME}/repos/dotfiles" SYMBOLS_DIR="${DOTFILES}/install/build/xkb" -KEYMAP="${DOTFILES}/dotfiles/xkb/.config/xkb/keymap.xkb" + +case "$(uname -s)" in + FreeBSD*) KEYMAP="${DOTFILES}/dotfiles/xkb/.config/xkb/keymap-bsd.xkb" ;; + *) KEYMAP="${DOTFILES}/dotfiles/xkb/.config/xkb/keymap-linux.xkb" ;; +esac mkdir -p "$(dirname "$KEYMAP")" diff --git a/scripts/apply-xkb.sh b/scripts/apply-xkb.sh index f6536f8..44607b8 100755 --- a/scripts/apply-xkb.sh +++ b/scripts/apply-xkb.sh @@ -7,11 +7,16 @@ # # Build the keymap first with: install/build/xkb/build-xkb.sh -if [ -f "$HOME/.config/xkb/keymap.xkb" ]; then - xkbcomp -w0 "$HOME/.config/xkb/keymap.xkb" "$DISPLAY" +case "$(uname -s)" in + FreeBSD*) KEYMAP="$HOME/.config/xkb/keymap-bsd.xkb" ;; + *) KEYMAP="$HOME/.config/xkb/keymap-linux.xkb" ;; +esac + +if [ -f "$KEYMAP" ]; then + xkbcomp -w0 "$KEYMAP" "$DISPLAY" pkill -x xcape 2>/dev/null || true xcape -e 'Control_L=Escape' & echo "custom" > "$HOME/.cache/xkb-layout" else - echo "Warning: $HOME/.config/xkb/keymap.xkb not found. Run install/build/xkb/build-xkb.sh first." >&2 + echo "Warning: $KEYMAP not found. Run install/build/xkb/build-xkb.sh first." >&2 fi diff --git a/scripts/dmenu-xkb.sh b/scripts/dmenu-xkb.sh index 66aecb0..ff26211 100755 --- a/scripts/dmenu-xkb.sh +++ b/scripts/dmenu-xkb.sh @@ -1,5 +1,8 @@ #!/bin/sh -KEYMAP="$HOME/.config/xkb/keymap.xkb" +case "$(uname -s)" in + FreeBSD*) KEYMAP="$HOME/.config/xkb/keymap-bsd.xkb" ;; + *) KEYMAP="$HOME/.config/xkb/keymap-linux.xkb" ;; +esac STATE="$HOME/.cache/xkb-layout" if fc-list | grep -qi "JetBrainsMono Nerd Font"; then From cd31d99b29e5c1d04d3a9c5d03bd08e9ac81d03a Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 00:26:46 +0200 Subject: [PATCH 20/29] xkb> freebsd ok --- dotfiles/xkb/.config/xkb/keymap-bsd.xkb | Bin 0 -> 13184 bytes install/bsdinstall/sanity_check.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 dotfiles/xkb/.config/xkb/keymap-bsd.xkb diff --git a/dotfiles/xkb/.config/xkb/keymap-bsd.xkb b/dotfiles/xkb/.config/xkb/keymap-bsd.xkb new file mode 100644 index 0000000000000000000000000000000000000000..d3133d25b751357223e34dc37e180ddbabfa4eb4 GIT binary patch literal 13184 zcmcJWdvsh!eaGkSLo2N%+liBql(a`Akk}C-yLTVbwv>9cyOP$sT5Wb$k{v>X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xf7qKEEUMZkijAM&P5lSg)jHdbv$>^ z1?4WfAn!!Y(;UAa4Lqgr7rME-aI8AF z++;lssAtp{7yw)=(T{g;5Mu6qe)n!}0XmO&KM@MFtY`Oh;{1DuP_Sh^x3?4D>;7Ml z^4w7=HyApvzC^iCsAHXSqt5-ZSG%6}>HUu6;S>@KpI49VVTQ4sG93GzLSAhddp!T& o#8gEEyUwf6Gr9hnDaUOKQytD2U)}yd<_6}4nEwAG*;wp<0FpNf_W%F@ literal 0 HcmV?d00001 diff --git a/install/bsdinstall/sanity_check.sh b/install/bsdinstall/sanity_check.sh index bf2f749..759e3dc 100755 --- a/install/bsdinstall/sanity_check.sh +++ b/install/bsdinstall/sanity_check.sh @@ -124,7 +124,7 @@ check_command "notify-send" "Desktop notifications" print_header "Key Bindings & Input" check_command "xbindkeys" "Key binding daemon" check_file "$HOME/.xbindkeysrc" "xbindkeys configuration" -check_file "$HOME/.config/xkb/keymap.xkb" "XKB configuration" +check_file "$HOME/.config/xkb/keymap-bsd.xkb" "XKB configuration" check_command "backlight" "Brightness control (FreeBSD)" check_command "mixer" "Audio mixer (OSS)" From 5a51ca4a0f7ef8d8ac6c91e4e621550788e64645 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 10:43:01 +0200 Subject: [PATCH 21/29] xkb: more keys --- dotfiles/x/.xinitrc | 2 + dotfiles/xkb/.config/xkb/keymap-linux.xkb | Bin 13672 -> 13652 bytes dotfiles/xkb/README.md | 39 ++++++++++++---- install/build/xkb/build-xkb.sh | 2 +- install/build/xkb/symbols/local | 52 +++++++++++++--------- 5 files changed, 65 insertions(+), 30 deletions(-) diff --git a/dotfiles/x/.xinitrc b/dotfiles/x/.xinitrc index 8fafeea..37b9a47 100644 --- a/dotfiles/x/.xinitrc +++ b/dotfiles/x/.xinitrc @@ -35,7 +35,9 @@ case "$(uname -s)" in ;; esac +# Set keymap (don't background - fast and should complete before apps start) setxkbmap se +echo "se" > "$HOME/.cache/xkb-layout" # Cache current layout for dmenu status script # Set the default X cursor to the usual pointer xsetroot -cursor_name left_ptr & diff --git a/dotfiles/xkb/.config/xkb/keymap-linux.xkb b/dotfiles/xkb/.config/xkb/keymap-linux.xkb index fa89e0fd65ff2eec9548abfff3d5f36f2b69c6fa..ea42f3cefa1d5bf2ab341a69b43c39bfa271699e 100644 GIT binary patch delta 151 zcmaEnbtP+pf$$rF4k=~^Muq^!5^Yu>J%QuMMrThcR*-n$XEBf$48$svZRMXcX)sKdlU17Rp}@nW31L delta 184 zcmcbT^&)G6fiQz$hZHjdBSQdVhc+vap1^TqqqC` | +Each key can have up to 8 levels, defined as `[ level1, level2, level3, level4, ... ]`: +- **Level 1**: normal tap +- **Level 2**: Shift+key +- **Level 3**: Super+key (via `lv3:lwin_switch`) +- **Level 4**: Super+Shift+key + +Example: `key { [ u, U, 7 ] };` means: normal=`u`, Shift=`U`, Super=`7`. + +### Custom symbol mappings + +| Key | L1 | L2 | L3 | L4 | +|-----|----|----|----|----| +| å | `[` | `]` | — | — | +| ö | ⌫ | ↑ | `=` | — | +| ä | `:` | `\|` | `/` | — | +| s | `s` | `S` | `$` | — | +| j | `j` | `J` | `4` | `(` | +| k | `k` | `K` | `5` | `)` | +| `,` | `,` | `;` | `2` | — | +| `.` | `.` | `:` | `3` | — | --- @@ -78,6 +91,16 @@ xcape -e 'Control_L=Escape' **level-3 activator** — the same mechanism as AltGr. `~/.config/xkb/symbols/local` assigns digits at level 3 for the numpad cluster. +### XKB Levels + +Each key has multiple levels — outputs defined as `[ level1, level2, level3, ... ]`: +- **Level 1**: unshifted (normal tap) +- **Level 2**: Shift+key +- **Level 3**: level-3 activator held (AltGr by default, Super in this config) +- **Level 4**: level-3 + Shift + +Example: `key { [ u, U, 7 ] };` means: normal=`u`, Shift=`U`, Super=`7`. + ### Load (`apply-keys.sh`) Run on every X startup via `.xinitrc`: diff --git a/install/build/xkb/build-xkb.sh b/install/build/xkb/build-xkb.sh index 1180d9a..f6dd536 100755 --- a/install/build/xkb/build-xkb.sh +++ b/install/build/xkb/build-xkb.sh @@ -20,7 +20,7 @@ esac mkdir -p "$(dirname "$KEYMAP")" setxkbmap se -option ctrl:nocaps,lv3:lwin_switch -print \ - | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local(numpad)+local(remaps)"|' \ + | sed '/xkb_symbols/s|include "\(.*\)"|include "\1+local"|' \ | xkbcomp -w0 -I"${SYMBOLS_DIR}" - -o "${KEYMAP}" echo "Keymap written to ${KEYMAP}" diff --git a/install/build/xkb/symbols/local b/install/build/xkb/symbols/local index 39f812f..d9a0a7e 100644 --- a/install/build/xkb/symbols/local +++ b/install/build/xkb/symbols/local @@ -1,35 +1,45 @@ // ~/.config/xkb/symbols/local // -// Num-layer activated by Super (lv3:lwin_switch): +// Custom key mappings for Swedish layout + numpad layer +// +// Activated by Super (lv3:lwin_switch): +// - Level 1: normal key +// - Level 2: Shift+key +// - Level 3: Super+key (numpad digits, symbols, operators) +// - Level 4: Super+Shift+key (extended symbols) +// +// Numpad grid (Super): // u i o → 7 8 9 // j k l → 4 5 6 // m , . → 1 2 3 -// n → 0 +// n → 0 +// +// Symbol access (Super): +// s → $ +// ö → = +// ä → / +// å → [ ] +// +// Extended symbols (Super+Shift): +// j → ( k → ) partial alphanumeric_keys -xkb_symbols "numpad" { +xkb_symbols "local" { + // Numpad layer (Super+key) key { [ u, U, 7 ] }; key { [ i, I, 8 ] }; key { [ o, O, 9 ] }; - key { [ j, J, 4 ] }; - key { [ k, K, 5 ] }; + key { [ j, J, 4, parenleft ] }; + key { [ k, K, 5, parenright ] }; key { [ l, L, 6 ] }; key { [ m, M, 1 ] }; key { [ n, N, 0 ] }; -}; - -// Persistent remaps (always active, independent of layers): -// å → = Å → ~ -// ö → : Ö → ; -// ä → / Ä → | -// , → , ; → < (Super → 2) -// . → . : → > (Super → 3) - -partial alphanumeric_keys -xkb_symbols "remaps" { - key { [ equal, asciitilde ] }; - key { [ colon, semicolon ] }; - key { [ slash, bar ] }; - key { [ comma, less, 2 ] }; - key { [ period, greater, 3 ] }; + key { [ comma, semicolon, 2 ] }; + key { [ period, colon, 3 ] }; + + // Swedish key remaps (always active) + key { [ bracketleft, bracketright ] }; + key { [ BackSpace, Up, equal ] }; + key { [ colon, bar, slash ] }; + key { [ s, S, dollar ] }; }; From c601900b189c095ec7471297b3c372ff2206c042 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 10:51:05 +0200 Subject: [PATCH 22/29] test as default --- install/archinstall/configure_build_install_link.sh | 10 +++++++--- install/bsdinstall/configure_build_install_link.sh | 9 ++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/install/archinstall/configure_build_install_link.sh b/install/archinstall/configure_build_install_link.sh index 653f981..cd36549 100755 --- a/install/archinstall/configure_build_install_link.sh +++ b/install/archinstall/configure_build_install_link.sh @@ -143,10 +143,14 @@ case "$ans" in ;; esac -read -p "Run tests? [y/N] " ans +read -p "Run tests? [Y/n] " ans case "$ans" in - [Yy]*) - # Test + [Nn]) + # Skip tests + ;; + *) + # Test (default) $TEST ;; esac + diff --git a/install/bsdinstall/configure_build_install_link.sh b/install/bsdinstall/configure_build_install_link.sh index c8dc368..460a4c6 100755 --- a/install/bsdinstall/configure_build_install_link.sh +++ b/install/bsdinstall/configure_build_install_link.sh @@ -128,10 +128,13 @@ case "$ans" in ;; esac -read -p "Run tests? [y/N] " ans +read -p "Run tests? [Y/n] " ans case "$ans" in - [Yy]*) - # Test + [Nn]) + # Skip tests + ;; + *) + # Test (default) $TEST ;; esac From 6012a9b2c4225c7ee2d61d022287000cc97c3a12 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 11:31:57 +0200 Subject: [PATCH 23/29] xkb: dmenu help --- dotfiles/xkb/README.md | 45 +++++++++++++++++++-------------- install/build/xkb/symbols/local | 28 +++----------------- scripts/dmenu-xkb.sh | 8 +++++- 3 files changed, 37 insertions(+), 44 deletions(-) diff --git a/dotfiles/xkb/README.md b/dotfiles/xkb/README.md index b560a6b..5d902eb 100644 --- a/dotfiles/xkb/README.md +++ b/dotfiles/xkb/README.md @@ -11,13 +11,33 @@ X11 keyboard customisation using **XKB** and **xcape**. | CapsLock | Escape | Control | | Super | — | Num-layer | -### Num-layer (Super held) - +## Custom symbol mappings + +| Key | L1 | L2 | L3 | L4 | +|-----|-----|-----|-----|----| +| u | u | U | 7 | — | +| i | i | I | 8 | — | +| o | o | O | 9 | — | +| j | j | J | 4 | ( | +| k | k | K | 5 | ) | +| l | l | L | 6 | — | +| m | m | M | 1 | — | +| n | n | N | 0 | — | +| , | , | ; | 2 | — | +| . | . | : | 3 | — | +| å | [ | ] | — | — | +| ö | ⌫ | ↑ | = | — | +| ä | : | \| | / | — | +| s | s | S | $ | — | + +### Num-layer + +Level 3 (Super held) maps row keys to numpad grid: ``` - u i o → 7 8 9 - j k l → 4 5 6 - m , . → 1 2 3 - n → 0 +u i o → 7 8 9 +j k l → 4 5 6 +m , . → 1 2 3 + n → 0 ``` ### XKB Levels @@ -30,19 +50,6 @@ Each key can have up to 8 levels, defined as `[ level1, level2, level3, level4, Example: `key { [ u, U, 7 ] };` means: normal=`u`, Shift=`U`, Super=`7`. -### Custom symbol mappings - -| Key | L1 | L2 | L3 | L4 | -|-----|----|----|----|----| -| å | `[` | `]` | — | — | -| ö | ⌫ | ↑ | `=` | — | -| ä | `:` | `\|` | `/` | — | -| s | `s` | `S` | `$` | — | -| j | `j` | `J` | `4` | `(` | -| k | `k` | `K` | `5` | `)` | -| `,` | `,` | `;` | `2` | — | -| `.` | `.` | `:` | `3` | — | - --- ## Files diff --git a/install/build/xkb/symbols/local b/install/build/xkb/symbols/local index d9a0a7e..7756028 100644 --- a/install/build/xkb/symbols/local +++ b/install/build/xkb/symbols/local @@ -1,31 +1,13 @@ // ~/.config/xkb/symbols/local // -// Custom key mappings for Swedish layout + numpad layer +// Custom XKB symbol definitions for Swedish layout. +// See ../../../dotfiles/xkb/README.md for complete mappings. // -// Activated by Super (lv3:lwin_switch): -// - Level 1: normal key -// - Level 2: Shift+key -// - Level 3: Super+key (numpad digits, symbols, operators) -// - Level 4: Super+Shift+key (extended symbols) -// -// Numpad grid (Super): -// u i o → 7 8 9 -// j k l → 4 5 6 -// m , . → 1 2 3 -// n → 0 -// -// Symbol access (Super): -// s → $ -// ö → = -// ä → / -// å → [ ] -// -// Extended symbols (Super+Shift): -// j → ( k → ) +// Format: key { [ level1, level2, level3, level4 ] }; +// Example: key { [ u, U, 7 ] }; // u, Shift+u→U, Super+u→7 partial alphanumeric_keys xkb_symbols "local" { - // Numpad layer (Super+key) key { [ u, U, 7 ] }; key { [ i, I, 8 ] }; key { [ o, O, 9 ] }; @@ -36,8 +18,6 @@ xkb_symbols "local" { key { [ n, N, 0 ] }; key { [ comma, semicolon, 2 ] }; key { [ period, colon, 3 ] }; - - // Swedish key remaps (always active) key { [ bracketleft, bracketright ] }; key { [ BackSpace, Up, equal ] }; key { [ colon, bar, slash ] }; diff --git a/scripts/dmenu-xkb.sh b/scripts/dmenu-xkb.sh index ff26211..569e8ad 100755 --- a/scripts/dmenu-xkb.sh +++ b/scripts/dmenu-xkb.sh @@ -4,6 +4,7 @@ case "$(uname -s)" in *) KEYMAP="$HOME/.config/xkb/keymap-linux.xkb" ;; esac STATE="$HOME/.cache/xkb-layout" +README="$HOME/repos/dotfiles/dotfiles/xkb/README.md" if fc-list | grep -qi "JetBrainsMono Nerd Font"; then FONT="JetBrainsMono Nerd Font Mono-14" @@ -13,12 +14,17 @@ fi current=$(cat "$STATE" 2>/dev/null || echo "se") -choice=$(printf "custom\nse" | dmenu -p "xkb[$current]" -nb "#222222" -nf "#ffffff" -sb "#A300A3" -sf "#ffffff" \ +choice=$(printf "help\ncustom\nse" | dmenu -p "xkb[$current]" -nb "#222222" -nf "#ffffff" -sb "#A300A3" -sf "#ffffff" \ -fn "$FONT") [ -z "$choice" ] && exit 0 case "$choice" in + help) + head -50 "$README" | dmenu -l 32 -i -p "XKB Help" \ +-nb "#222222" -nf "#ffffff" -sb "#222222" -sf "#ffffff" \ +-fn "JetBrainsMono Nerd Font Mono-14" + ;; custom) xkbcomp -w0 "$KEYMAP" "$DISPLAY" pkill -x xcape 2>/dev/null || true From 74a8c4c608a00e512fbb67d748b727a533d72eb9 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 16:22:17 +0200 Subject: [PATCH 24/29] xkb: adapt to freebsd --- dotfiles/xkb/.config/xkb/keymap-bsd.xkb | Bin 13184 -> 13168 bytes dotfiles/xkb/README.md | 2 -- scripts/dmenu-xkb.sh | 5 +++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dotfiles/xkb/.config/xkb/keymap-bsd.xkb b/dotfiles/xkb/.config/xkb/keymap-bsd.xkb index d3133d25b751357223e34dc37e180ddbabfa4eb4..c66dd4cb60c0d10a035200acabaaeee83d0b38d3 100644 GIT binary patch delta 164 zcmZoj|ByDpKsZ3aL6Vt)ks*L_f+j1Fp1|>7qcfuUJk|yo0n_)GcrEd{9UV)0|1o? BEcXBa delta 185 zcmey6){s8IKsZ6bL6Vt)ks*L_fhH@Ep1|>8qcfu42|0efID^1=b z$HVw>vZI3X/dev/null || true xcape -e 'Control_L=Escape' & + echo "$choice" > "$STATE" ;; se) pkill -x xcape 2>/dev/null || true setxkbmap se + echo "$choice" > "$STATE" ;; esac -echo "$choice" > "$STATE" From 64ba2b6921a48a3da9a9b7d501ed92798f2f0dbe Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 16:56:22 +0200 Subject: [PATCH 25/29] xmonad: dmenu keymaps from README --- dotfiles/xmonad/README.md | 28 ++++++++++++++-------------- scripts/dmenu-help.sh | 37 ++++++------------------------------- 2 files changed, 20 insertions(+), 45 deletions(-) diff --git a/dotfiles/xmonad/README.md b/dotfiles/xmonad/README.md index 0c2d1f2..4cd12c5 100644 --- a/dotfiles/xmonad/README.md +++ b/dotfiles/xmonad/README.md @@ -7,34 +7,34 @@ This repository contains a custom configuration for the [XMonad](https://xmonad. ## Shortcuts -| Key Combination | Action | -|------------------------|----------------------------------------| +| Key Combination | Action | +|------------------------|---------------------------------------| | `Mod + Enter` | Launch terminal | -| `Mod + M` | Help menu | | `Mod + Q` | Close the focused window | -| `Mod + Shift + Q` | Quit xmonad | -| `Mod + Space` | Rotate through available layouts | +| `Mod + J` | Move focus to the next window | +| `Mod + K` | Move focus to the previous window | | `Mod + Tab` | Next workspace | | `Mod + Shift + Tab` | Previous workspace | | `Mod + [1..4]` | Switch to workspace N | | `Mod + Shift + [1..4]` | Move window to workspace N and follow | +| `Mod + E` | Launch file manager (lf) | +| `Mod + B` | Launch browser | +| `Mod + Space` | Rotate through available layouts | | `Mod + H` | Shrink the master area | -| `Mod + J` | Move focus to the next window | -| `Mod + K` | Move focus to the previous window | | `Mod + L` | Expand the master area | -| `Mod + Shift + Return` | Swap the focused window with master | | `Mod + ,` | Increment master windows | | `Mod + .` | Decrement master windows | -| `Mod + X` | Logout menu | -| `Mod + V` | VPN menu | +| `Mod + Shift + Return` | Swap the focused window with master | | `Mod + S` | Screenshot to `~/Downloads` | -| `Mod + Shift + S` | Capture a selected area screenshot to `~/Downloads` | +| `Mod + Shift + S` | Screenshot selected area | | `Mod + W` | Browser scratchpad toggle | | `Mod + P` | htop scratchpad toggle | -| `Mod + B` | Launch browser | -| `Mod + E` | Launch file manager (lf) | -| `Mod + A` | Launch dmenu | +| `Mod + V` | VPN menu | | `Mod + Z` | XKB layout menu | +| `Mod + X` | Logout menu | +| `Mod + A` | Launch dmenu | +| `Mod + Shift + Q` | Quit xmonad | +| `Mod + M` | Help menu | ## Requirements diff --git a/scripts/dmenu-help.sh b/scripts/dmenu-help.sh index fa23606..ec17ae9 100755 --- a/scripts/dmenu-help.sh +++ b/scripts/dmenu-help.sh @@ -1,34 +1,9 @@ #!/bin/sh + +README="$HOME/repos/dotfiles/dotfiles/xmonad/README.md" + # Show xmonad keybindings in dmenu -cat < Date: Fri, 3 Apr 2026 18:50:48 +0200 Subject: [PATCH 26/29] xkb: Up level0 --- README.md | 10 +++++++--- dotfiles/xkb/.config/xkb/keymap-linux.xkb | Bin 13652 -> 13652 bytes dotfiles/xkb/README.md | 18 +++++++++++++----- install/build/xkb/symbols/local | 4 ++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c65e87f..9cdf82f 100644 --- a/README.md +++ b/README.md @@ -31,15 +31,19 @@ Then follow prompts: ``` Configure git? [y/N] Generate SSH key? [y/N] -/home/holmen1/repos/dotfiles/install/bsdinstall/packages/besk/pkglist.txt +Install yay? [y/N] +/home/holmen1/repos/dotfiles/install/archinstall/packages/x1/pkglist.txt Install pkglist? [y/N] +/home/holmen1/repos/dotfiles/install/archinstall/packages/x1/foreignpkglist.txt +Install foreignpkglist? [y/N] Build xmonad? [y/N] Install xmonad? [y/N] Build st? [y/N] Install st? [y/N] +Build xkb keymap? [y/N] Link dotfiles? [y/N] -Enable system monitoring? [y/N] -Run tests? [y/N] +Enable services? [y/N] +Run tests? [Y/n] ``` diff --git a/dotfiles/xkb/.config/xkb/keymap-linux.xkb b/dotfiles/xkb/.config/xkb/keymap-linux.xkb index ea42f3cefa1d5bf2ab341a69b43c39bfa271699e..8948be5350cc0906a078ab3bd897537bef0bdd3d 100644 GIT binary patch delta 22 ecmcbTbtP* { [ comma, semicolon, 2 ] }; key { [ period, colon, 3 ] }; key { [ bracketleft, bracketright ] }; - key { [ BackSpace, Up, equal ] }; - key { [ colon, bar, slash ] }; + key { [ BackSpace, colon, equal ] }; + key { [ Up, bar, slash ] }; key { [ s, S, dollar ] }; }; From 549a4cce7c9dae03e6f7cecb677caacc118d700a Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 19:09:59 +0200 Subject: [PATCH 27/29] freebsd ok --- dotfiles/xkb/.config/xkb/keymap-bsd.xkb | Bin 13168 -> 13168 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/dotfiles/xkb/.config/xkb/keymap-bsd.xkb b/dotfiles/xkb/.config/xkb/keymap-bsd.xkb index c66dd4cb60c0d10a035200acabaaeee83d0b38d3..03d134a4609cf99d1bac8b6ad5a2bcdc47d219d7 100644 GIT binary patch delta 29 jcmey6_91P9fIO!a0|SFC5Z{=5Q9+m~=>KLtc_$G7lVu4c delta 29 lcmey6_91P9fIMf=e+C9y1_p*3lP@X=Gg&cg){}P<0RW<>2_ygj From 4e790b410db1ac95d3369122a3c40abd5a70741b Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 19:24:56 +0200 Subject: [PATCH 28/29] format --- scripts/dmenu-xkb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dmenu-xkb.sh b/scripts/dmenu-xkb.sh index 2688447..17a5d95 100755 --- a/scripts/dmenu-xkb.sh +++ b/scripts/dmenu-xkb.sh @@ -29,12 +29,12 @@ case "$choice" in xkbcomp -w0 "$KEYMAP" "$DISPLAY" pkill -x xcape 2>/dev/null || true xcape -e 'Control_L=Escape' & - echo "$choice" > "$STATE" + echo "$choice" > "$STATE" ;; se) pkill -x xcape 2>/dev/null || true setxkbmap se - echo "$choice" > "$STATE" + echo "$choice" > "$STATE" ;; esac From fd3e25b9090ad61011be7349b0232c1f9f8f62a5 Mon Sep 17 00:00:00 2001 From: holmen1 Date: Fri, 3 Apr 2026 19:52:24 +0200 Subject: [PATCH 29/29] some git --- install/README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/install/README.md b/install/README.md index 8c956f5..f86cdd6 100644 --- a/install/README.md +++ b/install/README.md @@ -356,6 +356,35 @@ find /path/to/search -name "*.txt" -exec grep "search term" {} \; ### Repo behind remote +**If you've committed locally but remote also has new commits:** + +Git will refuse to pull and ask you to specify a reconciliation strategy: + +``` +fatal: Need to specify how to reconcile divergent branches. +``` + +**Best option (recommended):** +```bash +git pull --rebase +``` +Replays your local commits on top of remote changes. Linear history, cleaner. + +**Alternative (preserves merge history):** +```bash +git pull --no-rebase +``` +or set default: +```bash +git config pull.rebase false +``` + +**Or fast-forward only (fails if diverged):** +```bash +git pull --ff-only +``` + +**Legacy workaround (not recommended):** ```bash git stash [-u] git pull