Add files via upload

1. New and improved .bashrc removed duplicate alias in it 
2. new vmrc fixed definition keys 
3. Started using using zsh and now i have a zshrc
4. new ncmpcpp config
5.ls++ config i used it a little worth checking out
6. Added Xcalc setting to Xresources
This commit is contained in:
TekNinja Kevin authored and GitHub committed 2017-10-13 17:35:06 -05:00
1 parent 2469a0b424
commit e38e13705c
7 files changed
+2434 -346

No files matched your search

+15 -1
View File
@@ -43,10 +43,24 @@ Xcursor.size: 16
XLogo*geometry: 150x150
Xclock*geometry: 150x150-0-0
Xclock*background: #121314
XCalc.ti.Command.background: green
XCalc.ti.Command.foreground: Black
XCalc*ti.backgroundPixmap: blue
XCalc*.bevel.background: red
XCalc*.bevel.displayList: foreground black;lines -1,0,0,0,0,-1;lines 3,-4,-4,-4,-4,3
XCalc*ti.Command.shapeStyle: roundedSquare
XCalc*.bevel.screen*background: black
XCalc*.bevel.screen.borderColor: red
XCalc*.bevel.screen*LCD.foreground: white
XCalc*.bevel.screen*INV.vertDistance: 2
XCalc*.bevel.borderColor: blue
!Start of URxvt Code-------------------------------
!URxvt settings
!-------------------
Urxvt.shell: /bin/zsh
URxvt.termName: screen-256color
URxvt.fading: 40
URxvt.tint: #990077
@@ -82,7 +96,7 @@ URxvt*color15: #EEEEEC
!Pearl Library Plugins
!------------------------------------------------
URxvt.perl-ext: clipboard,url-select,keyboard-select,tabbedex
URxvt.perl-ext: clipboard,url-select,tabbedex
URxvt*perl-lib: /home/kevin/.urxvt/
!URxvt*perl-ext-common : default,matcher,clipboard,url-select,url-picker
+679 -64
View File
@@ -11,18 +11,15 @@
#│ \ \____/ │#
#│ \/___/ │#
#└─────────────────────────────────────────────────────────────┘#
##################### BashRC File(v8)############################
# d8888b. .d8b. .d8888. db db d8888b. .o88b. #
# 88 `8D d8' `8b 88' YP 88 88 88 `8D d8P Y8 #
# 88oooY' 88ooo88 `8bo. 88ooo88 88oobY' 8P #
# 88~~~b. 88~~~88 `Y8b. 88~~~88 88`8b 8b #
# 88 8D 88 88 db 8D 88 88 88 `88. Y8b d8 #
# Y8888P' YP YP `8888Y' YP YP 88 YD `Y88P' #
#################################################################
#!/usr/bin/env bash
#!/bin/sh
#################################################################
# ██████ █████ ███████ ██ ██
# ██ ██ ██ ██ ██ ██ ██
# ██████ ███████ ███████ ███████
# ██ ██ ██ ██ ██ ██ ██
# ██████ ██ ██ ███████ ██ ██
#################################################################
#!/usr/bin/env Bash #
#!/bin/sh #
#################################################################
#-----Exports{{{
#################################################################
@@ -44,9 +41,15 @@ export OPENER="xdg-open"
#-----------------------------Paths-----------------------------#
export PATH="$PATH:/home/kevin/scripts:/home/kevin/bin:/sbin:/usr:/usr/sbin"
export PATH="$PATH:/home/kevin/scripts:/home/kevin/bin:/sbin:/usr:/usr/sbin:/home/kevin/scripts/Fun"
export GOPATH="home/kevin/.go"
export PATH="$PATH:$GOPATH/bin"
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
#}}}
#-----Command History Setup{{{
#---------------------------------------------------------------#
@@ -99,6 +102,8 @@ fi
# Lock and Load a custom theme file
#location '.bash-it/themes/'
############Selected Theme###############
# Run twolfson/sexy-bash-prompt
. ~/.bash_prompt
export BASH_IT_THEME='powerline-multiline'
#export BASH_IT_THEME='powerline-plain'
#export BASH_IT_THEME='powerline'
@@ -214,8 +219,11 @@ cfg-ranger() { $EDITOR ~/.config/ranger/rc.conf ;}
cfg-ranger-rifle() { $EDITOR ~/.config/ranger/rifle.conf ;}
cfg-ranger-commands() { $EDITOR ~/.config/ranger/commands.py ;}
cfg-fstab() { sudo $EDITOR /etc/fstab ;}
cfg-hosts() { sudo $EDITOR /etc/hosts ;}
cfg-profile() { $EDITOR ~/.profile ;}
cfg-xresources() { $EDITOR ~/.Xresources ;}
cfg-mc() { $EDITOR ~/.config/mc/ini ;}
cfg-sudoers() { sudo $EDITOR /etc/sudoers ;}
cfg-ncmpcpp() { $EDITOR ~/.ncmpcpp/config ;}
cfg-samba() { sudo $EDITOR /etc/samba/smb.config ;}
#---------------------------------------#
#----------Reload Config files----------#
@@ -248,8 +256,8 @@ lsl() {
ls -hl --color=yes "$@" \
| awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'
}
#----------------------------------------#
#-------------CD Improvments-------------#
#-------------------------------------------------------------#
#----------------------------CD Improvments-------------------#
[ -n "$RANGER_LEVEL" ] && PS1="$PS1"'(in ranger) '
#ranger cd
function rcd {
@@ -276,8 +284,8 @@ mkdircd() { mkdir -p -v $1; cd $1 ;} # create folder then cd into it
nohup-command() { nohup "$@" >/dev/null 2>&1& } # background a process w/o error msg
open() { xdg-open "$@" > /dev/null 2>&1 ;} # open with default GUI program
#-----------------------------------------#
#------------Usful infer
#-------------------------------------------------------------#
#-------------------------------Usful info--------------------#
upinfo()
{
echo -ne "${green}uptime is ${green} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
@@ -304,7 +312,7 @@ m-ip()
# echo External IP: $(curl -s https://ifconfig.co/)
# echo External IP: $(curl -s http://pasteip.me/api/cli/ && echo)
echo external ip: $(curl -s http://ipecho.net/plain)
echo "---------------------------------------------------"
echo "***************************************************"
}
#----------------------Mounting Iso Files------------------#
mount-discimage() {
@@ -331,25 +339,40 @@ unmount-discimage() {
return 1
fi
}
#------------------------------------------------------------#
#-----------------------other--------------------------------#
#-------------------------------------------------------------#
#---------------------------other-----------------------------#
# http://blog.metamatt.com/blog/2013/01/09/previewing-markdown-files-from-the-terminal/
mdless(){ pandoc -s -f markdown -t man "$*" | groff -T utf8 -man | less ;}
#-------------------------------------------------------------#
alias vless="/usr/share/vim/vim74/macros/less.sh" # vim as a pager
open() { xdg-open "$@" > /dev/null 2>&1 ;} # open with program
#-------------------------------------------------------------#
#Remove White Spaces for file Names
detox-unix() {
detox() {
myArray=( "$@" )
for arg in "${myArray[@]}"; do
filter_name=$(echo "$arg" | sed 's/%20/ /g' | sed 's/ /_/g' | tr '[:upper:]' '[:lower:]')
mv -- "$arg" "$filter_name"
done
}
#-------------------------------------------------------------#
#backup file maker
cpbak() { cp $1{,.bak} ;} # create backup copy
#Show
fp() { stat --format '%a %n' "$@" ;}
# display mime of file application/zip, application/x-tar
ft() { file --mime-type -b "$@" ;}
#-------------------------------------------------------------#
#}}}
#-----Alias List{{{
##############################
#----Alias-------------------#
##############################
#_____________________________________________________________#
# alias sudo='sudo -i'
# alias sudo='sudo ' # make aliases work with sudo
#_____________________________________________________________#
#---------------------don't have to type cd to go back--------#
alias ..="cd .."
alias ...="cd ../.."
@@ -361,13 +384,23 @@ alias ......="cd ../../../../.."
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
# Always use color output for `ls`
alias ls="command ls ${colorflag}"
# List all files colorized in long format
alias l="ls -lF ${colorflag}"
export colorflag='color=always'
alias ls='ls --color=auto'
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# List all files colorized in long format, including dot files
alias la="ls -laF ${colorflag}"
# List only directories
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# Ls Files Only
alias lsf='ls --color=always -p | grep -v '/$''
# sort by extension
alias lx='ls -lXB'
# sort by size
@@ -381,46 +414,42 @@ alias lr='ls -l | less'
# sort by date
alias lt='ls -ltr'
# ls + more
alias lm='ls -al |more'
alias lm='ls -al |most'
#list Files and use pick to select them
alias lsp='ls | pick | xargs xdg-open'
#----------------------------------------------------------#
#--------------------- Shortcuts---------------------------#
#------------------------------------------------------------#
#--------------------- Shortcuts-----------------------------#
alias docs="cd ~/Documents"/
alias dl="cd ~/Downloads"
alias bk="cd /media/Shared_Docs/Books"
alias dt="cd ~/Desktop"
alias p="cd ~/projects"
alias g="git"
alias h="history"
alias j="jobs"
#---------------------------------------------------------#
#----------------- Language aliases-----------------------#
#------------------------------------------------------------#
#--------------------Language aliases------------------------#
alias rb='ruby'
alias py='python'
alias ipy='ipython'
#---------------------------------------------------------#
#---------------- Directory Manepulation------------------#
alias jj="java jar-"
#------------------------------------------------------------#
#---------------- Directory Manepulation---------------------#
alias md='mkdir -p'
alias rd='rmdir'
#---------------------------------------------------------#
#Vim Like Exit
#------------------------------------------------------------#
#----------------------Vim Like Exit-------------------------#
alias :q='exit'
alias q="exit"
#--------------------Safer Commands------------------------#
#------------------------------------------------------------#
#--------------------Safer Commands--------------------------#
alias rm='rm -i -v'
alias cp='cp -i -v'
alias mv='mv -i -v'
alias du='du -kh'
alias df='df -kTh'lias mkdir="mkdir -p"
#----------------------------------------------------------#
#---------------------programs-----------------------------#
#-------------------------------------------------------------#
#------------------------programs-----------------------------#
alias mail="Alphine"
alias scld="calcurse"
alias r="ranger"
@@ -434,7 +463,7 @@ alias news='newsbeuter'
alias v="vim"
alias bc='bc -q -l' # dont show opening msg, use math library
alias cal='cal -3' # show 3 months
alias df='df -hT --total' # human readable, print filetype, and total
alias df='df -hT --total' # human readable, print filetype, and total
alias du='du -d1 -h' # max depth, human readable
alias emacs='emacs -nw' # cli mode
alias feh='feh --auto-zoom --scale-down -g 1360x768 -B white'
@@ -456,50 +485,61 @@ alias Copy='cp'
alias pmix=" pa-mixer-mk2.py"
alias neofetch='neofetch --backend w3m --source ~/hacker.jpg'
alias ?="man"
#--------------controll audio levels---------#
alias wifi='wicd-curses'
#-------------------------------------------------------------#
#----------------controll audio levels------------------------#
alias mute="pamixer -m"
alias vd="pamixer -d 10"
alias p="mocp -G &> /dev/null"
alias next="mocp -f &> /dev/null"
alias prev="mocp -r &> /dev/null"
alias vu="pamixer -i 10"
#---------------------------------------------#
#---------------Tmux Commands-----------------#
#-------------------------------------------------------------#
#-----------------------Tmux Commands-------------------------#
alias kl='tmux kill-window'
alias nw='tmux new-window'
#---------------------------------------------#
#----------------net commands-----------------#
#-------------------------------------------------------------#
#-------------------------net commands------------------------#
alias ports='netstat -nape --inet'
alias opennet='lsof -i'
alias ping='ping -c 4'
#---------------------------------------------#
#----------------Disk Commands---------------#
#-------------------------------------------------------------#
#-----------------------Disk Commands-------------------------#
alias localrepo='sudo sh ~/scripts/mount_IS0_repo mount'
alias mountsd='sh ~/scripts/mount-sdcard'
alias fdisk="sudo fdisk -l"
#--------------------------------------------#
#------------alias to fix dyslixia-----------#
alias fdisk="sudo fdisk -l"
#-------------------------------------------------------------#
#---------------------alias to fix dyslixia-------------------#
alias root='sudo'
alias s='sudo'
#--------------------------------------------#
alias sodu='sudo'
#-------------------------------------------------------------#
#------------------------Just for fun-------------------------#
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
#------------------Just for fun--------------#
alias 99bottles='x="bottles of beer";y="on the wall";for b in {99..1};do echo "$b $x $y, $b $x. Take one down pass it around, $(($b-1)) $x $y"; sleep 3;done'
alias matrix='echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r "; else v+="\e[2m $r "; fi; else v+=" "; fi; done; echo -e "$v"; v=""; done'
alias matrix2='echo -e "\e[31m"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="\e[1m $r";else v="\e[2m $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;'
alias matrix3='COL=$(( $(tput cols) / 2 )); clear; tput setaf 2; while :; do tput cup $((RANDOM%COL)) $((RANDOM%COL)); printf "%$((RANDOM%COL))s" $((RANDOM%2)); done'
alias matrix4='echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done'
alias matrix5='tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=lcase,unblock | GREP_COLOR="1;32" grep --color "[^ ]"'
alias colorrainbow='yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done'
alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && echo Die || echo Live' # command line Russian roulette
alias einsteiny='A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";' # numbers guessing game
alias etchasketch='c=12322123;x=20;y=20;while read -sn1 p;do k=${c:(p-1)*2:2};let x+=$((k/10-2));let y+=$((k%10-2));echo -en \\033[$y\;"$x"HX;done' # use the 1 2 3 and 4 keys to move the cursor around the screen (It's an etch-a-sketch for your terminal!)
alias starwars="telnet towel.blinkenlights.nl"
#-------------------------------------------#
#-------------------------------------------------------------#
#}}}
#-----Turbo-Less{{{
#---------------------------------------------------
@@ -588,6 +628,581 @@ bind "set mark-symlinked-directories on"
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
#
#}}}
#-------- Image Resizer (32|96|128|480|600|768|720|960|1080) {{{
#------------------------------------------------------
# Resizing Pictures to different resolutions
image-resize-32x32() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 32x32 "${arg%.*}"_32x32_resized."${arg##*.}"
done
}
image-resize-96x96() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 96x96 "${arg%.*}"_96x96_resized."${arg##*.}"
done
}
image-resize-128x128() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 128x128 "${arg%.*}"_128x128_resized."${arg##*.}"
done
}
image-resize-640x480() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 640x480 "${arg%.*}"_640x480_resized."${arg##*.}"
done
}
image-resize-800x600() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 800x600 "${arg%.*}"_800x600_resized."${arg##*.}"
done
}
image-resize-1024x768() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 1024x768 "${arg%.*}"_1024x768_resized."${arg##*.}"
done
}
image-resize-1280x720() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 1280x720 "${arg%.*}"_1280x720_resized."${arg##*.}"
done
}
image-resize-1280x960() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 1280x960 "${arg%.*}"_1280x960_resized."${arg##*.}"
done
}
image-resize-1920x1080() {
if [ $# -lt 1 ]
then
echo -e "resize pictures to another resolution"
echo -e "\nUsage:\n$0 <picture>"
echo -e "\nExample:\n$0 pic1.png pic2.png pic3.png"
echo -e "$0 *.jpg"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
convert "$arg" -resize 1920x1080 "${arg%.*}"_1920x1080_resized."${arg##*.}"
done
}
# }}}
#-------- Format USB Stick/HDD/SDCards {{{
#------------------------------------------------------
# DEMO: https://www.youtube.com/watch?v=7txO1cdNJsQ
# DESC: format USB Stick/Hard Drive; It will create a single partition that fills the whole drive space
format2usb-ext2() {
if [ $# -lt 2 ]; then
echo -e "format and create a partition that fills up the whole device"
echo -e "\nUsage: $0 <label> <device>"
echo -e "Example: $0 MY_USB sdx"
return 1
fi
# check if the device is mounted
mount_status=$(mount | grep /dev/"$2" | wc -l)
if [ "$mount_status" -ne 0 ]
then
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep "$2"
echo -e "${Red}/dev/$2 is mounted. You have to unmount /dev/$2 ${Color_Off}"
return 1
fi
# list out all drives
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep --color -E "$2|$"
echo -n -e "${Red}WARNING: You are about to FORMAT a drive. Do you want to continue? [y/n] ${Color_Off}"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "... You chose to continue"
else
return 1
fi
# delete existing partition then create new linux partition
echo -e "d\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\no\nn\np\n1\n\n\nw" | sudo fdisk /dev/"$2"
# delete partiton x8 using d\n\n
# d delete a partition
# default, partition
# o create a new empty DOS partition table
# n add a new partition
# p print the partition table
# 1 partition number 1
# default, start immediately after preceding partition
# default, extend partition to end of disk
# w write table to disk and exit
# format device
echo -e "y\n" | sudo mkfs.ext2 -L "$1" /dev/"$2"1
# set permission
mkdir -p /tmp/testmount
sudo mount /dev/"$2"1 /tmp/testmount
sudo chmod -R 777 /tmp/testmount
sudo umount /tmp/testmount
rmdir /tmp/testmount
}
format2usb-ext3() {
if [ $# -lt 2 ]; then
echo -e "format and create a partition that fills up the whole device"
echo -e "\nUsage: $0 <label> <device>"
echo -e "Example: $0 MY_USB sdx"
return 1
fi
# check if the device is mounted
mount_status=$(mount | grep /dev/"$2" | wc -l)
if [ "$mount_status" -ne 0 ]
then
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep "$2"
echo -e "${Red}/dev/$2 is mounted. You have to unmount /dev/$2 ${Color_Off}"
return 1
fi
# list out all drives
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep --color -E "$2|$"
echo -n -e "${Red}WARNING: You are about to FORMAT a drive. Do you want to continue? [y/n] ${Color_Off}"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "... You chose to continue"
else
return 1
fi
# delete existing partition then create new linux partition
echo -e "d\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\no\nn\np\n1\n\n\nw" | sudo fdisk /dev/"$2"
# delete partiton x8 using d\n\n
# d delete a partition
# default, partition
# o create a new empty DOS partition table
# n add a new partition
# p print the partition table
# 1 partition number 1
# default, start immediately after preceding partition
# default, extend partition to end of disk
# w write table to disk and exit
# format device
echo -e "y\n" | sudo mkfs.ext3 -L "$1" /dev/"$2"1
# set permission
mkdir -p /tmp/testmount
sudo mount /dev/"$2"1 /tmp/testmount
sudo chmod -R 777 /tmp/testmount
sudo umount /tmp/testmount
rmdir /tmp/testmount
}
format2usb-ext4() {
if [ $# -lt 2 ]; then
echo -e "format and create a partition that fills up the whole device"
echo -e "\nUsage: $0 <label> <device>"
echo -e "Example: $0 MY_USB sdx"
return 1
fi
# check if the device is mounted
mount_status=$(mount | grep /dev/"$2" | wc -l)
if [ "$mount_status" -ne 0 ]
then
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep "$2"
echo -e "${Red}/dev/$2 is mounted. You have to unmount /dev/$2 ${Color_Off}"
return 1
fi
# list out all drives
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep --color -E "$2|$"
echo -n -e "${Red}WARNING: You are about to FORMAT a drive. Do you want to continue? [y/n] ${Color_Off}"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "... You chose to continue"
else
return 1
fi
# delete existing partition then create new linux partition
echo -e "d\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\no\nn\np\n1\n\n\nw" | sudo fdisk /dev/"$2"
# delete partiton x8 using d\n\n
# d delete a partition
# default, partition
# o create a new empty DOS partition table
# n add a new partition
# p print the partition table
# 1 partition number 1
# default, start immediately after preceding partition
# default, extend partition to end of disk
# w write table to disk and exit
# format device
echo -e "y\n" | sudo mkfs.ext4 -L "$1" /dev/"$2"1
# set permission
mkdir -p /tmp/testmount
sudo mount /dev/"$2"1 /tmp/testmount
sudo chmod -R 777 /tmp/testmount
sudo umount /tmp/testmount
rmdir /tmp/testmount
}
format2usb-fat32() {
if [ $# -lt 2 ]; then
echo -e "format and create a partition that fills up the whole device"
echo -e "\nUsage: $0 <label> <device>"
echo -e "Example: $0 MY_USB sdx"
return 1
fi
# check if the device is mounted
mount_status=$(mount | grep /dev/"$2" | wc -l)
if [ "$mount_status" -ne 0 ]
then
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep "$2"
echo -e "${Red}/dev/$2 is mounted. You have to unmount /dev/$2 ${Color_Off}"
return 1
fi
# list out all drives
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep --color -E "$2|$"
echo -n -e "${Red}WARNING: You are about to FORMAT a drive. Do you want to continue? [y/n] ${Color_Off}"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "... You chose to continue"
else
return 1
fi
# delete existing partition then create new linux partition
echo -e "d\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\no\nn\np\n1\n\n\nt\nb\nw" | sudo fdisk /dev/"$2"
# delete partiton x8 using d\n\n
# d delete a partition
# default, partition
# o create a new empty DOS partition table
# n add a new partition
# p print the partition table
# 1 partition number 1
# default, start immediately after preceding partition
# default, extend partition to end of disk
# t change a partition type (L to list all types)
# b W95 FAT32
# w write table to disk and exit
# fat32 likes the labels to be in uppercase
label_name=$(echo "$1" | tr '[:lower:]' '[:upper:]')
# format device
sudo mkfs.fat -F 32 -n "$label_name" -I /dev/"$2"1
# set permission
mkdir -p /tmp/testmount
sudo mount /dev/"$2"1 /tmp/testmount
sudo chmod -R 777 /tmp/testmount
sudo umount /tmp/testmount
rmdir /tmp/testmount
}
format2usb-ntfs() {
if [ $# -lt 2 ]; then
echo -e "format and create a partition that fills up the whole device"
echo -e "\nUsage: $0 <label> <device>"
echo -e "Example: $0 MY_USB sdx"
return 1
fi
# check if the device is mounted
mount_status=$(mount | grep /dev/"$2" | wc -l)
if [ "$mount_status" -ne 0 ]
then
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep "$2"
echo -e "${Red}/dev/$2 is mounted. You have to unmount /dev/$2 ${Color_Off}"
return 1
fi
# list out all drives
lsblk -o "NAME,SIZE,FSTYPE,TYPE,LABEL,MOUNTPOINT,UUID" | grep --color -E "$2|$"
echo -n -e "${Red}WARNING: You are about to FORMAT a drive. Do you want to continue? [y/n] ${Color_Off}"
read REPLY
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "... You chose to continue"
else
return 1
fi
# delete existing partition then create new linux partition
echo -e "d\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\nd\n\no\nn\np\n1\n\n\nt\n7\nw" | sudo fdisk /dev/"$2"
# delete partiton x8 using d\n\n
# d delete a partition
# default, partition
# o create a new empty DOS partition table
# n add a new partition
# p print the partition table
# 1 partition number 1
# default, start immediately after preceding partition
# default, extend partition to end of disk
# t change a partition type (L to list all types)
# 7 HPFS/NTFS/exFAT
# w write table to disk and exit
# format device
sudo mkfs.ntfs -f -L "$1" /dev/"$2"1
# set permission
mkdir -p /tmp/testmount
sudo mount /dev/"$2"1 /tmp/testmount
sudo chmod -R 777 /tmp/testmount
sudo umount /tmp/testmount
rmdir /tmp/testmount
}
# }}}
#-------- Mount Disc Images (ISO|NRG|BIN|MDF|IMG) {{{
#------------------------------------------------------
mount-discimage() {
if [ $# -lt 1 ]
then
echo -e "mount ISO filesystem images (iso,nrg,bin,mdf,img)"
echo -e "\nUsage:\n$0 <disc_image>"
echo -e "\nExample:\n$0 disc_image.iso"
echo -e "$0 disc_image.iso disc_image2.bin disc_image3.mdf"
echo -e "$0 *.iso"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
fuseiso -n -p "$arg" "/tmp/$arg"
done
# if mount was sucessful then cd and ls the mountpoint
if [ $? -eq 0 ]; then
cd "/tmp/$1" && ls
else
return 1
fi
}
unmount-discimage() {
if [ $# -lt 1 ]
then
echo -e "unmount ISO filesystem images (iso,nrg,bin,mdf,img)"
echo -e "\nUsage:\n$0 <mount_point|disc_image>"
echo -e "\nExample:\n$0 disc_image.iso"
echo -e "$0 disc_image.iso disc_image2.bin"
echo -e "$0 mount_point1 mount_point2"
echo -e "cd /tmp && $0 mount_point"
echo -e "cd /tmp && $0 *.iso"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
fusermount -u "$arg"
done
}
mount-img() {
if [ $# -lt 1 ]; then
echo -e "mount image to access files"
echo -e "\nUsage: $0 <img_file>"
echo -e "\nExample: $0 foo.img"
return 1
fi
mkdir -p "/tmp/$1"
sudo mount "$PWD/$1" "/tmp/$1"
# if mount was sucessful then cd and ls the mountpoint
if [ $? -eq 0 ]; then
cd "/tmp/$1" && ls
else
return 1
fi
}
unmount-img() {
if [ $# -lt 1 ]; then
echo -e "unmount image"
echo -e "\nUsage: $0 <img_file>"
echo -e "\nExample: $0 foo.img"
return 1
fi
sudo umount "/tmp/$1"
rmdir "/tmp/$1"
}
# }}}
#-------- Mount Archive (ISO|ZIP|RAR|TAR) {{{
#------------------------------------------------------
# http://ubuntuforums.org/showthread.php?t=1207096
mount-archive() {
if [ $# -lt 1 ]
then
echo -e "mount archive files (iso|zip|rar|tar...etc)"
echo -e "\nUsage:\n$0 <archive>"
echo -e "\nExample:\n$0 file.zip"
echo -e "$0 *.zip"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
gvfs-mount "archive://$( ( echo -n 'file://' ; readlink -f $arg ; ) | perl -MURI::Escape -lne 'print uri_escape($_)')"
done
# if mount was sucessful then cd into gvfs dir and ls the mountpoint
if [ $? -eq 0 ]; then
cd "/run/user/$(id -u)/gvfs" && ls
else
return 1
fi
}
unmount-archive() {
if [ $# -lt 1 ]
then
echo -e "unmount archive files (iso|zip|rar|tar)"
echo -e "\nUsage:\n$0 <mount_point>"
echo -e "\nExample:\n$0 archive:host=file%253Afoo%bar.zip"
echo -e "cd /run/user/${UID}/gvfs/ && $0 archive:host=file%253Afoo%bar.zip"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
gvfs-mount -u "/run/user/$(id -u)/gvfs/$arg"
done
}
# }}}
#-------- Keybinding {{{
#------------------------------------------------------
# movement and autocompeletion at the prompt
bind 'set completion-ignore-case on' # case insensitive on tab completion
bind '"\t":menu-complete' # Tab: Cycle thru completion
bind '"\e[1;3D":backward-kill-word' # Alt + arrowleft : delete word backward
bind '"\e\e[D":backward-kill-word' # Alt + arrowleft : delete word backward
bind '"\e[1;3A":kill-whole-line' # Alt + arrowup : delete whole line
bind '"\e[1;3B":undo' # Alt + arrowdown : undo
bind '"\e[1;5C":forward-word' # Ctrl + arrowright : Jump a word forward
bind '"\e[1;5D":backward-word' # Ctrl + arrowleft : Jump a word backward
bind '"\e[Z":menu-complete-backward' # Shift+Tab: Cycle backwards
bind '"\e[A": history-search-backward' # ArrowUp: history completion backwards
bind '"\e[B": history-search-forward' # ArrowDown: history completion forward
#}}}
#################################################################
# add this configuration to ~/.bashrc
export HH_CONFIG=hicolor # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # mem/file sync
# if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh -- \C-j"'; fi
+212
View File
@@ -0,0 +1,212 @@
# ls++ configuration file
# location: $XDG_CONFIG_HOME/ls++/ls++.conf
use vars qw(@ignores
@d
@c
$colorscheme
%ls_colors
$symlink_delim
$symlink_color
);
$colorscheme = 'trapd00r';
@ignores = (
'\.un~$',
'\.sw[o-z]$',
);
@d = qw(▕ - │ ▏);
#$d[0] = '├';
#$d[1] = ' ';
#$d[2] = '▕▏';
#$d[3] = '┤';
$symlink_delim = '=>';
$symlink_color = 1;
@c = (0 .. 16);
#);
# extended colors
if($colorscheme eq '') {
$c[0] = 208;
$c[1] = 197;
$c[2] = 190;
$c[3] = 196;
$c[4] = 242;
$c[5] = 209;
$c[6] = 185;
$c[7] = 215;
$c[8] = 032;
$c[9] = 061;
$c[10] = 142;
$c[11] = 197;
$c[12] = 106;
$c[13] = 060;
$c[14] = 236;
$c[15] = 215;
}
elsif($colorscheme eq 'greyscale') {
$c[0] = 252;
$c[1] = 251;
$c[2] = 250;
$c[3] = 249;
$c[4] = 239;
$c[5] = 244;
$c[6] = 240;
$c[7] = 242;
$c[8] = 244;
$c[9] = 244;
$c[10] = 243;
$c[11] = 241;
$c[12] = 240;
$c[13] = 239;
$c[14] = 236;
$c[15] = 242;
}
elsif($colorscheme eq 'early') {
$c[0] = 233;
$c[1] = 245;
$c[2] = 250;
$c[3] = 201;
$c[4] = 239;
$c[5] = 209;
$c[6] = 185;
$c[7] = 216;
$c[8] = 244;
$c[9] = 254;
$c[10] = 243;
$c[11] = 241;
$c[12] = 240;
$c[13] = 239;
$c[14] = 237;
$c[15] = 220;
}
elsif($colorscheme eq 'trapd00r') {
$c[0] = 237;
$c[1] = 131;
$c[2] = 107; # K
$c[3] = 075; # G, sec
$c[4] = 240; # day
$c[5] = 209; # +x
$c[6] = 185; # +r
$c[7] = 216; # +w, M
$c[8] = 220;
$c[9] = 208; # hour
$c[10] = 243;
$c[11] = 161;
$c[12] = 240;
$c[13] = 025;
$c[14] = 248; # Bytes, month
$c[15] = 196; # Min
}
%ls_colors = (
'README$' => $c[8],
'Makefile$' => $c[15],
'(=:.+)?\..*rc' => $c[3],
);
=pod
=head1 NAME
ls++.conf - ls++ configuration file
=head1 DESCRIPTION
ls++.conf is the configuration file for ls++(1). ls++ first searches for it at
~/.config/ls++/ls++.conf then at ~/.ls++.conf then at ./ls++.conf and finally at
/etc/ls++.conf.
Lines beginning with a '#' character are comments. All other non-empty lines
are live Perl code. This gives a lot of power to the end user, but it also
allows for fuckups.
Please don't fuckup.
=head1 ENVIRONMENT
=over 8
=item @d
Array containting the characters to use for delimiting the columns.
=item @c
Array containing the colors to be used.
=item $colorscheme
Colorscheme to be used.
=item %ls_colors
A hash where its keys are patterns (possibly valid regular expressions) to be
matched against the files. The values should be attributes or colors which will
be added to the output.
This does the same thing as LS_COLORS, except that you can match against the
full filname, and not only the extension. Using LS_COLORS, you could never match
README or Makefile for example. Those two are matched by default.
The special value IGNORE will ignore all files matching the key pattern.
=back
=head1 COLORS
The default colortable left here for reference (ANSI colors).
0 NULL black
1 NULL bright black
2 K red
3 G, sec bright red
4 day green
5 +x bright green
6 +r yellow
7 +w, M bright yellow
8 other blue
9 hour bright blue
10 magenta
11 +s bright magenta
12 cyan
13 link bright cyan
14 B, month, delim white
15
16 reset
17 bold
=head1 AUTHOR
Magnus Woldrich
CPAN ID: WOLDRICH
magnus@trapd00r.se
http://japh.se
=head1 REPORTING BUGS
Report bugs and/or feature requests on L<https://github.com/trapd00r/ls--/issues>
or to L<magnus@trapd00r.se>
=head1 COPYRIGHT
Copyright (C) 2010 Magnus Woldrich. All right reserved.
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
=cut
1;
# vim: set ft=perl ts=2 expandtab:
+99 -164
View File
@@ -29,36 +29,39 @@
"justify
"grammarous
"supertab
"
"-----General Settings{{{
"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
"dwm
"syntastic
"#-----General Settings{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
runtime! debian.vim " Set Vim to work with Debian
colorscheme dw_purple " My favorite Color Scheme
syntax on " redundent but works
colorscheme satori " My favorite Color Scheme.
hi Normal ctermbg=none " Trasparent Back Ground
hi NotText ctermbg=none " Trasparent Back Ground
hi LineNr ctermbg=none " Transparent Back Ground
syntax on " Redundent but works.
filetype plugin indent on " File type plug ins and autoendent
execute pathogen#infect()
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set encoding=utf-8 " Is there any other encoding really?
set history=1000 " Remeamber
set nocompatible " Make Vim more useful
set noswapfile " Desable The Swap File
set clipboard=unnamed " Use the OS clipboard by default (on versions compiled with `+clipboard`)
set wildmenu " Enhance command-line completion
set noswapfile " Desable swap file
set t_Co=256 " 256 color terminal
set clipboard=unnamed " Use the OS clipboard by default
set wildmenu " Enhance command-line completion.
set t_Co=256 " 256 color terminal.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
set ignorecase " Do case insensitive matching
set smartcase " Do smart case matching
set incsearch " Incremental search
set autoread " Automatically read for syntax
set ignorecase " Do case insensitive matching.
set smartcase " Do smart case matching.
set incsearch " Incremental search.
set autoread " Automatically read for syntax.
set autowrite " Automatically save before commands like :next and :make
set mouse=a " Enable mouse usage (all modes)
set mouse=a " Enable mouse usage (all modes).
set number " Enables Line Numbers
set numberwidth=5 " number of culumns for line numbers
set autoindent " Who does not want auto endent
set ruler " show curser position
set magic "for regular expersions turn magic on
set numberwidth=5 " Number of culumns for line numbers.
set smartindent " Set Smartindent
set autoindent " Who does not want auto endent.
set ruler " show curser position.
set magic " for regular expersions turn magic on
set esckeys " Allow cursor keys in insert mode
set backspace=indent,eol,start " Allow backspace in insert mode
set modelines=4 " Respect modeline in files
@@ -68,130 +71,100 @@ set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_ "Markers
set list " Show “invisible” characters
set nostartofline " Dont go to start of line when moving around
set showmode " Show the current mode
set title " Show the filename in the window titlebar
set title " Show the ilename in the window titlebar
set scrolloff=3 " Start scrolling three lines before the horizontal window border
set laststatus=2 " Status line setup
set noswapfile " write .swp files
set foldenable " Vse Foldable Text
set ls=2 " ls
set laststatus=2 " Status line on
set cmdheight=5 " Lots of space
set visualbell " No sound
set smartindent " Set Smartindent
set confirm " Set Confermation
set backup " Make Backup
set nostartofline " Do not goto start of line
set matchpairs+=<:> " use % to jump between pairs
set hidden "
set foldenable " Turn Folding on
set foldmethod=marker " Use {{{}}} To mark Folding
set omnifunc=syntaxcomplete " Complete
set fillchars=vert:│ " that's a vertical box-drawing character useful for split views ala :vsplit
set incsearch " do highlight as you type
set hlsearch " do not highlight searched for phrases
set showmatch " show matching brackets
set matchtime=3 " blinking time for matching brackets
set timeoutlen=500 " time waiting for next char in command"
set grepprg=grep\ -nH\ $*
set smarttab
set shiftwidth=4
set tabstop=4
set ai "Auto indent"
set si "smart indent"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Turn persistent undo on
" means that you can undo even when you close a buffer/VIM
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "Undo File
set backupdir=$HOME/.vim/backup " but not when they clog .
set directory=$HOME/.vim/swap " Same for swap files
set timeoutlen=1000 " time waiting for next char in command"
set grepprg=grep\ -nH\ $*
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Undo File
try
set undodir=~/.vim_runtime/temp_dirs/undodir
set undofile
catch
endtry
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
"#-----keymap{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Fast Save
nmap <leader>w :w!<cr>
" Use space to inter insert mode
" Going all the way to the end/Start of Line
noremap H ^
noremap L $
" Improve up/down movement on wrapped lines
nnoremap j gj
nnoremap k gk
" Move Form window to window
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" Force Save
nmap :w<cr> :w!<cr>
" Use Brake to to exit insert mode
map <C-z> <Esc>
"Cut n past
vmap <C-C> y: call system("xclip -i -selection clipboard", getreg("\""))<CR>
nmap <C-v> :call setreg("\"",system("xclip -o -selection clipboard"))<CR>p
imap <C-v> <Esc><C-v>
"#}}}
"#-----Plug Ins***{{{
""""""""""""""""""""""""''''''''''''''''''''''''''''''''''''''''''''''''"
"Nerd Tree
map <leader>n :NERDTreeToggle<cr>
map <leader>nb :NERDTreeFromBookmark<Space>
map <leader>nf :NERDTreeFind<cr
"Nerd Commenter
nmap <Leader>z <Plug>NERDCommenterToggle
vmap <Leader>z <Plug>NERDCommenterToggle
" Clear Search Matches
nmap cm :call clearmatches()
" Change case
"inoremap <C-u> <esc>mzgUiw`za
"faster Commands
nmap ; :
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
" Close the current buffer
map <leader>bd :Bclose<cr>:tabclose<cr>gT
" Close all the buffers
map <leader>ba :bufdo bd<cr>
map <leader>l :bnext<cr>
map <leader>h :bprevious<cr>
" Let 'tl' toggle between this and the last accessed tab
let g:lasttab = 1
let g:NERDTreeWinPos = "left"
let NERDTreeShowHidden=1
let NERDTreeIgnore = ['\.pyc$', '__pycache__']
let g:NERDTreeWinSize=35
""""""""""""""""""""""synastics""""""""""""""""""""""""""""""
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_enable_signs = 1
let g:syntastic_aggregate_errors = 1
let g:syntastic_error_symbol = "X"
let g:syntastic_style_error_symbol = ">"
let g:syntastic_warning_symbol = "!"
let g:syntastic_style_warning_symbol = ">"
let g:syntastic_cpp_compiler = "g++"
let g:syntastic_cpp_checkers = ['gcc']
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_no_include_search = 1
let g:syntastic_cpp_compiler_options = " -std=c++11"
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_coffeescript_checkers = ["coffeelint"]
let g:syntastic_markdown_checkers = ['mdl']
let g:syntastic_css_checkers = ["csslint", "prettycss"]
let g:syntastic_python_checkers = ["flake8", "python"]
let g:syntastic_html_checkers = ['validator']
let g:livepreview_previewer = 'evince'
let g:html_indent_inctags = "html,body,head,tbody"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""window Manager""""""""""""""""""""""""""
let g:winManagerWindowLayout = 'FileExplorer,BufExplorer'
"let g:tex_flavor='latex'
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
"#***keymap***{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
noremap H ^ " Shift H goto Start of line
noremap L $ " Shift L goto End of line"
nnoremap j gj " Use actial line insted of logical line
nnoremap k gk " ===
nnoremap <C-j> <C-w>j " Move to window above
nnoremap <C-k> <C-w>k " Move to window Below
nnoremap <C-h> <C-w>h " Move to window on left
nnoremap <C-l> <C-w>l " Move to window on right
map cm :call clearmatches() " Clear Search Matches
nmap ; :
map <leader>l :bnext<cr> " Goto Next Buffer
map <leader>h :bprevious<cr> " Goto Previous Buffer
map <C-t> :tabnew<CR> " Goto New Tab
map <leader>nn :NERDTreeToggle<cr> "Nerdtree file Tree
imap <C-c> <esc> "use Brake as an exit to insertmode
"last Tab Magic Trick
let g:lasttab = 1 "
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
au TabLeave * let g:lasttab = tabpagenr()
" Firefox keybindings
nmap <leader> tn :tabnext<CR>
map <C-t> :tabnew<CR>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><cr> :noh<cr>
nnoremap ,z zMzvzz
" move between matching opening and ending code; example { code }
map <tab> %
" Opens a new tab with the current buffer's path
" Super useful when editing files in the same directory
" Switch CWD to the directory of the open buffer
map <leader>cd :cd %:p:h<cr>:pwd<cr>
" Specify the behavior when switching between buffers
try
set switchbuf=useopen,usetab,newtab
set stal=2
catch
endtry
" Pressing ,ss will toggle and untoggle spell checking
map <leader>ss :setlocal spell!<cr>
" Shortcuts using <leader>
map <leader>sn ]s
map <leader>sp [s
map <leader>sa zg
map <leader>s? z=
"Fuction Keys Mapping
" F1: help Key
map <F1> :help
"Fuction Keys Mapping
"F1: help Key
map <F1> :help
"F2: Show/Hide Marker Charcters
map <silent> <F2> :set invlist<CR>
"F3: HOW/Hide found pattern (After search)
@@ -211,29 +184,10 @@ map <leader>s? z=
"F11 Use to toggle between 'paste' and 'nopaste'
set pastetoggle=<F11>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Parenthesis/bracket
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $e <esc>`>a"<esc>`<i"<esc>
" Map auto complete of (, ", ', [
inoremap $1 ()<esc>i
inoremap $2 []<esc>i
inoremap $3 {}<esc>i
inoremap $4 {<esc>o}<esc>O
inoremap $q ''<esc>i
inoremap $e ""<esc>i
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
"#***Light Line Settings***{{{
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:lightline = {
\ 'colorscheme': 'Tomorrow',
\ 'active': {
@@ -257,7 +211,6 @@ let g:lightline = {
\ },
\ 'subseparator': { 'left': '|', 'right': '|' }
\ }
function! LightlineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
@@ -294,11 +247,9 @@ endfunction
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
autocmd FileType text setlocal textwidth=78
function! LightlineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
function! StripWhitespace()
let save_cursor = getpos(".")
@@ -384,15 +335,15 @@ endfunction
let g:unite_force_overwrite_statusline = 0
let g:vimfiler_force_overwrite_statusline = 0
let g:vimshell_force_overwrite_statusline = 0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
"#***Fuctions***{{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func! WordProcessorMode()
setlocal textwidth=80
"setlocal smartindent
setlocal smartindent
setlocal spell spelllang=en
"setlocal noexpandtab
setlocal noexpandtab
g:grammarous#use_vim_spelllang`. Default 0, to enable
endfu
@@ -416,22 +367,6 @@ map <f8> :call OpenCurrentLine()
command Preview :!firefox %<CR>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
"#Auto Commands{{{
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""For HTML
autocmd FileType html inoremap ;b <b></b><Space><Esc>FbT>i
autocmd FileType html inoremap ;i <em></em><Space><Esc>FeT>i
autocmd FileType html inoremap ;1 <h1></h1><Enter><Enter><Esc>2kf<i
autocmd FileType html inoremap ;2 <h2></h2><Enter><Enter><++><Esc>2kf<i
autocmd FileType html inoremap ;3 <h3></h3><Enter><Enter><++><Esc>2kf<i
autocmd FileType html inoremap ;p <p></p><Enter><Enter><++><Esc>02kf>a
autocmd FileType html inoremap ;a <a<Space>href=""><++></a><Space><++><Esc>F"i
autocmd FileType html inoremap ;ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
autocmd FileType html inoremap ;li <Esc>o<li></li><Esc>F>a
autocmd FileType html inoremap ;ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"#}}}
+744
View File
@@ -0,0 +1,744 @@
#################################################################
#┌─────────────────────────────────────────────────────────────┐#
#│ ______ __ __ __ │#
#│/\__ _\ /\ \ /\ \/\ \ __ __ │#
#│\/_/\ \/ __\ \ \/'\\ \ `\\ \/\_\ ___ /\_\ __ │#
#│ \ \ \ /'__`\ \ , < \ \ , ` \/\ \ /' _ `\ \/\ \ /'__`\ │#
#│ \ \ \/\ __/\ \ \\`\\ \ \`\ \ \ \/\ \/\ \ \ \ \/\ \L\.\_ │#
#│ \ \_\ \____\\ \_\ \_\ \_\ \_\ \_\ \_\ \_\_\ \ \ \__/.\_\│#
#│ \/_/\/____/ \/_/\/_/\/_/\/_/\/_/\/_/\/_/\ \_\ \/__/\/_/│#
#│ \ \____/ │#
#│ \/___/ │#
#└─────────────────────────────────────────────────────────────┘#
#################################################################
# ________ _______. __ __ #
# | / / || | | | #
# `---/ / | (----`| |__| | #
# / / \ \ | __ | #
# / /----.----) | | | | | #
# /________|_______/ |__| |__| #
#################################################################
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
#--------Programs{{{
export EDITOR="vim"
export READER="zathura"
export viewer="~/scripts/img"
export BROWSER="uzbl"
export BROWASERCLI="w3m"
export COMICER="comix"
export PAGER="most"
export PLAYER="mpv"
export FILEMANAGER="ranger"
source ~/.local/bin/bashmarks.sh
#}}}
#--------Paths{{{
export CDPATH="~/bin/:~/scripts"
export PATH="$PATH:/home/kevin/scripts:/home/kevin/bin:/sbin:/usr:/usr/sbin"
export PATH="$PATH:/home/kevin/scripts:/home/kevin/bin:/sbin:/usr:/usr/sbin:/home/kevin/scripts/Fun"
export GOPATH="home/kevin/.go"
export PATH="$PATH:$GOPATH/bin"
#}}}
#--------History {{{
#------------------------------------------------------
# get more info: $man zshoptions
setopt APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt HIST_FIND_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_NO_STORE
setopt HIST_REDUCE_BLANKS
setopt HIST_SAVE_NO_DUPS
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_FIND_NO_DUPS
setopt HIST_VERIFY
setopt SHARE_HISTORY
setopt INTERACTIVE_COMMENTS # pound sign in interactive prompt
HISTFILE=~/.zsh_history # where to save zsh history
HISTSIZE=10000
SAVEHIST=10000
cfg-history() { $EDITOR $HISTFILE ;}
#
# }}}
#--------Theme{{{
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="cypher"
ZSH_THEME="agnoster"
#ZSH_THEME="dstufft"i
#ZSH_THEME="essembeh"
#ZSH_THEME="nanotech"
#ZSH_THEME="bira"
#ZSH_THEME="darkblood"
#ZSH_THEME="eastwood"
#ZSH_THEME="3den"
#ZSH_THEME="gozilla"
#ZSH_THEME="fishy"
#ZSH_THEME="flazz"
#ZSH_THEME="fox"
#ZSH_THEME="half-life"
#ZSH_THEME="humza"
#ZSH_THEME="gallois"
#ZSH_THEME="gnzh"
#ZSH_THEME="josh"
#ZSH_THEME="crunch"
#ZSH_THEME="trapd00r"
#ZSH_THEME="kolo"
#ZSH_THEME="mh"
#ZSH_THEME="mgutz"
#ZSH_THEME="KIWI"
#ZSH_THEME="mgutz'
#ZSH_THEME="kardan"
#ZSH_THEME="maran"
#ZSH_THEME="mikeh"
#ZSH_THEME="kafeitu"
#ZSH_THEME="jreese"
#}}}
#--------Oh-My-Zsh-Settings{{{
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(colorize command-not-found debian theme zsh_reload chucknorris)
zstyle ':completion:*' menu select # to activate the menu, press tab twice
source $ZSH/oh-my-zsh.sh
#}}}
#--------User configuration{{{
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_US.UTF-8
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
alias zshconfig="mate ~/.zshrc"
alias ohmyzsh="mate ~/.oh-my-zsh"
#}}}
#--------Autocomplete {{{
#------------------------------------------------------
# http://www.refining-linux.org/archives/40/ZSH-Gem-5-Menu-selection/
# https://github.com/robbyrussell/oh-my-zsh/blob/master/lib/completion.zsh
autoload -U compinit && compinit # enable autocompletion
fpath+=(~/.zsh/completion) # set path to custom autocompletion
zstyle ':completion:*' menu select # to activate the menu, press tab twice
unsetopt menu_complete # do not autoselect the first completion entry
setopt completealiases # autocompletion CLI switches for aliases
zstyle ':completion:*' list-colors '' # show colors on menu completion
# http://unix.stackexchange.com/a/297000
setopt complete_in_word # tab completion from both ends
setopt glob_complete # wildcard completion eg. *-tar
# setopt auto_menu # show completion menu on succesive tab press
# setopt always_to_end
# show dots if tab compeletion is taking long to load
expand-or-complete-with-dots() {
echo -n "\e[31m......\e[0m"
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-dots
bindkey "^I" expand-or-complete-with-dots
# autocomplete case-insensitive (all),partial-word and then substring
zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# better completion for killall
zstyle ':completion:*:killall:*' command 'ps -u $USER -o cmd'
# when new programs is installed, auto update autocomplete without reloading shell
zstyle ':completion:*' rehash true
#}}}
#--------Vim Mode {{{
#------------------------------------------------------
# enable vim mode on commmand line
bindkey -v
# edit command with editor
# http://stackoverflow.com/a/903973
# usage: type someshit then hit Esc+v
autoload -U edit-command-line
zle -N edit-command-line
bindkey -M vicmd v edit-command-line
# no delay entering normal mode
# https://github.com/pda/dotzsh/blob/master/keyboard.zsh#L10
# 10ms for key sequences
KEYTIMEOUT=1
# show vim status
# http://zshwiki.org/home/examples/zlewidgets
function zle-line-init zle-keymap-select {
RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}"
RPS2=$RPS1
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# add missing vim hotkeys
# fixes backspace deletion issues
# http://zshwiki.org/home/zle/vi-mode
bindkey -a u undo
# bindkey -a '^R' redo # conflicts with history search hotkey
bindkey -a '^T' redo
bindkey '^?' backward-delete-char #backspace
# history search in vim mode
# http://zshwiki.org./home/zle/bindkeys#why_isn_t_control-r_working_anymore
bindkey -M viins '^r' history-incremental-search-backward
bindkey -M vicmd '^r' history-incremental-search-backward
# use cursor blinker color as indicator of vi mode
# http://andreasbwagner.tumblr.com/post/804629866/zsh-cursor-color-vi-mode
# http://reza.jelveh.me/2011/09/18/zsh-tmux-vi-mode-cursor
# bug; 112 ascii randomly showing up
#zle-keymap-select () {
# if [ $KEYMAP = vicmd ]; then
# if [[ $TMUX = '' ]]; then
# echo -ne "\033]12;Red\007"
# else
# printf '\033Ptmux;\033\033]12;red\007\033\\'
# fi
# else
# if [[ $TMUX = '' ]]; then
# echo -ne "\033]12;Grey\007"
# else
# printf '\033Ptmux;\033\033]12;grey\007\033\\'
# fi
# fi
#}
#zle-line-init () {
# zle -K viins
# echo -ne "\033]12;Grey\007"
#}
#zle -N zle-keymap-select
#zle -N zle-line-init
# }}}
#--------Functions{{{
#-------------------------------------------------------------------
##############################
#----------Functions---------#
##############################
cfg-bash() { $EDITOR ~/.bashrc ;}
cfg-ranger() { $EDITOR ~/.config/ranger/config ;}
cfg-comix() { $EDITOR ~/.config/comix/keybindings.conf ;}
cfg-mpd() { $EDITOR ~/.mpd/mpd.conf ;}
cfg-mplayer() { $EDITOR ~/.mplayer/config ;}
cfg-mpv() { $EDITOR ~/.config/mpv/input.conf ;}
cfg-mocp() { $EDITOR ~/.moc/config ;}
cfg-mutt() { $EDITOR ~/.muttrc ;}
cfg-Xres() { $EDITOR ~/.Xresource ;}
cfg-ncmpcpp() { $EDITOR ~/.ncmpcpp/config ;}
cfg-i3wm() { $EDITOR ~/.i3/config ;}
cfg-cursor() { $EDITOR ~/.icons/default/index.theme ;}
cfg-cursor-list() { ls ~/.icons ;}
cfg-grub() { sudo $EDITOR /etc/default/grub ;}
cfg-ranger() { $EDITOR ~/.config/ranger/rc.conf ;}
cfg-ranger-rifle() { $EDITOR ~/.config/ranger/rifle.conf ;}
cfg-ranger-commands() { $EDITOR ~/.config/ranger/commands.py ;}
cfg-fstab() { sudo $EDITOR /etc/fstab ;}
cfg-profile() { $EDITOR ~/.profile ;}
cfg-xresources() { $EDITOR ~/.Xresources ;}
reloadxd() { xrdb ~/.Xdefaults ;}
rld-xmodmap() { xmodmap ~/.Xmodmap ;}
reloadxr() { xrdb -load ~/.Xresources ;}
killall-zombies() { kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }') ;}
rationalise-dot() {
if [[ $LBUFFER = *.. ]]; then
LBUFFER+=/..
else
LBUFFER+=.
fi
}
zle -N rationalise-dot
bindkey . rationalise-dot
lsg() {
figlet -f smkeyboard List Grep
keyword=$(echo "$@" | sed 's/ /.*/g')
ls -hlA --color=yes \
| awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}' \
| grep -iE $keyword
}
[ -n "$RANGER_LEVEL" ] && PS1="$PS1"'(in ranger) '
#ranger cd
function rcd {
tempfile='/tmp/chosendir'
ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
}
myip()
{
figlet myip
lynx -dump -hiddenlinks=ignore -nolist [url]http://checkip.dyndns.org:8245/[/url] | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
}
:wupinfo ()
{
echo -ne "${green}uptime is ${green} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
cd()
{
if [ -n "$1" ]; then
builtin cd "$@" && ls
else
builtin cd ~ && ls
fi
}
lnet ()
{
figlet -f fender Net Address
/sbin/ifconfig | awk /'inet addr/ {print $2}'
echo ""
/sbin/ifconfig | awk /'Bcast/ {print $3}'
echo ""
}
myip()
{
lynx -dump -hiddenlinks=ignore -nolist [url]http://checkip.dyndns.org:8245/[/url] | grep "Current IP Address" | cut -d":" -f2 | cut -d" " -f2
}
upinfo()
{
echo -ne "${green}uptime is ${green} \t ";uptime | awk /'up/ {print $3,$4,$5,$6,$7,$8,$9,$10}'
}
cd()
{
if [ -n "$1" ]; then
builtin cd "$@" && ls
else
builtin cd ~ && ls
fi
}
calc() {
figlet -f larry3d Calculator
echo press ctrl+D to exit
if which python2 &>/dev/null; then
python2 -ic "from __future__ import division; from math import *; from random import *"
elif which python3 &>/dev/null; then
python3 -ic "from math import *; import cmath"
elif which bc &>/dev/null; then
bc -q -l
else
echo "Requires python2, python3 or bc for calculator features"
fi
}
mkdircd() { mkdir -p -v $1; cd $1 ;} # create folder then cd into it
nohup-command() { nohup "$@" >/dev/null 2>&1& } # background a process w/o error msg
open() { xdg-open "$@" > /dev/null 2>&1 ;} # open with default GUI program
# ls recent items at bottom with green TODAY yel/low YESTERDAY substituted with file permission also
# https://www.reddit.com/r/archlinux/comments/41s1w4/what_is_your_favorite_one_liner_to_use/cz50y1m
# http://askubuntu.com/a/152005
lst() {
ls -vAFq --color=yes -got --si --time-style=long-iso "$@" \
| sed "s/$(date +%Y-%m-%d)/\x1b[32m TODAY\x1b[m/;s/$(date +'%Y-%m-%d' -d yesterday)/\x1b[33m YESTERDAY\x1b[m/" \
| awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}' | tac
}
lsl() {
ls -hl --color=yes "$@" \
| awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'
}
export PATH_SCREENSHOT=~/Pictures/screenshots
pix() { scrot -d 2 "$PATH_SCREENSHOT/fullscr_`date +'%F_%Hh%Ms%S'`.png" ;}
# uses ip or ifconfig, good on older or newer system
m-ip() {
figlet Network Information
echo "router ip:" $(netstat -rn | awk 'FNR == 3 {print $2}')
# newer system like archlinux
ip addr | awk '/global/ {print $1,$2}' | cut -d\/ -f1
ip addr | awk '/global/ {print $3,$4}'
ip addr | awk '/ether/ {print $1,$2}'
ip addr | awk '/scope link/ {print $1,$2}' | cut -d\/ -f1
# older system like debian
ifconfig | awk '/inet addr/ {print $1,$2}' | awk -F: '{print $1,$2}'
ifconfig | awk '/Bcast/ {print $3}' | awk -F: '{print $1,$2}'
ifconfig | awk '/inet addr/ {print $4}' | awk -F: '{print $1,$2}'
ifconfig | awk '/HWaddr/ {print $4,$5}'
ifconfig | awk '/Scope:Link/ {print $1,$3}' | cut -d\/ -f1
# echo External IP $(curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+")
# echo External IP: $(curl -s http://ipaddr.io/)
# echo External IP: $(curl -s https://icanhazip.com/)
# echo External IP: $(curl -s https://ifconfig.co/)
# echo External IP: $(curl -s http://pasteip.me/api/cli/ && echo)
echo external ip: $(curl -s http://ipecho.net/plain)
echo "---------------------------------------------------"
}
mount-discimage() {
if [ $# -lt 1 ]
then
echo -e "mount ISO filesystem images (iso,nrg,bin,mdf,img)"
echo -e "\nUsage:\n$0 <disc_image>"
echo -e "\nExample:\n$0 disc_image.iso"
echo -e "$0 disc_image.iso disc_image2.bin disc_image3.mdf"
echo -e "$0 *.iso"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
fuseiso -n -p "$arg" "/tmp/$arg"
done
# if mount was sucessful then cd and ls the mountpoint
if [ $? -eq 0 ]; then
cd "/tmp/$1" && ls
else
return 1
fi
}
unmount-discimage() {
if [ $# -lt 1 ]
then
echo -e "unmount ISO filesystem images (iso,nrg,bin,mdf,img)"
echo -e "\nUsage:\n$0 <mount_point|disc_image>"
echo -e "\nExample:\n$0 disc_image.iso"
echo -e "$0 disc_image.iso disc_image2.bin"
echo -e "$0 mount_point1 mount_point2"
echo -e "cd /tmp && $0 mount_point"
echo -e "cd /tmp && $0 *.iso"
return 1
fi
myArray=( "$@" )
for arg in "${myArray[@]}"; do
fusermount -u "$arg"
done
}
mount-img() {
if [ $# -lt 1 ]; then
echo -e "mount image to access files"
echo -e "\nUsage: $0 <img_file>"
echo -e "\nExample: $0 foo.img"
return 1
fi
mkdir -p "/tmp/$1"
sudo mount "$PWD/$1" "/tmp/$1"
# if mount was sucessful then cd and ls the mountpoint
if [ $? -eq 0 ]; then
cd "/tmp/$1" && ls
else
return 1
fi
}
unmount-img() {
if [ $# -lt 1 ]; then
echo -e "unmount image"
echo -e "\nUsage: $0 <img_file>"
echo -e "\nExample: $0 foo.img"
return 1
fi
sudo umount "/tmp/$1"
rmdir "/tmp/$1"
}
detox() {
myArray=( "$@" )
for arg in "${myArray[@]}"; do
filter_name=$(echo "$arg" | sed 's/%20/ /g' | sed 's/ /_/g' | tr '[:upper:]' '[:lower:]')
mv -- "$arg" "$filter_name"
done
}
cpbak() { cp $1{,.bak} ;} # create backup copy
#}}}
#-------------Alias List{{{
#--------------------------------------------------------------
##############################
#----Alias-------------------#
##############################
#_____________________________________________________________#
alias sudo='sudo -i'
alias sudo='sudo ' # make aliases work with sudo
#_____________________________________________________________#
#---------------------don't have to type cd to go back--------#
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
#-------------------------------------------------------------#
alias -g ND='*(/om[1])' # newest directory
alias -g NF='*(.om[1])' # newest file
#-------------------------listing files-----------------------#
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
# Always use color output for `ls`
export colorflag='color=always'
alias ls='ls --color=auto'
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# List all files colorized in long format, including dot files
alias la="ls -laF ${colorflag}"
# List only directories
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
# Ls Files Only
alias lsf='ls --color=always -p | grep -v '/$''
# sort by extension
alias lx='ls -lXB'
# sort by size
alias lk='ls -lSr'
# sort by change time
alias lc='ls -lcr'
# sort by access time
alias lu='ls -lur'
# recursive ls
alias lr='ls -l | less'
# sort by date
alias lt='ls -ltr'
# ls + more
alias lm='ls -al |most'
#list Files and use pick to select them
alias lsp='ls | pick | xargs xdg-open'
#------------------------------------------------------------#
#--------------------- Shortcuts-----------------------------#
alias docs="cd ~/Documents"/
alias dl="cd ~/Downloads"
alias bk="cd /media/Shared_Docs/Books"
alias dt="cd ~/Desktop"
alias p="cd ~/projects"
alias g="git"
alias h="history"
alias j="jobs"
#------------------------------------------------------------#
#--------------------Language aliases------------------------#
alias rb='ruby'
alias py='python'
alias ipy='ipython'
alias jj="java jar-"
#------------------------------------------------------------#
#---------------- Directory Manepulation---------------------#
alias md='mkdir -p'
alias rd='rmdir'
#------------------------------------------------------------#
#----------------------Vim Like Exit-------------------------#
alias :q='exit'
alias q="exit"
#------------------------------------------------------------#
#--------------------Safer Commands--------------------------#
alias rm='rm -i -v'
alias cp='cp -i -v'
alias mv='mv -i -v'
alias du='du -kh'
alias df='df -kTh'lias mkdir="mkdir -p"
#-------------------------------------------------------------#
#------------------------programs-----------------------------#
alias mail="mutt"
alias scld="calcurse"
alias r="ranger"
alias fm="ranger:"
alias Ranger="ranger"
alias e="vin"
alias edit="vim"
alias inxi="inxi -Fxzc2"
alias weechat="weechat-curses"
alias news='newsbeuter'
alias v="vim"
alias bc='bc -q -l' # dont show opening msg, use math library
alias cal='cal -3' # show 3 months
alias df='df -hT --total' # human readable, print filetype, and total
alias du='du -d1 -h' # max depth, human readable
alias emacs='emacs -nw' # cli mode
alias feh='feh --auto-zoom --scale-down -g 1360x768 -B white'
alias free='free -h' # human readable
alias info='infobrowser' # GNU info act like man command
alias mount='mount | column -t' # align in column
alias nano='nano -c -$' # word wrapping
alias menu='pdmenu'
alias hale9000='ruby ~/betty/main.rb'
alias trash='trash-put -v'
alias psg='ps -ef | grep $1'
alias less='less -R --tabs=4' # colorful 'less', tab stops = 4
alias mkdir='mkdir -p -v'
alias reload='source ~/.bashrc'
alias wget='wget -c'
alias which='type -a'
alias quota='quota -vs'
alias Copy='cp'
alias pmix=" pa-mixer-mk2.py"
alias neofetch='neofetch --backend w3m --source ~/hacker.jpg'
alias wtf='dmesg'
alias wifi='wicd-curses'
#-------------------------------------------------------------#
#----------------controll audio levels------------------------#
alias mute="pamixer -m"
alias vd="pamixer -d 10"
alias p="mocp -G &> /dev/null"
alias next="mocp -f &> /dev/null"
alias prev="mocp -r &> /dev/null"
alias vu="pamixer -i 10"
#-------------------------------------------------------------#
#-----------------------Tmux Commands-------------------------#
alias kl='tmux kill-window'
alias nw='tmux new-window'
#-------------------------------------------------------------#
#-------------------------net commands------------------------#
alias ports='netstat -nape --inet'
alias opennet='lsof -i'
alias ping='ping -c 4'
#-------------------------------------------------------------#
#-----------------------Disk Commands-------------------------#
alias localrepo='sudo sh ~/scripts/mount_IS0_repo mount'
alias fdisk="sudo fdisk -l"
#-------------------------------------------------------------#
#---------------------alias to fix dyslixia-------------------#
alias root='sudo'
alias s='sudo'
alias sodu='sudo'
#-------------------------------------------------------------#
#------------------------Just for fun-------------------------#
# Stopwatch
alias timer='echo "Timer started. Stop with Ctrl-D." && date && time cat && date'
alias 99bottles='x="bottles of beer";y="on the wall";for b in {99..1};do echo "$b $x $y, $b $x. Take one down pass it around, $(($b-1)) $x $y"; sleep 3;done'
alias matrix='echo -e "\e[32m"; while :; do for i in {1..16}; do r="$(($RANDOM % 2))"; if [[ $(($RANDOM % 5)) == 1 ]]; then if [[ $(($RANDOM % 4)) == 1 ]]; then v+="\e[1m $r "; else v+="\e[2m $r "; fi; else v+=" "; fi; done; echo -e "$v"; v=""; done'
alias matrix2='echo -e "\e[31m"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="\e[1m $r";else v="\e[2m $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;'
alias matrix3='COL=$(( $(tput cols) / 2 )); clear; tput setaf 2; while :; do tput cup $((RANDOM%COL)) $((RANDOM%COL)); printf "%$((RANDOM%COL))s" $((RANDOM%2)); done'
alias matrix4='echo -ne "\e[32m" ; while true ; do echo -ne "\e[$(($RANDOM % 2 + 1))m" ; tr -c "[:print:]" " " < /dev/urandom | dd count=1 bs=50 2> /dev/null ; done'
alias matrix5='tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=lcase,unblock | GREP_COLOR="1;32" grep --color "[^ ]"'
alias colorrainbow='yes "$(seq 1 255)" | while read i; do printf "\x1b[48;5;${i}m\n"; sleep .01; done'
alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && echo Die || echo Live' # command line Russian roulette
alias einsteiny='A=1;B=100;X=0;C=0;N=$[$RANDOM%$B+1];until [ $X -eq $N ];do read -p "N between $A and $B. Guess? " X;C=$(($C+1));A=$(($X<$N?$X:$A));B=$(($X>$N?$X:$B));done;echo "Took you $C tries, Einstein";' # numbers guessing game
alias etchasketch='c=12322123;x=20;y=20;while read -sn1 p;do k=${c:(p-1)*2:2};let x+=$((k/10-2));let y+=$((k%10-2));echo -en \\033[$y\;"$x"HX;done' # use the 1 2 3 and 4 keys to move the cursor around the screen (It's an etch-a-sketch for your terminal!)
alias starwars="telnet towel.blinkenlights.nl"
#-------------------------------------------------------------#
#}}}
#-------- Suffix Alias {{{
#------------------------------------------------------
# open file with default program base on extension
# Ex: 'alias -s avi=mplayer' makes 'file.avi' execute 'mplayer file.avi'
alias -s {avi,flv,mkv,mp4,mpeg,mpg,ogv,wmv}=$PLAYER
alias -s {flac,mp3,ogg,wav}=$PLAYER
alias -s {gif,GIF,jpeg,JPEG,jpg,JPG,png,PNG}=img
alias -s {djvu,pdf,ps}="background $READER"
alias -s txt=$EDITOR
alias -s epub="background $EBOOKER"
alias -s {cbr,cbz}="background $COMICER"
# might conflict with emacs org mode
alias -s {at,ch,com,de,net,org}="background $BROWSER"
alias -s {html,htm}=$BROWSERCLI
# archive extractor
alias -s ace="atool l"
alias -s rar="unrar l"
alias -s {tar,bz2,gz,xz}="tar tvf" #tar.bz2,tar.gz,tar.xz
alias -s zip="unzip -l"
#}}}
#################################################################
+539
View File
@@ -0,0 +1,539 @@
##########################################################
## this is example bindings configuration file, copy it ##
## to ~/.ncmpcpp/bindings and set up your preferences ##
##########################################################
##
##### General rules #####
##
## 1) Because each action has runtime checks whether it's
## ok to run it, a few actions can be bound to one key.
## Actions will be bound in order given in configuration
## file. When a key is pressed, first action in order
## will test itself whether it's possible to run it. If
## test succeeds, action is executed and other actions
## bound to this key are ignored. If it doesn't, next
## action in order tests itself etc.
##
## 2) It's possible to bind more that one action at once
## to a key. It can be done using the following syntax:
##
## def_key "key"
## action1
## action2
## ...
##
## This creates a chain of actions. When such chain is
## executed, each action in chain is run until the end of
## chain is reached or one of its actions fails to execute
## due to its requirements not being met. If multiple actions
## and/or chains are bound to the same key, they will be
## consecutively run until one of them gets fully executed.
##
## 3) When ncmpcpp starts, bindings configuration file is
## parsed and then ncmpcpp provides "missing pieces"
## of default keybindings. If you want to disable some
## bindings, there is a special action called 'dummy'
## for that purpose. Eg. if you want to disable ability
## to crop playlists, you need to put the following
## into configuration file:
##
## def_key "C"
## dummy
##
## After that ncmpcpp will not bind any default action
## to this key.
##
## 4) To let you write simple macros, the following special
## actions are provided:
##
## - push_character "character" - pushes given special
## character into input queue, so it will be immediately
## picked by ncmpcpp upon next call to readKey function.
## Accepted values: mouse, up, down, page_up, page_down,
## home, end, space, enter, insert, delete, left, right,
## tab, ctrl-a, ctrl-b, ..., ctrl-z, ctrl-[, ctrl-\\,
## ctrl-], ctrl-^, ctrl-_, f1, f2, ..., f12, backspace.
## In addition, most of these names can be prefixed with
## alt-/ctrl-/shift- to be recognized with the appropriate
## modifier key(s).
##
## - push_characters "string" - pushes given string into
## input queue.
##
## - require_runnable "action" - checks whether given action
## is runnable and fails if it isn't. This is especially
## useful when mixed with previous two functions. Consider
## the following macro definition:
##
## def_key "key"
## push_characters "custom_filter"
## apply_filter
##
## If apply_filter can't be currently run, we end up with
## sequence of characters in input queue which will be
## treated just as we typed them. This may lead to unexpected
## results (in this case 'c' will most likely clear current
## playlist, 'u' will trigger database update, 's' will stop
## playback etc.). To prevent such thing from happening, we
## need to change above definition to this one:
##
## def_key "key"
## require_runnable "apply_filter"
## push_characters "custom_filter"
## apply_filter
##
## Here, first we test whether apply_filter can be actually run
## before we stuff characters into input queue, so if condition
## is not met, whole chain is aborted and we're fine.
##
## - require_screen "screen" - checks whether given screen is
## currently active. accepted values: browser, clock, help,
## media_library, outputs, playlist, playlist_editor,
## search_engine, tag_editor, visualizer, last_fm, lyrics,
## selected_items_adder, server_info, song_info,
## sort_playlist_dialog, tiny_tag_editor.
##
## - run_external_command "command" - runs given command using
## system() function.
##
## 5) In addition to binding to a key, you can also bind actions
## or chains of actions to a command. If it comes to commands,
## syntax is very similar to defining keys. Here goes example
## definition of a command:
##
## def_command "quit" [deferred]
## stop
## quit
##
## If you execute the above command (which can be done by
## invoking action execute_command, typing 'quit' and pressing
## enter), ncmpcpp will stop the player and then quit. Note the
## presence of word 'deferred' enclosed in square brackets. It
## tells ncmpcpp to wait for confirmation (ie. pressing enter)
## after you typed quit. Instead of 'deferred', 'immediate'
## could be used. Then ncmpcpp will not wait for confirmation
## (enter) and will execute the command the moment it sees it.
##
## Note: while command chains are executed, internal environment
## update (which includes current window refresh and mpd status
## update) is not performed for performance reasons. However, it
## may be desirable to do so in some situration. Therefore it's
## possible to invoke by hand by performing 'update enviroment'
## action.
##
## Note: There is a difference between:
##
## def_key "key"
## action1
##
## def_key "key"
## action2
##
## and
##
## def_key "key"
## action1
## action2
##
## First one binds two single actions to the same key whilst
## second one defines a chain of actions. The behavior of
## these two is different and is described in (1) and (2).
##
## Note: Function def_key accepts non-ascii characters.
##
##### List of unbound actions #####
##
## The following actions are not bound to any key/command:
##
## - set_volume
##
#
#def_key "mouse"
# mouse_event
#
def_key "k"
scroll_up
#
#def_key "shift-up"
# select_item
# scroll_up
#
def_key "j"
scroll_down
#
#def_key "shift-down"
# select_item
# scroll_down
#
#def_key "["
# scroll_up_album
#
#def_key "]"
# scroll_down_album
#
#def_key "{"
# scroll_up_artist
#
#def_key "}"
# scroll_down_artist
#
#def_key "page_up"
# page_up
#
#def_key "page_down"
# page_down
#
#def_key "home"
# move_home
#
#def_key "end"
# move_end
#
#def_key "insert"
# select_item
#
#def_key "enter"
# enter_directory
#
#def_key "enter"
# toggle_output
#
#def_key "enter"
# run_action
#
#def_key "enter"
# play_item
#
#def_key "space"
# add_item_to_playlist
#
#def_key "space"
# toggle_lyrics_update_on_song_change
#
#def_key "space"
# toggle_visualization_type
#
#def_key "delete"
# delete_playlist_items
#
#def_key "delete"
# delete_browser_items
#
#def_key "delete"
# delete_stored_playlist
#
def_key "l"
next_column
#
#def_key "right"
# slave_screen
#
#def_key "right"
# volume_up
#
#def_key "+"
# volume_up
#
def_key "h"
previous_column
#
#def_key "left"
# master_screen
#
#def_key "left"
# volume_down
#
#def_key "-"
# volume_down
#
#def_key ":"
# execute_command
#
#def_key "tab"
# next_screen
#
#def_key "shift-tab"
# previous_screen
#
def_key "f2"
show_help
#
#def_key "1"
# show_playlist
#
#def_key "2"
# show_browser
#
#def_key "2"
# change_browse_mode
#
#def_key "3"
# show_search_engine
#
#def_key "3"
# reset_search_engine
#
#def_key "4"
# show_media_library
#
#def_key "4"
# toggle_media_library_columns_mode
#
#def_key "5"
# show_playlist_editor
#
#def_key "6"
# show_tag_editor
#
#def_key "7"
# show_outputs
#
#def_key "8"
# show_visualizer
#
#def_key "="
# show_clock
#
#def_key "@"
# show_server_info
#
#def_key "s"
# stop
#
#def_key "p"
# pause
#
#def_key ">"
# next
#
#def_key "<"
# previous
#
#def_key "ctrl-h"
# jump_to_parent_directory
#
#def_key "ctrl-h"
# replay_song
#
#def_key "backspace"
# jump_to_parent_directory
#
#def_key "backspace"
# replay_song
#
#def_key "f"
# seek_forward
#
#def_key "b"
# seek_backward
#
#def_key "r"
# toggle_repeat
#
#def_key "z"
# toggle_random
#
#def_key "y"
# save_tag_changes
#
#def_key "y"
# start_searching
#
#def_key "y"
# toggle_single
#
#def_key "R"
# toggle_consume
#
#def_key "Y"
# toggle_replay_gain_mode
#
#def_key "T"
# toggle_add_mode
#
#def_key "|"
# toggle_mouse
#
#def_key "#"
# toggle_bitrate_visibility
#
#def_key "Z"
# shuffle
#
#def_key "x"
# toggle_crossfade
#
#def_key "X"
# set_crossfade
#
#def_key "u"
# update_database
#
#def_key "ctrl-s"
# sort_playlist
#
#def_key "ctrl-s"
# toggle_browser_sort_mode
#
#def_key "ctrl-s"
# toggle_media_library_sort_mode
#
#def_key "ctrl-r"
# reverse_playlist
#
#def_key "ctrl-_"
# select_found_items
#
#def_key "/"
# find
#
#def_key "/"
# find_item_forward
#
#def_key "?"
# find
#
#def_key "?"
# find_item_backward
#
#def_key "."
# next_found_item
#
#def_key ","
# previous_found_item
#
#def_key "w"
# toggle_find_mode
#
#def_key "e"
# edit_song
#
#def_key "e"
# edit_library_tag
#
#def_key "e"
# edit_library_album
#
#def_key "e"
# edit_directory_name
#
#def_key "e"
# edit_playlist_name
#
#def_key "e"
# edit_lyrics
#
#def_key "i"
# show_song_info
#
#def_key "I"
# show_artist_info
#
#def_key "g"
# jump_to_position_in_song
#
def_key "i"
show_lyrics
#
#def_key "ctrl-v"
# select_range
#
#def_key "v"
# reverse_selection
#
#def_key "V"
# remove_selection
#
#def_key "B"
# select_album
#
#def_key "a"
# add_selected_items
#
#def_key "c"
# clear_playlist
#
#def_key "c"
# clear_main_playlist
#
#def_key "C"
# crop_playlist
#
#def_key "C"
# crop_main_playlist
#
#def_key "m"
# move_sort_order_up
#
#def_key "m"
# move_selected_items_up
#
#def_key "m"
# set_visualizer_sample_multiplier
#
#def_key "n"
# move_sort_order_down
#
#def_key "n"
# move_selected_items_down
#
#def_key "M"
# move_selected_items_to
#
#def_key "A"
# add
#
#def_key "S"
# save_playlist
#
#def_key "o"
# jump_to_playing_song
#
#def_key "G"
# jump_to_browser
#
#def_key "G"
# jump_to_playlist_editor
#
#def_key "~"
# jump_to_media_library
#
#def_key "E"
# jump_to_tag_editor
#
#def_key "U"
# toggle_playing_song_centering
#
#def_key "P"
# toggle_display_mode
#
#def_key "\\"
# toggle_interface
#
#def_key "!"
# toggle_separators_between_albums
#
#def_key "L"
# toggle_lyrics_fetcher
#
#def_key "F"
# toggle_fetching_lyrics_in_background
#
#def_key "ctrl-l"
# toggle_screen_lock
#
#def_key "`"
# toggle_library_tag_type
#
#def_key "`"
# refetch_lyrics
#
#def_key "`"
# add_random_items
#
#def_key "ctrl-p"
# set_selected_items_priority
#
#def_key "q"
# quit
#
+146 -117
View File
@@ -1,128 +1,157 @@
## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting.
[general]
# Smoothing mode. Can be 'normal', 'scientific' or 'waves'.
; mode = waves
# Accepts only non-negative values.
; framerate = 80
# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off
# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens.
auosens = 1
# overshoot = 20
# Manual sensitivity in %. Autosens must be turned off for this to take effect.
# 200 means double height. Accepts only non-negative values.
sensitivity = 50
# The number of bars (0-200). 0 sets it to auto (fill up console).
# Bars' width and space between bars in number of characters.
bars = 0
bar_width = 1
bar_spacing = 1
# Lower and higher cutoff frequencies for lowest and highest bars
# the bandwidth of the visualizer.
# Note: there is a minimum total bandwidth of 43Mhz x number of bars.
# Cava will automatically increase the higher cutoff if a too low band is specified.
lower_cutoff_freq = 50
higher_cutoff_freq = 10000
[input]
# Audio capturing method. Possible methods are: 'pulse', 'alsa' or 'fifo'.
# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with.
# ████ ██ ██████ ████ ████ ███████ ██████ ███████ ███████
# ░██░██ ░██ ██░░░░██░██░██ ██░██░██░░░░██ ██░░░░██░██░░░░██░██░░░░██
# ░██░░██ ░██ ██ ░░ ░██░░██ ██ ░██░██ ░██ ██ ░░ ░██ ░██░██ ░██
# ░██ ░░██ ░██░██ ░██ ░░███ ░██░███████ ░██ ░███████ ░███████
# ░██ ░░██░██░██ ░██ ░░█ ░██░██░░░░ ░██ ░██░░░░ ░██░░░░
# ░██ ░░████░░██ ██░██ ░ ░██░██ ░░██ ██░██ ░██
# ░██ ░░███ ░░██████ ░██ ░██░██ ░░██████ ░██ ░██
# ░░ ░░░ ░░░░░░ ░░ ░░ ░░ ░░░░░░ ░░ ░░
#
# All input methods uses the same config variable 'source'
# to define where it should get the audio.
#----General Settings{{{
ncmpcpp_directory = "~/.ncmpcpp"
#lyrics_directory = "~/.lyrics"
#**********
use_console_editor = "yes"
external_editor = "/usr/bin/vim"
#**********
titles_visibility = "yes"
playlist_separate_albums = "yes"
#**********
follow_inside_symlinks "yes"
follow_outside_symlinks "yes"
#**********
mouse_support = "yes"
header_visibility = "yes"
statusbar_visibility = "yes"
autocenter_mode = "yes"
centered_cursor = "yes"
titles_visibility = "yes"
discard_colors_if_item_is_selected = "yes"
display_bitrate = "yes"
display_remaining_time = "Yes"
regular_expressions = "extended"
display_volume_level = "yes"
user_interface = "alternative"
playlist_display_mode = "columns"
browser_display_mode = "columns"
search_engine_display_mode = "columns"
ask_before_clearing_playlists = "yes"
#**********
#}}}
#-----MPD Settings{{{
mpd_crossfade_time = "3"
mpd_music_dir = "/media/Music/Music_Archives"
mpd_host = "localhost"
mpd_port = "6603"
#}}}
#-----Visualizer Settings{{{
visualizer_in_stereo = "yes"
visualizer_fifo_path = "/tmp/mpd.fifo"
visualizer_sync_interval = "10"
visualizer_color = "blue"
visualizer_look = "●▮"
visualizer_type = "spectrum"
#}}}
#-----Color settings{{{
colors_enabled = "yes"
color1 = "red"
color2 = "purple"
statusbar_color = "blue"
main_window_color = "green"
statusbar_time_color = "blue"
player_state_color = "green
main_window_highlight_color = "white"
active_column_color = "White"
active_window_border = "blue"
progressbar_color = "red"
progressbar_elapsed_color = "blue"
window_border_color = "green"
alternative_ui_separator_color = "green"
empty_tag_color = "black"
state_line_color = "green"
state_flags_color = "green
header_window_color = "green"
volume_color = "blue"
#}}}
#-----Format Syntax{{{
song_list_format = "{$7%a $6> $5}{%t$6$R$b} [{%l}]"
song_status_format = "$8%a$9 ✖ $2%t$9"
song_library_format = "{%n - }{%t}|{%f}"
song_status_format = "$7%a $6$b> $5%t $6$b> $2%b$6"
song_columns_list_format = "(20)[green]{a} (30)[cyan]{b} (50)[blue]{t|f}"
song_status_format = "{{$8%a$9{ $b-$/b $6%b$9 {(%y)}} ✖ } '{%t}}|{%f}'"
song_window_title_format = "MPD: {%a > }{%t}{ [%b{ Disc %d}]}|{%f}"
alternative_header_first_line_format = "$8$aqqu$/a$b {%t}|{%f} $/b$8$atqq$/a$9"
alternative_header_second_line_format = "{{$8%a}{$8 - %b$9}{$8 (%y)$8}}|{%D$9}"
#}}}
#-----Prefix Suffix{{{
now_playing_prefix = "$b$1$8♫$1 "
now_playing_suffix = " $8♫$9 "
selected_item_prefix = " √ "
browser_playlist_prefix = "$2plist »$9 "
#progressbar_look = "=>"
#progressbar_look = "─- "
#progressbar_look = "▒▒░"
#progressbar_look = "┅┅┄"
progressbar_look = "─⊙┄"
#progressbar_look = "─➞─"
#progressbar_look = "─┅─"
#progressbar_look = "▪▪▪"
#progressbar_look = "▪▪▫"
#progressbar_look = "───"
#progressbar_look = "▁▁▁"
#progressbar_look = "‒‒‒"
#progressbar_look = "■◣ "
#progressbar_look = "◈◆◇"
#
# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink
# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them).
#
# For alsa 'source' will be the capture device.
# For fifo 'source' will be the path to fifo-file.
method = pulse
source = auto
progressbar_boldness = "yes"
;method = alsa
;source = hw:Loopback,1
;method = fifo
;source = /tmp/mpd.fifo
#}}}
[output]
# Ouput method. Can be 'ncurses', 'noncurses' or 'raw'.
# 'noncurses' is for systems that does not suport ncurses.
# 'raw' is a 16 bit data stream of the bar heights that can be used to send to other applications.
# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above.
method = ncurses
# Visual styles. Can be 'stereo' or 'mono'.
# 'stereo' mirrors both channels with low frequencies in center.
# 'mono' averages both channels and outputs left to right lowest to highest frequencies.
style = stereo
# Raw output target. A fifo will be created if target does not exist.
raw_target = /dev/stdout
# Raw data format. Can be 'binary' or 'ascii'.
data_format = binary
# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530).
bit_format = 16bit
# Ascii max value. In 'ascii' mode range will run from 0 to value specified here
ascii_max_range = 1000
# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters.
# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)).
; bar_delimiter = 59
; frame_delimiter = 10
[color]
# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow.
# Or defined by hex code '#xxxxxx' (hex code must be within '').
; background = black
foreground = green
[smoothing]
# Multiplier for the integral smoothing calculations. Takes values from 0-0.99.
# Higher values means smoother, but less precise. Set to 0 to disable.
; integral = 0
# Disables or enables the so-called "Monstercat smoothing". Set to 0 to disable.
; monstercat = 0
# Set gravity multiplier for "drop off". Higher values means bars will drop faster.
# Accepts only non-negative values. 0.5 means half gravity, 2 means double. Set to 0 to disable "drop off".
gravity = 0
# In bar height, bars that would have been lower that this will not be drawn.
; ignore = 0
[eq]
# This one is tricky. You can have as much keys as you want.
# Remember to uncomment more then one key! More keys = more precision.
# Look at readme.md on github for further explanations and examples.
; 1 = 1 # bass
; 2 = 1
; 3 = 1 # midtone
; 4 = 1
; 5 = 1 # treble
#------Settings cheat sheet
# %l - length
# %f - filename
# %D - directory
# %a - artist
# %t - title
# %b - album
# %y - year
# %n - track number (01/12 -> 01)
# %N - full track info (01/12 -> 01/12)
# %g - genre
# %c - composer
# %p - performer
# %d - disc
# %C - comment
# $R - begin right alignment
# █▓▒░ colors
# $0 - default window color
# $1 - black
# $2 - red
# $3 - green
# $4 - yellow
# $5 - blue
# $6 - magenta
# $7 - cyan
# $8 - white
#
#
# $9 - end of current color
#
#/* vim: set Filetype=conf : */