Complete the move from the old .conf-style Hyprland config to Lua: - Drop base.conf, hyprland.conf, monitors.conf and the empty workspaces.conf; base.lua + colors.lua are now the sources. - gen-colors emits hypr/colors.lua globals, build.sh cats it with base.lua into hyprland.lua. - Add .luarc.json so the editor picks up Hyprland's Lua stubs. - Correct the DP-2 monitor position and drop the stale transform. Untrack the build outputs that were gitignored yet still committed (i3/config, sway/config, waybar/style.css, wofi/style.css) so the ignore rules take effect; install.sh already runs gen-colors and each build.sh, so a fresh clone regenerates them. Also regroup .gitignore by what produces each file, refresh the docs for the Lua layout, and drop a stray scratch dump. Carries along in-progress config tweaks: pin the i3 keyboard layout, make the nerd-dictation toggle match on the full command, drop the X11-only DP-2 rotate, and add a clangd LSP setup for nvim. Co-Authored-By: Claude Opus 5 <[email protected]>
57 lines
1.5 KiB
Bash
Executable File
57 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
# Generate color fragment files for all configs from colors.conf
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SRC="$SCRIPT_DIR/colors.conf"
|
|
|
|
if [ ! -f "$SRC" ]; then
|
|
echo "Error: $SRC not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Read colors into variables
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
eval "color_$key=$value"
|
|
done <"$SRC"
|
|
|
|
# Hyprland (Lua): color_name = "rgb(HEXVAL)" globals (no #)
|
|
{
|
|
echo "-- Generated by sh/gen-colors from colors.conf. Do not edit."
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
hex="${value#\#}"
|
|
echo "color_$key = \"rgb($hex)\""
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/hypr/colors.lua"
|
|
echo "Wrote hypr/colors.lua"
|
|
|
|
# Sway: set $color_name #HEXVAL
|
|
{
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
echo "set \$color_$key $value"
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/sway/colors.conf"
|
|
echo "Wrote sway/colors.conf"
|
|
|
|
# i3: same format as sway
|
|
cp "$SCRIPT_DIR/sway/colors.conf" "$SCRIPT_DIR/i3/colors.conf"
|
|
echo "Wrote i3/colors.conf"
|
|
|
|
# Waybar CSS: @define-color color_name #HEXVAL;
|
|
{
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
echo "@define-color color_$key $value;"
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/waybar/colors.css"
|
|
echo "Wrote waybar/colors.css"
|
|
|
|
# Wofi CSS: same as waybar
|
|
cp "$SCRIPT_DIR/waybar/colors.css" "$SCRIPT_DIR/wofi/colors.css"
|
|
echo "Wrote wofi/colors.css"
|
|
|
|
echo "Done. All color fragments generated."
|