From cf5d7a087731a913ce8c83a2c65c3022f8205890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=90=D0=BA=D1=81=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2?= Date: Fri, 14 Nov 2025 18:29:06 +0800 Subject: [PATCH] shell misc --- README.md | 2 +- shell/.bash_aliases | 24 ++++++++++++++++++------ shell/.profile | 30 +++++++++++++----------------- shell/.zshrc | 2 +- xcompose/.XCompose | 2 +- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 36eee60..7ade340 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,4 @@ Target (`-t`) defaults to the parent of `pwd`, so if you clone this repo not in * * * -* https://github.com/jimeh/git-aware-stow +* diff --git a/shell/.bash_aliases b/shell/.bash_aliases index 55d7c2b..fcfa6c4 100644 --- a/shell/.bash_aliases +++ b/shell/.bash_aliases @@ -1,14 +1,14 @@ #!/usr/bin/env bash -# alias bashrc='source ~/.bashrc' -alias aliases='cat ~/.bash_aliases' +alias bashrc='source ~/.bashrc' alias zshrc='source ~/.zshrc' +# alias aliases='cat ~/.bash_aliases' # use 'alias' instead (without args) alias realias='source ~/.bash_aliases' alias stow="stow -v" alias unstow="stow -D" alias restow="stow -R" alias reload='exec ${SHELL} -l' -alias sudo='sudo ' # enable aliases to be sudo’ed +alias sudo='sudo ' # enable aliases to be sudo'ed alias g='git' alias hosts="sudo nano /etc/hosts" alias shrug="echo '¯\_(ツ)_/¯' | xclip -selection c" @@ -49,9 +49,8 @@ alias gpg.list='gpg --list-keys --keyid-format SHORT' # alias pubkey="more ~/.ssh/id_ed25519.pub | xclip -selection clipboard | echo '=> Public key copied to pasteboard.'" -alias lite-xl="LITE_SCALE=1 lite-xl" alias wine='LANG=ru_RU.utf8 wine' -alias docker.prune='docker image prune -f; docker network prune -f; docker container prune -f' +alias wine64='LANG=ru_RU.utf8 wine64' # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert @@ -60,6 +59,19 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo # https://obsproject.com/forum/threads/how-to-start-virtual-camera-without-sudo-privileges.139783/ alias obscam="sudo modprobe v4l2loopback video_nr=2 card_label='OBS Virtual Camera'" +curltime() { + curl -w @- -o /dev/null -s "$@" <<'EOF' + time_namelookup: %{time_namelookup} sec\n + time_connect: %{time_connect} sec\n + time_appconnect: %{time_appconnect} sec\n + time_pretransfer: %{time_pretransfer} sec\n + time_redirect: %{time_redirect} sec\n + time_starttransfer: %{time_starttransfer} sec\n + ---------------\n + time_total: %{time_total} sec\n +EOF +} + # Download music from Youtube or Youtube Music # and save as top quality flac file without video # Playlist and video/track URLs are supported @@ -85,7 +97,7 @@ docker.ip() { | sed -e 's#^/##' \ | column -t elif [ "$1" = "-c" ]; then - docker-compose ps -q \ + docker compose ps -q \ | xargs -n 1 docker inspect --format '{{.Name}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' \ | sed -e 's#^/##' \ | column -t diff --git a/shell/.profile b/shell/.profile index caf5f20..e9b90ba 100644 --- a/shell/.profile +++ b/shell/.profile @@ -16,35 +16,29 @@ fi ### AAA ########################################## -[ -f ~/.bash_aliases ] && source ~/.bash_aliases -[ -f ~/.profile.extra ] && source ~/.profile.extra - -export LITE_SCALE=1 # workaround https://github.com/lite-xl/lite-xl/issues/1173 - export JAVA_HOME="/usr/bin/" -export PATH="/opt/nvim/bin:$PATH" -export PATH="$HOME/.local/bin/:$PATH" -export PATH="$HOME/.local/share/JetBrains/Toolbox/scripts:$PATH" -export PATH="$(composer config -g home)/vendor/bin:$PATH" +export PATH="$PATH:/opt/nvim/bin/" +export PATH="$PATH:$HOME/.local/bin/" +export PATH="$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts/" + +if hash composer >/dev/null; then + composer_home=$(composer config -g home 2>/dev/null) + export PATH="$PATH:$composer_home/vendor/bin" +fi # phpbrew # export PHPBREW_SET_PROMPT=1 # export PHPBREW_RC_ENABLE=1 -# [ -f ~/.phpbrew/bashrc ] && source ~/.phpbrew/bashrc +# [ -f $HOME/.phpbrew/bashrc ] && source $HOME/.phpbrew/bashrc # golang -export PATH="/usr/local/go/bin:$PATH" +export PATH="$PATH:/usr/local/go/bin" export GOPATH="$HOME/.go" # rust cargo -[ -f ~/.cargo/env ] && source ~/.cargo/env +[ -f "$HOME/.cargo/env" ] && source "$HOME/.cargo/env" # nvm -# export NVM_DIR="$HOME/.nvm" -# [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" # This loads nvm -# [ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion" # This loads nvm bash_completion - -# neovim export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion @@ -55,3 +49,5 @@ export NVM_DIR="$HOME/.nvm" # The next line enables shell command completion for yc. [ -f "$HOME/yandex-cloud/completion.zsh.inc" ] && source "$HOME/yandex-cloud/completion.zsh.inc" +# misc +[[ -f $HOME/.profile.extra ]] && source $HOME/.profile.extra diff --git a/shell/.zshrc b/shell/.zshrc index 1622c82..8b714ad 100644 --- a/shell/.zshrc +++ b/shell/.zshrc @@ -77,7 +77,7 @@ ZSH_THEME="powerlevel10k/powerlevel10k" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git docker docker-compose composer zsh-autosuggestions zsh-syntax-highlighting) +plugins=(git docker docker-compose composer zsh-autosuggestions zsh-syntax-highlighting laravel) source $ZSH/oh-my-zsh.sh diff --git a/xcompose/.XCompose b/xcompose/.XCompose index 037b117..8a99849 100644 --- a/xcompose/.XCompose +++ b/xcompose/.XCompose @@ -4,7 +4,7 @@ include "%L" : "¯\\_(ツ)_/¯" # хз : "¯\\_(ツ)_/¯" # штош : "¯\\_(ツ)_/¯" # нуштош - : "¯\\_(ツ)_/¯" # нуштош + : "¯\\_(ツ)_/¯" # ну штош # ударения : "А́" # CYRILLIC CAPITAL LETTER A plus COMBINING ACUTE --- AAA