diff --git a/install b/install index f504e28..a784c3c 100755 --- a/install +++ b/install @@ -149,47 +149,47 @@ fi ############################################################################### # Install package manager and packages # ############################################################################### -print_section "Installing package requirements" -sudo pacman -S sudo ccache git base-devel --noconfirm --needed +# print_section "Installing package requirements" +# sudo pacman -S sudo ccache git base-devel --noconfirm --needed -print_section "Installing yay" -is_yay_installed=$(command -v yay) +# print_section "Installing yay" +# is_yay_installed=$(command -v yay) -# Install yay if not already installed -if [ -z "${is_yay_installed}" ]; then - git clone https://aur.archlinux.org/yay.git - ( - cd yay || exit - makepkg -si --noconfirm --skippgpcheck - ) - rm -rf yay -else - print_log "yay is already installed" -fi +# # Install yay if not already installed +# if [ -z "${is_yay_installed}" ]; then +# git clone https://aur.archlinux.org/yay.git +# ( +# cd yay || exit +# makepkg -si --noconfirm --skippgpcheck +# ) +# rm -rf yay +# else +# print_log "yay is already installed" +# fi -print_section "Installing native packages" -# List created using: yay -Qqen > packages.native.list -package_count=$(< "${PACKAGES_DIR}/packages.native.list" wc -l) -print_log "Installing ${package_count} packages" -yay -Syy > /dev/null 2>&1 -yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list" +# print_section "Installing native packages" +# # List created using: yay -Qqen > packages.native.list +# package_count=$(< "${PACKAGES_DIR}/packages.native.list" wc -l) +# print_log "Installing ${package_count} packages" +# yay -Syy > /dev/null 2>&1 +# yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list" -print_section "Installing Rust toolchain and components" -rustup toolchain install beta -rustup default beta -rustup component add "${RUST_COMPONENTS[@]}" -rustup default beta +# print_section "Installing Rust toolchain and components" +# rustup toolchain install beta +# rustup default beta +# rustup component add "${RUST_COMPONENTS[@]}" +# rustup default beta -print_section "Installing AUR packages" -package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l) -# List created using: yay -Qqem > packages.aur.list -print_log "Installing ${package_count} packages" -yay -Syy > /dev/null 2>&1 -yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list" +# print_section "Installing AUR packages" +# package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l) +# # List created using: yay -Qqem > packages.aur.list +# print_log "Installing ${package_count} packages" +# yay -Syy > /dev/null 2>&1 +# yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list" -print_section "Installing global npm packages" -print_log "Installing ${#NPM_PACKAGES[@]} packages" -npm i -g "${NPM_PACKAGES[@]}" +# print_section "Installing global npm packages" +# print_log "Installing ${#NPM_PACKAGES[@]} packages" +# npm i -g "${NPM_PACKAGES[@]}" ############################################################################### # Creating directories # @@ -197,10 +197,10 @@ npm i -g "${NPM_PACKAGES[@]}" print_section "Creating directories" for dir in "${DIRECTORIES[@]}" - do - print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}" - mkdir -p "${HOME}/${dir}" - done +do + print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}" + mkdir -p "${HOME}/${dir}" +done if [ "${IS_WORK}" = "1" ]; then for dir in "${WORK_DIRECTORIES[@]}" @@ -330,10 +330,12 @@ sudo install -Dm 644 "${SYSTEM_DIR}/etc/zsh/zshenv" "/etc/zsh" print_log "Copying pacman.conf to ${YELLOW}/etc/pacman.conf${RESET}" sudo install -Dm 644 "${SYSTEM_DIR}/etc/pacman.conf" "/etc/pacman.conf" +print_log "Copying 00-keyboard.conf to ${YELLOW}/etc/X11/xorg.conf.d${RESET}" +sudo install -Dm 644 "${SYSTEM_DIR}/etc/X11/xorg.conf.d/00-keyboard.conf" "/etc/X11/xorg.conf.d" +sudo install -Dm 644 "${SYSTEM_DIR}/etc/X11/xorg.conf.d/00-keyboard.conf" "/etc/X11/nvidia-xorg.conf.d" + print_log "Copying 20-displaylink.conf to ${YELLOW}/etc/X11/xorg.conf.d${RESET}" sudo install -Dm 644 "${SYSTEM_DIR}/etc/X11/xorg.conf.d/20-displaylink.conf" "/etc/X11/xorg.conf.d" - -print_log "Copying 20-displaylink.conf to ${YELLOW}/etc/X11/nvidia-xorg.conf.d${RESET}" sudo install -Dm 644 "${SYSTEM_DIR}/etc/X11/xorg.conf.d/20-displaylink.conf" "/etc/X11/nvidia-xorg.conf.d" print_log "Copying vconsole.conf to ${YELLOW}/etc/vconsole.conf${RESET}" @@ -342,6 +344,9 @@ sudo install -Dm 644 "${SYSTEM_DIR}/etc/vconsole.conf" "/etc/vconsole.conf" print_log "Copying mkinitcpio.conf to ${YELLOW}/etc/mkinitcpio.conf${RESET}" sudo install -Dm 644 "${SYSTEM_DIR}/etc/mkinitcpio.conf" "/etc/mkinitcpio.conf" +print_log "Copying resolvconf.conf to ${YELLOW}/etc/resolvconf.conf${RESET}" +sudo install -Dm 644 "${SYSTEM_DIR}/etc/resolvconf.conf" "/etc/resolvconf.conf" + ############################################################################### # Setting lockscreen image # ############################################################################### diff --git a/system/.config/cron/crontab b/system/.config/cron/crontab index c0458c0..8fc0639 100644 --- a/system/.config/cron/crontab +++ b/system/.config/cron/crontab @@ -11,16 +11,16 @@ # This file is loaded on boot by crontab. # Synchronize Google Drive every 15 minutes -*/15 * * * * grive -d -p $HOME/documents/ >> $HOME/.local/log/cron.log +*/15 * * * * grive -d -p $HOME/documents/ >> $HOME/.local/log/cron.log 2>&1 # Sync pacman databases every 15 minutes -*/15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log +*/15 * * * * sudo $HOME/.local/bin/sync-packages >> $HOME/.local/log/cron.log 2>&1 # Synchronize notes every 15 minutes -*/15 * * * * $HOME/.local/bin/sync-notes >> $HOME/.local/log/cron.log +*/15 * * * * $HOME/.local/bin/sync-notes >> $HOME/.local/log/cron.log 2>&1 # Synchronize tasks every 10 minutes -*/10 * * * * $HOME/.local/bin/sync-tasks >> $HOME/.local/log/cron.log +*/10 * * * * $HOME/.local/bin/sync-tasks >> $HOME/.local/log/cron.log 2>&1 # Synchronize rss feeds every 15 minutes -*/15 * * * * $HOME/.local/bin/rss-sync >> $HOME/.local/log/cron.log +*/15 * * * * $HOME/.local/bin/rss-sync >> $HOME/.local/log/cron.log 2>&1 diff --git a/system/.config/custom/env b/system/.config/custom/env index 2ad560b..6a3e8ea 100644 --- a/system/.config/custom/env +++ b/system/.config/custom/env @@ -16,6 +16,10 @@ if [ -f "${XDG_BIN_HOME}/utils" ]; then . "${XDG_BIN_HOME}/utils" fi +if [ -z "${HOME}" ]; then + export HOME="/home/severin" +fi + export XDG_CONFIG_HOME="${HOME}/.config" export XDG_CACHE_HOME="${HOME}/.cache" export XDG_DATA_HOME="${HOME}/.local/share" diff --git a/system/.config/i3/config.private b/system/.config/i3/config.private index e0266b7..1c3585d 100644 --- a/system/.config/i3/config.private +++ b/system/.config/i3/config.private @@ -22,17 +22,11 @@ exec --no-startup-id "i3-msg 'workspace 1: '" # Start compton exec --no-startup-id compton -b -# Start polybar -exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch - # Start dunst exec --no-startup-id dunst -# Set resolution -exec_always --no-startup-id resolution - -# Set wallpaper -exec_always --no-startup-id wallpaper +# Setup monitor +exec_always --no-startup-id monitor-setup # Other applications exec autokey-gtk diff --git a/system/.config/i3/config.work b/system/.config/i3/config.work index 3f9ebb5..7fb889e 100644 --- a/system/.config/i3/config.work +++ b/system/.config/i3/config.work @@ -16,17 +16,11 @@ exec --no-startup-id "i3-msg 'workspace 1: '" # Start compton exec --no-startup-id compton -b -# Start polybar -exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch - # Start dunst exec --no-startup-id dunst -# Set resolution -exec_always --no-startup-id resolution - -# Set wallpaper -exec_always --no-startup-id wallpaper +# Setup monitor +exec_always --no-startup-id monitor-setup # Other applications exec autokey-gtk diff --git a/system/.config/polybar/config b/system/.config/polybar/config index 3a081e4..587aa2f 100644 --- a/system/.config/polybar/config +++ b/system/.config/polybar/config @@ -23,7 +23,7 @@ bar-height = 35 # Top bar ####################################### [bar/top] -monitor = HDMI1 +monitor = ${env:POLYBAR_MONITOR} width = 100% height = ${settings.bar-height} @@ -50,26 +50,6 @@ separator = | scroll-up = i3wm-desknext scroll-down = i3wm-deskprev -[bar/top2] -inherit = bar/top -monitor = eDP1 - -[bar/top3] -inherit = bar/top -monitor = DVI-I-1-1 - -[bar/top-nvidia] -inherit = bar/top -monitor = HDMI-1-1 - -[bar/top2-nvidia] -inherit = bar/top -monitor = eDP-1-1 - -[bar/top3-nvidia] -inherit = bar/top -monitor = DVI-I-2-1 - ####################################### # Bottom bar @@ -80,31 +60,6 @@ bottom = true modules-left = modules-center = modules-right = music -tray-position = none - -[bar/bottom2] -inherit = bar/bottom -monitor = eDP1 -tray-position = left - -[bar/bottom3] -inherit = bar/bottom -monitor = DVI-I-1-1 -tray-position = left - -[bar/bottom-nvidia] -inherit = bar/bottom -monitor = HDMI-1-1 -tray-position = none - -[bar/bottom2-nvidia] -inherit = bar/bottom -monitor = eDP-1-1 -tray-position = left - -[bar/bottom3-nvidia] -inherit = bar/bottom -monitor = DVI-I-2-1 tray-position = left diff --git a/system/.local/bin/is-connected b/system/.local/bin/is-connected new file mode 100755 index 0000000..72da53e --- /dev/null +++ b/system/.local/bin/is-connected @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +# +# SCRIPT NAME: +# is-connected +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Checks if the output is connected +# +# USAGE: +# ./is-connected OUTPUT + +if [ -z "${1}" ]; then + echo "No output given" + exit 1 +fi + +if [ -z "$(xrandr --query | grep "${1} connected")" ]; then + exit 1 +else + exit 0 +fi diff --git a/system/.local/bin/monitor-setup b/system/.local/bin/monitor-setup new file mode 100755 index 0000000..bc461f5 --- /dev/null +++ b/system/.local/bin/monitor-setup @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# +# SCRIPT NAME: +# monitor-setup +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Setups the resolution, wallpaper and polybar +# +# USAGE: +# ./monitor-setup +resolution +polybar-launch +wallpaper \ No newline at end of file diff --git a/system/.config/polybar/launch b/system/.local/bin/polybar-launch similarity index 65% rename from system/.config/polybar/launch rename to system/.local/bin/polybar-launch index 681bdde..0342f2e 100755 --- a/system/.config/polybar/launch +++ b/system/.local/bin/polybar-launch @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # SCRIPT NAME: -# .config/polybar/launch +# polybar-launch # # AUTHOR: # Severin Kaderli @@ -10,10 +10,10 @@ # This script kills existing polybar processes and then launches the bars. # # USAGE: -# ./launch +# ./polybar-launch # Terminate already running bar instances -pkill polybar +killall -q polybar # Wait until the processes have been shut down while pgrep -x polybar >/dev/null; do sleep 1; done @@ -28,17 +28,17 @@ else export POLYBAR_NETWORK="enp0s31f6" fi -# Launch bar1 and bar2 -polybar top & -polybar top2 & -polybar top3 & -polybar bottom & -polybar bottom2 & -polybar bottom3 & +MONITORS=( + "eDP1" + "eDP-1-1" + "HDMI1" + "HDMI-1-1" + "DVI-I-1-1" + "DVI-I-2-1" +) -polybar top-nvidia & -polybar top2-nvidia & -polybar top3-nvidia & -polybar bottom-nvidia & -polybar bottom2-nvidia & -polybar bottom3-nvidia & \ No newline at end of file +for monitor in "${MONITORS[@]}"; do + export POLYBAR_MONITOR="${monitor}" + polybar top & + polybar bottom & +done \ No newline at end of file diff --git a/system/.local/bin/resolution b/system/.local/bin/resolution index 240c581..6133bda 100755 --- a/system/.local/bin/resolution +++ b/system/.local/bin/resolution @@ -16,9 +16,30 @@ xrandr --listproviders | grep -q "modesetting" && xrandr --setprovideroutputsource 1 0 xrandr --dpi 96 -xrandr --output HDMI1 --mode 1280x1024 --pos 0x56 --rotate normal -xrandr --output HDMI-1-1 --mode 1280x1024 --pos 0x56 --rotate normal + +if is-connected "HDMI1"; then + xrandr --output HDMI1 --mode 1280x1024 --left-of eDP1 +else + xrandr --output HDMI1 --off +fi + +if is-connected "HDMI-1-1"; then + xrandr --output HDMI-1-1 --mode 1280x1024 --left-of eDP-1-1 +else + xrandr --output HDMI-1-1 --off +fi + xrandr --output eDP1 --primary --mode 1920x1080 --pos 1280x0 --rotate normal xrandr --output eDP-1-1 --primary --mode 1920x1080 --pos 1280x0 --rotate normal -xrandr --output DVI-I-1-1 --mode 1920x1080 --pos -640x0 --rotate normal -xrandr --output DVI-I-2-1 --mode 1920x1080 --pos -640x0 --rotate normal + +if is-connected "DVI-I-1-1"; then + xrandr --output DVI-I-1-1 --off +else + xrandr --output DVI-I-1-1 --mode 1920x1080 --left-of eDP1 +fi + +if is-connected "DVI-I-2-1"; then + xrandr --output DVI-I-2-1 --off +else + xrandr --output DVI-I-2-1 --mode 1920x1080 --left-of eDP-1-1 +fi diff --git a/system/etc/X11/xorg.conf.d/00-keyboard.conf b/system/etc/X11/xorg.conf.d/00-keyboard.conf new file mode 100644 index 0000000..cb54bd0 --- /dev/null +++ b/system/etc/X11/xorg.conf.d/00-keyboard.conf @@ -0,0 +1,6 @@ +Section "InputClass" + Identifier "system-keyboard" + MatchIsKeyboard "on" + Option "XkbLayout" "ch" + Option "XkbModel" "pc105" +EndSection \ No newline at end of file diff --git a/system/etc/resolvconf.conf b/system/etc/resolvconf.conf new file mode 100644 index 0000000..4ef3632 --- /dev/null +++ b/system/etc/resolvconf.conf @@ -0,0 +1,2 @@ +resolv_conf=/etc/resolv.conf +name_servers=127.0.0.1 \ No newline at end of file