Compare commits
11
Commits
7947a628ed
...
832f8bb584
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
832f8bb584 | ||
|
|
1c8359fa4d | ||
|
|
22e0b707e8 | ||
|
|
55eb10c69b | ||
|
|
19c44740c9 | ||
|
|
5b5f0bac38 | ||
|
|
22546ab7dd | ||
|
|
2227a23630 | ||
|
|
4ad70d24eb | ||
|
|
f8ad3ee62c | ||
|
|
cb96dd6159 |
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"diagnostics.globals": ["hl"]
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["sumneko.lua"]
|
||||
}
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"js/ts.experimental.useTsgo": false
|
||||
"js/ts.experimental.useTsgo": true
|
||||
}
|
||||
@@ -34,11 +34,25 @@ There is no build step — `tsx` runs the TypeScript directly.
|
||||
## Architecture
|
||||
|
||||
- `src/packages.ts` — the package model. Each entry has a `tier` (`required` installs with no prompt; `recommended` is offered via checkbox), an optional `group` for mutually-exclusive alternatives (e.g. `waybar` vs an alternative both having `group: "bar"`, only one gets picked via a select prompt — `bar` and `launcher` currently each have just one member but are kept as groups so alternatives can be added the same way), and an optional `dir` for when a package's Stow directory name needs to differ from the package name. `toDirs()` converts chosen package names to their Stow directory names.
|
||||
- `src/gpu.ts` — `detectGpuVendors()` shells out to `lspci` and matches VGA/3D controller lines against NVIDIA/AMD/Intel keywords (word-boundary regexes — a naive `/amd|ati/i` used to false-positive on the "ati" inside "Corporation"); `driverPackagesFor()` maps detected vendors to their Arch driver packages. `install.ts` shows every detected vendor's packages in a pre-checked confirm prompt (installing all of them on hybrid/Optimus laptops), and if NVIDIA is kept, `stow.ts`'s `writeNvidiaEnvConfig()` writes `~/.config/hypr/conf.d/nvidia.lua` (machine-generated, not stowed) with the Wayland env vars Hyprland's NVIDIA docs recommend.
|
||||
- `src/gpu.ts` — `detectGpuVendors()` shells out to `lspci` and matches VGA/3D controller lines against NVIDIA/AMD/Intel keywords (word-boundary regexes — a naive `/amd|ati/i` used to false-positive on the "ati" inside "Corporation"); `driverPackagesFor()` maps detected vendors to their Arch driver packages. `install.ts` shows every detected vendor's packages in a pre-checked confirm prompt (installing all of them on hybrid/Optimus laptops), and if NVIDIA is kept, `stow.ts`'s `writeNvidiaEnvConfig()` writes `~/.config/hypr/confd/nvidia.lua` (machine-generated, not stowed) with the Wayland env vars Hyprland's NVIDIA docs recommend.
|
||||
- `src/stow.ts` — all filesystem/process side effects live here: bootstrapping `yay` and oh-my-zsh/zinit if missing, installing packages via `yay`, enabling the `sddm` systemd service (`ensureSddmEnabled`), backing up real (non-symlink) files that would collide with a Stow target into `~/.dotfiles-backup/<timestamp>/`, and wrapping `stow`/`--restow`/`-D` (always invoked with an explicit `-d <PACKAGES_DIR>` so behavior doesn't depend on cwd). Also reads/writes `~/.config/dotfiles/state.json`, which records which package dirs were chosen at install time — `update` and `remove` act on this list rather than re-prompting.
|
||||
- `src/install.ts`, `src/update.ts`, `src/remove.ts` — the three subcommands, each a thin sequence of calls into `stow.ts`, using `@clack/prompts` for interactive selection in `install.ts`.
|
||||
- `src/cli.ts` — dispatches `install|update|remove` via Node's built-in `node:util.parseArgs`.
|
||||
- `packages/hyprland/.config/hypr/hyprland.lua` — Hyprland's config, in its **current Lua format** (`hl.config`/`hl.bind`/`hl.monitor`/`hl.on`/`hl.env`), not the old `hyprland.conf` ini/hyprlang syntax deprecated since Hyprland 0.55. Easy detail to get wrong when editing — check `wiki.hypr.land` (or the raw `hyprland-wiki` GitHub markdown) for current syntax rather than assuming the old ini style.
|
||||
- `packages/hyprland/.config/hypr/hyprland.lua` — Hyprland's config, in its **current Lua format** (`hl.config`/`hl.bind`/`hl.monitor`/`hl.on`/`hl.env`), not the old `hyprland.conf` ini/hyprlang syntax deprecated since Hyprland 0.55. Easy detail to get wrong when editing — check `wiki.hypr.land` (or the raw `hyprland-wiki` GitHub markdown) for current syntax rather than assuming the old ini style. `require()` inside it resolves dots in the module string as directory separators (standard Lua `package.path` behavior) — that's why the machine-generated config dir is named `confd`, not `conf.d`: a literal dot in the directory name would make `require("conf.d.foo")` look for `conf/d/foo.lua` instead and silently fail (wrapped in `pcall`, so it fails with no visible error).
|
||||
- `packages/hyprpaper/.config/hypr/hyprpaper.conf` — hyprpaper's config, in its **current hyprlang block format** (`wallpaper { monitor = ... path = ... fit_mode = ... }`), not the old `preload =` / `wallpaper = monitor,path` key=value syntax removed in hyprpaper 0.8.0. `preload` doesn't exist anymore at all. Verify against `src/config/ConfigManager.cpp` in the `hyprwm/hyprpaper` repo (`m_config.addSpecialConfigValue(...)` calls list every valid key) rather than assuming the old ini style — same trap as `hyprland.lua` above.
|
||||
- `packages/foot/.config/foot/foot.ini` — the `[colors]` section was renamed to `[colors-dark]` in foot 1.26.0 (with a new `[colors-light]` counterpart, selected via `initial-color-theme=light`); `[colors]`/`[colors2]` still work but print a deprecation warning on every launch.
|
||||
|
||||
### Pinned reference versions (Arch, checked 2026-07-07)
|
||||
|
||||
These packages have had **breaking, from-scratch config rewrites** in living memory — don't assume a config snippet found online (or from an older revision of this repo) is still valid without checking the installed version against the package's current source/changelog:
|
||||
|
||||
| package | version | note |
|
||||
|---|---|---|
|
||||
| `hyprland` | 0.55.4 | Lua config (`hyprland.lua`) since 0.55; older configs use `hyprland.conf` hyprlang/ini syntax. |
|
||||
| `hyprpaper` | 0.8.4 | Rewritten onto `hyprtoolkit` in 0.8.0 ("configs are broken and much simplified" — upstream's own words); new block-based `wallpaper { }` syntax, `preload` removed. |
|
||||
| `foot` | 1.27.0 | `[colors]`/`[colors2]` renamed to `[colors-dark]`/`[colors-light]` in 1.26.0; old names still work but warn. |
|
||||
|
||||
Other managed packages (`waybar` 0.15.0, `mako` 1.11.0, `hyprlauncher` 0.1.6, `kitty` 0.47.4, `foot` 1.27.0, `zsh` 5.9.1, `xdg-desktop-portal-hyprland` 1.3.12, `sddm` 0.21.0, `stow` 2.4.1) are recorded here for reference, but haven't been confirmed to carry a similar breaking-rewrite risk — re-check versions with `pacman -Qi <pkg>` before trusting this table, since this is a rolling-release Arch machine and it will drift.
|
||||
|
||||
### Adding a new app
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ URL for them above, as well as copies of any plain-text lines
|
||||
beginning with `Required Notice:` that the licensor provided
|
||||
with the software. For example:
|
||||
|
||||
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
||||
> Required Notice: Copyright Arthur Erlich (https://me.arthurerlich.de)
|
||||
|
||||
## Changes and New Works License
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ without re-prompting.
|
||||
actually starts at next boot), and auto-detects installed GPU(s) via `lspci`
|
||||
to propose NVIDIA/AMD/Intel driver packages (confirm/override before they're
|
||||
installed). If NVIDIA is kept, the required Wayland env vars are written to
|
||||
`~/.config/hypr/conf.d/nvidia.lua` (machine-generated, not stowed) and
|
||||
`~/.config/hypr/confd/nvidia.lua` (machine-generated, not stowed) and
|
||||
sourced from `hyprland.lua`.
|
||||
|
||||
## Wallpaper
|
||||
|
||||
Generated
+4
-32
@@ -5,12 +5,13 @@
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dotfiles",
|
||||
"license": "LicenseRef-PolyForm-Noncommercial-1.0.0",
|
||||
"dependencies": {
|
||||
"@clack/prompts": "^0.9.0"
|
||||
"@clack/prompts": "^0.9.0",
|
||||
"tsx": "^4.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.0",
|
||||
"tsx": "^4.19.0",
|
||||
"@types/node": "^22.20.0",
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
},
|
||||
@@ -42,7 +43,6 @@
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -59,7 +59,6 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -76,7 +75,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -93,7 +91,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -110,7 +107,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -127,7 +123,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -144,7 +139,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -161,7 +155,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -178,7 +171,6 @@
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -195,7 +187,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -212,7 +203,6 @@
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -229,7 +219,6 @@
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -246,7 +235,6 @@
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -263,7 +251,6 @@
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -280,7 +267,6 @@
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -297,7 +283,6 @@
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -314,7 +299,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -331,7 +315,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -348,7 +331,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -365,7 +347,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -382,7 +363,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -399,7 +379,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -416,7 +395,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -433,7 +411,6 @@
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -450,7 +427,6 @@
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -467,7 +443,6 @@
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
@@ -491,7 +466,6 @@
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
|
||||
"integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -533,7 +507,6 @@
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
@@ -560,7 +533,6 @@
|
||||
"version": "4.23.0",
|
||||
"resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz",
|
||||
"integrity": "sha512-eUdUIaCr963q2h5u3+QwvYp0+eqPvn+egeqZUm0hwERCqqx1E3kK5ehbGCvqSE5MQAULr67ww0cA3jKc3YkM1w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"esbuild": "~0.28.0"
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
"tsx": "^4.19.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.0",
|
||||
"@types/node": "^22.20.0",
|
||||
"typescript": "^5.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||
<fontconfig>
|
||||
<alias>
|
||||
<family>monospace</family>
|
||||
<prefer>
|
||||
<family>0xProto Nerd Font</family>
|
||||
</prefer>
|
||||
</alias>
|
||||
</fontconfig>
|
||||
@@ -1,5 +1,5 @@
|
||||
[main]
|
||||
font=monospace:size=11
|
||||
|
||||
[colors]
|
||||
[colors-dark]
|
||||
alpha=0.95
|
||||
|
||||
@@ -11,7 +11,7 @@ hl.config({
|
||||
})
|
||||
|
||||
-- machine-generated by src/install.ts based on chosen packages/detected hardware/locale
|
||||
pcall(require, "conf.d.autostart")
|
||||
pcall(require, "conf.d.locale")
|
||||
pcall(require, "conf.d.nvidia")
|
||||
pcall(require, "conf.d.terminal")
|
||||
pcall(require, "confd.autostart")
|
||||
pcall(require, "confd.locale")
|
||||
pcall(require, "confd.nvidia")
|
||||
pcall(require, "confd.terminal")
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
preload = ~/.config/hypr/wallpapers/wallpaper.png
|
||||
wallpaper = ,~/.config/hypr/wallpapers/wallpaper.png
|
||||
wallpaper {
|
||||
monitor =
|
||||
path = ~/.config/hypr/wallpapers/wallpaper.png
|
||||
fit_mode = cover
|
||||
}
|
||||
|
||||
splash = false
|
||||
ipc = on
|
||||
|
||||
@@ -14,6 +14,7 @@ export const packages: Pkg[] = [
|
||||
{ name: "pciutils", tier: "required" },
|
||||
{ name: "stow", tier: "required" },
|
||||
{ name: "ttf-0xproto-nerd", tier: "required" },
|
||||
{ name: "fontconfig", tier: "required" },
|
||||
{ name: "waybar", tier: "recommended", group: "bar" },
|
||||
{ name: "hyprlauncher", tier: "recommended", group: "launcher" },
|
||||
{ name: "kitty", tier: "recommended" },
|
||||
|
||||
+6
-4
@@ -127,11 +127,13 @@ export function ensureSddmEnabled() {
|
||||
}
|
||||
}
|
||||
|
||||
// Machine-generated Hyprland config lives under ~/.config/hypr/conf.d, sourced from the
|
||||
// stowed hyprland.lua via pcall(require, "conf.d.<name>") — never stowed itself, since it
|
||||
// varies per machine/per install run (chosen packages, detected hardware/locale).
|
||||
// Machine-generated Hyprland config lives under ~/.config/hypr/confd, sourced from the
|
||||
// stowed hyprland.lua via pcall(require, "confd.<name>") — never stowed itself, since it
|
||||
// varies per machine/per install run (chosen packages, detected hardware/locale). Named
|
||||
// "confd" (no dot) rather than "conf.d" because Lua's require() treats dots in the module
|
||||
// string as directory separators, so "conf.d.<name>" would resolve to conf/d/<name>.lua.
|
||||
function hyprConfD(): string {
|
||||
return join(homedir(), ".config", "hypr", "conf.d");
|
||||
return join(homedir(), ".config", "hypr", "confd");
|
||||
}
|
||||
|
||||
// Only written when install detects an NVIDIA GPU.
|
||||
|
||||
Reference in New Issue
Block a user