Skip to content

Commit 4c6f8ab

Browse files
morotenEdSchouten
authored andcommitted
Allow ~/.config/bb_clientd subdirectory
When having multiple configuration files, the ~/.config directory gets cleaner when they are all gathered in the subdirectory bb_clientd. Adding an automatic migration for now to move bb_clientd.jsonnet from ~/.config/ into ~/.config/bb_clientd/. Note that any potential load statements might fail if those files are not moved.
1 parent 0313de5 commit 4c6f8ab

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ journalctl --user -u bb_clientd -f
7878

7979
By default, bb\_clientd will use the configuration file that is also
8080
shipped with this repository. It is possible to override configuration
81-
options by creating a file named `~/.config/bb_clientd.jsonnet` that
82-
uses the following structure:
81+
options by creating a file named `~/.config/bb_clientd/bb_clientd.jsonnet`
82+
that uses the following structure:
8383

8484
```jsonnet
8585
local defaultConfiguration = import 'bb_clientd_defaults.jsonnet';

configs/linux/launch_bb_clientd_linux.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ if [ "$1" = "start" ]; then
2323
# Use either the user provided or system-wide configuration file, based
2424
# on whether the former is present.
2525
config_file=/usr/lib/bb_clientd/bb_clientd.jsonnet
26-
personal_config_file="${HOME}/.config/bb_clientd.jsonnet"
26+
personal_config_file="${HOME}/.config/bb_clientd/bb_clientd.jsonnet"
27+
28+
# TODO: 2025-04-08 Remove migration code after a year.
29+
old_personal_config_file="${HOME}/.config/bb_clientd.jsonnet"
30+
if [ -f "$old_personal_config_file" ]; then
31+
echo "Found ${old_personal_config_file}, moving it to ${personal_config_file}"
32+
mkdir -p "${HOME}/.config/bb_clientd"
33+
mv "$old_personal_config_file" "$personal_config_file"
34+
fi
35+
rm -f "${HOME}/.config/bb_clientd_defaults.jsonnet"
36+
2737
if [ -f "${personal_config_file}" ]; then
28-
ln -sf "${config_file}" "${HOME}/.config/bb_clientd_defaults.jsonnet"
38+
ln -sf "${config_file}" "${HOME}/.config/bb_clientd/bb_clientd_defaults.jsonnet"
2939
config_file="${personal_config_file}"
3040
fi
3141

0 commit comments

Comments
 (0)