diff --git a/.Xresources b/.Xresources index 81b5a49..ebc9257 100644 --- a/.Xresources +++ b/.Xresources @@ -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 diff --git a/.bashrc b/.bashrc index 07e321d..3847360 100644 --- a/.bashrc +++ b/.bashrc @@ -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 " + 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 " + 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 " + 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 " + 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 " + 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 " + 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 " + 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 " + 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 " + 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