<commit_before>#!/bin/bash
#configure_display.sh

# Configures displays to my specifications using aticonfig

# Make sure the user is root
if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root!"
    exit
fi

# Parse command line.  If no mode is specified, use "help" mode
mode=${1}
if ! [ "${mode}" ]; then
    mode="help"
fi

# Depending on specified mode, do different things
case "${mode}" in
    "help")
        echo "A script for automatically configuring display modes using the"
        echo "aticonfig utility."
        echo ""; echo '    Usage: $> configure_display MODE'
        echo ""; echo "Allowed MODE values are:"
        echo "    single [x y]: only use the laptop monitor.  Optionally allow"
        echo "                  user to specify resolution.
        echo "    clone x y: clone the display on an external monitor"
        echo "               using the given x/y resolution"
        echo "    big: span display across laptop and external monitor"
        echo "    clean: removes xorg.conf.fglrx-* backup files."
        echo "    help: displays this help message and exits"
        exit
        ;;
    "single")
    
        if ! ( [ $2 ] && [ $3 ] ); then
            x=1400
            y=1050
        else
            x=$2
            y=$3
        fi

        echo "Configuring X for a single display (${x}x${y})"
        aticonfig --desktop-setup=single --sync-vsync=on \
                  --resolution=0,${x}x${y}
        ;;
    "clone")
        if ! ( [ $2 ] && [ $3 ] ); then
            echo "\"clone\" option requires x and y resolution!"
            echo "example: clone 1024 768"
            exit
        fi

        x=$2
        y=$3
        echo "Configuring X for a ${x}x${y} cloned display!"
        aticonfig --desktop-setup=clone --mode2=${x}x${y} \
                  --sync-vsync=on --resolution=0,${x}x${y}

        ;;
    "big")
        echo "Configuring X for a big desktop display"<commit_msg>fixed configure_display.sh<commit_after>#!/bin/bash
#configure_display.sh

# Configures displays to my specifications using aticonfig

# Make sure the user is root
if [ "$(id -u)" != "0" ]; then
    echo "This script must be run as root!"
    exit
fi

# Parse command line.  If no mode is specified, use "help" mode
mode=${1}
if ! [ "${mode}" ]; then
    mode="help"
fi

# Depending on specified mode, do different things
case "${mode}" in
    "help")
        echo "A script for automatically configuring display modes using the"
        echo "aticonfig utility."
        echo ""; echo '    Usage: $> configure_display MODE'
        echo ""; echo "Allowed MODE values are:"
        echo "    single [x y]: only use the laptop monitor.  Optionally allow"
        echo "                  user to specify resolution."
        echo "    clone x y: clone the display on an external monitor"
        echo "               using the given x/y resolution"
        echo "    big: span display across laptop and external monitor"
        echo "    clean: removes xorg.conf.fglrx-* backup files."
        echo "    help: displays this help message and exits"
        exit
        ;;
    "single")
    
        if ! ( [ $2 ] && [ $3 ] ); then
            x=1400
            y=1050
        else
            x=$2
            y=$3
        fi

        echo "Configuring X for a single display (${x} x ${y})"
        aticonfig --desktop-setup=single --sync-vsync=on \
                  --resolution=0,${x}x${y}
        ;;
    "clone")
        if ! ( [ $2 ] && [ $3 ] ); then
            echo "\"clone\" option requires x and y resolution!"
            echo "example: clone 1024 768"
            exit
        fi

        x=$2
        y=$3
        echo "Configuring X for a ${x}x${y} cloned display!"
        aticonfig --desktop-setup=clone --mode2=${x}x${y} \
                  --sync-vsync=on --resolution=0,${x}x${y}

        ;;
    "big")
        echo "Configuring X for a big desktop display"
{'fraction_non_alphanumeric': 0.11833417978669375, 'fraction_numerical': 0.014220416455053326, 'mean_word_length': 1.7680955727336614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '877566', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1119, 'n_words': 414}