diff --git a/bash/.alias.sh b/bash/.alias.sh new file mode 100644 index 0000000..10b258e --- /dev/null +++ b/bash/.alias.sh @@ -0,0 +1,107 @@ +# useful dockers +alias phpserver='docker run --rm -p 2000:80 -v "$PWD":/var/www/html mastermindzh/php-xdebug' +alias nodeserver='docker run --rm -p 3000:3000 -v "$PWD":/app mastermindzh/generic_node' +alias reactserver='docker run --rm -p 8080:8080 -v "$PWD":/app mastermindzh/generic_node' + +#upload text to sprunge.us +#USAGE cat file.txt | sprunge +alias sprunge='curl -F "sprunge=<-" http://sprunge.us' + +## pacman and yaourt +alias aur='yaourt --noconfirm' +alias update='yaourt -Syyu --noconfirm --aur' + +## systeminfo +alias meminfo='free -mth' +alias cpuinfo='lscpu' +alias hddinfo='df -h' +alias temp='watch "sensors | grep Core"' +alias internalip=$'ip route get 8.8.8.8 | awk \'NR==1 {print $NF}\'' + +#show 5 most memory consuming apps +alias psmem='ps auxf | sort -nr -k 5 | head -n 5' + +#git +alias gitdiff='git diff --name-only --diff-filter=U' +alias status='git status' +alias push='git push' +alias add='git add .' + +##utility +alias nmapscan='nmap -n -sP' + +# show file content without comment lines +alias nocomment='grep -Ev '\''^(#|$)'\''' + +#show directories +alias dirs='ls -FlA | grep :*/' + +#show executables +alias execx='ls -FlA | grep -v \*' + +#ls -al +alias la='ls -al' + +# show external ip +alias cmyip='curl -s http://ipecho.net/plain; echo' + +## default command fixes :P +alias mkdir='mkdir -p' +alias wget='wget -c' +alias ls='ls --color=auto' + +## Functions + +# function to cd up a couple of times +# USAGE: up 3 (goes up 3 directories) +up(){ + DEEP=$1; + [ -z "${DEEP}" ] && { DEEP=1; }; + for i in $(seq 1 ${DEEP}); do + cd ../; + done; +} +# function to extract ... well anything really +extract () { + if [ -f $1 ] ; then + case $1 in + *.tar.bz2) tar xvjf $1 ;; + *.tar.gz) tar xvzf $1 ;; + *.bz2) bunzip2 $1 ;; + *.rar) unrar x $1 ;; + *.gz) gunzip $1 ;; + *.tar) tar xvf $1 ;; + *.tbz2) tar xvjf $1 ;; + *.tgz) tar xvzf $1 ;; + *.zip) unzip $1 ;; + *.Z) uncompress $1 ;; + *.7z) 7z x $1 ;; + *) echo "don't know how to extract '$1'..." ;; + esac + else + echo "'$1' is not a valid file!" + fi +} + +# function to return uptime in a human readable format +myuptime () { + uptime | awk '{ print "Uptime:", $3, $4, $5 }' | sed 's/,//g' + return; +} + +# function to check whether a specific host is up +isup(){ + if ! [ -z "$1" ]; then + ping -c 3 $1 > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "$1 Seems to be offline"; + else + echo "$1 Seems to be online"; + fi + fi +} + +# function to print a line across the screen +printLine(){ + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - +} diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..4394492 --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,17 @@ +# +# ~/.bashrc +# + +source ~/.alias +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + + +alias ls='ls --color=auto' + +eval $(thefuck --alias) + +#... :P fancy stuffs +screenfetch -t -A "UBUNTU" +PS1='[\u@\h \W]\$ ' + diff --git a/config/gtk-3.0/settings.ini b/config/gtk-3.0/settings.ini new file mode 100644 index 0000000..87968a3 --- /dev/null +++ b/config/gtk-3.0/settings.ini @@ -0,0 +1,16 @@ +gtk-application-prefer-dark-theme=0 +gtk-theme-name=Arc +gtk-icon-theme-name=Numix +gtk-font-name=System San Francisco Display 12 +gtk-cursor-theme-name=Breeze +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull +gtk-xft-rgba=rgb \ No newline at end of file diff --git a/dependencies.txt b/dependencies.txt index 2185f4c..6c93bac 100644 --- a/dependencies.txt +++ b/dependencies.txt @@ -4,16 +4,16 @@ arandr chromium xfce4-terminal nautilus -gnome-sushi +sushi compton lxappearance arc-gtk-theme rofi -rofi-dmenu i3blocks gnome-screenshot wmctrl -x11-xserver-utils zenity -xrandr -nm-applet +xorg-xrandr +networkmanager +notify-osd +eog diff --git a/config b/i3/config similarity index 98% rename from config rename to i3/config index aff7130..fbf7963 100644 --- a/config +++ b/i3/config @@ -1,3 +1,6 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# # i3 config file (v4) # # Please see http://i3wm.org/docs/userguide.html for a complete reference! @@ -35,7 +38,6 @@ set $workspace11 " Enpass" ############################################ # i3 management keys # ############################################ -# use the interactive tool xev to find the keycode # kill focused window bindsym $mod+Shift+q kill @@ -210,8 +212,6 @@ for_window [class="Eog"] floating enable assign [class="Google Play Music Desktop Player"] $workspace10 assign [class="Franz"] $workspace9 assign [class="Enpass-Desktop"] $workspace11 -assign [class="robo3t"] $workspace8 -assign [class="Mysql-workbench-bin"] $workspace8 # database stuff assign [class="MongoDB Compass"] $workspace8 diff --git a/i3blocks.conf b/i3/i3blocks.conf similarity index 100% rename from i3blocks.conf rename to i3/i3blocks.conf diff --git a/icons/lock.png b/i3/icons/lock.png similarity index 100% rename from icons/lock.png rename to i3/icons/lock.png diff --git a/scripts/blocks/currentSong.py b/i3/scripts/blocks/currentSong.py similarity index 100% rename from scripts/blocks/currentSong.py rename to i3/scripts/blocks/currentSong.py diff --git a/scripts/blocks/temp.sh b/i3/scripts/blocks/temp.sh similarity index 100% rename from scripts/blocks/temp.sh rename to i3/scripts/blocks/temp.sh diff --git a/scripts/brightness.sh b/i3/scripts/brightness.sh similarity index 100% rename from scripts/brightness.sh rename to i3/scripts/brightness.sh diff --git a/scripts/i3lock.sh b/i3/scripts/i3lock.sh similarity index 100% rename from scripts/i3lock.sh rename to i3/scripts/i3lock.sh diff --git a/scripts/screenshot.sh b/i3/scripts/screenshot.sh similarity index 100% rename from scripts/screenshot.sh rename to i3/scripts/screenshot.sh diff --git a/scripts/startup.sh b/i3/scripts/startup.sh similarity index 100% rename from scripts/startup.sh rename to i3/scripts/startup.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..1f984f5 --- /dev/null +++ b/install.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# ======================================= +# Functions +# ======================================= + +# Ask a question and return true or false based on the users input +function yes_or_no { + while true; do + read -p "$* [y/n]: " yn + case $yn in + [Yy]*) return 0 ;; + [Nn]*) echo "Aborted" ; return 1 ;; + esac + done +} + +# moves all fonts into the fonts directory (overwriting existing files) +function install_fonts { + yes | cp -rf ./fonts/*.ttf ~/.fonts +} + +# install basic rice files +function install_rice { + mkdir ~/.config/i3 + yes | cp -rf ../* ~/.config/i3 +} + +# install other configs +function install_config { + rsync -av ./config ~/.config +} + +# Installs the dependencies on Arch Linux +function install_dependencies { + sudo pacman -S $(cat dependencies.txt | sed ':a;N;$!ba;s/\n/ /g') +} + +# list the dependencies file +function list_dependencies { + echo "" + echo "==========================" + echo "" + cat dependencies.txt + echo "" + echo "==========================" + echo "" +} + +# Run the intro bit +function intro { + echo "This will install my i3rice". +} + + +# ======================================= +# Main loop +# ======================================= + +# Run the intro function +intro + +# Ask for dependency installation +list_dependencies +yes_or_no "Do you want to install the list of applications above?" && install_dependencies + +# Ask for font installation +yes_or_no "Do you want to install the fonts?" && install_fonts + +# Ask the user whether it wants to continue +yes_or_no "Are you sure you want to install my rice?" && install_rice