Advertisement
v1ral_ITS

my newest bashrc config

Aug 5th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 10.28 KB | None | 0 0
  1. # alias zenity='yad --text-info --title "$(yad --title "Title New GUI Box What")" --height=450 width=125'
  2. # alias yad='yad  --text-info --title "$(yad --title "Title New GUI Box What")" --height=450 width=125'
  3. # ~/.bashrc: executed by bash(1) for non-login shells.
  4. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
  5. # for examples
  6.  
  7. # If not running interactively, don't do anything
  8. case $- in
  9.     *i*) ;;
  10.       *) return;;
  11. esac
  12.  
  13. # don't put duplicate lines or lines starting with space in the history.
  14. # See bash(1) for more options
  15. HISTCONTROL=ignoreboth
  16.  
  17. # append to the history file, don't overwrite it
  18. shopt -s histappend
  19.  
  20. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  21. HISTSIZE=1000
  22. HISTFILESIZE=2000
  23.  
  24. # check the window size after each command and, if necessary,
  25. # update the values of LINES and COLUMNS.
  26. shopt -s checkwinsize
  27.  
  28. # If set, the pattern "**" used in a pathname expansion context will
  29. # match all files and zero or more directories and subdirectories.
  30. #shopt -s globstar
  31.  
  32. # make less more friendly for non-text input files, see lesspipe(1)
  33. [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
  34.  
  35. # set variable identifying the chroot you work in (used in the prompt below)
  36. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  37.     debian_chroot=$(cat /etc/debian_chroot)
  38. fi
  39.  
  40. # set a fancy prompt (non-color, unless we know we "want" color)
  41. case "$TERM" in
  42.     xterm|xterm-color|*-256color) color_prompt=yes;;
  43. esac
  44.  
  45. # uncomment for a colored prompt, if the terminal has the capability; turned
  46. # off by default to not distract the user: the focus in a terminal window
  47. # should be on the output of commands, not on the prompt
  48. #force_color_prompt=yes
  49.  
  50. if [ -n "$force_color_prompt" ]; then
  51.     if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
  52.     # We have color support; assume it's compliant with Ecma-48
  53.     # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
  54.     # a case would tend to support setf rather than setaf.)
  55.     color_prompt=yes
  56.     else
  57.     color_prompt=
  58.     fi
  59. fi
  60.  
  61. if [ "$color_prompt" = yes ]; then
  62.     if [[ ${EUID} == 0 ]] ; then
  63.         PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
  64.     else
  65.         PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
  66.     fi
  67. else
  68.     PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
  69. fi
  70. unset color_prompt force_color_prompt
  71.  
  72. # If this is an xterm set the title to user@host:dir
  73. case "$TERM" in
  74. xterm*|rxvt*)
  75.     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h \w\a\]$PS1"
  76.     ;;
  77. *)
  78.     ;;
  79. esac
  80.  
  81. # enable color support of ls and also add handy aliases
  82. if [ -x /usr/bin/dircolors ]; then
  83.     test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
  84.     #alias ls='ls --color=auto'
  85.     #alias dir='dir --color=auto'
  86.     #alias vdir='vdir --color=auto'
  87.  
  88.     alias grep='grep --color=auto'
  89.     alias fgrep='fgrep --color=auto'
  90.     alias egrep='egrep --color=auto'
  91. fi
  92.  
  93. # colored GCC warnings and errors
  94. #export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
  95.  
  96. # some more ls aliases
  97. alias ll='ls -alF'
  98. alias la='ls -A'
  99. alias l='ls -CF'
  100.  
  101. # Add an "alert" alias for long running commands.  Use like so:
  102. #   sleep 10; alert
  103. alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
  104.  
  105. # Alias definitions.
  106. # You may want to put all your additions into a separate file like
  107. # ~/.bash_aliases, instead of adding them here directly.
  108. # See /usr/share/doc/bash-doc/examples in the bash-doc package.
  109.  
  110. if [ -f ~/.bash_aliases ]; then
  111.     . ~/.bash_aliases
  112. fi
  113.  
  114. # enable programmable completion features (you don't need to enable
  115. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  116. # sources /etc/bash.bashrc).
  117. if ! shopt -oq posix; then
  118.   if [ -f /usr/share/bash-completion/bash_completion ]; then
  119.     . /usr/share/bash-completion/bash_completion
  120.   elif [ -f /etc/bash_completion ]; then
  121.     . /etc/bash_completion
  122.   fi
  123. fi
  124.  
  125. if [ -x /usr/bin/mint-fortune ]; then
  126.      /usr/bin/mint-fortune
  127. fi
  128. #########################
  129. # START PERSONALIZATION #
  130. #########################
  131. alias apt='aptitude'
  132. alias apt-get='aptitude'
  133. export PATH=$HOME/bin:/usr/local/bin:$PATH
  134. #########################
  135. # START PERSONALIZATION #
  136. #########################
  137. new_clear() {
  138.     \clear
  139.     \ls
  140.     echo Current Working Directory = ''$(pwd)''
  141. }
  142. alias c='new_clear'
  143. alias ls='ls --color='always' -h -S'
  144. new_backdir() {
  145.     \clear
  146.     \cd ..
  147.     \ls
  148.     echo Current Working Directory = '$(pwd)'
  149. }
  150. alias ..='new_backdir'
  151. new_cd() {
  152.     \clear
  153.     cd $*
  154.     \ls
  155.     echo Current Working Directory = '$(pwd)'
  156. }
  157. alias cd='new_cd'
  158. alias media='"/media/$(whoami)/$(\ls /media/$(whoami)/ | zenity --list --column "Choose Folder")"'
  159. aptg1() {
  160.     echo -e "CHOICES:   \n1) Update \n2) Upgrade \n3) Dist-Upgrade \n4) Apt Search \n5) Apt Download .deb [no install] \n6) Apt Autoclean && Autoremove \n7) Install a .deb With apt-get"
  161.     read n
  162.     case $n in
  163.         1) sudo apt-get -y update ;;
  164.         2) sudo apt-get -y upgrade ;;
  165.         3) sudo apt-get -y dist-upgrade ;;
  166.         4) echo "Search What: "; read SRC; apt search '$SRC' ;;
  167.         5) echo "Download What .deb: "; read DEB; sudo apt-get -y download $DEB ;;
  168.         6) sudo apt-get -y autoremove && sudo apt-get -y clean ;;
  169.         7) echo "Install What:"; read SIN ; sudo apt-get -y install $SIN ;;
  170.             *) invalid option ;;
  171.     esac
  172. }
  173. sin() {
  174.     echo -e "\nInstall What: "
  175.     read INS
  176.     sudo apt-get -y install $INS
  177. }
  178. httpserver() {
  179.     echo ""
  180.     echo ""
  181.     echo -e "You can Enter Any Begining [root] Directory To Start This Server, [press [E]nter to (c)ontinue: ]"
  182.     read NULL
  183.     echo ""
  184.     echo ""
  185.     echo "Checking Filesystem........      "
  186.     sleep 2
  187.     echo ""
  188.     echo -e "\nPlease Now Enter Begining Directory For Server: "
  189.     read SRVROOT
  190.     echo -e  "Specify A 4 Digit Number For The Port: "
  191.     read PRT
  192.         echo -e "Automatic Showing Of index.html On Or Off: \npress {Y}es or {N}o\n"
  193.         read ANS
  194.         if [[ $ANS == y ]]; then
  195.         shttps --index -u -p $PRT $SRVROOT
  196.         fi
  197.     if [[ $ANS == n ]]; then
  198.     shttps -u -p $PRT $SRVROOT
  199.     fi
  200. }
  201. new_bash() {
  202.     echo -e "\nBash Aliases, are formated \n like so, for example," | yad --width 500 --height 100 --title "New Bash-rc" --text-info
  203.     echo -e "alias x='exit' \nSo for the formula we use \nalias abbreviation=definition" | yad --width 500 --height 100 --title "New Bash-rc" --text-info
  204.     echo -e "So Lets Begin With ABREV, \n I have Already set the pre alias command" | yad --width 500 --height 100 --title "New Bash-rc" --text-info
  205.     read ABREV
  206.     echo -e "Okay Now The definition, \nAnd I will Give You A Graphical" | yad --title "New Bash-rc" --text-info
  207.     echo -e "Interface to use, \nSo use as much room as you need" | yad --title "New Bash-rc" --text-info
  208.     echo "alias "$(yad --width 500 --height 100 --title "New Bash-rc" --text-info --editable --button="Please Define The Aliases Abreviation"
  209.     )"='$(kdialog --title='ImPerial TeK Solutions' --inputbox='Define Alias Command')'" >> $HOME/.bashrc
  210.     cat $HOME/.bashrc
  211. }
  212. bookmarkurl() {
  213.     URL="$(kdialog --title=Bookmarks --inputbox=URL/Files)"
  214.     echo -e "\n`date` \n$URL" >> $HOME/bookmarks-url
  215.     \cat $HOME/bookmarks-url
  216. }
  217. tarcz() {
  218.     clear
  219.     sudo tar czf "$(yad --title "Name New .tar.gz" --entry --width 500 --height 100)".tar.gz "$(yad --file-selection --directory)"
  220. }
  221. updupg() {
  222.     sudo apt update -y
  223.     sudo apt upgrade -y
  224.     sudo apt dist-upgrade -y
  225.     sudo apt-get -y update
  226.     sudo apt-get -y upgrade
  227.     sudo apt-get -y dist-upgrade
  228.     sudo aptitude update
  229.     sudo aptitude upgrade
  230.     sudo aptitude dist-upgrade
  231.     sudo apt clean
  232.     sudo apt autoremove
  233.     sudo apt-get -y clean
  234.     sudo apt-get -y autoremove
  235. }
  236. transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
  237. tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
  238. nap() {
  239.     echo -e "\nChoose any Video, \nFile by it Self, \nOr Directory, \nTo Play playlist, \n No Audio Video Player: \n"
  240.     read PLY
  241.     mpv --no-audio "$PLY"
  242. }
  243. new_rm() {
  244.     sudo rm -R ./$@
  245. }
  246. white='\033[0m'
  247. red='\033[31m'
  248. green='\033[32m'
  249. orange='\033[33m'
  250. blue='\033[34m'
  251. blink='\e[5m'
  252. purple='\033[35m'
  253. cyan='\033[36m'
  254. gray='\033[37m'
  255. #############
  256. # PS1 == ?? #
  257. #############
  258. alias x='exit'
  259. alias h='cd $HOME'
  260. alias m='cd $MHOME'
  261. alias newb='new_bash'
  262. alias aptg='aptg1'
  263. alias a='alias'
  264. alias bmu='bookmarkurl'
  265. alias chx='chmod +x "$(ls . | zenity --list --column Files"'
  266. alias czf='tarcz'
  267. export MHOME='/media/$(whoami)/MISC.'
  268. alias media='"/media/$(whoami)/$(\ls /media/$(whoami)/ | zenity --list --column "Choose Folder")"'
  269. export MHOMEX='/media/$(whoami)/XVIDS'
  270. export MHOMEMUSIC='/media/$(whoami)/MUSIC'
  271. export MHOMEM='/media/$(whoami)/MOVIES'
  272. alias az='aptg'
  273. alias rm='new_rm'
  274. alias wspace='sudo bash /home/$(whoami)/bin/whitespace'
  275. alias catgui='kdialog --textbox $(ls . | zenity --list --column "Choose File To Cat") 512 286'
  276. alias zshrc='nano $HOME/.zshrc'
  277. alias fullup='updupg'
  278. alias gdl='drive download "$(kdialog --title "Copy/Paste Items ID #" --inputbox "File/Directorys ID")"'
  279. alias gup='drive upload $(ls | zenity --list --column "Choose File To Upload")'
  280. alias gupdir='drive upload --recursive $(kdialog --getexistingdirectory /)'
  281. alias smp='smplayer $(kdialog --title "Choose Directory For play-list; " --getexistingdirectory / )'
  282. alias nmp='mpv --no-video "$(kdialog --title "Choose Folder" --getexistingdirectory /)"'
  283. alias unz='unzip *.zip'
  284. alias ifc='ifconfig'
  285. alias mvp='mpv --no-audio "$(kdialog --title "Choose Folder" --getexistingdirectory /)"'
  286. alias calc='gnome-calculator'
  287. alias edit='xed $*'
  288. alias gdlir='drive download --recursive "$(kdialog --title "Copy/Paste Items ID #" --inputbox "File/Directorys ID")"'
  289. alias new_note='\echo -e "`yad --title "Add Notes" --entry`" >> ~/notes; cat ~/notes'
  290. alias ytv='youtube-viewer'
  291. alias xdgo='xdg-open $*'alias youtube-dl='youtube-dl --prefer-ffmpeg'
  292. alias a='\ls -x -lah -w 5 --color='always' --sort='size' $*'
  293. alias fbin='chmod +x /home/$USER/bin/*'
  294. alias ownbin='sudo -u "$(whoami)" chown -R "$(whoami)" /home/"$(whoami)"/bin'
  295. alias ac='\clear'
  296. PS1="\n\033[1mITS \033[04m<\@>\n\033[02m>>\033[000m\nCurrent Directory=<\w>\n\033[m\d>> \n>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement