You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.1 KiB
Bash

3 years ago
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
ect() {
if [ "$#" -ne 0 ]; then
echo "$1" | sudo tee /sys/devices/system/cpu/intel_pstate/no_turbo
else
cat /sys/devices/system/cpu/intel_pstate/no_turbo
fi
}
off4() {
for x in /sys/devices/system/cpu/cpu[4-7]*/online; do
echo 0 | sudo tee "$x"
done
}
on() {
for x in /sys/devices/system/cpu/cpu[0-7]*/online; do
echo 1 | sudo tee "$x"
done
}
3 years ago
[ -z ${WSLENV+x} ] || export PATH="${PATH:+"$PATH:"}$HOME/bin"
# base16 config
#BASE16_SHELL="$HOME/.config/base16-shell/"
#[ -n "$PS1" ] && \
# [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
# source "$BASE16_SHELL/profile_helper.sh"
3 years ago
# Aliases
# general aliases
alias ls='ls --color=auto'
alias vim='nvim'
alias tf='terraform'
3 years ago
# git aliases
alias ga='git add'
alias gcm='git commit -m'
alias gs='git status'
alias gp='git push'
alias gl='git log'
3 years ago
# config aliases
alias vimc='nvim ~/.config/nvim/init.lua'
alias wmc='nvim ~/.config/sway/config'
3 years ago
# asus tools aliases
alias sup='supergfxctl'
# Shell prompt
# Reset PS1 prompt everytime
resetPrompt() {
printf "\e[6 q"
}
# Colors: https://misc.flogisoft.com/bash/tip_colors_and_formatting
PS1='$(resetPrompt)\[\e[1;36m\]\u ($HOSTNAME) \[\e[1;32m\]\w \[\e[0m\]$(parse_git_branch)\n\[\e[35m\]\[\e[1m\]\$ \[\e[0m\]'
# export editor
export EDITOR=nvim
3 years ago
# export pip path
export PATH=$PATH:~/.local/bin
# export composer path
export PATH=$PATH:~/.config/composer/vendor/bin
3 years ago
# android studio stuff
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# flutter
export FLUTTER_HOME=$HOME/flutter
export PATH=$PATH:$FLUTTER_HOME/bin
export CHROME_EXECUTABLE=brave
# pnpm
export PNPM_HOME="/home/ayush/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
1 year ago
# composer globals
export PATH=$PATH:~/.config/composer
# nvm
source /usr/share/nvm/init-nvm.sh