Add home setup

This commit is contained in:
dabruh 2024-04-18 19:46:27 +02:00
parent 4cac467d32
commit c7145e8b4a
1 changed files with 12 additions and 3 deletions

View File

@ -291,7 +291,7 @@ move_nonexistent_i3_workspaces() {
}
main() {
local primary_monitor monitor_count monitors=() profile_found=false
local primary_monitor monitor_count monitors=() profile_found=false exists
primary_monitor=$(get_monitors primary | cut -d',' -f1)
monitor_count=$(get_monitors connected | wc -l)
echo "Monitors connected: $monitor_count"
@ -300,7 +300,7 @@ main() {
echo "Applying laptop-only profile"
xrandr --auto
profile_found=true
elif usb_devices_exist all exact "HP, Inc HP USB-C Universal Dock" >/dev/null; then
elif usb_devices_exist all exact "HP, Inc HP USB-C Universal Dock" >/dev/null 2>&1; then
monitors=(
"eDP-1,DVI-I-1-1,DVI-I-2-2"
"eDP-1,DVI-I-2-2,DVI-I-3-3"
@ -309,7 +309,7 @@ main() {
for monitor in "${monitors[@]}"; do
IFS=',' read -r -a monitor_array <<<"$monitor"
if monitors_exist "${monitor_array[@]}" >/dev/null; then
echo "Applying dock profile for ${monitor_array[*]}"
echo "Applying work profile for ${monitor_array[*]}"
xrandr \
--output "${monitor_array[0]}" --mode 1920x1200 --rotate normal --pos 1200x1474 --primary \
--output "${monitor_array[1]}" --mode 1920x1200 --rotate left --pos 0x0 \
@ -318,6 +318,15 @@ main() {
break
fi
done
elif usb_devices_exist all exact "Lenovo ThinkPad USB-C Dock Audio" >/dev/null 2>&1; then
monitor_array=(eDP-1 DP-1-0.3 DP-1-0.1)
if monitors_exist "${monitor_array[@]}" >/dev/null; then
echo "Applying home profile for ${monitor_array[*]}"
xrandr \
--output "${monitor_array[0]}" --mode 2560x1440 --rotate normal --pos 0x480 --primary \
--output "${monitor_array[1]}" --mode 3440x1440 --rotate normal --pos 2560x480 \
--output "${monitor_array[2]}" --mode 1920x1200 --rotate right --pos 6000x0
fi
fi
if ! "$profile_found"; then