feat: add external monitor detection
This commit is contained in:
parent
8cd08998c1
commit
4524badf49
2 changed files with 20 additions and 0 deletions
|
@ -42,6 +42,8 @@ exec --no-startup-id xset s 480 dpms 600 600 600
|
|||
# Desktop notifications
|
||||
exec --no-startup-id dbus-launch dunst --config ~/.config/dunst/dunstrc
|
||||
|
||||
exec --no-startup-id ~/scripts/monitor.sh
|
||||
|
||||
# set floating (nontiling) for special apps
|
||||
for_window [class="Pavucontrol" instance="pavucontrol"] floating enable
|
||||
for_window [class="Blueberry.py" instance="blueberry.py"] floating enable
|
||||
|
|
18
scripts/executable_monitor.sh
Normal file
18
scripts/executable_monitor.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
# v1.0 - Shell Script to automatically set display based on connected monitors.
|
||||
|
||||
get_active_monitors()
|
||||
{
|
||||
xrandr | awk '/ connected/ && /[[:digit:]]x[[:digit:]].*+/{print $1}'
|
||||
}
|
||||
|
||||
monitors=$(get_active_monitors)
|
||||
|
||||
for sub in "${monitors[@]}"; do
|
||||
if [[ *"$sub"* == *"HDMI-1"* ]]; then
|
||||
echo "HDMI-1 detected, switching to one primary display."
|
||||
xrandr --output eDP-1 --off --output HDMI-1 --primary --mode 1920x1080 --pos 0x0 --rotate normal
|
||||
fi
|
||||
done
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue