Squashed 'i3/' changes from dd4b0c9..3b59540
3b59540 Some cleanup, more monitor stuff 2a7e4c5 Add monitor setup git-subtree-dir: i3 git-subtree-split: 3b59540cda64e740d296c3c2928d7e5696304bbd
This commit is contained in:
22
auto_monitor.sh
Executable file
22
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