From 0709694533c652358e213cb77c3e8a670b8aec44 Mon Sep 17 00:00:00 2001 From: Mateja Date: Wed, 25 Nov 2020 23:23:59 +0100 Subject: Better bashrc --- .bash_aliases | 7 ++ .bashrc | 137 +++++++++++++++++++++++++++---- .dir_colors | 257 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 385 insertions(+), 16 deletions(-) create mode 100644 .bash_aliases create mode 100644 .dir_colors diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..892a455 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,7 @@ +alias yts="mpv --ytdl-format='bestvideo[height<=360]+bestaudio'" +alias ytd='youtube-dl -o "%(playlist_index)d-%(title)s.%(ext)s"' +alias ytv3="youtube-dl --write-auto-sub -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' -o '%(playlist_index)d-%(title)s.%(ext)s'" +alias ytv4="youtube-dl --write-auto-sub -f 'bestvideo[height<=480]+bestaudio/best[height<=480]' -o '%(playlist_index)d-%(title)s.%(ext)s'" +alias ytv7="youtube-dl --write-auto-sub -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' -o '%(playlist_index)d-%(title)s.%(ext)s'" +alias ytv10="youtube-dl --write-auto-sub -f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]' -o '%(playlist_index)d-%(title)s.%(ext)s'" +alias yta='youtube-dl --extract-audio -o "%(playlist_index)d-%(title)s.%(ext)s"' diff --git a/.bashrc b/.bashrc index fe78d41..0a1eafa 100644 --- a/.bashrc +++ b/.bashrc @@ -1,23 +1,128 @@ -# -# ~/.bashrc -# -PATH=$PATH:/home/$USER/programs/scripts +# ~/.bashrc: executed by bash(1) for non-login shells. +# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) +# for examples # If not running interactively, don't do anything -[[ $- != *i* ]] && return +case $- in + *i*) ;; + *) return;; +esac -#PS1='\T [\u@\h \W]\$ ' -export PS1="\[$(tput bold)\]\[$(tput setaf 6)\]\T \[$(tput setaf 4)\][\[$(tput setaf 5)\]\u\[$(tput setaf 4)\]@\[$(tput setaf 5)\]\h \[$(tput setaf 2)\]\W\[$(tput setaf 4)\]]\\$ \[$(tput sgr0)\]" -test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors) -alias ls='ls --color=auto' +# don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# If set, the pattern "**" used in a pathname expansion context will +# match all files and zero or more directories and subdirectories. +#shopt -s globstar + +# make less more friendly for non-text input files, see lesspipe(1) +#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color|*-256color|xterm-termite) color_prompt=yes;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +#force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' + #PS1="\[$(tput bold)\]\[$(tput setaf 6)\]\T \[$(tput setaf 4)\][\[$(tput setaf 5)\]\u\[$(tput setaf 4)\]@\[$(tput setaf 5)\]\h \[$(tput setaf 2)\]\W\[$(tput setaf 4)\]]\\$ \[$(tput sgr0)\]" +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' + #PS1='\T [\u@\h \W]\$ ' +fi +unset color_prompt force_color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + #alias dir='dir --color=auto' + #alias vdir='vdir --color=auto' + + #alias grep='grep --color=auto' + #alias fgrep='fgrep --color=auto' + #alias egrep='egrep --color=auto' +fi + +# colored GCC warnings and errors +#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' + +# some more ls aliases +#alias ll='ls -l' +#alias la='ls -A' +#alias l='ls -CF' + +# Alias definitions. +# You may want to put all your additions into a separate file like +# ~/.bash_aliases, instead of adding them here directly. +# See /usr/share/doc/bash-doc/examples in the bash-doc package. + +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if ! shopt -oq posix; then + if [ -f /usr/share/bash-completion/bash_completion ]; then + . /usr/share/bash-completion/bash_completion + elif [ -f /etc/bash_completion ]; then + . /etc/bash_completion + fi +fi + +PATH=$PATH:/home/$USER/stuff/scripts export EDITOR='nvim' export VISUAL='nvim' -alias ytd='youtube-dl -o "%(playlist_index)d-%(title)s.%(ext)s"' -alias ytv10="youtube-dl --write-auto-sub -f 'bestvideo[height<=1080]+bestaudio/best[height<=1080]' -o '%(playlist_index)d-%(title)s.%(ext)s'" -alias ytv7="youtube-dl --write-auto-sub -f 'bestvideo[height<=720]+bestaudio/best[height<=720]' -o '%(playlist_index)d-%(title)s.%(ext)s'" -alias ytv4="youtube-dl --write-auto-sub -f 'bestvideo[height<=480]+bestaudio/best[height<=480]' -o '%(playlist_index)d-%(title)s.%(ext)s'" -alias ytv3="youtube-dl --write-auto-sub -f 'bestvideo[height<=360]+bestaudio/best[height<=360]' -o '%(playlist_index)d-%(title)s.%(ext)s'" -alias yts="mpv --ytdl-format='bestvideo[height<=360]+bestaudio'" -alias yta='youtube-dl --extract-audio -o "%(playlist_index)d-%(title)s.%(ext)s"' +#bind 'set show-all-if-ambiguous on' +#bind 'set show-all-if-unmodified on' +#bind 'set menu-complete-display-prefix on' +#bind 'TAB:menu-complete' + +#"\t": menu-complete +#"\e[Z": menu-complete-backward diff --git a/.dir_colors b/.dir_colors new file mode 100644 index 0000000..bbcc50e --- /dev/null +++ b/.dir_colors @@ -0,0 +1,257 @@ +# Copyright (C) 2017-present Arctic Ice Studio +# Copyright (C) 2017-present Sven Greb + +# Project: Nord dircolors +# Version: 0.2.0 +# Repository: https://github.com/arcticicestudio/nord-dircolors +# License: MIT + +COLOR tty + +TERM alacritty +TERM alacritty-direct +TERM ansi +TERM *color* +TERM con[0-9]*x[0-9]* +TERM cons25 +TERM console +TERM cygwin +TERM dtterm +TERM dvtm +TERM dvtm-256color +TERM Eterm +TERM eterm-color +TERM fbterm +TERM gnome +TERM gnome-256color +TERM hurd +TERM jfbterm +TERM konsole +TERM konsole-256color +TERM kterm +TERM linux +TERM linux-c +TERM mlterm +TERM putty +TERM putty-256color +TERM rxvt* +TERM rxvt-unicode +TERM rxvt-256color +TERM rxvt-unicode256 +TERM screen* +TERM screen-256color +TERM st +TERM st-256color +TERM terminator +TERM tmux* +TERM tmux-256color +TERM vt100 +TERM xterm* +TERM xterm-color +TERM xterm-88color +TERM xterm-256color +TERM xterm-kitty + +#+-----------------+ +#+ Global Defaults + +#+-----------------+ +NORMAL 00 +RESET 0 + +FILE 00 +DIR 01;34 +LINK 36 +MULTIHARDLINK 04;36 + +FIFO 04;01;36 +SOCK 04;33 +DOOR 04;01;36 +BLK 01;33 +CHR 33 + +ORPHAN 31 +MISSING 01;37;41 + +EXEC 01;36 + +SETUID 01;04;37 +SETGID 01;04;37 +CAPABILITY 01;37 + +STICKY_OTHER_WRITABLE 01;37;44 +OTHER_WRITABLE 01;04;34 +STICKY 04;37;44 + +#+-------------------+ +#+ Extension Pattern + +#+-------------------+ +#+--- Archives ---+ +.7z 01;32 +.ace 01;32 +.alz 01;32 +.arc 01;32 +.arj 01;32 +.bz 01;32 +.bz2 01;32 +.cab 01;32 +.cpio 01;32 +.deb 01;32 +.dz 01;32 +.ear 01;32 +.gz 01;32 +.jar 01;32 +.lha 01;32 +.lrz 01;32 +.lz 01;32 +.lz4 01;32 +.lzh 01;32 +.lzma 01;32 +.lzo 01;32 +.rar 01;32 +.rpm 01;32 +.rz 01;32 +.sar 01;32 +.t7z 01;32 +.tar 01;32 +.taz 01;32 +.tbz 01;32 +.tbz2 01;32 +.tgz 01;32 +.tlz 01;32 +.txz 01;32 +.tz 01;32 +.tzo 01;32 +.tzst 01;32 +.war 01;32 +.xz 01;32 +.z 01;32 +.Z 01;32 +.zip 01;32 +.zoo 01;32 +.zst 01;32 + +#+--- Audio ---+ +.aac 32 +.au 32 +.flac 32 +.m4a 32 +.mid 32 +.midi 32 +.mka 32 +.mp3 32 +.mpa 32 +.mpeg 32 +.mpg 32 +.ogg 32 +.opus 32 +.ra 32 +.wav 32 + +#+--- Customs ---+ +.3des 01;35 +.aes 01;35 +.gpg 01;35 +.pgp 01;35 + +#+--- Documents ---+ +.doc 32 +.docx 32 +.dot 32 +.odg 32 +.odp 32 +.ods 32 +.odt 32 +.otg 32 +.otp 32 +.ots 32 +.ott 32 +.pdf 32 +.ppt 32 +.pptx 32 +.xls 32 +.xlsx 32 + +#+--- Executables ---+ +.app 01;36 +.bat 01;36 +.btm 01;36 +.cmd 01;36 +.com 01;36 +.exe 01;36 +.reg 01;36 + +#+--- Ignores ---+ +*~ 02;37 +.bak 02;37 +.BAK 02;37 +.log 02;37 +.log 02;37 +.old 02;37 +.OLD 02;37 +.orig 02;37 +.ORIG 02;37 +.swo 02;37 +.swp 02;37 + +#+--- Images ---+ +.bmp 32 +.cgm 32 +.dl 32 +.dvi 32 +.emf 32 +.eps 32 +.gif 32 +.jpeg 32 +.jpg 32 +.JPG 32 +.mng 32 +.pbm 32 +.pcx 32 +.pgm 32 +.png 32 +.PNG 32 +.ppm 32 +.pps 32 +.ppsx 32 +.ps 32 +.svg 32 +.svgz 32 +.tga 32 +.tif 32 +.tiff 32 +.xbm 32 +.xcf 32 +.xpm 32 +.xwd 32 +.xwd 32 +.yuv 32 + +#+--- Video ---+ +.anx 32 +.asf 32 +.avi 32 +.axv 32 +.flc 32 +.fli 32 +.flv 32 +.gl 32 +.m2v 32 +.m4v 32 +.mkv 32 +.mov 32 +.MOV 32 +.mp4 32 +.mpeg 32 +.mpg 32 +.nuv 32 +.ogm 32 +.ogv 32 +.ogx 32 +.qt 32 +.rm 32 +.rmvb 32 +.swf 32 +.vob 32 +.webm 32 +.wmv 32 + -- cgit v1.2.3