Skip to content

Commit 88ce8ce

Browse files
committed
Move to XDG for config
1 parent b4ed473 commit 88ce8ce

File tree

2 files changed

+29
-33
lines changed

2 files changed

+29
-33
lines changed

build_files/60-binaryos-xdg.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BinaryOS XDG Configuration
2+
#
3+
# This configuration adds BinaryOS system configs to the XDG search paths.
4+
#
5+
# Config lookup order (highest to lowest priority):
6+
# 1. ~/.config/ - User overrides
7+
# 2. /etc/xdg/ - Admin overrides
8+
# 3. /usr/share/binaryos/config/ - BinaryOS defaults (always current)
9+
#
10+
# Data lookup order:
11+
# 1. ~/.local/share/ - User data
12+
# 2. /usr/local/share/ - Local admin data
13+
# 3. /usr/share/ - System data
14+
# 4. /usr/share/binaryos/data/ - BinaryOS data
15+
16+
XDG_CONFIG_DIRS=/etc/xdg:/usr/share/binaryos/config
17+
XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/binaryos/data
18+

build_files/build.sh

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,43 +45,21 @@ dnf5 -y install wezterm
4545
dnf5 -y copr enable agriffis/neovim-nightly
4646
dnf5 -y install neovim python3-neovim
4747

48-
# Install BinaryOS application configs as system defaults
49-
# XDG-compliant applications will use these as defaults when users first log in
50-
51-
# Hyprland configs
52-
install -Dm644 /usr/share/binaryos/config/hypr/hyprland.conf /usr/etc/xdg/hypr/hyprland.conf
53-
install -Dm644 /usr/share/binaryos/config/hypr/hyprlock.conf /usr/etc/xdg/hypr/hyprlock.conf
54-
install -Dm644 /usr/share/binaryos/config/hypr/hypridle.conf /usr/etc/xdg/hypr/hypridle.conf
55-
install -Dm644 /usr/share/binaryos/config/hypr/hyprpaper.conf /usr/etc/xdg/hypr/hyprpaper.conf
56-
57-
# Install background image to system location
58-
install -Dm644 /usr/share/binaryos/config/hypr/background.webp /usr/share/binaryos/hypr/background.webp
59-
6048
# Fish shell configs
61-
install -Dm644 /usr/share/binaryos/config/fish/config.fish /usr/etc/fish/config.fish
62-
cp -r /usr/share/binaryos/config/fish/conf.d /usr/etc/fish/
63-
cp -r /usr/share/binaryos/config/fish/functions /usr/etc/fish/ 2>/dev/null || true
64-
cp -r /usr/share/binaryos/config/fish/completions /usr/etc/fish/ 2>/dev/null || true
65-
66-
# Neovim configs
67-
cp -r /usr/share/binaryos/config/nvim /usr/etc/xdg/nvim
49+
# Fish doesn't use XDG_CONFIG_DIRS, so we install to /etc/fish
50+
install -Dm644 /usr/share/binaryos/config/fish/config.fish /etc/fish/config.fish
51+
cp -r /usr/share/binaryos/config/fish/conf.d /etc/fish/
52+
cp -r /usr/share/binaryos/config/fish/functions /etc/fish/ 2>/dev/null || true
53+
cp -r /usr/share/binaryos/config/fish/completions /etc/fish/ 2>/dev/null || true
6854

6955
# Wezterm configs
70-
# Wezterm doesn't support /etc/xdg for system defaults, so we install to /etc/skel
56+
# Wezterm doesn't support XDG_CONFIG_DIRS for system defaults, so we install to /etc/skel
7157
# which will be copied to new user home directories
72-
install -Dm644 /usr/share/binaryos/config/wezterm/wezterm.lua /usr/etc/skel/.config/wezterm/wezterm.lua
73-
74-
# Walker configs
75-
cp -r /usr/share/binaryos/config/walker/themes /usr/etc/xdg/walker/
76-
install -Dm644 /usr/share/binaryos/config/walker/config.toml /usr/etc/xdg/walker/config.toml
77-
78-
# Gitui configs
79-
install -Dm644 /usr/share/binaryos/config/gitui/key_bindings.ron /usr/etc/xdg/gitui/key_bindings.ron
80-
81-
# Elephant configs
82-
install -Dm644 /usr/share/binaryos/config/elephant/elephant.toml /usr/etc/xdg/elephant/elephant.toml
58+
install -Dm644 /usr/share/binaryos/config/wezterm/wezterm.lua /etc/skel/.config/wezterm/wezterm.lua
8359

84-
# Ashell configs
85-
install -Dm644 /usr/share/binaryos/config/ashell/config.toml /usr/etc/xdg/ashell/config.toml
60+
# Configure XDG environment for BinaryOS
61+
# This makes all configs in /usr/share/binaryos/config discoverable
62+
# while preserving user and admin override capabilities
63+
install -Dm644 /ctx/60-binaryos-xdg.conf /usr/lib/environment.d/60-binaryos-xdg.conf
8664

8765
# systemctl enable podman.socket

0 commit comments

Comments
 (0)