diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5a4c5b3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +image: ubuntu:latest + +before_script: + - apt-get update && apt-get install -y --no-install-recommends shellcheck + +Lint: + script: + - shellcheck -x ./system/bin/* + - shellcheck -x ./install.sh + - shellcheck -x ./post-install.sh diff --git a/install.sh b/install.sh index 25add87..2d22f53 100755 --- a/install.sh +++ b/install.sh @@ -40,12 +40,15 @@ LINKED_FILES_HOME=( ".xprofile" ".Xresources" "bin" + "dconf" ) # Array of systemd services which should be enabled SYSTEMD_SERVICES=( - "cronie" "bumblebeed" + "cronie" + "lightdm" + "wicd" ) ####################################### @@ -55,8 +58,7 @@ SYSTEMD_SERVICES=( print_header "Creating directories" for dir in "${DIRECTORIES[@]}" do - echo "- Creating $HOME/$dir" - mkdir -p "$HOME/$dir" + create_directory "${dir}" done # Install base-devel for building aur packages @@ -71,16 +73,14 @@ print_header "Installing packages" #rm -rf aurman # Install packages -#aurman -S --noconfirm $(cat "$PACKAGES_DIR/packages.list") -#aurman -S --noconfirm $(cat "$PACKAGES_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 "${LINKED_FILES_HOME[@]}" do - echo "- Linking $HOME/$file -> $SYSTEM_DIR/$file" - rm -rf "$HOME/$file" - ln -fs "$SYSTEM_DIR/$file" "$HOME/$file" + create_link "${file}" done print_header "Asking for root permissions" @@ -88,11 +88,10 @@ sudo -v # Give scripts execute permissions print_header "Give permissions" -set_permission severin 744 "$HOME/bin" - +set_permission severin 744 "${HOME}/bin" print_header "Enabling systemd services" for service in "${SYSTEMD_SERVICES[@]}" do - enable_service "$service" + enable_service "${service}" done \ No newline at end of file diff --git a/system/.aliases b/system/.aliases index 7556909..130d8d7 100644 --- a/system/.aliases +++ b/system/.aliases @@ -1,7 +1,8 @@ #!/bin/bash # # Author: Severin Kaderli -# Shortcut for clear because I often type the DOS command instead + +# Shortcut for clear because I sometimes type the DOS command instead alias cls="clear" # Use exa as ls replacement @@ -14,4 +15,6 @@ alias grep="rg -n" # cd shortcut to get to my Projects folder alias pj="cd ~/Projects" -alias gw2="optirun wine64 ~/.wine/drive_c/Program\ Files/Guild\ Wars\ 2/Gw2-64.exe -dx9single -autologin -mapLoadinfo" +alias e="code" + +alias gw2="primusrun wine64 ~/.wine/drive_c/Program\ Files/Guild\ Wars\ 2/Gw2-64.exe -dx9single -autologin -mapLoadinfo" diff --git a/system/.bash_profile b/system/.bash_profile index c9fd7de..953e4d6 100644 --- a/system/.bash_profile +++ b/system/.bash_profile @@ -11,6 +11,9 @@ if [[ -f $HOME/.keyleds ]]; then . $HOME/.keyleds fi +# Restore custom dconf configuration +cat "${HOME}/dconf/root.conf" | dconf load / + # Activate correct crontab file crontab $HOME/.crontab diff --git a/system/.bashrc b/system/.bashrc index f47106d..56b2bd0 100644 --- a/system/.bashrc +++ b/system/.bashrc @@ -5,7 +5,6 @@ shopt -s histappend shopt -s checkwinsize shopt -s globstar - # set a fancy prompt (non-color, unless we know we "want" color) case "$TERM" in xterm|xterm-color|*-256color) color_prompt=yes;; diff --git a/system/.config/polybar/config b/system/.config/polybar/config index 67e4e52..36e95de 100644 --- a/system/.config/polybar/config +++ b/system/.config/polybar/config @@ -3,7 +3,7 @@ background = #222D32 foreground = #A1B0B8 [bar/top] -monitor = HDMI-1 +monitor = HDMI1 width = 100% height = 35 offset-x = 0 @@ -33,7 +33,7 @@ tray-position = right [bar/top2] inherit = bar/top -monitor = eDP-1 +monitor = eDP1 [module/i3] diff --git a/system/.xinitrc b/system/.xinitrc index f91ffa4..cc008f7 100644 --- a/system/.xinitrc +++ b/system/.xinitrc @@ -9,5 +9,10 @@ setxkbmap -model pc105 -layout ch # Start ibus ibus-daemon -drx + +. "${HOME}/bin/resolution.sh" +xrandr --setprovideroutputsource modesetting NVIDIA -0 +xrandr --auto + # Start i3 -exec dbus-launch i3 +i3 \ No newline at end of file diff --git a/system/bin/resolution.sh b/system/bin/resolution.sh index 367fe5a..8d3101a 100755 --- a/system/bin/resolution.sh +++ b/system/bin/resolution.sh @@ -1,2 +1,4 @@ #!/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 +xrandr --setprovideroutputsource modesetting NVIDIA-0 +#xrandr --auto +xrandr --output HDMI3 --off --output HDMI2 --off --output HDMI1 --mode 1280x1024 --pos 80x56 --rotate normal --output eDP1 --primary --mode 1920x1080 --pos 1360x0 --rotate normal --output DP3 --off --output DP2 --off --output DP1 --off diff --git a/system/bin/upgrade.sh b/system/bin/upgrade.sh new file mode 100755 index 0000000..604d772 --- /dev/null +++ b/system/bin/upgrade.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# +# Author: Severin Kaderli +aurman -Syuu --rebuild +npm update -g \ No newline at end of file diff --git a/system/dconf/root.conf b/system/dconf/root.conf new file mode 100644 index 0000000..d262041 --- /dev/null +++ b/system/dconf/root.conf @@ -0,0 +1,22 @@ +[org/nemo/preferences] +show-full-path-titles=true +show-new-folder-icon-toolbar=false +show-bookmarks-in-to-menus=true +default-sort-order='name' +default-folder-viewer='list-view' +sort-directories-first=true +show-hidden-files=false +show-image-thumbnails='never' +date-format='iso' +show-places-in-to-menus=true + +[desktop/ibus/general] +engines-order=['xkb:ch::ger', 'anthy'] +preload-engines=['xkb:ch::ger', 'anthy'] + +[desktop/ibus/general/hotkey] +triggers=['space'] + +[desktop/ibus/panel/emoji] +unicode-hotkey=@as [] +hotkey=@as [] diff --git a/utils.sh b/utils.sh index ed25673..5013cf4 100644 --- a/utils.sh +++ b/utils.sh @@ -6,8 +6,8 @@ # Directory variables ####################################### DIR="$( cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)" -SYSTEM_DIR="$DIR/system" -PACKAGES_DIR="$DIR/packages" +SYSTEM_DIR="${DIR}/system" +PACKAGES_DIR="${DIR}/packages" ####################################### # Bash color code variables @@ -22,22 +22,42 @@ YELLOW='\033[33m' # Helper functions ####################################### # Function to display fancy headers +# $1: Title function print_header() { - echo -e "$GREEN########################################" - echo -e "# $1" - echo -e "########################################$RESET" + echo -e "\n${GREEN}########################################" + echo -e "# ${1}" + echo -e "########################################${RESET}" +} + +# Creates the given directory in the home directory +# $1: Directory +function create_directory() { + echo -e "- Creating directory ${YELLOW}${HOME}/${dir}${RESET}" + mkdir -p "${HOME}/${dir}" +} + +# Creates a symlink of the given file from the home directory to here. +# $1: Filename +function create_link() { + echo -e "- Linking ${YELLOW}${HOME}/${1}${RESET} -> ${YELLOW}${SYSTEM_DIR}/${1}${RESET}" + rm -rf "${HOME:?}/$1" + ln -fs "${SYSTEM_DIR}/${1}" "${HOME}/${1}" } # Function to set owner and permission of a file +# $1: Owner +# $2: Permissions +# $3: 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" + echo -e "- Changing permission of ${YELLOW}${3}${RESET} to ${YELLOW}${1}${RESET}" + sudo chown -R "${1}" "${3}" + echo -e "- Changing permission of ${YELLOW}${3}${RESET} to ${YELLOW}${2}${RESET}" + sudo chmod -R "${2}" "${3}" } # Function to enable a service +# $1: Service function enable_service() { - echo -e "- Enabling service $1" - sudo systemctl enable "$1" + echo -e "- Enabling service ${YELLOW}${1}${RESET}" + sudo systemctl enable "${1}" } \ No newline at end of file