aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2014-04-10 11:28:27 +0200
committerDavid Runge <david.runge@frqrec.com>2014-04-10 11:28:27 +0200
commit8819879892489e40f5c3460c2467870b6d88d285 (patch)
treed0a1285288382b2cffe1944d280cd588043de29c /bin
parentf0261262a8596241cb7ae784ab0a340ca311c5f7 (diff)
downloaddotfiles-8819879892489e40f5c3460c2467870b6d88d285.tar.gz
dotfiles-8819879892489e40f5c3460c2467870b6d88d285.tar.bz2
dotfiles-8819879892489e40f5c3460c2467870b6d88d285.tar.xz
dotfiles-8819879892489e40f5c3460c2467870b6d88d285.zip
Cleaning up script after final stage.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/lid-switch-action17
1 files changed, 7 insertions, 10 deletions
diff --git a/bin/lid-switch-action b/bin/lid-switch-action
index f543d86..e4b45a7 100755
--- a/bin/lid-switch-action
+++ b/bin/lid-switch-action
@@ -49,7 +49,6 @@ done < <(xrandr)
# Loop all connected displays
for i in ${connected[@]}
do
- echo "Display connected: $i" >> $log_file
case $i in
"HDMI1")
HDMI1=1
@@ -72,8 +71,7 @@ done
# Now checking which autorandr profile to use
case "$call" in
"0")
- echo "Called to close">> $log_file
- if [[ $connections -gt 1 ]];then
+ if [[ $connections -gt 1 ]];then # check if more than one connection
if [[ $HDMI1 -gt 0 ]];then
echo "HDMI1 connected." >> $log_file
/usr/bin/autorandr -l external-plugged & >> $log_file
@@ -81,10 +79,10 @@ case "$call" in
echo "DP2 connected." >> $log_file
/usr/bin/autorandr -l external-docked & >> $log_file
fi
- else
- echo "Only one screen connected" >> $log_file
+ else # else suspend
+ echo "Only one screen connected." >> $log_file
if [[ -f "/home/dave/.config/awesome/i3lock" ]];then
- echo "Using i3lock" >> $log_file
+ echo "Using i3lock to lock screen." >> $log_file
su dave -c "/home/dave/.config/awesome/i3lock"
fi
echo "Suspending." >> $log_file
@@ -92,13 +90,12 @@ case "$call" in
fi
;;
"1")
- echo "Called to open">> $log_file
- if [[ $connections -gt 1 ]];then
+ if [[ $connections -gt 1 ]];then # check if more than one connection
if [[ $HDMI1 -gt 0 ]];then
- echo "HDMI1 connected" >> $log_file
+ echo "HDMI1 connected." >> $log_file
/usr/bin/autorandr -l multi-plugged & >> $log_file
elif [[ $DP2 -gt 0 ]];then
- echo "DP2 connected" >> $log_file
+ echo "DP2 connected." >> $log_file
/usr/bin/autorandr -l multi-docked & >> $log_file
fi
fi