diff --git a/.config/screen_layout.sh b/.config/screen_layout.sh deleted file mode 100755 index 2c8f77a..0000000 --- a/.config/screen_layout.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xrandr --output eDP-1 --primary --mode 1920x1080 --pos 1280x0 --rotate normal --output HDMI-3 --off --output HDMI-2 --off --output HDMI-1 --mode 1280x1024 --pos 0x56 --rotate normal --output DP-3 --off --output DP-2 --off --output DP-1 --off diff --git a/.crontab b/.crontab deleted file mode 100644 index 6a34fd7..0000000 --- a/.crontab +++ /dev/null @@ -1,2 +0,0 @@ -# Synchronize Google Drive -*/5 * * * * grive -p $HOME/GoogleDrive/ > /dev/null 2>&1 diff --git a/bin/screenlock.sh b/bin/screenlock.sh deleted file mode 100755 index a356ca9..0000000 --- a/bin/screenlock.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -i3lock-fancy -pf Roboto -- scrot -z \ No newline at end of file diff --git a/install.sh b/install.sh index ab47077..16fbcb3 100755 --- a/install.sh +++ b/install.sh @@ -2,14 +2,27 @@ # # Author: Severin Kaderli # Usage: ./install.sh -# Array of files which should be symlinked. -FILES=( + +####################################### +# Configuration variables +####################################### +# Array of directories which should be created +DIRECTORIES=( + "Build" + "Downloads" + "Projects" + ".logs" +) + +# Array of files which should be symlinked in the home folder +LINKED_FILES_HOME=( ".aliases" ".bash_logout" ".bash_profile" ".bashrc" ".config/compton.conf" ".config/dunst" + ".config/gtk-3.0" ".config/i3" ".config/polybar" ".config/streamlink" @@ -22,20 +35,59 @@ FILES=( ".keyleds" ".vimrc" ".xinitrc" + ".xprofile" ".Xresources" "bin" ) -# The directory of this repository -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +# Array of systemd services which should be enabled +SYSTEMD_SERVICES=( + "cronie" + "bumblebeed" +) +####################################### +# Directory variables +####################################### +DIR="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)" +SYSTEM_DIR="$DIR/system" +PACKAGES_DIR="$DIR/packages" + +####################################### +# Helper functions +####################################### # Function to display fancy headers function print_header() { - echo -e "\e[32m########################################" + echo -e "\n\e[32m########################################" echo -e "# $1" echo -e "########################################\e[39m" } +# Function to set owner and permission of a file +function set_permission() { + echo -e "- Changing permission of $3 to $1" + sudo chown -R "$1" "$3" + echo -e "- Changing permission of $3 to $2" + sudo chmod -R "$2" "$3" +} + +# Function to enable a service +function enable_service() { + echo -e "- Enabling service $1" + sudo systemctl enable "$1" +} + +####################################### +# Main code +####################################### +# Creating needed directories +print_header "Creating directories" +for dir in "${DIRECTORIES[@]}" +do + echo "- Creating $HOME/$dir" + mkdir -p "$HOME/$dir" +done + # Install base-devel for building aur packages print_header "Installing packages" #sudo pacman -S git base-devel --noconfirm @@ -48,21 +100,28 @@ print_header "Installing packages" #rm -rf aurman # Install packages -#aurman -S --noconfirm $(cat "$DIR/packages.list") -#aurman -S --noconfirm $(cat "$DIR/packages2.list") +#aurman -S --noconfirm $(cat "$PACKAGES_DIR/packages.list") +#aurman -S --noconfirm $(cat "$PACKAGES_DIR/packages2.list") # Create symlinks to dotfiles print_header "Creating symlinks" -for file in "${FILES[@]}" +for file in "${LINKED_FILES_HOME[@]}" do - echo "Linking $file" + echo "- Linking $HOME/$file -> $SYSTEM_DIR/$file" rm -rf "$HOME/$file" - ln -fs "$DIR/$file" "$HOME/$file" + ln -fs "$SYSTEM_DIR/$file" "$HOME/$file" done +print_header "Asking for root permissions" +sudo -v + # Give scripts execute permissions print_header "Give permissions" -chmod -R +x "$HOME/bin" +set_permission severin 744 "$HOME/bin" -# TODO: Enable services -print_header "Enabling systemd services" \ No newline at end of file + +print_header "Enabling systemd services" +for service in "${SYSTEMD_SERVICES[@]}" +do + enable_service "$service" +done \ No newline at end of file diff --git a/packages.list b/packages/packages.list similarity index 100% rename from packages.list rename to packages/packages.list diff --git a/packages2.list b/packages/packages2.list similarity index 100% rename from packages2.list rename to packages/packages2.list diff --git a/.Xresources b/system/.Xresources similarity index 100% rename from .Xresources rename to system/.Xresources diff --git a/.aliases b/system/.aliases similarity index 100% rename from .aliases rename to system/.aliases diff --git a/.bash_logout b/system/.bash_logout similarity index 100% rename from .bash_logout rename to system/.bash_logout diff --git a/.bash_profile b/system/.bash_profile similarity index 100% rename from .bash_profile rename to system/.bash_profile diff --git a/.bashrc b/system/.bashrc similarity index 100% rename from .bashrc rename to system/.bashrc diff --git a/.config/compton.conf b/system/.config/compton.conf similarity index 100% rename from .config/compton.conf rename to system/.config/compton.conf diff --git a/.config/dunst/dunstrc b/system/.config/dunst/dunstrc similarity index 100% rename from .config/dunst/dunstrc rename to system/.config/dunst/dunstrc diff --git a/system/.config/gtk-3.0/bookmarks b/system/.config/gtk-3.0/bookmarks new file mode 100644 index 0000000..fac5e7a --- /dev/null +++ b/system/.config/gtk-3.0/bookmarks @@ -0,0 +1,4 @@ +file:///home/severin/GoogleDrive GoogleDrive +file:///home/severin/Downloads Downloads +file:///home/severin/Projects Projects +file:///home/severin/dotfiles dotfiles diff --git a/system/.config/gtk-3.0/settings.ini b/system/.config/gtk-3.0/settings.ini new file mode 100644 index 0000000..18d03bb --- /dev/null +++ b/system/.config/gtk-3.0/settings.ini @@ -0,0 +1,14 @@ +[Settings] +gtk-theme-name=Adapta-Nokto +gtk-icon-theme-name=Paper-Mono-Dark +gtk-font-name=Roboto 11 +gtk-cursor-theme-size=0 +gtk-toolbar-style=GTK_TOOLBAR_BOTH +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=1 +gtk-xft-hinting=1 +gtk-xft-hintstyle=hintfull diff --git a/.config/i3/config b/system/.config/i3/config similarity index 97% rename from .config/i3/config rename to system/.config/i3/config index 6ef31c2..9192505 100644 --- a/.config/i3/config +++ b/system/.config/i3/config @@ -64,8 +64,8 @@ bindsym $mod+a focus parent #bindsym $mod+d focus child # Set monitor names -set $output1 HDMI-1 -set $output2 eDP-1 +set $output1 HDMI1 +set $output2 eDP1 # Set workspace titles set $workspace1 "1: " @@ -222,7 +222,7 @@ exec --no-startup-id compton exec_always --no-startup-id feh --bg-fill $HOME/GoogleDrive/02_Media/Images/01_Wallpaper/Desktop/Fearsome_Awakening.png # Monitor settings -exec_always --no-startup-id xrandr --output $output2 --primary --mode 1920x1080 --pos 1280x0 --rotate normal --output $output1 --mode 1280x1024 --pos 0x56 --rotate normal +exec_always --no-startup-id $HOME/bin/resolution.sh # Other applications exec google-chrome-beta diff --git a/.config/i3/i3bar/datetime.sh b/system/.config/i3/i3bar/datetime.sh similarity index 100% rename from .config/i3/i3bar/datetime.sh rename to system/.config/i3/i3bar/datetime.sh diff --git a/.config/i3/i3bar/music.sh b/system/.config/i3/i3bar/music.sh similarity index 100% rename from .config/i3/i3bar/music.sh rename to system/.config/i3/i3bar/music.sh diff --git a/.config/i3/i3bar/shutdown.sh b/system/.config/i3/i3bar/shutdown.sh similarity index 100% rename from .config/i3/i3bar/shutdown.sh rename to system/.config/i3/i3bar/shutdown.sh diff --git a/.config/i3/i3bar/volume.sh b/system/.config/i3/i3bar/volume.sh similarity index 100% rename from .config/i3/i3bar/volume.sh rename to system/.config/i3/i3bar/volume.sh diff --git a/.config/i3/i3bar/wifi.sh b/system/.config/i3/i3bar/wifi.sh similarity index 100% rename from .config/i3/i3bar/wifi.sh rename to system/.config/i3/i3bar/wifi.sh diff --git a/.config/i3/i3blocks.conf b/system/.config/i3/i3blocks.conf similarity index 100% rename from .config/i3/i3blocks.conf rename to system/.config/i3/i3blocks.conf diff --git a/.config/polybar/config b/system/.config/polybar/config similarity index 100% rename from .config/polybar/config rename to system/.config/polybar/config diff --git a/.config/polybar/launch.sh b/system/.config/polybar/launch.sh similarity index 100% rename from .config/polybar/launch.sh rename to system/.config/polybar/launch.sh diff --git a/.config/streamlink/config b/system/.config/streamlink/config similarity index 100% rename from .config/streamlink/config rename to system/.config/streamlink/config diff --git a/.config/termite/config b/system/.config/termite/config similarity index 100% rename from .config/termite/config rename to system/.config/termite/config diff --git a/system/.crontab b/system/.crontab new file mode 100644 index 0000000..56097b1 --- /dev/null +++ b/system/.crontab @@ -0,0 +1,2 @@ +# Synchronize Google Drive +*/10 * * * * grive -d -p /home/severin/GoogleDrive/ >> /home/severin/.logs/cron.log 2>&1 diff --git a/.dircolors b/system/.dircolors similarity index 100% rename from .dircolors rename to system/.dircolors diff --git a/.gitconfig b/system/.gitconfig similarity index 100% rename from .gitconfig rename to system/.gitconfig diff --git a/.gtkrc-2.0 b/system/.gtkrc-2.0 similarity index 100% rename from .gtkrc-2.0 rename to system/.gtkrc-2.0 diff --git a/.gtkrc-2.0.mine b/system/.gtkrc-2.0.mine similarity index 100% rename from .gtkrc-2.0.mine rename to system/.gtkrc-2.0.mine diff --git a/.keyleds b/system/.keyleds similarity index 100% rename from .keyleds rename to system/.keyleds diff --git a/.vimrc b/system/.vimrc similarity index 100% rename from .vimrc rename to system/.vimrc diff --git a/.xinitrc b/system/.xinitrc similarity index 100% rename from .xinitrc rename to system/.xinitrc diff --git a/system/.xprofile b/system/.xprofile new file mode 100644 index 0000000..a3f4d47 --- /dev/null +++ b/system/.xprofile @@ -0,0 +1,14 @@ +# Disable screen saver +xset s off +xset -dpms +xset s noblank + +# Set keyboard layout +setxkbmap -model pc105 -layout ch + +# Start ibus +ibus-daemon -drx + +if [[ -f $HOME/.bash_profile ]]; then + . $HOME/.bash_profile +fi diff --git a/bin/increase_volume.sh b/system/bin/increase_volume.sh similarity index 100% rename from bin/increase_volume.sh rename to system/bin/increase_volume.sh diff --git a/system/bin/resolution.sh b/system/bin/resolution.sh new file mode 100755 index 0000000..367fe5a --- /dev/null +++ b/system/bin/resolution.sh @@ -0,0 +1,2 @@ +#!/bin/sh +xrandr --output VIRTUAL1 --off --output DP3 --off --output eDP1 --mode 1920x1080 --pos 1400x472 --rotate normal --output DP1 --off --output HDMI3 --off --output HDMI2 --off --output HDMI1 --mode 1280x1024 --pos 120x528 --rotate normal --output DP2 --off diff --git a/system/bin/screenlock.sh b/system/bin/screenlock.sh new file mode 100755 index 0000000..3bc27de --- /dev/null +++ b/system/bin/screenlock.sh @@ -0,0 +1,2 @@ +#!/bin/bash +dm-tool lock diff --git a/bin/server.sh b/system/bin/server.sh similarity index 100% rename from bin/server.sh rename to system/bin/server.sh diff --git a/bin/twitch.sh b/system/bin/twitch.sh similarity index 100% rename from bin/twitch.sh rename to system/bin/twitch.sh