Merge commit '1d94a73b6f9a1613cf82406159f17c38aca87ac6'
This commit is contained in:
22
i3/auto_monitor.sh
Executable file
22
i3/auto_monitor.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#! /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
|
||||
Reference in New Issue
Block a user