summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sc b/sc
index a9e75f5..f64e118 100755
--- a/sc
+++ b/sc
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
# Quick hack to manage screen hotplugging
+
+reset_ratpoison="yes"
case "$1" in
"d") xrandr --nograb --output VGA1 --off --output LVDS1 --auto;;
"r") xrandr --nograb --output VGA1 --auto --primary --output LVDS1 --off;;
@@ -8,8 +10,10 @@ case "$1" in
"s") xrandr --nograb --output LVDS1 --auto --below VGA1 --output VGA1 --auto;;
"e") xrandr --nograb --output LVDS1 --auto --right-of VGA1 --output VGA1 --auto;;
"w") xrandr --nograb --output LVDS1 --auto --left-of VGA1 --output VGA1 --auto;;
- *) xrandr --nograb ;;
+ *) xrandr --nograb; reset_ratpoison="" ;;
esac;
-[ -n "$BACKGROUND_IMAGE" ] && feh --bg-scale "$BACKGROUND_IMAGE"
-ratpoison -c restart
+if [ -n "$reset_ratpoison" ]; then
+ [ -n "$BACKGROUND_IMAGE" ] && feh --bg-scale "$BACKGROUND_IMAGE"
+ ratpoison -c restart
+fi;