Index

dotfiles / ca87b70

My personal dotfiles for Debian/Ubuntu.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
2703 Oct 2021 20:19ca87b70Fix minesweeper install, headless vim color schemeJosh Stockin11610G

Blob @ dotfiles / install.sh

text/x-shellscript3454 bytesdownload raw
1#!/bin/bash
2
3HELPTEXT="./install.sh <desktop|laptop|headless>"
4case $1 in
5 h|help|\?|-h|-help|-\?|--h|--help|--\?)
6 echo -e $HELPTEXT
7 exit 0
8 ;;
9 desktop)
10 UNIT=DESKTOP
11 ;;
12 laptop)
13 UNIT=LAPTOP
14 ;;
15 headless)
16 UNIT=HEADLESS
17 ;;
18 *)
19 echo -e $HELPTEXT
20 exit 0
21 ;;
22esac
23
24category(){
25 echo -e " \e[1;37m$1\e[0m"
26}
27
28item(){
29 echo -e " \e[0m$1\e[0m"
30}
31
32echo -e " \e[1;33mInstall type \e[1;35m$UNIT\e[0m"
33
34SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
35
36# Bash config
37category "Bash config"
38item "~/.bash_aliases"
39install $SCRIPT_DIR/.bash_aliases $HOME/.bash_aliases
40item "~/.bashrc"
41install $SCRIPT_DIR/.bashrc $HOME/.bashrc
42item "~/.profile"
43install $SCRIPT_DIR/.profile $HOME/.profile
44
45category "Common folders"
46item "~/src/"
47SRCFOLDER=$HOME/src
48mkdir -p $SRCFOLDER
49item "~/.local/bin/"
50LOCALBIN=$HOME/.local/bin
51mkdir -p $LOCALBIN
52
53# Local scripts
54category "Local scripts"
55if [ $UNIT == "DESKTOP" ]; then
56 item "~/.local/bin/middle-mouse-scroll"
57 install $SCRIPT_DIR/middle-mouse-scroll $LOCALBIN/middle-mouse-scroll
58fi
59item "~/.local/bin/minesweeper"
60if ! command -v minesweeper &> /dev/null
61then
62 git clone --depth=1 git://joshstock.in/ncurses-minesweeper.git $SRCFOLDER/ncurses-minesweeper
63 cd $SRCFOLDER/ncurses-minesweeper
64 make compile build
65 install bin/minesweeper $LOCALBIN/minesweeper
66 rm -rf $SRCFOLDER/ncurses-minesweeper
67 cd $SCRIPT_DIR
68fi
69
70if [ $UNIT == "DESKTOP" ] || [ $UNIT == "LAPTOP" ]; then
71 # GTK config
72 category "GTK config"
73
74 GTKDIR=$HOME/.config/gtk-3.0
75 item "~/.config/gtk-3.0/"
76 mkdir -p $GTKDIR
77
78 item "~/.config/gtk-3.0/gtk.css"
79 install $SCRIPT_DIR/gtk.css $GTKDIR/gtk.css
80
81 item "Terminal theme 'Oceanic Next'"
82 $SCRIPT_DIR/terminal_theme.sh $1 &>/dev/null
83
84 # Fonts
85 category "Fonts"
86
87 item "~/.fonts/"
88 FONTDIR=$HOME/.fonts
89 mkdir -p $FONTDIR
90
91 item "Fira Sans pack"
92 if [ ! -f $FONTDIR/FiraSans-Regular.ttf ]; then
93 curl -fLso /tmp/Fira.zip https://fonts.google.com/download?family=Fira%20Sans
94 unzip -q /tmp/Fira.zip -d $FONTDIR
95 fi
96
97 item "Fira Mono (Powerline-patched) pack"
98 if [ ! -f $FONTDIR/FuraMono-Regular\ Powerline.otf ]; then
99 curl -fLso $FONTDIR/FuraMono-Regular\ Powerline.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Regular%20Powerline.otf
100 fi
101 if [ ! -f $FONTDIR/FuraMono-Medium.otf ]; then
102 curl -fLso $FONTDIR/FuraMono-Medium\ Powerline.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Medium%20Powerline.otf
103 fi
104 if [ ! -f $FONTDIR/FuraMono-Bold.otf ]; then
105 curl -fLso $FONTDIR/FuraMono-Bold\ Powerline.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Bold%20Powerline.otf
106 fi
107
108 item "Refreshing font cache"
109 fc-cache
110fi
111
112# Global git config
113category "Global git config"
114
115item "~/.gitconfig"
116install $SCRIPT_DIR/.gitconfig $HOME/.gitconfig
117
118# Vim
119category "Vim config"
120
121item "~/.vim/"
122VIMDIR=$HOME/.vim
123mkdir -p $VIMDIR
124
125item "~/.vim/vimrc"
126if [ $UNIT == "HEADLESS" ]; then
127 grep -v "RMHEADLESS" vimrc > $VIMDIR/vimrc
128else
129 install $SCRIPT_DIR/vimrc $VIMDIR/vimrc
130fi
131
132item "~/.vim/autoload/plug.vim"
133curl -fLso $VIMDIR/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
134
135# Done
136echo -e " \e[1;33mDONE\e[0m"
137