Compare commits

...

14 Commits

Author SHA1 Message Date
470ed4a7b2 Work: Update specific configuration 2026-05-05 08:45:38 +02:00
d613476129 fix: Prevent source .profile multiple times in tmux 2026-05-05 08:43:49 +02:00
2972d5c3dc MacOS: Set XDG_CONFIG_HOME 2026-05-05 08:43:17 +02:00
0062fbf550 tmux: Support mouse mode and copy to clipboard 2026-05-05 08:41:32 +02:00
6c93ca5052 Updates 2025-08-22 11:01:22 +02:00
c8ba38833f Revert "Large improvement to tmux config"
This reverts commit 0a8c6c6553.
2025-07-21 10:43:49 +02:00
0a8c6c6553 Large improvement to tmux config 2024-12-02 10:35:51 +01:00
4df23bbe78 Add work laptop configuration 2024-11-29 14:57:23 +01:00
9f75ebf473 Fix Order of operation
Commands would not bee seen from the host.* files as the configuration
was not yet done.
2024-11-29 13:04:38 +01:00
05c6e1381b Ignore Obsidian configs folders 2024-11-29 13:00:48 +01:00
bd49782e10 Use manual format for older 'date' commands
MacOS Big Sur's date command does not support `-Iseconds`.
2024-10-14 11:05:11 +02:00
e0aa301737 Rename and improve range ssh functions 2024-10-04 16:21:54 +02:00
d7857f2385 tmux config tweaks 2024-09-19 20:36:46 +02:00
b397c654b6 Fix typo in README 2024-09-15 14:41:36 +02:00
9 changed files with 132 additions and 37 deletions

View File

@@ -11,7 +11,7 @@ MV := ${Q}mv
# Make sure that all files moved during this invokation of make get the same
# timestamp.
TS := $(shell date -Iseconds)
TS := $(shell date +%Y-%m-%d-T%H:%M:%S%z)
OHMYZSH_URL := https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh
VUNDLE_URL := https://github.com/gmarik/vundle.git

View File

@@ -10,7 +10,7 @@ The configuration relies on Vundle and expects a Nerd Font.
### ZSH
The configuration relies on [Ho My Zsh](https://ohmyz.sh).
The configuration relies on [Oh My Zsh](https://ohmyz.sh).
The target to install it is **not** automatically triggered at this time, even with `make all`.

View File

@@ -16,20 +16,31 @@ alias grep='grep --color=auto'
alias weather='curl -H "Accept-Language: en" http://wttr.in/Lausanne'
function dias() {
n=$1
shift
ssh diascld$n.iccluster.epfl.ch -A -Y $@
function _ssh_wrap() {
if [ ! $# -gt 1 ]
then
echo "Usage: ${0} remote_host [ssh arguments] command"
return
fi
local n="${1}"; shift
ssh ${n} -A -Y "$@"
}
function diasrange() {
start=$1
end=$2
shift; shift;
function ssh_range() {
if [ ! $# -gt 3 ]
then
echo "Usage: ${0} remote_prefix start end [ssh arguments] command"
return
fi
local prefix="${1}"; shift
local start="${1}"; shift
local end="${1}"; shift
for d in $(seq ${start} ${end})
do
echo diascld$d
dias $d -x "$@"
echo ------------------------------------------------------------------------------
local remote="${prefix}${d}"
echo "${remote}"
_ssh_wrap "${remote}" -x "$@"
echo "------------------------------------------------------------------------------"
done
}

View File

@@ -46,6 +46,10 @@ Network Trash Folder
Temporary Items
.apdisk
# App specific configurations
.obsidian
.idea
# Hidden files
#.??* # Remove this comment in a project

View File

@@ -1,11 +1,34 @@
#set -g default-terminal "screen-255color"
# Enable 265 colors
# https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
set -g default-terminal "tmux-256color"
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
#Does not work with Terminal.app?
#set -as terminal-overrides ",*:RGB"
# Might be useful with Windows Terminal
#set -g default-terminal "screen-255color"
# Enable xterm scrolling
#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Enable mouse support
set -g mouse on
bind-key -T prefix m set -g mouse\; display 'Mouse: #{?mouse,ON,OFF}'
# Copy to system clipboard
if-shell "uname | grep -q Darwin" \
'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"' \
'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"'
if-shell "uname | grep -q Darwin" \
'bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"' \
'bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"'
# Highlight pane with activity
setw -g monitor-activity on
# THEME
set -g pane-border-lines double
set -g pane-active-border-style fg=blue
set -g status-bg white
set -g status-fg black
set -g status-left-length 30
@@ -13,5 +36,5 @@ set -g status-right-length 60
set -g status-left '#[fg=black] [#S] #[default]'
set -g status-right '#[fg=black]%H:%M#[default] '
setw -g window-status-format '#[fg=blue]#I#[fg=black]:#W#[default]'
setw -g window-status-current-format '#[bg=black,fg=white]#I:#W#[default]'
setw -g window-status-format '#[fg=red]#I#[fg=darkblue]:#W#F#[default]'
setw -g window-status-current-format '#[bg=black,fg=white]#I:#W#F#[default]'

View File

@@ -1,3 +1,5 @@
[ $SHLVL -gt 1 ] && return
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
@@ -8,6 +10,31 @@
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# Store preferences on MacOS in .config
export XDG_CONFIG_HOME=$HOME/.config
# Add brew
if [ -x "/opt/homebrew/bin/brew" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Add ~/bin
if [ -e "${HOME}/bin" ]; then
PATH="${HOME}/bin:${PATH}"
fi
# Add cargo
if [ -e "${HOME}/.cargo/env" ]; then
. "${HOME}/.cargo/env"
fi
export PATH
# Set language to English, UTF-8
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG=en_US.UTF-8
# Host-specific alias definitions
if [ -f "${HOME}/.host.profile" ]; then
. "${HOME}/.host.profile"
@@ -20,23 +47,3 @@ if [ -n "${BASH_VERSION}" ]; then
. "${HOME}/.bashrc"
fi
fi
# Add brew
if [ -x "/opt/homebrew/bin/brew" ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Add ~/bin
if [ -e "${HOME}/bin" ]; then
PATH="${HOME}/bin:${PATH}"
fi
# Add cargo
if [ -f "${HOME}/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi
# Set language to English, UTF-8
export LC_ALL=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LANG=en_US.UTF-8

10
m1.epfl.ch.bash_aliases Normal file
View File

@@ -0,0 +1,10 @@
alias dcb='devcontainer build --workspace-folder $(git rev-parse --show-toplevel)'
alias dce='devcontainer exec --workspace-folder $(git rev-parse --show-toplevel)'
alias dcu='devcontainer up --workspace-folder $(git rev-parse --show-toplevel)'
alias k='kubectl'
alias meld=/Applications/Meld.app/Contents/MacOS/Meld
if /usr/bin/which -s pyenv; then
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
fi

39
m1.epfl.ch.profile Normal file
View File

@@ -0,0 +1,39 @@
for d in \
"${HOME}/.dotnet/tools" \
"/opt/homebrew/opt/dotnet@9/bin" \
"${HOME}/go/bin" \
"${HOME}/.local/bin" \
"${HOME}/.bun" \
;
do
if [ -d ${d} ]; then
PATH="${d}:${PATH}"
fi
done
# pyenv support
export PYENV_ROOT="${HOME}/.pyenv"
[[ -d ${PYENV_ROOT}/bin ]] && export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
# pyenv-virtualenv
eval "$(pyenv virtualenv-init -)"
# DotNet support
export DOTNET_ROOT="/opt/homebrew/opt/dotnet@9/libexec"
export PATH
#export API_KEY_INPUT="d07304e9c314b20c7ac022d6b0c328a5"
# Terraform cache folder is 400MiB per projects...
export TF_PLUGIN_CACHE_DIR="${HOME}/.cache/terraform/plugins"
# Set default config for k9s
export K9S_CONFIG_DIR="${HOME}/.config/k9s"
# bun completions
[ -s "/Users/sambuc/.bun/_bun" ] && source "/Users/sambuc/.bun/_bun"
# bun
export BUN_INSTALL="$HOME/.bun"

1
m1.epfl.ch.zshrc Normal file
View File

@@ -0,0 +1 @@
p="${HOME}/Projects"