Merged config files & improved script
This commit is contained in:
parent
a10a8aa4ca
commit
908a510c31
|
@ -50,25 +50,30 @@ def import_gnome_config(file: str, path: str):
|
||||||
p = subprocess.Popen(f"dconf load {path} < {dconf}", shell=True)
|
p = subprocess.Popen(f"dconf load {path} < {dconf}", shell=True)
|
||||||
p.wait()
|
p.wait()
|
||||||
|
|
||||||
dotfiles = cwd / "dotfiles.yml"
|
# Main part
|
||||||
if dotfiles.exists():
|
|
||||||
config = yaml.safe_load(dotfiles.read_text())
|
|
||||||
if config:
|
|
||||||
print("Installing dotfiles...")
|
|
||||||
for folder in config:
|
|
||||||
print(f" - {folder}")
|
|
||||||
set_dotfiles(folder, config[folder])
|
|
||||||
|
|
||||||
gnome = cwd / "gnome.yml"
|
def main():
|
||||||
if gnome.exists():
|
config_file = cwd / "config.yml"
|
||||||
config = yaml.safe_load(gnome.read_text())
|
if not config_file.exists():
|
||||||
if "extensions" in config:
|
return
|
||||||
print("Installing GNOME extensions...")
|
config = yaml.safe_load(config_file.read_text())
|
||||||
for ext in config["extensions"]:
|
if not config:
|
||||||
print(f" - {ext}")
|
return
|
||||||
install_gnome_extension(ext)
|
if "dotfiles" in config:
|
||||||
if "import" in config:
|
print("Installing dotfiles...")
|
||||||
print("Importing GNOME settings...")
|
for folder in config["dotfiles"]:
|
||||||
for file in config["import"]:
|
print(f" - {folder}")
|
||||||
print(f" - {file}")
|
set_dotfiles(folder, config["dotfiles"][folder])
|
||||||
import_gnome_config(file, config["import"][file])
|
if "gnome" in config:
|
||||||
|
if "extensions" in config["gnome"]:
|
||||||
|
print("Installing GNOME extensions...")
|
||||||
|
for ext in config["gnome"]["extensions"]:
|
||||||
|
print(f" - {ext}")
|
||||||
|
install_gnome_extension(ext)
|
||||||
|
if "import" in config["gnome"]:
|
||||||
|
print("Importing GNOME settings...")
|
||||||
|
for file in config["gnome"]["import"]:
|
||||||
|
print(f" - {file}")
|
||||||
|
import_gnome_config(file, config["gnome"]["import"][file])
|
||||||
|
|
||||||
|
main()
|
23
config.yml
Normal file
23
config.yml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
dotfiles:
|
||||||
|
bash:
|
||||||
|
$home:
|
||||||
|
- .bashrc
|
||||||
|
- .bash_logout
|
||||||
|
- .profile
|
||||||
|
etc:
|
||||||
|
$home:
|
||||||
|
- .selected_editor
|
||||||
|
git:
|
||||||
|
$home:
|
||||||
|
- .gitconfig
|
||||||
|
|
||||||
|
gnome:
|
||||||
|
extensions:
|
||||||
|
- cpupower@mko-sl.de
|
||||||
|
- dash-to-panel@jderose9.github.com
|
||||||
|
- gnome-clipboard@b00f.github.io
|
||||||
|
- blur-my-shell@aunetx
|
||||||
|
- hibernate-status@dromi
|
||||||
|
import:
|
||||||
|
extensions/cpupower: /org/gnome/shell/extensions/cpupower/
|
||||||
|
extensions/dash-to-panel: /org/gnome/shell/extensions/dash-to-panel/
|
11
dotfiles.yml
11
dotfiles.yml
|
@ -1,11 +0,0 @@
|
||||||
bash:
|
|
||||||
$home:
|
|
||||||
- .bashrc
|
|
||||||
- .bash_logout
|
|
||||||
- .profile
|
|
||||||
etc:
|
|
||||||
$home:
|
|
||||||
- "*"
|
|
||||||
git:
|
|
||||||
$home:
|
|
||||||
- .gitconfig
|
|
Loading…
Reference in a new issue