From c4816f33f206b077ffb98d8cd348629b14c8ed8a Mon Sep 17 00:00:00 2001 From: Nicholas Ohs Date: Thu, 24 Aug 2017 00:26:03 +0200 Subject: [PATCH 1/2] Simplified prezto setup. --- configuration_zsh/zsh_setup_configs.sh | 4 ---- pyscripts/s04_packages.py | 5 +++-- pyscripts/s13_shell.py | 16 ---------------- 3 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 configuration_zsh/zsh_setup_configs.sh diff --git a/configuration_zsh/zsh_setup_configs.sh b/configuration_zsh/zsh_setup_configs.sh deleted file mode 100644 index 2acafd0..0000000 --- a/configuration_zsh/zsh_setup_configs.sh +++ /dev/null @@ -1,4 +0,0 @@ -setopt EXTENDED_GLOB -for rcfile in /mnt/etc/skel/.zprezto/runcoms/^README.md(.N); do - ln -s ".zprezto/runcoms/${rcfile:t}" "/mnt/etc/skel/.${rcfile:t}" -done \ No newline at end of file diff --git a/pyscripts/s04_packages.py b/pyscripts/s04_packages.py index 5913f2d..368d72c 100644 --- a/pyscripts/s04_packages.py +++ b/pyscripts/s04_packages.py @@ -19,7 +19,8 @@ def install_packages(user_input, install_user_name): 'unrar', 'fortune-mod', 'reflector', - 'tree'] + 'tree', + 'prezto-git'] packages = { 'minimal': { 'desktop' : [], @@ -101,7 +102,7 @@ def install_packages(user_input, install_user_name): if 'full' in user_input['packages']: for _, value in packages.items(): package_list += value[user_input['system type']] - + if user_input['desktop'] != 'none': package_list += desktop_distros[user_input['desktop']] for _, value in gui_packages.items(): diff --git a/pyscripts/s13_shell.py b/pyscripts/s13_shell.py index e6eff8a..8b0f4d7 100644 --- a/pyscripts/s13_shell.py +++ b/pyscripts/s13_shell.py @@ -15,30 +15,14 @@ def configure_shell(): ### Install zsh and configure print(" >> Installing zsh with prezto") - ### Clone the Prezto files - run("git clone --recursive https://github.com/sorin-ionescu/prezto.git /mnt/etc/skel/.zprezto") - - ### Set correct theme - # sed -i "s|theme ''|theme '$USER_ZSH_THEME'|g" arch-installer/configuration_zsh/zpreztorc - - ### Copy them into the user's folder - run("zsh arch-installer/configuration_zsh/zsh_setup_configs.sh") - ### Copy prompt theme and .zpreztorc over copy2("arch-installer/configuration_zsh/zshrc", "/mnt/etc/skel/.zshrc") copy2("arch-installer/configuration_zsh/zpreztorc", "/mnt/etc/skel/.zpreztorc") copy2("arch-installer/configuration_zsh/prompt_plasmon_setup", "/mnt/etc/skel/.zprezto/modules/prompt/functions/") - ### Add powerline fonts to display prezto symbols - print(" >> Installing powerline fonts") - run("git clone https://github.com/powerline/fonts") - run("export HOME='/mnt/etc/skel' && zsh ./fonts/install.sh") - - ### Copy Vim-config copy2("arch-installer/configuration_zsh/.vimrc", "/mnt/etc/skel/") - ### Change the default shell print(" >> Changing default shell to zsh") sed_inplace("/mnt/etc/default/useradd", "SHELL=/bin/bash", "SHELL=/bin/zsh") From c869a5b227c006d299794e89109cd0d0b0e08340 Mon Sep 17 00:00:00 2001 From: Nicholas Ohs Date: Thu, 24 Aug 2017 00:34:02 +0200 Subject: [PATCH 2/2] Fixed a missing directory. --- pyscripts/s13_shell.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyscripts/s13_shell.py b/pyscripts/s13_shell.py index 8b0f4d7..3edc43a 100644 --- a/pyscripts/s13_shell.py +++ b/pyscripts/s13_shell.py @@ -1,3 +1,4 @@ +import os import fileinput from shutil import copy2 from subprocess import CalledProcessError @@ -18,7 +19,12 @@ def configure_shell(): ### Copy prompt theme and .zpreztorc over copy2("arch-installer/configuration_zsh/zshrc", "/mnt/etc/skel/.zshrc") copy2("arch-installer/configuration_zsh/zpreztorc", "/mnt/etc/skel/.zpreztorc") - copy2("arch-installer/configuration_zsh/prompt_plasmon_setup", "/mnt/etc/skel/.zprezto/modules/prompt/functions/") + + directory = "/mnt/etc/skel/.zprezto/modules/prompt/functions/" + if not os.path.exists(directory): + os.makedirs(directory) + + copy2("arch-installer/configuration_zsh/prompt_plasmon_setup", directory) ### Copy Vim-config copy2("arch-installer/configuration_zsh/.vimrc", "/mnt/etc/skel/")