pmb.config: write config file to xdg location
This commit is contained in:
parent
445410d08c
commit
de3b709af5
|
@ -8,6 +8,7 @@ import os
|
||||||
#
|
#
|
||||||
from pmb.config.load import load
|
from pmb.config.load import load
|
||||||
from pmb.config.save import save
|
from pmb.config.save import save
|
||||||
|
from pmb.config.xdg import get_xdg_config_home
|
||||||
from pmb.config.merge_with_args import merge_with_args
|
from pmb.config.merge_with_args import merge_with_args
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@ defaults = {
|
||||||
# aes-xts-plain64 would be better, but this is not supported on LineageOS
|
# aes-xts-plain64 would be better, but this is not supported on LineageOS
|
||||||
# kernel configs
|
# kernel configs
|
||||||
"cipher": "aes-cbc-plain64",
|
"cipher": "aes-cbc-plain64",
|
||||||
"config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg",
|
"config": os.path.join(get_xdg_config_home(), "pmbootstrap.cfg"),
|
||||||
"device": "qemu-amd64",
|
"device": "qemu-amd64",
|
||||||
"extra_packages": "none",
|
"extra_packages": "none",
|
||||||
"fork_alpine": False,
|
"fork_alpine": False,
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
def get_xdg_config_home():
|
||||||
|
home = os.path.expanduser('~')
|
||||||
|
xdg_config_home = os.environ.get('XDG_CONFIG_HOME') \
|
||||||
|
or os.path.join(home, '.config')
|
||||||
|
|
||||||
|
return os.path.join(xdg_config_home, 'pmbootstrap')
|
Loading…
Reference in New Issue