mirror of
				https://github.com/ItsDrike/dotfiles.git
				synced 2025-11-04 01:16:35 +00:00 
			
		
		
		
	Initial Commit
This commit is contained in:
		
						commit
						e456ebf6ae
					
				
					 12 changed files with 895 additions and 0 deletions
				
			
		
							
								
								
									
										6
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,6 @@
 | 
			
		|||
# Contains wakatime API which should remain private
 | 
			
		||||
files/.wakatime.cfg
 | 
			
		||||
# Backup directory will get created by script, no need to push it
 | 
			
		||||
backup/
 | 
			
		||||
# Don't include file backups
 | 
			
		||||
*.bak
 | 
			
		||||
							
								
								
									
										21
									
								
								LICENSE.md
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										21
									
								
								LICENSE.md
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
MIT License
 | 
			
		||||
 | 
			
		||||
Copyright (c) 2020 Koumakpet
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
			
		||||
of this software and associated documentation files (the "Software"), to deal
 | 
			
		||||
in the Software without restriction, including without limitation the rights
 | 
			
		||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
			
		||||
copies of the Software, and to permit persons to whom the Software is
 | 
			
		||||
furnished to do so, subject to the following conditions:
 | 
			
		||||
 | 
			
		||||
The above copyright notice and this permission notice shall be included in all
 | 
			
		||||
copies or substantial portions of the Software.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
			
		||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
			
		||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
			
		||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 | 
			
		||||
SOFTWARE.
 | 
			
		||||
							
								
								
									
										17
									
								
								README.md
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								README.md
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
# Dotfiles
 | 
			
		||||
## What can it do?
 | 
			
		||||
* Automate your daily tasks with handy aliases
 | 
			
		||||
* Use nice prompt that shows you your git branch and command failure
 | 
			
		||||
* Quickly install common packages with just 1 script
 | 
			
		||||
* Get a nice VIM interface
 | 
			
		||||
* Also works for ZSH Shell
 | 
			
		||||
* Adjust the settings any way you want
 | 
			
		||||
 | 
			
		||||
## How to use it?
 | 
			
		||||
Clone this repository into your home floder (~/dotfiles)<br>
 | 
			
		||||
(Note that it has to be installed in your home directory, otherwise the script will not work!)<br>
 | 
			
		||||
`$ git clone https://github.com/koumakpet/dotfiles`<br>
 | 
			
		||||
Before you run **install.sh**, you should take a look at the files included and adjust them however you like.
 | 
			
		||||
All files which will be added are in files/ directory
 | 
			
		||||
When you are prepared, you can run installer.sh file in \~/dotfiles<br>
 | 
			
		||||
`$ sh ~/dotfiles/instal.sh`
 | 
			
		||||
							
								
								
									
										94
									
								
								files/.config/sh/.aliases
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										94
									
								
								files/.config/sh/.aliases
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,94 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
# enable color support
 | 
			
		||||
if [ -x /usr/bin/dircolors ]; then
 | 
			
		||||
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
 | 
			
		||||
    alias dir='dir --color=auto'
 | 
			
		||||
    alias vdir='vdir --color=auto'
 | 
			
		||||
 | 
			
		||||
    alias grep='grep --color=auto'
 | 
			
		||||
	alias cgrep='grep --color=always'
 | 
			
		||||
    alias fgrep='fgrep --color=auto'
 | 
			
		||||
    alias egrep='egrep --color=auto'
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Exa aliases (replacement for ls, if you are using ls, comment or change this
 | 
			
		||||
alias ls='exa'
 | 
			
		||||
alias ll='exa -glah'
 | 
			
		||||
alias ld='exa -glahD'
 | 
			
		||||
alias lt='exa -Tlagh'
 | 
			
		||||
alias tree='exa -T'
 | 
			
		||||
 | 
			
		||||
# Shortcuts
 | 
			
		||||
alias vi='vim'
 | 
			
		||||
alias rr='rm -r'
 | 
			
		||||
alias mnt='mount'
 | 
			
		||||
 | 
			
		||||
# Changing directories
 | 
			
		||||
alias ..='cd ..'
 | 
			
		||||
alias ...='cd ../../'
 | 
			
		||||
alias ....='cd ../../../'
 | 
			
		||||
alias .....='cd ../../../../'
 | 
			
		||||
alias .2='cd ../../'
 | 
			
		||||
alias .3='cd ../../../'
 | 
			
		||||
alias .4='cd ../../../../'
 | 
			
		||||
alias .5='cd ../../../../../'
 | 
			
		||||
 | 
			
		||||
# Reconfigure default py to py3
 | 
			
		||||
alias py3='python3'
 | 
			
		||||
alias py='python3'
 | 
			
		||||
alias py2='python2'
 | 
			
		||||
 | 
			
		||||
# Config access shortcuts
 | 
			
		||||
alias cfvim='vim ~/.vimrc'
 | 
			
		||||
alias cfzsh='vim ~/config/zsh/.zsh_config'
 | 
			
		||||
alias cfzshrc='vim ~/.zshrc'
 | 
			
		||||
 | 
			
		||||
# Replacements
 | 
			
		||||
alias dd='dcfldd' # Use dcfldd instead of dd (shows progress)
 | 
			
		||||
alias du='du -ach | sort -h' # Sort du by size
 | 
			
		||||
alias mkdir='mkdir -p' # Mkdir with automatic creation of parent directories
 | 
			
		||||
alias ps='ps auxf' # Print all processes
 | 
			
		||||
alias tty-clock='tty-clock -Ssc' # Terminal clock screensaver
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Custom aliases
 | 
			
		||||
alias fhere='find . -name' # Find file/dir from currrent dir
 | 
			
		||||
alias ssh-list='ss | grep ssh' # List all SSH connections
 | 
			
		||||
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$//'\'')"'
 | 
			
		||||
alias psg='\ps aux | grep -v grep | grep -i -e VSZ -e' # Get searchable process with nice output
 | 
			
		||||
alias ip-show="dig +short myip.opendns.com @resolver1.opendns.com" # Gets your IP address
 | 
			
		||||
alias reload="exec \$SHELL" # Reload the shell (i.e. invoke as a login shell
 | 
			
		||||
alias path='echo -e ${PATH//:/\\n}' # Print each PATH entry on a separate line
 | 
			
		||||
alias dotfiles='exa -hula -d .[a-z]* | grep -v ^d' # Show all dotfiles
 | 
			
		||||
alias dotdirs='exa -hulaD -d .[a-z]*' # Show all dotdirs
 | 
			
		||||
alias dotall='exa -hula -d .[a-z]*' # Show both dotdirs and dotfiles
 | 
			
		||||
alias clean='rm -rf ~/.local/share/Trash/* && rm -rf ~/Downloads/*' # Remove trash and downloads files
 | 
			
		||||
alias colors-256='curl -s https://gist.githubusercontent.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263/raw/ | bash' # Show color table
 | 
			
		||||
alias minecraft='minecraft-launcher'
 | 
			
		||||
alias o='dolphin .' # open in dolphin (file manager)
 | 
			
		||||
alias pacman-extract='pacman -Syw --cachedir .' # Extract package/es into current floders
 | 
			
		||||
alias mount-table='df' # Show list of all mounted devices and their mount locations
 | 
			
		||||
alias swapout='sudo swapoff -a; sudo swapon -a' # Reset swap (move everything to RAM)
 | 
			
		||||
alias sound_control='alsamixer' # Sound control tool in alsa_utils package
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# If user is not root, pass all commands via sudo
 | 
			
		||||
if [ $UID -ne 0 ]; then
 | 
			
		||||
	# Enable aliases to be sudo’ed
 | 
			
		||||
 | 
			
		||||
	## Uncomment if you are using autocompletion (is ZSH)
 | 
			
		||||
	#alias sudo='nocorrect sudo'
 | 
			
		||||
	## Comment this if you are not using autocompletion (in ZSH)
 | 
			
		||||
	alias sudo='sudo '
 | 
			
		||||
 | 
			
		||||
	alias unsudo='sudo -k' # Reset sudo timeout (sudo will require password)
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Functions
 | 
			
		||||
if [ -f ~/.config/sh/.functions ]; then
 | 
			
		||||
	source ~/.config/sh/.functions
 | 
			
		||||
fi
 | 
			
		||||
							
								
								
									
										237
									
								
								files/.config/sh/.functions
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										237
									
								
								files/.config/sh/.functions
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,237 @@
 | 
			
		|||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
function extract {
 | 
			
		||||
 if [ -z "$1" ]; then
 | 
			
		||||
    # display usage if no parameters given
 | 
			
		||||
    echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
 | 
			
		||||
    echo "       extract <path/file_name_1.ext> [path/file_name_2.ext] [path/file_name_3.ext]"
 | 
			
		||||
    return 1
 | 
			
		||||
 else
 | 
			
		||||
    for n in $@
 | 
			
		||||
    do
 | 
			
		||||
      if [ -f "$n" ] ; then
 | 
			
		||||
          case "${n%,}" in
 | 
			
		||||
            *.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar)
 | 
			
		||||
                         tar xvf "$n"       ;;
 | 
			
		||||
            *.lzma)      unlzma ./"$n"      ;;
 | 
			
		||||
            *.bz2)       bunzip2 ./"$n"     ;;
 | 
			
		||||
            *.rar)       unrar x -ad ./"$n" ;;
 | 
			
		||||
            *.gz)        gunzip ./"$n"      ;;
 | 
			
		||||
            *.zip)       unzip ./"$n"       ;;
 | 
			
		||||
            *.z)         uncompress ./"$n"  ;;
 | 
			
		||||
            *.7z|*.arj|*.cab|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.rpm|*.udf|*.wim|*.xar)
 | 
			
		||||
                         7z x ./"$n"        ;;
 | 
			
		||||
            *.xz)        unxz ./"$n"        ;;
 | 
			
		||||
            *.exe)       cabextract ./"$n"  ;;
 | 
			
		||||
            *)
 | 
			
		||||
                         echo "extract: '$n' - unknown archive method"
 | 
			
		||||
                         return 1
 | 
			
		||||
                         ;;
 | 
			
		||||
          esac
 | 
			
		||||
      else
 | 
			
		||||
          echo "'$n' - file does not exist"
 | 
			
		||||
          return 1
 | 
			
		||||
      fi
 | 
			
		||||
    done
 | 
			
		||||
fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Hide any file / directory in ls using .hidden file
 | 
			
		||||
#function ls () {
 | 
			
		||||
#  if [ -f .hidden ]; then
 | 
			
		||||
#    declare GLOBIGNORE="$GLOBIGNORE:.*:$(tr '\n' ':' < .hidden)"
 | 
			
		||||
#    ls "$@"
 | 
			
		||||
#  fi
 | 
			
		||||
#}
 | 
			
		||||
 | 
			
		||||
# Create a new directory and enter it
 | 
			
		||||
function mkd() {
 | 
			
		||||
	mkdir -p "$@" && cd "$_";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Create a .tar.gz archive, using `zopfli`, `pigz` or `gzip` for compression
 | 
			
		||||
function targz() {
 | 
			
		||||
	local tmpFile="${@%/}.tar";
 | 
			
		||||
	tar -cvf "${tmpFile}" "${@}" || return 1;
 | 
			
		||||
 | 
			
		||||
	size=$(
 | 
			
		||||
		stat -f"%z" "${tmpFile}" 2> /dev/null; # macOS `stat`
 | 
			
		||||
		stat -c"%s" "${tmpFile}" 2> /dev/null;  # GNU `stat`
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	local cmd="";
 | 
			
		||||
	if (( size < 52428800 )) && hash zopfli 2> /dev/null; then
 | 
			
		||||
		# the .tar file is smaller than 50 MB and Zopfli is available; use it
 | 
			
		||||
		cmd="zopfli";
 | 
			
		||||
	else
 | 
			
		||||
		if hash pigz 2> /dev/null; then
 | 
			
		||||
			cmd="pigz";
 | 
			
		||||
		else
 | 
			
		||||
			cmd="gzip";
 | 
			
		||||
		fi;
 | 
			
		||||
	fi;
 | 
			
		||||
 | 
			
		||||
	echo "Compressing .tar ($((size / 1000)) kB) using \`${cmd}\`…";
 | 
			
		||||
	"${cmd}" -v "${tmpFile}" || return 1;
 | 
			
		||||
	[ -f "${tmpFile}" ] && rm "${tmpFile}";
 | 
			
		||||
 | 
			
		||||
	zippedSize=$(
 | 
			
		||||
		stat -f"%z" "${tmpFile}.gz" 2> /dev/null; # macOS `stat`
 | 
			
		||||
		stat -c"%s" "${tmpFile}.gz" 2> /dev/null; # GNU `stat`
 | 
			
		||||
	);
 | 
			
		||||
 | 
			
		||||
	echo "${tmpFile}.gz ($((zippedSize / 1000)) kB) created successfully.";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Determine size of a file or total size of a directory
 | 
			
		||||
function dir-size() {
 | 
			
		||||
	if du -b /dev/null > /dev/null 2>&1; then
 | 
			
		||||
		local arg=-sbh;
 | 
			
		||||
	else
 | 
			
		||||
		local arg=-sh;
 | 
			
		||||
	fi
 | 
			
		||||
	if [[ -n "$@" ]]; then
 | 
			
		||||
		\du $arg -- "$@";
 | 
			
		||||
	else
 | 
			
		||||
		\du $arg .[^.]* ./*;
 | 
			
		||||
	fi;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Use Git’s colored diff when available
 | 
			
		||||
hash git &>/dev/null;
 | 
			
		||||
if [ $? -eq 0 ]; then
 | 
			
		||||
	function diff() {
 | 
			
		||||
		git diff --no-index --color-words "$@";
 | 
			
		||||
	}
 | 
			
		||||
fi;
 | 
			
		||||
 | 
			
		||||
# Create a data URL from a file
 | 
			
		||||
function dataurl() {
 | 
			
		||||
	local mimeType=$(file -b --mime-type "$1");
 | 
			
		||||
	if [[ $mimeType == text/* ]]; then
 | 
			
		||||
		mimeType="${mimeType};charset=utf-8";
 | 
			
		||||
	fi
 | 
			
		||||
	echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Start an HTTP server from a directory, optionally specifying the port
 | 
			
		||||
function server() {
 | 
			
		||||
	local port="${1:-8000}";
 | 
			
		||||
	sleep 1 && open "http://localhost:${port}/" &
 | 
			
		||||
	# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
 | 
			
		||||
	# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
 | 
			
		||||
	python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Start a PHP server from a directory, optionally specifying the port
 | 
			
		||||
# (Requires PHP 5.4.0+.)
 | 
			
		||||
function phpserver() {
 | 
			
		||||
	local port="${1:-4000}";
 | 
			
		||||
	local ip=$(ipconfig getifaddr en1);
 | 
			
		||||
	sleep 1 && open "http://${ip}:${port}/" &
 | 
			
		||||
	php -S "${ip}:${port}";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Compare original and gzipped file size
 | 
			
		||||
function gz() {
 | 
			
		||||
	local origsize=$(wc -c < "$1");
 | 
			
		||||
	local gzipsize=$(gzip -c "$1" | wc -c);
 | 
			
		||||
	local ratio=$(echo "$gzipsize * 100 / $origsize" | bc -l);
 | 
			
		||||
	printf "orig: %d bytes\n" "$origsize";
 | 
			
		||||
	printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Run `dig` and display the most useful info
 | 
			
		||||
function digga() {
 | 
			
		||||
	dig +nocmd "$1" any +multiline +noall +answer;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Show all the names (CNs and SANs) listed in the SSL certificate
 | 
			
		||||
# for a given domain
 | 
			
		||||
function getcertnames() {
 | 
			
		||||
	if [ -z "${1}" ]; then
 | 
			
		||||
		echo "ERROR: No domain specified.";
 | 
			
		||||
		return 1;
 | 
			
		||||
	fi;
 | 
			
		||||
 | 
			
		||||
	local domain="${1}";
 | 
			
		||||
	echo "Testing ${domain}…";
 | 
			
		||||
	echo ""; # newline
 | 
			
		||||
 | 
			
		||||
	local tmp=$(echo -e "GET / HTTP/1.0\nEOT" \
 | 
			
		||||
		| openssl s_client -connect "${domain}:443" -servername "${domain}" 2>&1);
 | 
			
		||||
 | 
			
		||||
	if [[ "${tmp}" = *"-----BEGIN CERTIFICATE-----"* ]]; then
 | 
			
		||||
		local certText=$(echo "${tmp}" \
 | 
			
		||||
			| openssl x509 -text -certopt "no_aux, no_header, no_issuer, no_pubkey, \
 | 
			
		||||
			no_serial, no_sigdump, no_signame, no_validity, no_version");
 | 
			
		||||
		echo "Common Name:";
 | 
			
		||||
		echo ""; # newline
 | 
			
		||||
		echo "${certText}" | grep "Subject:" | sed -e "s/^.*CN=//" | sed -e "s/\/emailAddress=.*//";
 | 
			
		||||
		echo ""; # newline
 | 
			
		||||
		echo "Subject Alternative Name(s):";
 | 
			
		||||
		echo ""; # newline
 | 
			
		||||
		echo "${certText}" | grep -A 1 "Subject Alternative Name:" \
 | 
			
		||||
			| sed -e "2s/DNS://g" -e "s/ //g" | tr "," "\n" | tail -n +2;
 | 
			
		||||
		return 0;
 | 
			
		||||
	else
 | 
			
		||||
		echo "ERROR: Certificate not found.";
 | 
			
		||||
		return 1;
 | 
			
		||||
	fi;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Normalize `open` across Linux, macOS, and Windows.
 | 
			
		||||
# This is needed to make the `o` function (see below) cross-platform.
 | 
			
		||||
if [ ! $(uname -s) = 'Darwin' ]; then
 | 
			
		||||
	if grep -q Microsoft /proc/version; then
 | 
			
		||||
		# Ubuntu on Windows using the Linux subsystem
 | 
			
		||||
		alias open='explorer.exe';
 | 
			
		||||
	else
 | 
			
		||||
		alias open='xdg-open';
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# `o` with no arguments opens the current directory, otherwise opens the given
 | 
			
		||||
# location
 | 
			
		||||
function o() {
 | 
			
		||||
	if [ $# -eq 0 ]; then
 | 
			
		||||
		open .;
 | 
			
		||||
	else
 | 
			
		||||
		open "$@";
 | 
			
		||||
	fi;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
 | 
			
		||||
# the `.git` directory, listing directories first. The output gets piped into
 | 
			
		||||
# `less` with options to preserve color and line numbers, unless the output is
 | 
			
		||||
# small enough for one screen.
 | 
			
		||||
function tre() {
 | 
			
		||||
	tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Will update all git repositories found in current directory and its subdirectories
 | 
			
		||||
function update-git-repos() {
 | 
			
		||||
	# store the current dir
 | 
			
		||||
	CUR_DIR=$(pwd)
 | 
			
		||||
 | 
			
		||||
	# Let the person running the script know what's going on.
 | 
			
		||||
	echo -e "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
 | 
			
		||||
 | 
			
		||||
	# Find all git repositories and update it to the master latest revision
 | 
			
		||||
	for i in $(find . -name ".git" | cut -c 3-); do
 | 
			
		||||
		echo "";
 | 
			
		||||
		echo -e "\033[33m"+$i+"\033[0m";
 | 
			
		||||
 | 
			
		||||
		# We have to go to the .git parent directory to call the pull command
 | 
			
		||||
		cd "$i";
 | 
			
		||||
		cd ..;
 | 
			
		||||
 | 
			
		||||
		# finally pull
 | 
			
		||||
		git pull origin master;
 | 
			
		||||
 | 
			
		||||
		# lets get back to the CUR_DIR
 | 
			
		||||
		cd $CUR_DIR
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
	echo -e "\n\033[32mComplete!\033[0m\n"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								files/.config/sh/zsh/.zsh_config
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								files/.config/sh/zsh/.zsh_config
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
# Enable colors
 | 
			
		||||
autoload -U colors && colors
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# Basic auto/tab complete
 | 
			
		||||
autoload -U compinit
 | 
			
		||||
zstyle ':completion:*' menu select
 | 
			
		||||
zmodload zsh/complist
 | 
			
		||||
compinit
 | 
			
		||||
_comp_options+=(globdots)
 | 
			
		||||
 | 
			
		||||
# Setup aliases
 | 
			
		||||
if [ -f ~/.config/sh/.aliases ]; then
 | 
			
		||||
	source ~/.config/sh/.aliases
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# Load zsh-syntax-highlighting (should be last)
 | 
			
		||||
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
 | 
			
		||||
							
								
								
									
										17
									
								
								files/.config/terminator/config
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								files/.config/terminator/config
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
[global_config]
 | 
			
		||||
[keybindings]
 | 
			
		||||
[layouts]
 | 
			
		||||
  [[default]]
 | 
			
		||||
    [[[child1]]]
 | 
			
		||||
      parent = window0
 | 
			
		||||
      profile = default
 | 
			
		||||
      type = Terminal
 | 
			
		||||
    [[[window0]]]
 | 
			
		||||
      parent = ""
 | 
			
		||||
      type = Window
 | 
			
		||||
[plugins]
 | 
			
		||||
[profiles]
 | 
			
		||||
  [[default]]
 | 
			
		||||
    background_darkness = 0.92
 | 
			
		||||
    background_type = transparent
 | 
			
		||||
    cursor_color = "#aaaaaa"
 | 
			
		||||
							
								
								
									
										17
									
								
								files/.gitconfig
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								files/.gitconfig
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,17 @@
 | 
			
		|||
# This is Git's per-user configuration file.
 | 
			
		||||
[user]
 | 
			
		||||
	name = koumakpet
 | 
			
		||||
	email = koumakpet@protonmail.com
 | 
			
		||||
[credential]
 | 
			
		||||
	helper = store
 | 
			
		||||
[alias]
 | 
			
		||||
	l = log --oneline --decorate --all --graph
 | 
			
		||||
	lol = log --pretty=oneline --abbrev-commit --graph
 | 
			
		||||
	lg = log --all --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
 | 
			
		||||
[merge]
 | 
			
		||||
	tool = meld
 | 
			
		||||
[mergetool]
 | 
			
		||||
	keepbackup = false
 | 
			
		||||
	keeptemporaries = false
 | 
			
		||||
[diff]
 | 
			
		||||
	tool = meld
 | 
			
		||||
							
								
								
									
										135
									
								
								files/.vimrc
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										135
									
								
								files/.vimrc
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,135 @@
 | 
			
		|||
" TODO: Spell Checking
 | 
			
		||||
 | 
			
		||||
set nocompatible				" Disable vi compatibilty (Use vi improved only)
 | 
			
		||||
set encoding=utf-8				" Use UTF-8
 | 
			
		||||
syntax enable					" Turn on syntax highlighting
 | 
			
		||||
set showmatch					" Show matching brackets
 | 
			
		||||
set ignorecase					" Do case insensitive matching
 | 
			
		||||
set incsearch					" Show partial matches for a search phrase
 | 
			
		||||
set number						" Show numbers
 | 
			
		||||
set relativenumber				" Show relative numbersi
 | 
			
		||||
set undolevels=999				" Lots of these
 | 
			
		||||
set hlsearch					" Highlight Search
 | 
			
		||||
set tabstop=4					" Tab size
 | 
			
		||||
set noexpandtab					" Do not expand tab into spaces (change to expandtab to use spaces)
 | 
			
		||||
set shiftwidth=4				" Indentation size
 | 
			
		||||
set softtabstop=4				" Tabs/Spaces interrop
 | 
			
		||||
set autoindent					" Enable autoindent
 | 
			
		||||
set ruler						" Show cursor position
 | 
			
		||||
set cursorline					" Highlight cursor line
 | 
			
		||||
set mouse=a						" Enable mouse mode
 | 
			
		||||
set termguicolors				" Enable true colors
 | 
			
		||||
set backspace=indent,eol,start	" Delete everything
 | 
			
		||||
set laststatus=2				" Always show status line
 | 
			
		||||
set wildmode=longest,list,full	" Enable autocompletion
 | 
			
		||||
set splitbelow splitright		" Split in more natural way
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
"set nomodeline     " Disable as a security precaution
 | 
			
		||||
"set wildmenu       " Enable wildmenu
 | 
			
		||||
"set conceallevel=0 " Disable concealing
 | 
			
		||||
"set complete-=i    " Better completion
 | 
			
		||||
"set smarttab       " Better tabs
 | 
			
		||||
"set ttimeout       " Set timeout
 | 
			
		||||
"set ttimeoutlen=100
 | 
			
		||||
"set synmaxcol=500  " Syntax limit
 | 
			
		||||
"set scrolloff=3    " Scroll offset
 | 
			
		||||
"set sidescrolloff=5
 | 
			
		||||
"set autoread       " Reload files on change
 | 
			
		||||
"set tabpagemax=50  " More tabs
 | 
			
		||||
"set history=1000   " More history
 | 
			
		||||
"set viminfo^=!     " Better viminfo
 | 
			
		||||
"set formatoptions+=j " Delete comment character when joining commented lines
 | 
			
		||||
 | 
			
		||||
"set listchars=tab:,nbsp:_,trail:,extends:>,precedes:<
 | 
			
		||||
"set list           " Highlight non whitespace characters
 | 
			
		||||
"set nrformats-=octal " 007 != 010
 | 
			
		||||
"set sessionoptions-=options
 | 
			
		||||
"set viewoptions-=option
 | 
			
		||||
"set listchars=tab:\|\ " Set tab lines
 | 
			
		||||
"set listchars=tab:\|\- " Set tab lines with -
 | 
			
		||||
 | 
			
		||||
" Always use terminal background
 | 
			
		||||
autocmd ColorScheme * highlight! Normal ctermbg=NONE guibg=NONE
 | 
			
		||||
 | 
			
		||||
" Have Vim jump to the last position when reopening a file
 | 
			
		||||
if has("autocmd")
 | 
			
		||||
    au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\""
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
" Shortcutting split navigation, saving a keystroke
 | 
			
		||||
map <C-h> <C-w>h
 | 
			
		||||
map <C-j> <C-w>j
 | 
			
		||||
map <C-k> <C-w>k
 | 
			
		||||
map <C-l> <C-w>l
 | 
			
		||||
 | 
			
		||||
" Check file in shellcheck
 | 
			
		||||
map <leader>s :!clear && shellcheck %<CR>
 | 
			
		||||
 | 
			
		||||
" Copy selected text to system clipboard (requires gvim)
 | 
			
		||||
vnoremap <C-c> "*Y :let @+=@*<CR>
 | 
			
		||||
map <C-p> "+P
 | 
			
		||||
 | 
			
		||||
" Automatically deletes all trailing whitespace on save
 | 
			
		||||
autocmd BufWritePre * %s/\s\+$//e
 | 
			
		||||
 | 
			
		||||
" Vundle Init
 | 
			
		||||
set rtp+=~/.vim/bundle/Vundle.vim
 | 
			
		||||
call vundle#begin()
 | 
			
		||||
 | 
			
		||||
" Plugins
 | 
			
		||||
Plugin 'VundleVim/Vundle.vim'
 | 
			
		||||
Plugin 'airblade/vim-gitgutter' 		" Shows Git diff
 | 
			
		||||
Plugin 'joshdick/onedark.vim' 			" OneDark Theme
 | 
			
		||||
Plugin 'tpope/vim-fugitive' 			" Git Wrapper (also shows branch on statusline)
 | 
			
		||||
Plugin 'vim-airline/vim-airline' 		" AirLine statusline
 | 
			
		||||
Plugin 'vim-airline/vim-airline-themes' " AirLine statusline themes
 | 
			
		||||
Plugin 'scrooloose/nerdtree' 			" Adds File-tree
 | 
			
		||||
Plugin 'Xuyuanp/nerdtree-git-plugin'	" Shows git status in nerd-tree
 | 
			
		||||
Plugin 'vim-syntastic/syntastic'		" Syntax checking
 | 
			
		||||
Plugin 'PotatoesMaster/i3-vim-syntax'	" Add syntax for i3 config
 | 
			
		||||
Plugin 'jmcantrell/vim-virtualenv'		" Manage Virtual Enviroment
 | 
			
		||||
Plugin 'wakatime/vim-wakatime'			" Install WakaTime (Shows coding time)
 | 
			
		||||
Plugin 'gko/vim-coloresque'				" Show color highlight in css/html/less/sass
 | 
			
		||||
 | 
			
		||||
" Vundle End
 | 
			
		||||
call vundle#end()
 | 
			
		||||
filetype plugin indent on
 | 
			
		||||
 | 
			
		||||
" NERD Tree
 | 
			
		||||
autocmd StdinReadPre * let s:std_in=1
 | 
			
		||||
" Show tree when opening directory
 | 
			
		||||
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
 | 
			
		||||
" Use Ctrl+n to open tree
 | 
			
		||||
map <C-n> :NERDTreeToggle<CR>
 | 
			
		||||
 | 
			
		||||
" Syntastic
 | 
			
		||||
set statusline+=%#warningmsg#
 | 
			
		||||
set statusline+=%{SyntasticStatuslineFlag()}
 | 
			
		||||
set statusline+=%*
 | 
			
		||||
 | 
			
		||||
let g:syntastic_always_populate_loc_list = 1
 | 
			
		||||
let g:syntastic_auto_loc_list = 0
 | 
			
		||||
let g:syntastic_check_on_open = 1
 | 
			
		||||
let g:syntastic_check_on_wq = 0
 | 
			
		||||
let g:syntastic_python_checkers = ['flake8']
 | 
			
		||||
 | 
			
		||||
map <leader>c :SyntasticCheck<CR>
 | 
			
		||||
map <leader>z :Errors<CR>
 | 
			
		||||
 | 
			
		||||
" Airline
 | 
			
		||||
let g:airline_theme='onedark'
 | 
			
		||||
let g:airline#extensions#tabline#enabled = 1
 | 
			
		||||
let g:airline#extensions#tabline#formatter = 'unique_tail'
 | 
			
		||||
let g:airline_left_sep = "\uE0B0"
 | 
			
		||||
let g:airline_right_sep = "\uE0B2"
 | 
			
		||||
 | 
			
		||||
" One Dark
 | 
			
		||||
let g:onedark_color_overrides = {
 | 
			
		||||
\ "comment_grey": {"gui": "#69747C","cterm": "245", "cterm16": "8"},
 | 
			
		||||
\ "gutter_fg_grey": { "gui": "#69747C", "cterm": "245", "cterm16": "8"}
 | 
			
		||||
\}
 | 
			
		||||
if !exists('$TMUX')
 | 
			
		||||
    let g:onedark_terminal_italics = 1
 | 
			
		||||
endif
 | 
			
		||||
colorscheme onedark
 | 
			
		||||
							
								
								
									
										40
									
								
								files/.zshrc
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										40
									
								
								files/.zshrc
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
#save_aliases=$(alias -L)
 | 
			
		||||
# History in cache directory
 | 
			
		||||
HISTSIZE=10000
 | 
			
		||||
SAVEHIST=10000
 | 
			
		||||
HISTFILE=~/.cache/zsh/history
 | 
			
		||||
 | 
			
		||||
# Export oh-my-zsh location as $ZSH
 | 
			
		||||
export ZSH="$HOME/.config/oh-my-zsh"
 | 
			
		||||
 | 
			
		||||
# Set theme
 | 
			
		||||
#ZSH_THEME="agnoster"
 | 
			
		||||
#ZSH_THEME="bira"
 | 
			
		||||
#ZSH_THEME="gnzh"
 | 
			
		||||
#ZSH_THEME="rkj-repos"i
 | 
			
		||||
ZSH_THEME="af-magic"
 | 
			
		||||
 | 
			
		||||
# How often should zsh be updated
 | 
			
		||||
export UPDATE_ZSH_DAYS=5
 | 
			
		||||
 | 
			
		||||
# Enable command auto-correction
 | 
			
		||||
ENABLE_CORRECTION="false"
 | 
			
		||||
 | 
			
		||||
# Run oh-my-zsh
 | 
			
		||||
source $ZSH/oh-my-zsh.sh
 | 
			
		||||
 | 
			
		||||
# Load plugins
 | 
			
		||||
plugins=(
 | 
			
		||||
	git
 | 
			
		||||
	python
 | 
			
		||||
	pylint
 | 
			
		||||
	pyenv
 | 
			
		||||
	autopep8
 | 
			
		||||
	zsh-autosuggestions
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if [ -f "$HOME/.config/sh/zsh/.zsh_config" ]; then
 | 
			
		||||
	source "$HOME/.config/sh/zsh/.zsh_config"
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
#neofetch --cpu_temp C --gtk2 off --gtk3 off --color_blocks on --pixterm
 | 
			
		||||
							
								
								
									
										169
									
								
								install.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										169
									
								
								install.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,169 @@
 | 
			
		|||
#!/usr/bin/sh
 | 
			
		||||
 | 
			
		||||
# Set some basic colors using tput (8-bit color: 256 colors)
 | 
			
		||||
bold="$(tput bold)"
 | 
			
		||||
red="$(tput setaf 196)"
 | 
			
		||||
blue="$(tput setaf 27)"
 | 
			
		||||
yellow="$(tput setaf 226)"
 | 
			
		||||
gold="$(tput setaf 214)"
 | 
			
		||||
grey="$(tput setaf 238)"
 | 
			
		||||
reset="$(tput sgr0)"
 | 
			
		||||
 | 
			
		||||
SCRIPT_DIR="$HOME/dotfiles"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function choose() {
 | 
			
		||||
	return $(whiptail \
 | 
			
		||||
			--title "$1" \
 | 
			
		||||
			--yesno "$2" 25 72 \
 | 
			
		||||
			3>&1 1>&2 2>&3)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function menu2() {
 | 
			
		||||
	output=$(whiptail \
 | 
			
		||||
			--title "$1" \
 | 
			
		||||
			--menu "$2" 25 72 0 \
 | 
			
		||||
			"1" "$3" \
 | 
			
		||||
			"2" "$4" \
 | 
			
		||||
			3>&1 1>&2 2>&3)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function yes_no() {
 | 
			
		||||
	while true; do
 | 
			
		||||
		read -p "(Y/n): " yn
 | 
			
		||||
	    case $yn in
 | 
			
		||||
	        [Yy]* ) return 0; break;;
 | 
			
		||||
	        [Nn]* ) return 1;;
 | 
			
		||||
			* ) echo "Invalid choice (y/n)";;
 | 
			
		||||
		esac
 | 
			
		||||
	done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
echo "${blue} // Do you wish to create symbolic links?${reset}"
 | 
			
		||||
if (yes_no); then
 | 
			
		||||
 | 
			
		||||
	# Backup prompt
 | 
			
		||||
	echo "${blue} // Do you wish to create backup? (otherwise your dotfiles will be deleted).${reset}"
 | 
			
		||||
	if (yes_no); then
 | 
			
		||||
 | 
			
		||||
		echo "${gold} >> Backing up current dotfile configuration${reset}"
 | 
			
		||||
		sleep 1s
 | 
			
		||||
 | 
			
		||||
		# Create backup floder if it doesn't exist
 | 
			
		||||
		if ! [ -d "$SCRIPT_DIR/backup" ]; then
 | 
			
		||||
			echo "Creating backup directory $SCRIPT_DIR/backup"
 | 
			
		||||
			mkdir "$SCRIPT_DIR/backup"
 | 
			
		||||
		else
 | 
			
		||||
			echo "Backup directory: $SCRIPT_DIR/backup"
 | 
			
		||||
		fi
 | 
			
		||||
 | 
			
		||||
		# Backup .oh-my-zsh floder and move it to proper location
 | 
			
		||||
		if [ -d "$HOME/.oh-my-zsh"]; then
 | 
			
		||||
			echo "Creating backup of .oh-my-zsh"
 | 
			
		||||
			cp -r "$HOME/.oh-my-zsh" "$SCRIPT_DIR/backup/"
 | 
			
		||||
			# Ensure .config directory existence
 | 
			
		||||
			if ! [ -d "$HOME/.config" ]; then
 | 
			
		||||
				mkdir "$HOME/.config"
 | 
			
		||||
			fi
 | 
			
		||||
			# Move oh-my-zsh to config (to match .zshrc position)
 | 
			
		||||
			echo "Moving .oh-my-zsh/ to $HOME/.config/oh-my-zsh"
 | 
			
		||||
			mv "$HOME/.oh-my-zsh" "$HOME/.config/oh-my-zsh"
 | 
			
		||||
		fi
 | 
			
		||||
 | 
			
		||||
		# Loop through all dotfiles which will be affected and copy them to backup dir
 | 
			
		||||
		for file in $(find $SCRIPT_DIR/files -type f); do
 | 
			
		||||
			file=${file/$SCRIPT_DIR\/files\//}
 | 
			
		||||
 | 
			
		||||
			if [ -f "$HOME/$file" ]; then
 | 
			
		||||
				# Get name of parent directory of current file
 | 
			
		||||
				dirname=$(dirname "${file}")
 | 
			
		||||
				# Ensure current dirname is in backup dir
 | 
			
		||||
				if ! [ -d "$SCRIPT_DIR/backup/$dirname" ]; then
 | 
			
		||||
					echo "Creating directory backup/$dirname"
 | 
			
		||||
					mkdir -p "$SCRIPT_DIR/backup/$dirname"
 | 
			
		||||
				fi
 | 
			
		||||
 | 
			
		||||
				echo "Backing up file: $HOME/$file"
 | 
			
		||||
				cp "$HOME/$file" "$SCRIPT_DIR/backup/$file"
 | 
			
		||||
				sleep 0.1s
 | 
			
		||||
			else
 | 
			
		||||
				echo "Skipping $file (not found)"
 | 
			
		||||
			fi
 | 
			
		||||
		done
 | 
			
		||||
	else
 | 
			
		||||
		echo "${yellow} >> (WARNING) Backing up cancelled, this will erease your current dotfiles${reset}"
 | 
			
		||||
		sleep 2s
 | 
			
		||||
	fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	# Create SymLinks
 | 
			
		||||
	echo "${gold} >> Creating symbolic links to dotfiles${reset}"
 | 
			
		||||
	sleep 1s
 | 
			
		||||
 | 
			
		||||
	# Loop through every
 | 
			
		||||
	for file in $(find $SCRIPT_DIR/files -type f) ; do
 | 
			
		||||
		file=${file/$SCRIPT_DIR\/files\//}
 | 
			
		||||
 | 
			
		||||
		dirname=$(dirname "$HOME/$file")
 | 
			
		||||
		if ! [ -d $dirname ]; then
 | 
			
		||||
			echo "Creating directory: $dirname"
 | 
			
		||||
			mkdir -p $dirname
 | 
			
		||||
		fi
 | 
			
		||||
 | 
			
		||||
		echo "Creating symbolic link: $HOME/$file"
 | 
			
		||||
		ln -sf "$SCRIPT_DIR/files/$file" "$HOME/$file"
 | 
			
		||||
		# If file is .gitignore ask user for name and email to fill into that file
 | 
			
		||||
		if [[ $file == *'.gitconfig' ]]; then
 | 
			
		||||
			echo "${blue} // Please specify your name for gitconfig (will be used as commits creators name)${reset}"
 | 
			
		||||
			read NAME
 | 
			
		||||
			if ! [ -z $NAME ]; then
 | 
			
		||||
				sed -i "3s/.*/	name = $NAME/" "$SCRIPT_DIR/files/$file"
 | 
			
		||||
			else
 | 
			
		||||
				default_name=$(sed '3q;d' "$SCRIPT_DIR/files/$file")
 | 
			
		||||
				default_name="${default_name/\	/}"
 | 
			
		||||
				default_name="${default_name/name = /}"
 | 
			
		||||
				echo "${yellow} >> NAME not specified, using default ($default_name)${reset}"
 | 
			
		||||
			fi
 | 
			
		||||
 | 
			
		||||
			echo "${blue} // Please specify your email for gitconfig (will be used as commits creators mail)${reset}"
 | 
			
		||||
			read EMAIL
 | 
			
		||||
			if ! [ -z $EMAIL ]; then
 | 
			
		||||
				sed -i "4s/.*/	email = $EMAIL/" "$SCRIPT_DIR/files/$file"
 | 
			
		||||
			else
 | 
			
		||||
				default_email=$(sed '4q;d' "$SCRIPT_DIR/files/$file")
 | 
			
		||||
				default_email="${default_email/\	/}"
 | 
			
		||||
				default_email="${default_email/email = /}"
 | 
			
		||||
				echo "${yellow} >> EMAIL not specified, using default ($default_email)${reset}"
 | 
			
		||||
			fi
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
			unset NAME EMAIL default_name default_email
 | 
			
		||||
		fi
 | 
			
		||||
		sleep 0.2s
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
	unset file
 | 
			
		||||
else
 | 
			
		||||
	echo "${grey} >> Symbolic links to dotfiles will not be created${reset}"
 | 
			
		||||
	sleep 1s
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
if [ -f "$SCRIPT_DIR/package_install.sh" ]; then
 | 
			
		||||
 | 
			
		||||
	echo "${blue} // Do you wish to install some recommended packages?${reset}"
 | 
			
		||||
	if (yes_no); then
 | 
			
		||||
		echo "${gold} >> Installing packages, redirection to external script ($SCRIPT_DIR/package_install.sh)${reset}"
 | 
			
		||||
		sleep 1s
 | 
			
		||||
		sh "$SCRIPT_DIR/package_install.sh"
 | 
			
		||||
	else
 | 
			
		||||
		echo "${grey} >> No additional packages will be installed.${reset}"
 | 
			
		||||
		sleep 1s
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
unset title txt1 txt2 txt3
 | 
			
		||||
unset SCRIPT_DIR output
 | 
			
		||||
 | 
			
		||||
echo "${bold}Installation Complete.${reset}"
 | 
			
		||||
							
								
								
									
										123
									
								
								package_install.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								package_install.sh
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,123 @@
 | 
			
		|||
#!/usr/bin/sh
 | 
			
		||||
 | 
			
		||||
# Set some basic colors using tput (8-bit color: 256 colors)
 | 
			
		||||
bold="$(tput bold)"
 | 
			
		||||
red="$(tput setaf 196)"
 | 
			
		||||
blue="$(tput setaf 27)"
 | 
			
		||||
yellow="$(tput setaf 226)"
 | 
			
		||||
gold="$(tput setaf 214)"
 | 
			
		||||
grey="$(tput setaf 238)"
 | 
			
		||||
lgrey="$(tput setaf 243)"
 | 
			
		||||
green="$(tput setaf 46)"
 | 
			
		||||
reset="$(tput sgr0)"
 | 
			
		||||
 | 
			
		||||
SCRIPT_DIR="$HOME/dotfiles"
 | 
			
		||||
 | 
			
		||||
function choose() {
 | 
			
		||||
	return $(whiptail \
 | 
			
		||||
			--title "$1" \
 | 
			
		||||
			--yesno "$2" 25 72 \
 | 
			
		||||
			3>&1 1>&2 2>&3)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function menu2() {
 | 
			
		||||
	output=$(whiptail \
 | 
			
		||||
			--title "$1" \
 | 
			
		||||
			--menu "$2" 25 72 0 \
 | 
			
		||||
			"1" "$3" \
 | 
			
		||||
			"2" "$4" \
 | 
			
		||||
			3>&1 1>&2 2>&3)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function cecho() {
 | 
			
		||||
	echo "${lgrey} (package-install) $1${reset}"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function yes_no() {
 | 
			
		||||
	while true; do
 | 
			
		||||
		read -p "(Y/n): " yn
 | 
			
		||||
	    case $yn in
 | 
			
		||||
	        [Yy]* ) return 0; break;;
 | 
			
		||||
	        [Nn]* ) return 1;;
 | 
			
		||||
			* ) echo "Invalid choice (y/n)";;
 | 
			
		||||
		esac
 | 
			
		||||
	done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function choice2() {
 | 
			
		||||
	cecho "${green} -> 1. $1"
 | 
			
		||||
	cecho "${green} -> 2. $2"
 | 
			
		||||
	cecho "${green} -> c. Cancel"
 | 
			
		||||
	while true; do
 | 
			
		||||
		read -p "(1/2/c): " yn
 | 
			
		||||
	    case $yn in
 | 
			
		||||
	        [1]* ) return "1"; break;;
 | 
			
		||||
	        [2]* ) return "2";;
 | 
			
		||||
			[cC]* ) return "c";;
 | 
			
		||||
			* ) echo "Invalid choice (1/2/c)";;
 | 
			
		||||
		esac
 | 
			
		||||
	done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function choice3() {
 | 
			
		||||
	cecho "${green} -> 1. $1"
 | 
			
		||||
	cecho "${green} -> 2. $2"
 | 
			
		||||
	cecho "${green} -> 3. $3"
 | 
			
		||||
	cecho "${green} -> c. Cancel"
 | 
			
		||||
	while true; do
 | 
			
		||||
		read -p "(1/2/3/c): " yn
 | 
			
		||||
	    case $yn in
 | 
			
		||||
	        [1]* ) return "1"; break;;
 | 
			
		||||
	        [2]* ) return "2";;
 | 
			
		||||
			[3]* ) return "3";;
 | 
			
		||||
			[cC]* ) return "c";;
 | 
			
		||||
			* ) echo "Invalid choice (1/2/c)";;
 | 
			
		||||
		esac
 | 
			
		||||
	done
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
cecho "${blue} // Do you wish to upgrade packages before installing (recommended) [pacman -Syu]"
 | 
			
		||||
if (yes_no); then
 | 
			
		||||
	sudo pacman -Syu
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cecho "${gold} >> Choose which packages you wish to install"
 | 
			
		||||
cecho "${blue} // X window system (xorg xorg-server)"
 | 
			
		||||
if (yes_no); then
 | 
			
		||||
	sudo pacman -S xorg xorg-server
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cecho "${blue} // Desktop Enviroment (you will be able to choose which DE)"
 | 
			
		||||
if (yes_no); then
 | 
			
		||||
	res = choice2 "KDE - Plasma" "Gnome"
 | 
			
		||||
	if [ $res == "1" ]; then
 | 
			
		||||
		cecho "${gold} >> Installing plasma"
 | 
			
		||||
		sudo pacman -S --needed plasma
 | 
			
		||||
	elif [ $res == "2" ]; then
 | 
			
		||||
		cecho "${gold} >> Installing gnome"
 | 
			
		||||
		sudo pacman -S --needed gnome
 | 
			
		||||
	else
 | 
			
		||||
		cecho "${yellow} >> Aborting Desktop Enviroment installation"
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cecho "${blue} // Desktop Manager (you will be able to choose which DM)"
 | 
			
		||||
if (yes_no); then
 | 
			
		||||
	res = choice3 "SDDM (KDE)" "GDM (Gnome)" "LightDM"
 | 
			
		||||
	if [ $res == "1" ]; then
 | 
			
		||||
		cecho "${gold} >> Installing SDDM (KDE)"
 | 
			
		||||
		sudo pacman -S --needed sddm
 | 
			
		||||
	elif [ $res == "2" ]; then
 | 
			
		||||
		sudo pacman -S --needed gdm
 | 
			
		||||
	elif [ $res == "3" ]; then
 | 
			
		||||
		sudo pacman -S --needed lightdm
 | 
			
		||||
	else
 | 
			
		||||
		echo "${lgrey} (package-install) ${yellow} >> Aborting Desktop Enviroment install"
 | 
			
		||||
	fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# sudo pacman -S plasma | sudo pacman -S gnome
 | 
			
		||||
sudo pacman -S git
 | 
			
		||||
sudo pacman -S
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue