1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-11-24 20:41:31 +01:00

Added brethil-mobile.zsh-theme. Minor bugfixes

This commit is contained in:
bretello 2017-07-17 01:28:35 +02:00
parent 0ca03a69ac
commit c1d1b31778
6 changed files with 36 additions and 28 deletions

View File

@ -17,9 +17,10 @@ Copy the dotfiles folder to the location where you want to keep it and then run
Installs oh-my-zsh and sources aliases.sh, functions.sh and colors.sh, as well as installing Installs oh-my-zsh and sources aliases.sh, functions.sh and colors.sh, as well as installing
a a few utilities (see `install.sh`). a a few utilities (see `install.sh`).
### Installed programs ### ### Installed ###
0. oh-my-zsh (zsh config framework, lots of plugins available at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) 0. oh-my-zsh (zsh config framework, lots of plugins available at https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins)
Two zsh themes: brethil and brethil-minimal.
1. byobu (wrapper/config for tmux, a screen multiplexer) 1. byobu (wrapper/config for tmux, a screen multiplexer)
2. grc/ccze (output colorizers, color output of any command). Usage: 2. grc/ccze (output colorizers, color output of any command). Usage:
$ grc programname $ grc programname
@ -28,7 +29,6 @@ a a few utilities (see `install.sh`).
4. rmate remote for Textmate (can be called with `mate`/`rmate`) 4. rmate remote for Textmate (can be called with `mate`/`rmate`)
5. mtr (my traceroute, traceroute+ping network utility) 5. mtr (my traceroute, traceroute+ping network utility)
### Available Functions ### ### Available Functions ###
0. `cheat`, show cheat sheet for commands using cheat.sh (`cheat commandname`) 0. `cheat`, show cheat sheet for commands using cheat.sh (`cheat commandname`)
@ -52,7 +52,7 @@ creates a 4GB RAM disk
### Files/Folders ### ### Files/Folders ###
1. `~/bin`, `~/python`, `~/projects` folders 1. `~/bin`, `~/git`, `~/projects` folders
2. ssh config (`~/.ssh/config`): 2. ssh config (`~/.ssh/config`):
* Create ssh keys if not defined already * Create ssh keys if not defined already
* Keep connections alive by increasing timeout time * Keep connections alive by increasing timeout time
@ -60,14 +60,18 @@ creates a 4GB RAM disk
* (Optional: Compression, this should allow more responsive shells with slow connections, * (Optional: Compression, this should allow more responsive shells with slow connections,
but will slow things down when copying large files. My suggestion is to have compression enabled but will slow things down when copying large files. My suggestion is to have compression enabled
on a by-host basis in `~/.ssh/config`) on a by-host basis in `~/.ssh/config`)
3. brethil.zsh-theme, theme for oh-my-zsh, symlinked in ~/.oh-my-zsh/custom/themes 3. brethil.zsh-theme, brethil-minimal.zsh-themes, themes for oh-my-zsh, symlinked in `$ZSH/custom/themes` ($ZSH=~/.oh-my-zsh)
4. ~/.dotfiles_functions, ~/.dotfiles_aliases are sourced by this dotfiles, allowing for custom functions/aliases 4. ~/.dotfiles_functions, ~/.dotfiles_aliases are sourced by this dotfiles, allowing for custom functions/aliases
5. useful_commands contains a list of useful commands (the first rule of the tautology club...) 5. useful_commands contains a list of useful commands (the first rule of the tautology club...)
### Misc ### ### Misc ###
1. Colored output for: `diff`, `configure`, `make`, `gcc`, `g`, `as`, `gas`, `ld`, `netstat`, `ping`, `traceroute`, `head`, `tail`, `dig`, `mount`, `ps`, `mtr` 1. Colored output (via `grc`) for: `diff`, `configure`, `make`, `gcc`, `g`, `as`, `gas`, `ld`, `netstat`, `ping`, `traceroute`, `head`, `tail`, `dig`, `mount`, `ps`, `mtr`
2. Easy names for ANSI color escapes (Black, Red, Green, Yellow, Blue, Cyan, Purple, White, CLEAR), 2. Easy names for ANSI color escapes (Black, Red, Green, Yellow, Blue, Cyan, Purple, White, CLEAR),
for example: for example:
`echo -e "${Green}This text will be green${CLEAR}"` `echo -e "${Green}This text will be green${CLEAR}"`
will result in green text. Use `$CLEAR` to clear previous escape sequences add B before the variable (check colors.sh) will result in green text. Use `$CLEAR` to clear previous escape sequences add B before the variable (check colors.sh)
name to use **bold** and U to underline (examples: $BRed, $UBlack for bold red and underlined black) name to use **bold** and U to underline (examples: $BRed, $UBlack for bold red and underlined black)
3. Type `esc` twice to add `sudo` before the current command
4. Autoupdate script running every two weeks, autoupdate function: dotfiles_selfupdate (or `git pull` from `$DOTFILES` folder)
5.

View File

@ -57,10 +57,6 @@ alias upcd='. upcd.sh'
## Show the last 10 modified files ## Show the last 10 modified files
alias lsrt="ls -lrt | tail -10" alias lsrt="ls -lrt | tail -10"
#####################
#### New features
#####################
## List open connections, TCP and UDP ## List open connections, TCP and UDP
alias listconnections="lsof -n -i TCP -i UDP" alias listconnections="lsof -n -i TCP -i UDP"
## Stress (run stress &>/dev/null &) ## Stress (run stress &>/dev/null &)
@ -78,9 +74,9 @@ alias ssh1="ssh -o ControlMaster=no"
# Some colorizing options for grc # Some colorizing options for grc
GRC=`which grc` GRC=`which grc`
if [ "$TERM" != dumb ] && [ -n "$GRC" ] if [ "$TERM" != dumb ] && [ -n "$GRC" ]; then
then #alias colourify="$GRC -es --colour=auto"
alias colourify="$GRC -es --colour=auto" alias colourify="$GRC --colour=auto"
alias configure='colourify ./configure' alias configure='colourify ./configure'
alias diff='colourify diff' alias diff='colourify diff'
alias make='colourify make' alias make='colourify make'

View File

@ -0,0 +1,8 @@
ret_status="%(?:%{$fg_bold[green]%}➜%{$reset_color%}:%{$fg[red]%}➜%{$reset_color%})"
user="%(#:[root]:)"
PROMPT='%{$fg[red]%}${user}%{$reset_color%}[:%{$fg[green]%}%c%{$reset_color%}]$(git_prompt_info) ${ret_status} '
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[yellow]%}git:("
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$fg[yellow]%})%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[white]%} %{$fg[red]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[white]%} %{$fg[green]%}√%{$reset_color%}"

View File

@ -2,7 +2,7 @@
env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $DOTFILES/check_for_update.sh env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $DOTFILES/check_for_update.sh
# oh-my-zsh plugins (some of these have to be installed by running install.sh or install_zsh_plugins, found in install.sh) # oh-my-zsh plugins (some of these have to be installed by running install.sh or install_zsh_plugins, found in install.sh)
shared_plugins=(git common-aliases fast-syntax-highlighting zsh-autosuggestions colored-man-pages zsh-navigation-tools zsh_reload cheat) shared_plugins=(git brew common-aliases fast-syntax-highlighting zsh-autosuggestions colored-man-pages zsh-navigation-tools zsh_reload sudo alias-tips)
uname=$(uname -a) uname=$(uname -a)
if [[ $uname == *"Darwin"* ]]; then if [[ $uname == *"Darwin"* ]]; then

View File

@ -157,13 +157,11 @@ function list_functions
## MAC SPECIFIC # ## MAC SPECIFIC #
########################### ###########################
if [[ "$(uname)" == "Darwin" ]]; if [[ "$(uname)" == "Darwin" ]]; then
then
## Create a RAM disk. Default size 1GB. If supplied, first argument defines the RAM disk size in GB ## Create a RAM disk. Default size 1GB. If supplied, first argument defines the RAM disk size in GB
function ramdisk function ramdisk
{ {
if [[ -e $1 ]]; if [[ -e $1 ]]; then
then
sizeingb=$1 sizeingb=$1
else else
sizeingb=1 sizeingb=1
@ -199,16 +197,15 @@ function man2pdf
## Open Man in separate (different-looking) window ## Open Man in separate (different-looking) window
function nman function nman
{ {
if [ $# -eq 1 ] ; if [ $# -eq 1 ] ; then
then open x-man-page://$1 ; open x-man-page://$1 ;
elif [ $# -eq 2 ] ; elif [ $# -eq 2 ] ; then
then open x-man-page://$1/$2 ; open x-man-page://$1/$2 ;
fi fi
} }
fi # end of mac-specific functions fi # end of mac-specific functions
if [[ -f ~/.dotfiles_functions ]]; if [[ -f ~/.dotfiles_functions ]]; then
then
source ~/.dotfiles_functions source ~/.dotfiles_functions
fi fi

View File

@ -59,17 +59,17 @@ function create_ssh_config {
echo "Enter ssh-key comment (leave empty for default: user@host)" echo "Enter ssh-key comment (leave empty for default: user@host)"
read comment read comment
if [[ $comment ]]; if [[ $comment ]]; then
ssh-keygen -t rsa -b 4096 -C $comment ssh-keygen -t rsa -b 4096 -C $comment
else else
ssh-keygen -t rsa -b 4096 ssh-keygen -t rsa -b 4096
done fi
# fix permissions # fix permissions
chmod 0700 "$HOME/.ssh" chmod 0700 "$HOME/.ssh"
fi fi
if [[ -f $ssh_config ]]; then if [[ -f $ssh_config ]]; then
until [[ $modifyssh == "y" ]] or [[ $modifyssh == "n" ]]; do until [[ $modifyssh == "y" || $modifyssh == "n" ]]; do
echo "Do you want to modify the existing ssh config? (New values will be appended) (y/n)" echo "Do you want to modify the existing ssh config? (New values will be appended) (y/n)"
read modifyssh read modifyssh
done done
@ -137,12 +137,13 @@ function brethil_dotfiles_setup {
done done
if [[ $yn == "y" ]]; then if [[ $yn == "y" ]]; then
echo "Launching an interactive shell. Type exit after installing sudo." echo "Launching an interactive shell. Type exit after installing sudo."
/bin/bash # Launch bash
$(which bash)
else else
echo "Quitting." echo "Quitting."
exit 0 exit 0
fi fi
else [[ -f $(which sudo) ]]; then elif [[ -f $(which sudo) ]]; then
sudo="sudo " sudo="sudo "
fi fi
fi fi
@ -205,6 +206,8 @@ function brethil_dotfiles_setup {
# Symlink brethil.zsh-theme # Symlink brethil.zsh-theme
ln -s $DOTFILES/brethil.zsh-theme $HOME/.oh-my-zsh/themes/ ln -s $DOTFILES/brethil.zsh-theme $HOME/.oh-my-zsh/themes/
# Symlink brethil-minimal.zsh-theme
ln -s $DOTFILES/brethil-minimal.zsh-theme $HOME/.oh-my-zsh/themes/
# Set brethil theme # Set brethil theme
if [[ $(uname) == "Darwin" ]]; then # MacOS has a different syntax for sed if [[ $(uname) == "Darwin" ]]; then # MacOS has a different syntax for sed