Index

dotfiles / 8085050

My personal dotfiles for Debian/Ubuntu.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
2122 Sep 2021 19:308085050Update dotfilesJosh Stockin11260G

Blob @ dotfiles / install.sh

text/x-shellscript2984 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
34# Bash config
35category "Bash config"
36item "~/.bash_aliases"
37install .bash_aliases $HOME/.bash_aliases
38item "~/.bashrc"
39install .bashrc $HOME/.bashrc
40item "~/.profile"
41install .profile $HOME/.profile
42
43category "Common folders"
44item "~/src/"
45SRCFOLDER=$HOME/src
46mkdir -p $SRCFOLDER
47
48# Local scripts
49category "Local scripts"
50LOCALBIN=$HOME/.local/bin
51if [ $UNIT == "DESKTOP" ]; then
52 item "~/.local/bin/middle-mouse-scroll"
53 install middle-mouse-scroll $LOCALBIN/middle-mouse-scroll
54fi
55item "~/.local/bin/minesweeper"
56if [ ! -f $LOCALBIN/minesweeper ]; then
57 git clone --depth=1 git://joshstock.in/ncurses-minesweeper.git $SRCFOLDER/ncurses-minesweeper
58 cd $SRCFOLDER/ncurses-minesweeper
59 make compile build
60 install bin/minesweeper $LOCALBIN/minesweeper
61 rm -rf $SRCFOLDER/ncurses-minesweeper
62fi
63
64if [ $UNIT == "DESKTOP" ] || [ $UNIT == "LAPTOP" ]; then
65 # GTK config
66 category "GTK config"
67
68 GTKDIR=$HOME/.config/gtk-3.0
69 item "~/.config/gtk-3.0/"
70 mkdir -p $GTKDIR
71
72 item "~/.config/gtk-3.0/gtk.css"
73 install gtk.css $GTKDIR/gtk.css
74
75 item "Terminal theme 'Oceanic Next'"
76 ./terminal_theme.sh $1 &>/dev/null
77
78 # Fonts
79 category "Fonts"
80
81 item "~/.fonts/"
82 FONTDIR=$HOME/.fonts
83 mkdir -p $FONTDIR
84
85 item "Fira Sans pack"
86
87 item "Fira Mono (Powerline-patched) pack"
88 if [ ! -f $FONTDIR/FiraMono-Regular.otf ]; then
89 curl -fLso $FONTDIR/FiraMono-Regular.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Regular%20Powerline.otf
90 fi
91 if [ ! -f $FONTDIR/FiraMono-Medium.otf ]; then
92 curl -fLso $FONTDIR/FiraMono-Medium.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Medium%20Powerline.otf
93 fi
94 if [ ! -f $FONTDIR/FiraMono-Bold.otf ]; then
95 curl -fLso $FONTDIR/FiraMono-Bold.otf https://github.com/powerline/fonts/raw/master/FiraMono/FuraMono-Bold%20Powerline.otf
96 fi
97
98 item "Refreshing font cache"
99 fc-cache
100fi
101
102# Global git config
103category "Global git config"
104
105item "~/.gitconfig"
106install .gitconfig $HOME/.gitconfig
107
108# Vim
109category "Vim config"
110
111item "~/.vim/"
112VIMDIR=$HOME/.vim
113mkdir -p $VIMDIR
114
115item "~/.vim/vimrc"
116if [ $UNIT == "HEADLESS" ]; then
117 grep -v "RMHEADLESS" vimrc > $VIMDIR/vimrc
118else
119 install vimrc $VIMDIR/vimrc
120fi
121
122item "~/.vim/autoload/plug.vim"
123curl -fLso $VIMDIR/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
124
125# Done
126echo -e " \e[1;33mDONE\e[0m"
127