Fix monitor problems
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
92c15e04d0
commit
be92d7f1b3
12 changed files with 149 additions and 128 deletions
87
install
87
install
|
@ -149,47 +149,47 @@ fi
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Install package manager and packages #
|
# Install package manager and packages #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
print_section "Installing package requirements"
|
# print_section "Installing package requirements"
|
||||||
sudo pacman -S sudo ccache git base-devel --noconfirm --needed
|
# sudo pacman -S sudo ccache git base-devel --noconfirm --needed
|
||||||
|
|
||||||
print_section "Installing yay"
|
# print_section "Installing yay"
|
||||||
is_yay_installed=$(command -v yay)
|
# is_yay_installed=$(command -v yay)
|
||||||
|
|
||||||
# Install yay if not already installed
|
# # Install yay if not already installed
|
||||||
if [ -z "${is_yay_installed}" ]; then
|
# if [ -z "${is_yay_installed}" ]; then
|
||||||
git clone https://aur.archlinux.org/yay.git
|
# git clone https://aur.archlinux.org/yay.git
|
||||||
(
|
# (
|
||||||
cd yay || exit
|
# cd yay || exit
|
||||||
makepkg -si --noconfirm --skippgpcheck
|
# makepkg -si --noconfirm --skippgpcheck
|
||||||
)
|
# )
|
||||||
rm -rf yay
|
# rm -rf yay
|
||||||
else
|
# else
|
||||||
print_log "yay is already installed"
|
# print_log "yay is already installed"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
print_section "Installing native packages"
|
# print_section "Installing native packages"
|
||||||
# List created using: yay -Qqen > packages.native.list
|
# # List created using: yay -Qqen > packages.native.list
|
||||||
package_count=$(< "${PACKAGES_DIR}/packages.native.list" wc -l)
|
# package_count=$(< "${PACKAGES_DIR}/packages.native.list" wc -l)
|
||||||
print_log "Installing ${package_count} packages"
|
# print_log "Installing ${package_count} packages"
|
||||||
yay -Syy > /dev/null 2>&1
|
# yay -Syy > /dev/null 2>&1
|
||||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list"
|
# yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.native.list"
|
||||||
|
|
||||||
print_section "Installing Rust toolchain and components"
|
# print_section "Installing Rust toolchain and components"
|
||||||
rustup toolchain install beta
|
# rustup toolchain install beta
|
||||||
rustup default beta
|
# rustup default beta
|
||||||
rustup component add "${RUST_COMPONENTS[@]}"
|
# rustup component add "${RUST_COMPONENTS[@]}"
|
||||||
rustup default beta
|
# rustup default beta
|
||||||
|
|
||||||
print_section "Installing AUR packages"
|
# print_section "Installing AUR packages"
|
||||||
package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l)
|
# package_count=$(< "${PACKAGES_DIR}/packages.aur.list" wc -l)
|
||||||
# List created using: yay -Qqem > packages.aur.list
|
# # List created using: yay -Qqem > packages.aur.list
|
||||||
print_log "Installing ${package_count} packages"
|
# print_log "Installing ${package_count} packages"
|
||||||
yay -Syy > /dev/null 2>&1
|
# yay -Syy > /dev/null 2>&1
|
||||||
yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list"
|
# yay -S --noconfirm --sudoloop --needed --devel --nopgpfetch --mflags --skippgpcheck - < "${PACKAGES_DIR}/packages.aur.list"
|
||||||
|
|
||||||
print_section "Installing global npm packages"
|
# print_section "Installing global npm packages"
|
||||||
print_log "Installing ${#NPM_PACKAGES[@]} packages"
|
# print_log "Installing ${#NPM_PACKAGES[@]} packages"
|
||||||
npm i -g "${NPM_PACKAGES[@]}"
|
# npm i -g "${NPM_PACKAGES[@]}"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Creating directories #
|
# Creating directories #
|
||||||
|
@ -197,10 +197,10 @@ npm i -g "${NPM_PACKAGES[@]}"
|
||||||
print_section "Creating directories"
|
print_section "Creating directories"
|
||||||
|
|
||||||
for dir in "${DIRECTORIES[@]}"
|
for dir in "${DIRECTORIES[@]}"
|
||||||
do
|
do
|
||||||
print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}"
|
print_log "Creating directory ${YELLOW}${HOME}/${dir}${RESET}"
|
||||||
mkdir -p "${HOME}/${dir}"
|
mkdir -p "${HOME}/${dir}"
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "${IS_WORK}" = "1" ]; then
|
if [ "${IS_WORK}" = "1" ]; then
|
||||||
for dir in "${WORK_DIRECTORIES[@]}"
|
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}"
|
print_log "Copying pacman.conf to ${YELLOW}/etc/pacman.conf${RESET}"
|
||||||
sudo install -Dm 644 "${SYSTEM_DIR}/etc/pacman.conf" "/etc/pacman.conf"
|
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}"
|
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"
|
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"
|
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}"
|
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}"
|
print_log "Copying mkinitcpio.conf to ${YELLOW}/etc/mkinitcpio.conf${RESET}"
|
||||||
sudo install -Dm 644 "${SYSTEM_DIR}/etc/mkinitcpio.conf" "/etc/mkinitcpio.conf"
|
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 #
|
# Setting lockscreen image #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -11,16 +11,16 @@
|
||||||
# This file is loaded on boot by crontab.
|
# This file is loaded on boot by crontab.
|
||||||
|
|
||||||
# Synchronize Google Drive every 15 minutes
|
# 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
|
# 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
|
# 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
|
# 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
|
# 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
|
||||||
|
|
|
@ -16,6 +16,10 @@ if [ -f "${XDG_BIN_HOME}/utils" ]; then
|
||||||
. "${XDG_BIN_HOME}/utils"
|
. "${XDG_BIN_HOME}/utils"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "${HOME}" ]; then
|
||||||
|
export HOME="/home/severin"
|
||||||
|
fi
|
||||||
|
|
||||||
export XDG_CONFIG_HOME="${HOME}/.config"
|
export XDG_CONFIG_HOME="${HOME}/.config"
|
||||||
export XDG_CACHE_HOME="${HOME}/.cache"
|
export XDG_CACHE_HOME="${HOME}/.cache"
|
||||||
export XDG_DATA_HOME="${HOME}/.local/share"
|
export XDG_DATA_HOME="${HOME}/.local/share"
|
||||||
|
|
|
@ -22,17 +22,11 @@ exec --no-startup-id "i3-msg 'workspace 1: '"
|
||||||
# Start compton
|
# Start compton
|
||||||
exec --no-startup-id compton -b
|
exec --no-startup-id compton -b
|
||||||
|
|
||||||
# Start polybar
|
|
||||||
exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch
|
|
||||||
|
|
||||||
# Start dunst
|
# Start dunst
|
||||||
exec --no-startup-id dunst
|
exec --no-startup-id dunst
|
||||||
|
|
||||||
# Set resolution
|
# Setup monitor
|
||||||
exec_always --no-startup-id resolution
|
exec_always --no-startup-id monitor-setup
|
||||||
|
|
||||||
# Set wallpaper
|
|
||||||
exec_always --no-startup-id wallpaper
|
|
||||||
|
|
||||||
# Other applications
|
# Other applications
|
||||||
exec autokey-gtk
|
exec autokey-gtk
|
||||||
|
|
|
@ -16,17 +16,11 @@ exec --no-startup-id "i3-msg 'workspace 1: '"
|
||||||
# Start compton
|
# Start compton
|
||||||
exec --no-startup-id compton -b
|
exec --no-startup-id compton -b
|
||||||
|
|
||||||
# Start polybar
|
|
||||||
exec_always --no-startup-id $XDG_CONFIG_HOME/polybar/launch
|
|
||||||
|
|
||||||
# Start dunst
|
# Start dunst
|
||||||
exec --no-startup-id dunst
|
exec --no-startup-id dunst
|
||||||
|
|
||||||
# Set resolution
|
# Setup monitor
|
||||||
exec_always --no-startup-id resolution
|
exec_always --no-startup-id monitor-setup
|
||||||
|
|
||||||
# Set wallpaper
|
|
||||||
exec_always --no-startup-id wallpaper
|
|
||||||
|
|
||||||
# Other applications
|
# Other applications
|
||||||
exec autokey-gtk
|
exec autokey-gtk
|
||||||
|
|
|
@ -23,7 +23,7 @@ bar-height = 35
|
||||||
# Top bar
|
# Top bar
|
||||||
#######################################
|
#######################################
|
||||||
[bar/top]
|
[bar/top]
|
||||||
monitor = HDMI1
|
monitor = ${env:POLYBAR_MONITOR}
|
||||||
|
|
||||||
width = 100%
|
width = 100%
|
||||||
height = ${settings.bar-height}
|
height = ${settings.bar-height}
|
||||||
|
@ -50,26 +50,6 @@ separator = |
|
||||||
scroll-up = i3wm-desknext
|
scroll-up = i3wm-desknext
|
||||||
scroll-down = i3wm-deskprev
|
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
|
# Bottom bar
|
||||||
|
@ -80,31 +60,6 @@ bottom = true
|
||||||
modules-left =
|
modules-left =
|
||||||
modules-center =
|
modules-center =
|
||||||
modules-right = music
|
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
|
tray-position = left
|
||||||
|
|
||||||
|
|
||||||
|
|
24
system/.local/bin/is-connected
Executable file
24
system/.local/bin/is-connected
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# SCRIPT NAME:
|
||||||
|
# is-connected
|
||||||
|
#
|
||||||
|
# AUTHOR:
|
||||||
|
# Severin Kaderli <severin@kaderli.dev>
|
||||||
|
#
|
||||||
|
# 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
|
16
system/.local/bin/monitor-setup
Executable file
16
system/.local/bin/monitor-setup
Executable file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# SCRIPT NAME:
|
||||||
|
# monitor-setup
|
||||||
|
#
|
||||||
|
# AUTHOR:
|
||||||
|
# Severin Kaderli <severin@kaderli.dev>
|
||||||
|
#
|
||||||
|
# DESCRIPTION:
|
||||||
|
# Setups the resolution, wallpaper and polybar
|
||||||
|
#
|
||||||
|
# USAGE:
|
||||||
|
# ./monitor-setup
|
||||||
|
resolution
|
||||||
|
polybar-launch
|
||||||
|
wallpaper
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# SCRIPT NAME:
|
# SCRIPT NAME:
|
||||||
# .config/polybar/launch
|
# polybar-launch
|
||||||
#
|
#
|
||||||
# AUTHOR:
|
# AUTHOR:
|
||||||
# Severin Kaderli <severin@kaderli.dev>
|
# Severin Kaderli <severin@kaderli.dev>
|
||||||
|
@ -10,10 +10,10 @@
|
||||||
# This script kills existing polybar processes and then launches the bars.
|
# This script kills existing polybar processes and then launches the bars.
|
||||||
#
|
#
|
||||||
# USAGE:
|
# USAGE:
|
||||||
# ./launch
|
# ./polybar-launch
|
||||||
|
|
||||||
# Terminate already running bar instances
|
# Terminate already running bar instances
|
||||||
pkill polybar
|
killall -q polybar
|
||||||
|
|
||||||
# Wait until the processes have been shut down
|
# Wait until the processes have been shut down
|
||||||
while pgrep -x polybar >/dev/null; do sleep 1; done
|
while pgrep -x polybar >/dev/null; do sleep 1; done
|
||||||
|
@ -28,17 +28,17 @@ else
|
||||||
export POLYBAR_NETWORK="enp0s31f6"
|
export POLYBAR_NETWORK="enp0s31f6"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Launch bar1 and bar2
|
MONITORS=(
|
||||||
polybar top &
|
"eDP1"
|
||||||
polybar top2 &
|
"eDP-1-1"
|
||||||
polybar top3 &
|
"HDMI1"
|
||||||
polybar bottom &
|
"HDMI-1-1"
|
||||||
polybar bottom2 &
|
"DVI-I-1-1"
|
||||||
polybar bottom3 &
|
"DVI-I-2-1"
|
||||||
|
)
|
||||||
|
|
||||||
polybar top-nvidia &
|
for monitor in "${MONITORS[@]}"; do
|
||||||
polybar top2-nvidia &
|
export POLYBAR_MONITOR="${monitor}"
|
||||||
polybar top3-nvidia &
|
polybar top &
|
||||||
polybar bottom-nvidia &
|
polybar bottom &
|
||||||
polybar bottom2-nvidia &
|
done
|
||||||
polybar bottom3-nvidia &
|
|
|
@ -16,9 +16,30 @@
|
||||||
xrandr --listproviders | grep -q "modesetting" && xrandr --setprovideroutputsource 1 0
|
xrandr --listproviders | grep -q "modesetting" && xrandr --setprovideroutputsource 1 0
|
||||||
|
|
||||||
xrandr --dpi 96
|
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 eDP1 --primary --mode 1920x1080 --pos 1280x0 --rotate normal
|
||||||
xrandr --output eDP-1-1 --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
|
||||||
|
|
6
system/etc/X11/xorg.conf.d/00-keyboard.conf
Normal file
6
system/etc/X11/xorg.conf.d/00-keyboard.conf
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "system-keyboard"
|
||||||
|
MatchIsKeyboard "on"
|
||||||
|
Option "XkbLayout" "ch"
|
||||||
|
Option "XkbModel" "pc105"
|
||||||
|
EndSection
|
2
system/etc/resolvconf.conf
Normal file
2
system/etc/resolvconf.conf
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
resolv_conf=/etc/resolv.conf
|
||||||
|
name_servers=127.0.0.1
|
Loading…
Add table
Add a link
Reference in a new issue