mirror of https://gitlab.com/dabruh/dotfiles.git
Add home setup
This commit is contained in:
parent
4cac467d32
commit
c7145e8b4a
|
@ -291,7 +291,7 @@ move_nonexistent_i3_workspaces() {
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
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)
|
primary_monitor=$(get_monitors primary | cut -d',' -f1)
|
||||||
monitor_count=$(get_monitors connected | wc -l)
|
monitor_count=$(get_monitors connected | wc -l)
|
||||||
echo "Monitors connected: $monitor_count"
|
echo "Monitors connected: $monitor_count"
|
||||||
|
@ -300,7 +300,7 @@ main() {
|
||||||
echo "Applying laptop-only profile"
|
echo "Applying laptop-only profile"
|
||||||
xrandr --auto
|
xrandr --auto
|
||||||
profile_found=true
|
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=(
|
monitors=(
|
||||||
"eDP-1,DVI-I-1-1,DVI-I-2-2"
|
"eDP-1,DVI-I-1-1,DVI-I-2-2"
|
||||||
"eDP-1,DVI-I-2-2,DVI-I-3-3"
|
"eDP-1,DVI-I-2-2,DVI-I-3-3"
|
||||||
|
@ -309,7 +309,7 @@ main() {
|
||||||
for monitor in "${monitors[@]}"; do
|
for monitor in "${monitors[@]}"; do
|
||||||
IFS=',' read -r -a monitor_array <<<"$monitor"
|
IFS=',' read -r -a monitor_array <<<"$monitor"
|
||||||
if monitors_exist "${monitor_array[@]}" >/dev/null; then
|
if monitors_exist "${monitor_array[@]}" >/dev/null; then
|
||||||
echo "Applying dock profile for ${monitor_array[*]}"
|
echo "Applying work profile for ${monitor_array[*]}"
|
||||||
xrandr \
|
xrandr \
|
||||||
--output "${monitor_array[0]}" --mode 1920x1200 --rotate normal --pos 1200x1474 --primary \
|
--output "${monitor_array[0]}" --mode 1920x1200 --rotate normal --pos 1200x1474 --primary \
|
||||||
--output "${monitor_array[1]}" --mode 1920x1200 --rotate left --pos 0x0 \
|
--output "${monitor_array[1]}" --mode 1920x1200 --rotate left --pos 0x0 \
|
||||||
|
@ -318,6 +318,15 @@ main() {
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
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
|
fi
|
||||||
|
|
||||||
if ! "$profile_found"; then
|
if ! "$profile_found"; then
|
||||||
|
|
Loading…
Reference in New Issue