diff options
| author | Shubham Saini <shubham6405@gmail.com> | 2019-12-22 12:03:39 +0000 |
|---|---|---|
| committer | Shubham Saini <shubham6405@gmail.com> | 2019-12-22 12:03:39 +0000 |
| commit | d3a50583212a40a62d0bc29d05cc1ce2694c8a27 (patch) | |
| tree | 9514bc1bf2a9160a22a1dab1f79a3c0f5552f0f8 /bin | |
| parent | 364aef77ed7b8267b3223e2c5dce946b83aa694d (diff) | |
changes
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/.local/bin/dotstow | 21 | ||||
| -rwxr-xr-x | bin/.local/bin/fetch | 63 | ||||
| -rwxr-xr-x | bin/.local/bin/gitit | 10 |
3 files changed, 94 insertions, 0 deletions
diff --git a/bin/.local/bin/dotstow b/bin/.local/bin/dotstow new file mode 100755 index 0000000..bcadc5e --- /dev/null +++ b/bin/.local/bin/dotstow | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # This script will Stow all the dotfiles located in the ~/dotfiles folder. | ||
| 4 | # The -R flag is used to force a 'restow' which will remove any existing symlinks before attempting to Stow. | ||
| 5 | |||
| 6 | echo "Stowing Dotfiles..."; | ||
| 7 | |||
| 8 | cd ~/dotfiles | ||
| 9 | for file in ~/dotfiles/*; do | ||
| 10 | # Only run Stow on the directories in the dotfiles folder and not the individual files. | ||
| 11 | # Using 'basename' strips the filepath from the directory name. | ||
| 12 | if [ -d ${file} ]; then | ||
| 13 | stow -R $(basename $file) | ||
| 14 | echo "$(basename $file) stowed."; | ||
| 15 | fi | ||
| 16 | done | ||
| 17 | |||
| 18 | # Return back to the your PWD from before you ran the script | ||
| 19 | cd ~- | ||
| 20 | |||
| 21 | echo 'All stowed'; | ||
diff --git a/bin/.local/bin/fetch b/bin/.local/bin/fetch new file mode 100755 index 0000000..609850c --- /dev/null +++ b/bin/.local/bin/fetch | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # ufetch-arch - tiny system info for arch | ||
| 4 | |||
| 5 | ## INFO | ||
| 6 | |||
| 7 | # user is already defined | ||
| 8 | host="$(hostname)" | ||
| 9 | os='Arch Linux' | ||
| 10 | kernel="$(uname -sr)" | ||
| 11 | uptime="$(uptime -p | sed 's/up //')" | ||
| 12 | packages="$(pacman -Q | wc -l)" | ||
| 13 | shell="$(basename ${SHELL})" | ||
| 14 | |||
| 15 | if [ -z "${WM}" ]; then | ||
| 16 | if [ "${XDG_CURRENT_DESKTOP}" ]; then | ||
| 17 | envtype='DE' | ||
| 18 | WM="${XDG_CURRENT_DESKTOP}" | ||
| 19 | elif [ "${DESKTOP_SESSION}" ]; then | ||
| 20 | envtype='DE' | ||
| 21 | WM="${DESKTOP_SESSION}" | ||
| 22 | else | ||
| 23 | envtype='WM' | ||
| 24 | WM="$(tail -n 1 "${HOME}/.xinitrc" | cut -d ' ' -f 2)" | ||
| 25 | fi | ||
| 26 | else | ||
| 27 | envtype='WM' | ||
| 28 | fi | ||
| 29 | |||
| 30 | ## DEFINE COLORS | ||
| 31 | |||
| 32 | # probably don't change these | ||
| 33 | bold="$(tput bold)" | ||
| 34 | black="$(tput setaf 0)" | ||
| 35 | red="$(tput setaf 1)" | ||
| 36 | green="$(tput setaf 2)" | ||
| 37 | yellow="$(tput setaf 3)" | ||
| 38 | blue="$(tput setaf 4)" | ||
| 39 | magenta="$(tput setaf 5)" | ||
| 40 | cyan="$(tput setaf 6)" | ||
| 41 | white="$(tput setaf 7)" | ||
| 42 | reset="$(tput sgr0)" | ||
| 43 | |||
| 44 | # you can change these | ||
| 45 | lc="${reset}${bold}${cyan}" # labels | ||
| 46 | nc="${reset}${bold}${cyan}" # user and hostname | ||
| 47 | ic="${reset}${bold}${white}" # info | ||
| 48 | c0="${reset}${bold}${cyan}" # first color | ||
| 49 | c1="${reset}${cyan}" # second color | ||
| 50 | |||
| 51 | ## OUTPUT | ||
| 52 | |||
| 53 | cat <<EOF | ||
| 54 | |||
| 55 | ${c0} /\ ${nc}${USER}${ic}@${nc}${host}${reset} | ||
| 56 | ${c0} /^^\ ${lc}OS: ${ic}${os}${reset} | ||
| 57 | ${c0} /\ \ ${lc}KERNEL: ${ic}${kernel}${reset} | ||
| 58 | ${c0} / ${c1}__ \ ${lc}UPTIME: ${ic}${uptime}${reset} | ||
| 59 | ${c1} / ( ) \ ${lc}PACKAGES: ${ic}${packages}${reset} | ||
| 60 | ${c1} / __| |__\\\\ ${lc}SHELL: ${ic}${shell}${reset} | ||
| 61 | ${c1} /// \\\\\ ${lc}${envtype}: ${ic}${WM}${reset} | ||
| 62 | |||
| 63 | EOF | ||
diff --git a/bin/.local/bin/gitit b/bin/.local/bin/gitit new file mode 100755 index 0000000..af3eeec --- /dev/null +++ b/bin/.local/bin/gitit | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | set -e | ||
| 3 | printf "\033[0;32mDeploying updates to GitHub...\033[0m\n" | ||
| 4 | git add . | ||
| 5 | msg="changes" | ||
| 6 | if [ -n "$*" ]; then | ||
| 7 | msg="$*" | ||
| 8 | fi | ||
| 9 | git commit -m "$msg" | ||
| 10 | git push origin master | ||
