mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-12-05 00:03:44 +08:00
0359ba047c
Per conversation with @bpinto in Gitter. There's no need for two separate directories. You don't have a `.git` and `.git-custom` folder, you just put your config in `.git` :) The most straightforward interpretation of XDG basedir spec is that user configuration for omf would go in `~/.config/omf`, so let's put it there. The only question is whether omf-generated config (i.e. the `theme` file) should go there as well. By analogy with git, programmatically generated config should probably be merged in with user config. This also makes it so when a user clones their dotfiles to a new machine, both kinds of settings come with it.
19 lines
611 B
Fish
19 lines
611 B
Fish
function omf_theme
|
|
if not test -e $OMF_CONFIG/themes/$argv[1]
|
|
if not test -e $OMF_PATH/themes/$argv[1]
|
|
set -l theme $OMF_PATH/db/themes/$argv[1]
|
|
if test -e $theme
|
|
echo (omf::dim)"Downloading $argv[1] theme..."(omf::off)
|
|
git clone (cat $theme) $OMF_PATH/themes/$argv[1] >/dev/null ^&1
|
|
and echo (omf::em)"$argv[1] theme downloaded."(omf::off)
|
|
or return $OMF_UNKNOWN_ERR
|
|
else
|
|
echo (omf::err)"$argv[1] is not a valid theme"(omf::off) 1^&2
|
|
return $OMF_INVALID_ARG
|
|
end
|
|
end
|
|
end
|
|
echo "$argv[1]" > $OMF_CONFIG/theme
|
|
refresh
|
|
end
|