Skip to content

Commit

Permalink
Simplify setup
Browse files Browse the repository at this point in the history
  • Loading branch information
leomeinel committed Apr 20, 2023
1 parent 8385f7e commit 079fa91
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,10 @@
# Fail on error
set -e

# Define functions
sed_exit() {
echo "ERROR: 'sed' didn't replace, report this @"
echo " https://github.com/leomeinel/dot-files/issues"
exit 1
}

# Copy dot-files
cp -R ~/dot-files/.config ~/dot-files/.bash_aliases ~/dot-files/.bash_logout ~/dot-files/.bash_profile ~/dot-files/.bashrc ~/
source ~/.bash_profile

# Set screenshot dir
mkdir -p ~/Documents/Pictures/Screenshots
HOME=$(echo ~)
## START sed
FILE=~/.config/spectaclerc
STRING="^defaultSaveLocation=.*"
grep -q "$STRING" "$FILE" || sed_exit
sed -i "s|$STRING|defaultSaveLocation=file://$HOME/Documents/Pictures/Screenshots|" "$FILE"
## END sed

# Give KDE logout scripts correct permissions
chmod 744 ~/.config/plasma-workspace/shutdown/*.sh

# Create .ssh
mkdir -p ~/.ssh
chmod 700 ~/.ssh
Expand All @@ -45,6 +25,8 @@ mkdir -p ~/src
chmod 700 ~/src

# Create XDG dirs
# Some of these exist, even tho the program isn't installed.
# This is on purpose in case one of the programs gets installed later on.
mkdir -p ~/.local/share/android
mkdir -p ~/.local/share/cargo
mkdir -p ~/.local/share/go
Expand All @@ -56,10 +38,6 @@ mkdir -p ~/.local/state/bash
mkdir -p ~/.local/share/gnupg
chmod 700 ~/.local/share/gnupg

# Set default rust if rustup is installed
pacman -Qq rustup >/dev/null 2>&1 &&
rustup default stable

# Initialize nvim
nvim --headless -c 'sleep 5' -c 'q!'

Expand Down

0 comments on commit 079fa91

Please sign in to comment.