mirror of
https://gitlab.com/dabruh/dotfiles.git
synced 2024-12-26 20:08:11 +01:00
Compare commits
No commits in common. "a9ccc784827ed480f599886277119e46112a0c1e" and "0e1d39e82608cc6c095b016ecf474ccceca45f35" have entirely different histories.
a9ccc78482
...
0e1d39e826
1 changed files with 8 additions and 25 deletions
|
@ -285,7 +285,6 @@ move_nonexistent_i3_workspaces() {
|
|||
}
|
||||
|
||||
main() {
|
||||
local primary_monitor monitor_count monitors=() profile_found=false
|
||||
primary_monitor=$(get_monitors primary | cut -d',' -f1)
|
||||
monitor_count=$(get_monitors connected | wc -l)
|
||||
echo "Monitors connected: $monitor_count"
|
||||
|
@ -293,34 +292,18 @@ main() {
|
|||
if [ "$monitor_count" -eq 1 ]; then
|
||||
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
|
||||
monitors=(
|
||||
"eDP-1,DVI-I-1-1,DVI-I-2-2"
|
||||
"eDP-1,DVI-I-2-2,DVI-I-3-3"
|
||||
)
|
||||
|
||||
for monitor in "${monitors[@]}"; do
|
||||
IFS=',' read -r -a monitor_array <<<"$monitor"
|
||||
if monitors_exist "${monitor_array[@]}"; then
|
||||
echo "Applying dock profile for ${monitor_array[*]}"
|
||||
elif usb_devices_exist all exact "HP, Inc HP USB-C Universal Dock" >/dev/null && monitors_exist eDP-1 DVI-I-2-2 DVI-I-3-3; then
|
||||
echo "Applying work profile"
|
||||
xrandr \
|
||||
--output "${monitor_array[0]}" --mode 1920x1200 --rotate normal --pos 1200x1474 --primary \
|
||||
--output "${monitor_array[1]}" --mode 1920x1200 --rotate left --pos 0x0 \
|
||||
--output "${monitor_array[2]}" --mode 1920x1200 --rotate normal --pos 1200x274
|
||||
profile_found=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if ! "$profile_found"; then
|
||||
--output eDP-1 --primary --mode 1920x1200 --pos 1200x1474 --rotate normal \
|
||||
--output DVI-I-2-2 --mode 1920x1200 --pos 0x0 --rotate left \
|
||||
--output DVI-I-3-3 --mode 1920x1200 --pos 1200x274 --rotate normal
|
||||
else
|
||||
echo "No profile found"
|
||||
return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
move_nonexistent_i3_workspaces "$primary_monitor" 10
|
||||
i3-msg restart >/dev/null
|
||||
}
|
||||
|
||||
# Run if invoked directly
|
||||
|
|
Loading…
Reference in a new issue