diff options
-rwxr-xr-x | xsessionrc.dot.link | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/xsessionrc.dot.link b/xsessionrc.dot.link index fd8c199..a77b3a6 100755 --- a/xsessionrc.dot.link +++ b/xsessionrc.dot.link @@ -15,16 +15,33 @@ OSVERSION="`cut -d . -f 1 /etc/debian_version`" # Hostname HOSTNAME="`cat /etc/hostname`" -# Start xscreensaver -if [ -e "/usr/bin/xscreensaver" ]; then - xscreensaver -no-splash & -fi +# Output +# Example: OUTPUT="VGA-1" +OUTPUT="" # Custom config if [ -e "$HOME/.custom/xsession" ]; then . $HOME/.custom/xsession fi +# Set output display if defined in custom configuration +if [ ! -z "$OUTPUT" ] && xrandr | grep -q "^$OUTPUT connected"; then + # Disable all other outputs + for device in `xrandr | grep " connected " | cut -d ' ' -f 1 | xargs`; do + if [ "$device" != "$OUTPUT" ]; then + xrandr --output $device --off + fi + done + + # Turn on the desired device + xrandr --output $OUTPUT --auto +fi + +# Start xscreensaver +if [ -e "/usr/bin/xscreensaver" ]; then + xscreensaver -no-splash & +fi + # Set background if [ "$BACKGROUND" = "all" ]; then feh --bg-scale --randomize $HOME/.config/themes/backgrounds/* |