Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh update #4

Merged
merged 78 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
2aaefa3
remove unused stuff
marchdf Jan 25, 2024
4d5ff33
remove unused plugins
marchdf Jan 25, 2024
025a89d
remove unused function
marchdf Jan 25, 2024
2ae4108
more unused
marchdf Jan 25, 2024
6601805
remove rhodes
marchdf Jan 25, 2024
3667727
add zinit remove zplug
marchdf Jan 25, 2024
28d4e3c
remove z.lua replace with zoxide
marchdf Jan 25, 2024
2dd0377
reduce what is loaded by omz
marchdf Jan 25, 2024
a6cdc0d
better plugin
marchdf Jan 26, 2024
1fc2063
use fzf plugin
marchdf Jan 26, 2024
666ebe1
put together
marchdf Jan 26, 2024
7e17d56
Add a test
marchdf Jan 26, 2024
c496547
fix ci
marchdf Jan 26, 2024
f003975
try applying
marchdf Jan 26, 2024
2f30f85
change url
marchdf Jan 26, 2024
8af9ee0
better prompts
marchdf Jan 26, 2024
dd010d8
minor ci tweak
marchdf Jan 26, 2024
1280e9e
remove diff
marchdf Jan 26, 2024
cee0b4e
test this
marchdf Jan 26, 2024
e905a80
this?
marchdf Jan 26, 2024
13dc613
Another try
marchdf Jan 26, 2024
b666c05
or this
marchdf Jan 26, 2024
9366f70
this?
marchdf Jan 26, 2024
e9e4212
also this
marchdf Jan 26, 2024
06e1219
ok this
marchdf Jan 26, 2024
9d9ff76
put better prompts back in
marchdf Jan 27, 2024
16ff8de
simplify
marchdf Jan 27, 2024
7dea160
try this
marchdf Jan 27, 2024
3fe9ef8
try this
marchdf Jan 27, 2024
2dfde6b
try this too
marchdf Jan 27, 2024
c6b8bde
better white space
marchdf Jan 27, 2024
fa834e7
moving around
marchdf Jan 27, 2024
1a7366d
and this
marchdf Jan 27, 2024
b1db67c
easier test
marchdf Jan 27, 2024
38c2ea7
add linux
marchdf Jan 27, 2024
f4b819b
try curl
marchdf Jan 27, 2024
7f67716
better path
marchdf Jan 27, 2024
e203dae
skip spack manager on test machine
marchdf Jan 27, 2024
f590165
add fzf to linux
marchdf Jan 27, 2024
20df104
remove tests
marchdf Jan 29, 2024
7ba7975
install zsh and ohmyzsh
marchdf Jan 30, 2024
967f263
try this
marchdf Jan 30, 2024
64d3c44
add this
marchdf Jan 30, 2024
a4ce57e
don't do spack packages
marchdf Jan 30, 2024
b622459
move emacs to zinit
marchdf Jan 30, 2024
bb28ded
add gui emacs alias
marchdf Jan 31, 2024
181d07d
add tree
marchdf Jan 31, 2024
30e207b
consolidate some functions into a plugin
marchdf Feb 1, 2024
1ea8a21
conda update
marchdf Feb 1, 2024
d85bd9f
fix ediff
marchdf Feb 1, 2024
d27dbe1
update for eagle
marchdf Feb 1, 2024
832d7c5
remove unneeded frontier thing
marchdf Feb 1, 2024
048d4f5
more robust dl
marchdf Feb 2, 2024
1d9c7fe
better pyenv install for ellis
marchdf Feb 6, 2024
89adf7d
better colors for ssh
marchdf Feb 6, 2024
f26845d
better ls colors
marchdf Feb 8, 2024
582d10e
make the timer work with ventura
marchdf Feb 12, 2024
b07dc70
Trying a better history backup
marchdf Feb 12, 2024
7aa36b1
don't wait personal
marchdf Feb 12, 2024
f0f8c80
rejig
marchdf Feb 12, 2024
777dd21
enable fzf finding
marchdf Feb 12, 2024
cb2a278
less frequent backup
marchdf Feb 13, 2024
5d00c13
cleaner
marchdf Feb 13, 2024
89e1356
Better nrel cluster management
marchdf Feb 15, 2024
a0d9ba3
fix kestrel
marchdf Feb 15, 2024
1d41bbf
debug kestrel
marchdf Feb 15, 2024
29fc43b
revert thing
marchdf Feb 15, 2024
94904ad
add a python version for things
marchdf Feb 16, 2024
8684910
remove python version
marchdf Feb 16, 2024
f4bcc03
playing with spack
marchdf Feb 16, 2024
4a2cfef
Trying a better python setup
marchdf Feb 20, 2024
8572332
remove old python thing
marchdf Feb 20, 2024
ef78d6a
fix ellis python
marchdf Feb 20, 2024
453cd92
fix eagle python
marchdf Feb 20, 2024
ee1c118
minor update
marchdf Feb 26, 2024
4a0cda2
better omz install
marchdf Feb 26, 2024
5540a89
fix ellis python module
marchdf Feb 26, 2024
a767450
switch to exawind manager
marchdf Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .chezmoi.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@
command = "emacs"
args = ["-nw"]

{{- $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }}
{{ $email := promptString "email" -}}
{{ $use_zsh_root_dir := promptBoolOnce . "use_zsh_root_dir" "Use ZSH_ROOT_DIR for tmux shell" }}
{{ $email := promptStringOnce . "email" "email" -}}
{{ $test_machine := promptBoolOnce . "test_machine" "test_machine" }}

{{ $nrel_hpc := false -}}
{{ $nrel_cluster := env "NREL_CLUSTER" | quote -}}
{{- if or (eq (env "NREL_CLUSTER") "eagle") (eq (env "NREL_CLUSTER") "ellis") (eq (env "NREL_CLUSTER") "kestrel") -}}
{{ $nrel_hpc = true -}}
{{- end -}}

{{ $ornl_hpc := false -}}
{{- if eq (env "LMOD_SYSTEM_NAME") "frontier" -}}
{{ $ornl_hpc = true -}}
{{- end -}}

[data]
use_zsh_root_dir = {{ $use_zsh_root_dir }}
email = {{ $email | quote }}
test_machine = {{ $test_machine }}
spack_packages = false
nrel_hpc = {{ $nrel_hpc }}
nrel_cluster = {{ $nrel_cluster }}
ornl_hpc = {{ $ornl_hpc }}
1 change: 0 additions & 1 deletion .chezmoiignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ terminal-app
.config/karabiner
.config/iterm2
.hammerspoon
.oh-my-zsh/custom/iterm2_ssh_switch_tab_color.zsh
.vscode
bin/keyremap.sh
Library
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: dotfiles-CI

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 5 * * 1"

concurrency:
group: ${{github.ref}}-${{github.head_ref}}-ci
cancel-in-progress: true

jobs:
Dotfiles:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: macos-latest
install_deps: brew install chezmoi
- os: ubuntu-latest
install_deps: sudo apt-get update && sudo apt install zsh -y && sh -c "$(curl -fsLS get.chezmoi.io)" -- -b $HOME/.local/bin && export PATH="${HOME}/.local/bin:$PATH"
steps:
- name: Dependencies
run: |
${{matrix.install_deps}}
- name: Install
run: |
export CHEZMOI_BRANCH=${{ github.head_ref || github.ref_name }}
chezmoi init https://github.com/marchdf/dotfiles.git --branch ${CHEZMOI_BRANCH} --promptBool test_machine=t,"Use ZSH_ROOT_DIR for tmux shell"=f --promptString email=""
chezmoi data
chezmoi apply
- name: Cold start zsh
run: |
time zsh -i -c exit
- name: Warm start zsh
run: |
time zsh -i -c exit
46 changes: 46 additions & 0 deletions bin/executable_pyenv_python_install.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

if [[ ! -x "$(command -v pyenv)" ]]; then
echo "Please install pyenv"
exit 1
fi

{{- if eq .nrel_cluster "eagle" }}
source /nopt/nrel/ecom/hpacf/env.sh
module use ${HOME}/modules/linux-centos7-skylake_avx512
module load gcc
module load binutils
module load git
module load gnutls
module load libtool
module load bzip2
module load libffi
module load openssl
module load sqlite
export LDFLAGS="-L${OPENSSL_ROOT_DIR}/lib -L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib"
export CPPFLAGS="-I${OPENSSL_ROOT_DIR}/include -I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include"
{{- else if eq .nrel_cluster "ellis" }}
MODULES_DATE=2023-05-11
source /data/ssd1/software/${MODULES_DATE}/env.sh
module load gcc
module load binutils
module load git
module load gnutls
module load libtool
module load bzip2
module load libffi
module load sqlite
export LDFLAGS="-L${LIBFFI_ROOT_DIR}/lib64 -L${BZIP2_ROOT_DIR}/lib -L${SQLITE_ROOT_DIR}/lib"
export CPPFLAGS="-I${LIBFFI_ROOT_DIR}/include -I${BZIP2_ROOT_DIR}/include -I${SQLITE_ROOT_DIR}/include"
{{- end }}
export PYTHON_CONFIGURE_OPTS="--enable-optimizations --with-lto"
export PYTHON_CFLAGS="-mtune=native"


PYTHON_VERSION="${1}"
if [ ! -z "$python_version" ]
then
pyenv install
else
pyenv install -s ${PYTHON_VERSION}
fi
10 changes: 7 additions & 3 deletions bin/executable_teatimer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ if [ "$(uname)" == "Darwin" ]; then

# Make sure sound is enabled
osascript -e "set Volume 2"


# Doesn't work with ventura
# Make sure you installed terminal-notifier with homebrew
# Also increase the notification banner time by doing:
# defaults write com.apple.notificationcenterui bannerTime 15
# taken from: https://9to5mac.com/2014/01/30/how-to-change-os-x-banner-notification-duration-using-terminal/
terminal-notifier -title "Your tea is ready!" -message "" -sound default -contentImage "$HOME/bin/tea.jpg";
# terminal-notifier -title "Your tea is ready!" -message "" -sound default -contentImage "$HOME/bin/tea.jpg";

# Display notification
osascript -e 'display notification "--" with title "Your tea is ready"'

# Make my own sound aiff with the old system beep? and play it like this
#afplay /System/Library/Sounds/Funk.aiff
afplay /System/Library/Sounds/Funk.aiff

# Make sure sound is disabled (but wait for previous command to end)
gsleep 1s;
Expand Down
3 changes: 1 addition & 2 deletions conda-env/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.10
- python=3.11
- black
- ipython
- line_profiler
Expand All @@ -22,6 +22,5 @@ dependencies:
- seaborn
- snakeviz
- sphinx
- toml
- yt
prefix: /home/mhenryde/miniconda3/envs/main
25 changes: 13 additions & 12 deletions dot_emacs
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,19 @@
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]tmp_build_dir\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-build-.+\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\].spack-env\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/.cache\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/.tmp\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/configs\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/docs\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/env-templates\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/golds\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/repos\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/scripts\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/spack\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/spack-scripting\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/stage\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]spack-manager/tests\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/.cache\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/.tmp\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/configs\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/docs\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/env-templates\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/golds\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/repos\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/scripts\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack-manager\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/spack-scripting\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/stage\\'")
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]exawind-manager/tests\\'")

;; Increase garbage collection threshold
;; https://emacs-lsp.github.io/lsp-mode/page/performance/
Expand Down
120 changes: 120 additions & 0 deletions dot_local/share/zinit/plugins/hpc/hpc.plugin.zsh.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# -*- mode: sh; sh-indentation: 4; indent-tabs-mode: nil; sh-basic-offset: 4; -*-

# Copyright (c) 2024 Marc Henry de Frahan

# According to the Zsh Plugin Standard:
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html

0=${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}
0=${${(M)0:#/*}:-$PWD/$0}

# Then ${0:h} to get hpc's directory

if [[ ${zsh_loaded_plugins[-1]} != */personal && -z ${fpath[(r)${0:h}]} ]] {
fpath+=( "${0:h}" )
}

# Standard hash for plugins, to not pollute the namespace
typeset -gA Plugins
Plugins[PERSONAL_DIR]="${0:h}"

{{- if .nrel_hpc }}
# Custom for NREL HPC machines

# Set scratch
if [ -d "/scratch/${USER}" ]; then
export SCRATCH="/scratch/${USER}"
fi

# Set the modules
{{- if eq .nrel_cluster "eagle" }}
source /nopt/nrel/utils/lmod/lmod/init/zsh
source /nopt/nrel/ecom/hpacf/env.sh
module use ${HOME}/modules/linux-centos7-skylake_avx512/gcc-9.3.0
export TMPDIR=${SCRATCH}/.tmp
{{- else if eq .nrel_cluster "ellis" }}
MODULES_DATE=2023-05-11
source /data/ssd1/software/${MODULES_DATE}/env.sh
export TMPDIR=/data/ssd1/home/${USER}/.tmp
{{- else if eq .nrel_cluster "kestrel" }}
source /opt/cray/pe/lmod/lmod/init/zsh
source /nopt/nrel/apps/env.sh
export TMPDIR=${SCRATCH}/.tmp
{{- end }}

umask u=rwx,go=rx,o=rx

function load_custom_modules {

{
module purge
module load gcc
module load binutils
module load bzip2
module load cmake
module load ffmpeg/4.2.2
module load git
module load gnutls
module load htop
module load image-magick
module load libffi
module load libtool
module load py-setuptools-scm
module load sqlite
module load tmux
{{- if eq .nrel_cluster "eagle" }}
module load python/3.7.7
module load mpt
module load openssl
module load texlive
{{- else if eq .nrel_cluster "ellis" }}
module load python/3.10.10
{{- end }}

module load emacs/28.2
module load ccls
} &> /dev/null
}

function pv510server() {
module load paraview/5.10.1-server
srun -n $1 -c 1 --cpu_bind=cores pvserver
}

function pv510gui() {
module load paraview/5.10.1-gui
vglrun paraview
}

function pvtunnel() {
ssh -L 11111:$1:11111 mhenryde@$1
}

{{ end }}

{{- if .ornl_hpc }}
# Custom for OLCF HPC machines
function load_custom_modules {
{
module load DefApps-spi/default
module load cmake
module load emacs
module load go
module load htop
module load imagemagick
module load tmux

module load cray-python

} &> /dev/null
}
{{ end }}

{{- if or (.nrel_hpc) (.ornl_hpc) }}
load_custom_modules
{{ end }}

# Use alternate vim marks [[[ and ]]] as the original ones can
# confuse nested substitutions, e.g.: ${${${VAR}}}

# vim:ft=zsh:tw=80:sw=4:sts=4:et:foldmarker=[[[,]]]
Loading