From cd9a7e172e08081af1518639aac7145012693761 Mon Sep 17 00:00:00 2001 From: cronekorkn Date: Mon, 8 Jan 2024 12:25:44 +0100 Subject: [PATCH] macbook manage zsh theme and remove clamav --- bundles/macbook/files/freshclam.conf | 1 - bundles/macbook/files/zshrc | 3 ++- bundles/macbook/items.py | 15 ++++++--------- bundles/macbook/metadata.py | 4 +--- bundles/zsh/files/bw.zsh-theme | 11 ++++++++++- 5 files changed, 19 insertions(+), 15 deletions(-) delete mode 100644 bundles/macbook/files/freshclam.conf diff --git a/bundles/macbook/files/freshclam.conf b/bundles/macbook/files/freshclam.conf deleted file mode 100644 index 3d9ca5f..0000000 --- a/bundles/macbook/files/freshclam.conf +++ /dev/null @@ -1 +0,0 @@ -DatabaseMirror database.clamav.net diff --git a/bundles/macbook/files/zshrc b/bundles/macbook/files/zshrc index 14236e2..d9474a9 100644 --- a/bundles/macbook/files/zshrc +++ b/bundles/macbook/files/zshrc @@ -2,7 +2,8 @@ export PATH=~/.bin:$PATH export PATH=~/.cargo/bin:$PATH export ZSH=~/.zsh/oh-my-zsh -ZSH_THEME="ckn" +export ZSH_HOSTNAME='sm' +ZSH_THEME="bw" HIST_STAMPS="yyyy/mm/dd" plugins=( zsh-autosuggestions diff --git a/bundles/macbook/items.py b/bundles/macbook/items.py index f7ee9ea..97d8a16 100644 --- a/bundles/macbook/items.py +++ b/bundles/macbook/items.py @@ -22,6 +22,12 @@ files['/Users/mwiegand/.bin/macbook-update'] = { 'mode': '755', } +with open(f'{repo.path}/bundles/zsh/files/bw.zsh-theme') as f: + files['/Users/mwiegand/.zsh/oh-my-zsh/themes/bw.zsh-theme'] = { + 'content': f.read(), + 'mode': '0644', + } + # direnv directories['/Users/mwiegand/.local/share/direnv'] = {} @@ -31,15 +37,6 @@ files['/Users/mwiegand/.local/share/direnv/venv'] = {} files['/Users/mwiegand/.local/share/direnv/bundlewrap'] = {} -# clamav - -files['/opt/homebrew/etc/clamav/freshclam.conf'] = { - 'group': 'admin', -} -# run me baby one more time: -# freshclam && clamscan --infected --recursive --exclude-dir ~/Library/Mail ~ - - ################## for element in [*files.values(), *directories.values()]: diff --git a/bundles/macbook/metadata.py b/bundles/macbook/metadata.py index 1e6681b..5a9e17b 100644 --- a/bundles/macbook/metadata.py +++ b/bundles/macbook/metadata.py @@ -1,5 +1,3 @@ defaults = { - 'brew': { - 'clamav', - }, + 'brew': {}, } diff --git a/bundles/zsh/files/bw.zsh-theme b/bundles/zsh/files/bw.zsh-theme index b158614..1cbe9c5 100644 --- a/bundles/zsh/files/bw.zsh-theme +++ b/bundles/zsh/files/bw.zsh-theme @@ -34,7 +34,16 @@ function zsh_exitcode_color { echo "%(?:%{$fg_bold[green]%}:%{$fg_bold[red]%})" } -PROMPT='$(zsh_root_color)$(whoami)%{$reset_color%}@$(zsh_exitcode_color)$(hostname -s) %{$fg[cyan]%}$(zsh_spwd)%{$reset_color%} $(git_prompt_info)' +function zsh_hostname { + if [ -z "$ZSH_HOSTNAME" ] + then + hostname -s + else + echo "$ZSH_HOSTNAME" + fi +} + +PROMPT='$(zsh_root_color)$(whoami)%{$reset_color%}@$(zsh_exitcode_color)$(zsh_hostname) %{$fg[cyan]%}$(zsh_spwd)%{$reset_color%} $(git_prompt_info)' ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "