3b59540 Some cleanup, more monitor stuff 2a7e4c5 Add monitor setup git-subtree-dir: i3 git-subtree-split: 3b59540cda64e740d296c3c2928d7e5696304bbd
23 lines
597 B
Bash
Executable File
23 lines
597 B
Bash
Executable File
#! /bin/sh
|
|
#
|
|
# monitors.sh
|
|
# Copyright (C) 2017 Fabian Ising <fabian@murgi.de>
|
|
#
|
|
# Distributed under terms of the Apache v2.0 license.
|
|
#
|
|
|
|
# Get out of town if something errors
|
|
set -e
|
|
|
|
HDMI_STATUS=$(</sys/class/drm/card0/card0-HDMI-A-1/status )
|
|
|
|
|
|
if [ "connected" == "$HDMI_STATUS" ]; then
|
|
/usr/bin/xrandr --output eDP-1 --auto --left-of HDMI-1
|
|
/usr/bin/notify-send --urgency=low -t 5000 "Graphics Update" "HDMI plugged in"
|
|
else
|
|
/usr/bin/xrandr --output HDMI-1 --off
|
|
/usr/bin/notify-send --urgency=low -t 5000 "Graphics Update" "External monitor disconnected"
|
|
exit
|
|
fi
|