Switch to a simpler fake_home scheme.

Also add a few vim templates.
This commit is contained in:
Sage Vaillancourt 2022-12-03 00:56:43 -05:00
parent 39213f4565
commit daaf838366
22 changed files with 107 additions and 48 deletions

8
.idea/.dotfiles.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

69
copy.sh
View File

@ -1,52 +1,29 @@
#!/bin/bash #!/bin/bash
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
moving_files="$(find $SCRIPT_DIR -mindepth 1 -maxdepth 1 -type f -not -name "copy.sh" -not -name "*.git*")"
moving_files=$(echo -e "$moving_files\n$(find $SCRIPT_DIR/.vim/colors/ -mindepth 1)")
moving_files=$(echo -e "$moving_files\n$(find $SCRIPT_DIR/.config/ -mindepth 1)")
mkdir -p $HOME/.vim/user/
touch $HOME/.vim/user/files.vim
home_files=""
for f in $moving_files; do
home_file="$HOME$(echo $f | sed "s@$SCRIPT_DIR@@")"
if test -f "$home_file" && ! diff $home_file $f &>/dev/null; then
home_files="$home_files\n $home_file"
fi
done
if [[ "$home_files" != "" ]]; then
echo -n "Warning! This will overwrite all of the following files:"
echo -e $home_files
read -r -p "Are you sure you want to continue? [y/N] " response
response=${response,,} # tolower
if ! [[ "$response" =~ ^(yes|y)$ ]]; then
exit 1
fi
fi
for f in $moving_files; do
echo "$f => ~/"
ln -sf $f ~/
done
mkdir -p ~/.vim/colors
ln -sf $SCRIPT_DIR/.vim/colors/* ~/.vim/colors/
mkdir -p ~/.config/
ln -sf $SCRIPT_DIR/.config/* ~/.config/
touch ~/.zsh_local
if ! test -f ~/.gitlocal; then
echo "[user]" > ~/.gitlocal
echo " email = sagev9000@tutanota.com" >> ~/.gitlocal
fi
# Install required packages # Install required packages
if [[ "$1" == "--install" ]]; then if [[ "$1" != "--install" ]]; then
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
FAKE_HOME="$SCRIPT_DIR/fake_home"
dotdirs="$(find $FAKE_HOME -mindepth 1 -type d)"
echo "$dotdirs" | while read -r dotdir; do
new="$HOME${dotdir:${#FAKE_HOME}}"
echo "mkdir -p $new"
mkdir -p $new
done
dotfiles="$(find $FAKE_HOME -mindepth 1 -type f)"
echo "$dotfiles" | while read -r dotfile; do
new="$HOME${dotfile:${#FAKE_HOME}}"
echo "$dotfile => $new"
ln -sf "$dotfile" "$new"
done
touch "$HOME/.zsh_local"
else
echo -n "Rust is " echo -n "Rust is "
if ! command -v cargo; then if ! command -v cargo; then
echo "not installed. Installing..." echo "not installed. Installing..."

View File

@ -1,4 +1,4 @@
add_newline = false add_newline = true
format = """ format = """
[\\[sage\\]](bold red) \ [\\[sage\\]](bold red) \
$username\ $username\
@ -78,3 +78,17 @@ format = "$symbol"
[time] [time]
disabled = true disabled = true
use_12hr = true use_12hr = true
[[battery.display]]
threshold = 20
style = "bold red"
[[battery.display]] # "bold yellow" style when capacity is between 10% and 50%
threshold = 30
style = "yellow"
discharging_symbol = " "
# [[battery.display]]
# threshold = 100
# style = "green"
# discharging_symbol = " "

View File

@ -148,6 +148,7 @@ nnoremap <Leader>v :vert term ++cols=80<CR>
nnoremap <Leader>t :term ++rows=20<CR> nnoremap <Leader>t :term ++rows=20<CR>
autocmd BufNewFile,BufRead * if expand('%:t') !~ '\.' | setl spell | endif autocmd BufNewFile,BufRead * if expand('%:t') !~ '\.' | setl spell | endif
autocmd BufNewFile,BufRead *.pbl set syntax=clojure
" Expand %% to the current files dir " Expand %% to the current files dir
cabbr <expr> %% expand('%:p:h') cabbr <expr> %% expand('%:p:h')

View File

@ -38,7 +38,7 @@ if [ -x /usr/bin/dircolors ]; then
alias egrep='egrep --color=auto' alias egrep='egrep --color=auto'
fi fi
export PATH=./:~/.bin:/usr/local/go/bin:$PATH export PATH=./:~/.bin:$HOME/.platformio/penv/bin:/usr/local/go/bin:$PATH
fignore=(o) fignore=(o)
@ -91,3 +91,7 @@ if test -f ~/.cargo/env; then
fi fi
source ~/.shell_aliases source ~/.shell_aliases
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion

View File

@ -0,0 +1,9 @@
CC=gcc
CFLAGS=-I.
MAIN=hello
nonnull: $(MAIN).o
$(CC) -o $(MAIN) $(MAIN).o
clean:
rm ./*.o

View File

@ -0,0 +1,5 @@
#include <stdio.h>
int main() {
printf("Hello, world!\n");
}

View File

@ -0,0 +1,7 @@
#include <iostream>
using namespace std;
int main() {
cout << "Hello, world!" << endl;
}

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="styles.css">
<title>Wow, the title of the new website</title>
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#242627">
<meta name="msapplication-TileColor" content="#224679">
<meta name="theme-color" content="#ffffff">
<meta name="description" content="This should be a lovely new description">
</head>
<body>
<h1>Hello, world!</h1>
<p>This is the beginning of a beautiful new website.</p>
</body>
</html>

View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "Hello, world!"