From 8e3be516f7a76c6d6431745a22d99961dd402ee6 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Thu, 12 Dec 2013 14:42:53 +0100 Subject: [xorg/kdm] kdm/Xsetup sources global xorg/XSetup --- remote/modules/kdm/data/etc/kde4/kdm/Xsetup | 6 ++++++ remote/modules/xorg/data/etc/X11/Xsetup | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100755 remote/modules/xorg/data/etc/X11/Xsetup (limited to 'remote/modules') diff --git a/remote/modules/kdm/data/etc/kde4/kdm/Xsetup b/remote/modules/kdm/data/etc/kde4/kdm/Xsetup index 965f1f08..14ebe761 100755 --- a/remote/modules/kdm/data/etc/kde4/kdm/Xsetup +++ b/remote/modules/kdm/data/etc/kde4/kdm/Xsetup @@ -5,3 +5,9 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/o #xconsole -geometry 480x130-0-0 -notify -verbose -fn fixed -exitOnFail -file /dev/xconsole & #/sbin/initctl -q emit login-session-start DISPLAY_MANAGER=kdm + +# Use common Xreset framework if it exist +if [ -x /etc/X11/Xsetup ] ; then + /etc/X11/Xsetup +fi + diff --git a/remote/modules/xorg/data/etc/X11/Xsetup b/remote/modules/xorg/data/etc/X11/Xsetup new file mode 100755 index 00000000..f57fe3be --- /dev/null +++ b/remote/modules/xorg/data/etc/X11/Xsetup @@ -0,0 +1,9 @@ +#!/bin/ash + +SESSIONDIR="/etc/X11/Xsetup.d" + +if [ -d "$SESSIONDIR" ]; then + for file in $SESSIONDIR/*; do + . $file || slxlog "xsetup" "Xsetup: Could not source $file" "$file" + done +fi -- cgit v1.2.3-55-g7522 From d930be51f79715cb6f0df925fe08838109ff833b Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 12 Dec 2013 14:44:30 +0100 Subject: [pam] add missing /etc/pam-script folder to basic pam module --- remote/modules/pam/data/etc/pam-script/pam_script_ses_close | 1 + remote/modules/pam/data/etc/pam-script/pam_script_ses_open | 1 + 2 files changed, 2 insertions(+) create mode 120000 remote/modules/pam/data/etc/pam-script/pam_script_ses_close create mode 120000 remote/modules/pam/data/etc/pam-script/pam_script_ses_open (limited to 'remote/modules') diff --git a/remote/modules/pam/data/etc/pam-script/pam_script_ses_close b/remote/modules/pam/data/etc/pam-script/pam_script_ses_close new file mode 120000 index 00000000..f3682056 --- /dev/null +++ b/remote/modules/pam/data/etc/pam-script/pam_script_ses_close @@ -0,0 +1 @@ +/opt/openslx/scripts/pam_script_ses_close \ No newline at end of file diff --git a/remote/modules/pam/data/etc/pam-script/pam_script_ses_open b/remote/modules/pam/data/etc/pam-script/pam_script_ses_open new file mode 120000 index 00000000..4f5598e5 --- /dev/null +++ b/remote/modules/pam/data/etc/pam-script/pam_script_ses_open @@ -0,0 +1 @@ +/opt/openslx/scripts/pam_script_ses_open \ No newline at end of file -- cgit v1.2.3-55-g7522 From f86ab89f2ed45eff4c77b7e752adc0cd41fa668d Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Thu, 12 Dec 2013 15:03:44 +0100 Subject: [beamergui] Added Xsetup script for beamergui --- .../data/etc/X11/Xsetup.d/99-beamergui-mode_setter | 93 ++++++++++++++++++++++ .../opt/openslx/scripts/beamergui-Xsetup_script | 93 ---------------------- 2 files changed, 93 insertions(+), 93 deletions(-) create mode 100755 remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter delete mode 100755 remote/modules/beamergui/data/opt/openslx/scripts/beamergui-Xsetup_script (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter b/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter new file mode 100755 index 00000000..f58933e2 --- /dev/null +++ b/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter @@ -0,0 +1,93 @@ +#! /bin/bash +# This script explicitely needs bash for the arrays + +## This script adds the common resolutions to the Xserver if and only if there +## is a beamer connected. If additionally the preferred resolution is known +## (i.e. the Xserver received a proper EDID) the latter will be applied. + +################################################################################ +# Add or remove additional modes here. +declare -a MODES +MODES=("${MODES[@]}" "1280x800 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync") +MODES=("${MODES[@]}" "1440x1050 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync") +MODES=("${MODES[@]}" "1680x1200 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync") +MODES=("${MODES[@]}" "1920x1200 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync") +MODES=("${MODES[@]}" "1280x720 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync") +MODES=("${MODES[@]}" "1368x768 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync") +MODES=("${MODES[@]}" "1600x900 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync") +MODES=("${MODES[@]}" "1920x1080 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync") +MODES=("${MODES[@]}" "800x600 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync") +MODES=("${MODES[@]}" "1024x768 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync") +MODES=("${MODES[@]}" "1152x864 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync") +MODES=("${MODES[@]}" "1280x960 101.25 1280 1360 1488 1696 960 963 967 996 -hsync +vsync") +MODES=("${MODES[@]}" "1280x1024 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync") +################################################################################ + +# Get initial information about the screend from xrandr +XRANDR=$( xrandr --current ) +XRANDRV=$( xrandr --current --verbose ) + +# Get the names of the connected outputs +declare -a OUTPUTNAMES +while read line; do + OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") +done < <( echo "$XRANDR" | grep -i " connected" ) +echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" + +## The goal is to add more modelines to the X server. While this is done the +# screen is flickering. Hence this is just necessary if there is a beamer, do +# the flickering magic only if there are two outputs and one is a projector. +if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then + if ! ( echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null \ + && echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[1]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null ) + then + + # Create all modes, so that X knows them by name "x" + for i in "${MODES[@]}"; do + xrandr --current --newmode $i > /dev/null 2>&1 + done + + # Add the modes to the outputs, this means that, if this action is + # successful they can be applied to the screens. + for i in "${OUTPUTNAMES[@]}"; do + for j in "${MODES[@]}"; do + xrandr --current --addmode $i $(echo $j| awk '{print $1;}') + done + done + + # Check which of the outputs is the beamer. Just for reference. + if [[ -z "$(echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm")" ]]; then + BEAMER=0; + else + BEAMER=1; + fi + # echo -ne "${OUTPUTNAMES[$BEAMER]} is a beamer. " + + ## Finally if the EDID is present apply a proper resolution. + # Find out, if the beamer transmits reliable EDID data. The data in xrandr + # should be reliable if the EDID is present. + if echo "$XRANDRV" | grep -Pzo \ + "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ + | grep EDID > /dev/null ; then + + #echo "EDID present" + + + # If the breamer transmits the EDID there shall be a preferred resolution. + OPTIMALRES=$(echo "$XRANDRV" \ + | grep -Pzo "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ + | grep preferred | awk '{print $1}') + + # Apply the optimal resolution tho either of the outputs. The beamer has + # to be the secondary output. + xrandr \ + --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $OPTIMALRES \ + --primary \ + --output ${OUTPUTNAMES[$BEAMER]} --mode $OPTIMALRES \ + --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} + fi + fi +fi diff --git a/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-Xsetup_script b/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-Xsetup_script deleted file mode 100755 index f58933e2..00000000 --- a/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-Xsetup_script +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/bash -# This script explicitely needs bash for the arrays - -## This script adds the common resolutions to the Xserver if and only if there -## is a beamer connected. If additionally the preferred resolution is known -## (i.e. the Xserver received a proper EDID) the latter will be applied. - -################################################################################ -# Add or remove additional modes here. -declare -a MODES -MODES=("${MODES[@]}" "1280x800 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync") -MODES=("${MODES[@]}" "1440x1050 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync") -MODES=("${MODES[@]}" "1680x1200 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync") -MODES=("${MODES[@]}" "1920x1200 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync") -MODES=("${MODES[@]}" "1280x720 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync") -MODES=("${MODES[@]}" "1368x768 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync") -MODES=("${MODES[@]}" "1600x900 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync") -MODES=("${MODES[@]}" "1920x1080 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync") -MODES=("${MODES[@]}" "800x600 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync") -MODES=("${MODES[@]}" "1024x768 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync") -MODES=("${MODES[@]}" "1152x864 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync") -MODES=("${MODES[@]}" "1280x960 101.25 1280 1360 1488 1696 960 963 967 996 -hsync +vsync") -MODES=("${MODES[@]}" "1280x1024 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync") -################################################################################ - -# Get initial information about the screend from xrandr -XRANDR=$( xrandr --current ) -XRANDRV=$( xrandr --current --verbose ) - -# Get the names of the connected outputs -declare -a OUTPUTNAMES -while read line; do - OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") -done < <( echo "$XRANDR" | grep -i " connected" ) -echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" - -## The goal is to add more modelines to the X server. While this is done the -# screen is flickering. Hence this is just necessary if there is a beamer, do -# the flickering magic only if there are two outputs and one is a projector. -if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then - if ! ( echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null \ - && echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[1]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null ) - then - - # Create all modes, so that X knows them by name "x" - for i in "${MODES[@]}"; do - xrandr --current --newmode $i > /dev/null 2>&1 - done - - # Add the modes to the outputs, this means that, if this action is - # successful they can be applied to the screens. - for i in "${OUTPUTNAMES[@]}"; do - for j in "${MODES[@]}"; do - xrandr --current --addmode $i $(echo $j| awk '{print $1;}') - done - done - - # Check which of the outputs is the beamer. Just for reference. - if [[ -z "$(echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm")" ]]; then - BEAMER=0; - else - BEAMER=1; - fi - # echo -ne "${OUTPUTNAMES[$BEAMER]} is a beamer. " - - ## Finally if the EDID is present apply a proper resolution. - # Find out, if the beamer transmits reliable EDID data. The data in xrandr - # should be reliable if the EDID is present. - if echo "$XRANDRV" | grep -Pzo \ - "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep EDID > /dev/null ; then - - #echo "EDID present" - - - # If the breamer transmits the EDID there shall be a preferred resolution. - OPTIMALRES=$(echo "$XRANDRV" \ - | grep -Pzo "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep preferred | awk '{print $1}') - - # Apply the optimal resolution tho either of the outputs. The beamer has - # to be the secondary output. - xrandr \ - --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $OPTIMALRES \ - --primary \ - --output ${OUTPUTNAMES[$BEAMER]} --mode $OPTIMALRES \ - --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} - fi - fi -fi -- cgit v1.2.3-55-g7522 From 9a801ff48af35669fcfd268adb8e57f88c1802f2 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Thu, 12 Dec 2013 15:08:58 +0100 Subject: [beamergui] removed deprecated file --- .../data/opt/openslx/bin/screenRecognizer.sh | 418 --------------------- 1 file changed, 418 deletions(-) delete mode 100755 remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh b/remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh deleted file mode 100755 index feabe7ee..00000000 --- a/remote/modules/beamergui/data/opt/openslx/bin/screenRecognizer.sh +++ /dev/null @@ -1,418 +0,0 @@ -#! /bin/bash - -RES1610=(1920x1200 1680x1050 1440x900 1280x800 ) -RES169=(1920x1080 1600x900 1280x720 ) -RES54=(1280x1024 ) -RES43=(1280x960 1152x864 1024x768 ) -ALLRES=( ${RES1610[@]} ${RES169[@]} ${RES54[@]} ${RES43[@]} ) - -echo -e "\e[32mSupported resolutions\e[0m" -for i in ${ALLRES[@]} -do - echo -n "$i - " - echo "scale=2; $i" | tr "x" "/" | bc -l -done - -# Get initial data -XRANDR=$( xrandr ) -XRANDRV=$( xrandr --verbose ) - -# Get the connected outputs -declare -a OUTPUTNAMES -while read line; do - OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") -done < <( echo "$XRANDR" | grep -i " connected" ) -echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" - - -if [ ${#OUTPUTNAMES[@]} -eq 1 ]; then - - - # In case of one connected output - xrandr --auto - exit - - -elif [ ${#OUTPUTNAMES[@]} -eq 2 ]; then - - - # In case of two connected outputs - # If one of the two connected outputs is a beamer, based on the assumption - # that a beamer can not output a reasonable dimension. - if ! ( echo "$XRANDR" | egrep "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null \ - && echo "$XRANDR" | egrep "^${OUTPUTNAMES[1]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null ); then - - - # If one scree is a beamer. First check which one is the BEAMER - if [[ -z "$(echo "$XRANDR" | egrep "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm")" ]] - then BEAMER=0; else BEAMER=1; fi - echo -ne "${OUTPUTNAMES[$BEAMER]} is a beamer. " - - - # Get the supported modes of the outputs - # Get resolutions of output #0 - for RES in $( echo "$XRANDR" | grep -Pzo \ - "(?s)^${OUTPUTNAMES[0]} connected\N*\n(\t+\N*\n)*(\ +\N*\n)*" \ - | egrep -o "\ \ [[:digit:]]+x[[:digit:]]+" ); do - OUTPUT0+=("$RES"); - done - echo -e "\e[31mOUTPUT0:\e[0m" - for i in ${OUTPUT0[@]}; do echo "$i";done - - # Get resolutions of output #1 - for RES in $( echo "$XRANDR" | grep -Pzo \ - "(?s)^${OUTPUTNAMES[1]} connected\N*\n(\t+\N*\n)*(\ +\N*\n)*" \ - | egrep -o "\ \ [[:digit:]]+x[[:digit:]]+" ); do - OUTPUT1+=("$RES"); - done - echo -e "\e[31mOUTPUT1:\e[0m" - for i in ${OUTPUT1[@]}; do echo "$i";done - - - # Find out, if the beamer transmits reliable EDID data. The data in xrandr - # should be reliable if the EDID is present. - if echo "$XRANDRV" | grep -Pzo \ - "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep EDID > /dev/null ; then - - - echo "EDID present" - - # If the beamer transmits reliable EDID data, get the perfect match - # Presumed the preferred resolution is the native one, get both native - # resolutions - BEAMERPREF=$(echo "$XRANDRV" \ - | grep -Pzo "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep preferred | awk '{print $1}') - echo -e "\e[32mBEAMERPREF\e[0m=$BEAMERPREF" - MONITORPREF=$(echo "$XRANDRV" \ - | grep -Pzo "^${OUTPUTNAMES[$((1-$BEAMER))]}\N*\n((\ |\t)+\N*\n)+" \ - | grep preferred | awk '{print $1}') - echo -e "\e[32mMONITORPREF\e[0m=$MONITORPREF" - - # Compute the optimal resolution for presentations - # which is min( 1280, M.X, B.X ) - OPTIMALRESX=$(( ${MONITORPREF%x*} <= ${BEAMERPREF%x*} ? \ - ${MONITORPREF%x*} : ${BEAMERPREF%x*} )) - OPTIMALRESX=$(( $OPTIMALRESX <= 1280 ? $OPTIMALRESX : 1280 )) - AR=$(echo "$BEAMERPREF" | tr "x" "/" | bc -l) # "scale=2; 5/4" - OPTIMALRESY=$(echo "scale=0; $OPTIMALRESX / $(echo "$AR" | bc -l)" | bc -l) - OPTIMALRES="$OPTIMALRESX"x"$OPTIMALRESY" - echo -e "\e[32mOPTIMALRESX\e[0m=$OPTIMALRESX" - echo -e "\e[32mOPTIMALRESY\e[0m=$OPTIMALRESY" - echo -e "\e[32mOPTIMALRES\e[0m=$OPTIMALRES" - echo -e "\e[32mAR\e[0m=$AR" - - # Generate a list of common resolutions (Greedy fun) - for RES1 in ${OUTPUT0[@]}; do - for RES2 in ${OUTPUT1[@]}; do - if [ $RES1 = $RES2 ]; then - COMMONMATCHES+=("$RES1") - fi - done - done - echo -e "\e[31mCOMMONMATCHES:\e[0m" - for i in "${COMMONMATCHES[@]}" - do echo "$i - $( echo "scale=2; $i" | tr "x" "/" | bc -l)" - done - - # Compute the additional resolutions - for i in ${ALLRES[@]}; do - if (( $( echo "$i == $AR" | tr "x" "/" | bc -l ) )); then - if echo ${COMMONMATCHES[@]} | grep "$i" > /dev/null; then - if [ "$OPTIMALRES" = "$i" ]; then continue; fi - ADDITIONALRES+=("$i") - else - xrandr \ - --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} "$i" \ - --addmode ${OUTPUTNAMES[$BEAMER]} "$i" \ - && ADDITIONALRES+=("$i") - fi - fi - done - echo -e "\e[31mADDITIONALRES:\e[0m" - for i in "${ADDITIONALRES[@]}" - do echo "$i - $( echo "scale=2; ${i% *}" | tr "x" "/" | bc -l)" - done - - # Apply the optimal resolution - xrandr \ - --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} $OPTIMALRES \ - --addmode ${OUTPUTNAMES[$BEAMER]} $OPTIMALRES; - xrandr \ - --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $OPTIMALRES \ - --primary \ - --output ${OUTPUTNAMES[$BEAMER]} --mode $OPTIMALRES \ - --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} - - # Ask for a resolution - CHOSENRES=$( zenity --list \ - --title="Resolution Chooser" \ - --ok-label="Apply" \ - --cancel-label="Cancel" \ - --text "Choose a resolution\nor press cancel." \ - --width=300 --height=400 \ - --column="Resolution" "$OPTIMALRES (optimal)" "${ADDITIONALRES[@]}" \ - --print-column=1 \ - --hide-header ) || exit - echo "Chosen resolution $CHOSENRES" - - - - # Apply resolution - xrandr \ - --output ${OUTPUTNAMES[0]} --mode ${CHOSENRES%% *} \ - --output ${OUTPUTNAMES[1]} --mode ${CHOSENRES%% *} \ - --same-as ${OUTPUTNAMES[0]} - - - # If beamer DOES NOT transmit reliable EDID data - else - - echo "EDID is not present" - - # Compute the additional resolutions - for i in ${ALLRES[@]}; do - if ! xrandr \ - --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} "$i" \ - --addmode ${OUTPUTNAMES[$BEAMER]} "$i"; then - if xrandr --newmode \ - "$i" $( cvt $(echo "$i" | tr "x" " " ) \ - | grep Modeline | cut -d " " -f3-); then - if ! xrandr --dryrun \ - --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} "$i" \ - --addmode ${OUTPUTNAMES[$BEAMER]} "$i"; then - continue; - fi - else - continue - fi - fi - AR=$(echo "scale=2; $i" | tr "x" "/" | bc -l ) - case $AR in - "1.60") - ADDITIONALRES+=("$i (16:10)") - ;; - "1.77") - ADDITIONALRES+=("$i (16:9)") - ;; - "1.25") - ADDITIONALRES+=("$i (5:4)") - ;; - "1.33") - ADDITIONALRES+=("$i (4:3)") - ;; - *) - esac - done - echo -e "\e[31mADDITIONALRES:\e[0m" - for i in "${ADDITIONALRES[@]}" - do echo "$i - $( echo "scale=2; ${i% *}" | tr "x" "/" | bc -l)" - done - - TEXT="The connected beamer did not transmit reliable configuration\n" \ - TEXT+="data. To avoid clipping or streching, it is recommended to\n" \ - TEXT+="choose a resolution equal to the aspect ratio of the native\n" \ - TEXT+="resolution of the beamer." \ - - # Ask for a resolution - CHOSENRES=$( zenity --list \ - --title="Resolution Chooser" \ - --ok-label="Apply" \ - --cancel-label="Cancel" \ - --text "$TEXT" \ - --width=300 --height=400 \ - --column="Resolution" "${ADDITIONALRES[@]}" \ - --print-column=1 \ - --hide-header ) || exit - echo "Chosen resolution ${CHOSENRES%% *}" - - # Apply resolution - xrandr \ - --addmode ${OUTPUTNAMES[0]} ${CHOSENRES%% *} \ - --addmode ${OUTPUTNAMES[1]} ${CHOSENRES%% *}; - xrandr \ - --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode ${CHOSENRES%% *} \ - --primary \ - --output ${OUTPUTNAMES[$BEAMER]} --mode ${CHOSENRES%% *} \ - --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} - - fi - else - - - # If neiter of the outputs is a beamer (likely dualscreen - # setup) just apply preferred settings - echo "no beamer" - xrandr \ - --output ${OUTPUTNAMES[0]} --preferred \ - --output ${OUTPUTNAMES[1]} --preferred \ - --right-of ${OUTPUTNAMES[0]} - - - fi - -else - # If there are more than 3 outputs - # its up to the user. Quit. - exit; -fi - - - - # OLD APPROACH - # Find out, if the beamer transmits reliable EDID data. - # For the first assumption the beamer transmits reliable data, if in - # Xorg.log '*EDID for output $BEAMER*' is succeded by '*Manufacturer*' - # and '*Year*'. - # BEAMERELIABILITY=1 - # while read line - # do - # if echo $line | grep "EDID for output ${OUTPUTNAMES[$BEAMER]}" > /dev/null - # then - # read line - # if echo $line | grep "Manufacturer" > /dev/null - # then - # BEAMERELIABILITY=0 - # break - # fi - # fi - # done < "/var/log/Xorg.0.log" - - - - - - -# # if one of the outputs is a beamer, offer a choice -# declare -a OUTPUT1 -# declare -a OUTPUT2 -# - -# # Make sure the desired resolutions are existent -# # FULLHD -# #for in -# -# -# ####################################DEBUG################################### -# echo ${NATIVEMATCHES[@]} -# echo -e "\e[31m--------------------------------\e[0m" -# ############################################################################ -# -# # Add some experimental standard resolutions, which the outputs should be -# # able to display via interpolation. -# declare -a EXPERIMENTALMATCHES=("1920x1080 (16:9)" "1366x768 (16:9)" "1280x960 (4:3)" "1280x720 (16:9)") -# -# ## Form an interactive dialog to suit the users preferred resolution -# #zenity --question \ -# # --timeout=10 \ -# # --text="Do you want to change the resolution?" \ -# # --ok-label "Yes" \ -# # --cancel-label "No" -# -#OfferChoice() -#{ -# false; while [ "$?" != 0 ] #bash do{...}while(...) imitation -# do -# -# -# CHOSENRES=$( zenity --list \ -# --title="Resolution Chooser" \ -# --ok-label="Apply" \ -# --cancel-label="Cancel" \ -# --text "Choose a resolution\nor press cancel." \ -# --width=300 --height=400 \ -# --column="Resolution" 1920x1080 1366x768 1280x720 1024x768 \ -# --print-column=1 \ -# --hide-header ) -# -# ####################################DEBUG################################# -# echo "Chosen resolution $CHOSENRES" -# echo -e "\e[31m--------------------------------\e[0m" -# ########################################################################## -# -# if [ $? != 0 ] -# then -# break -# fi -# -# xrandr \ -# --output ${OUTPUTNAMES[0]} --mode ${CHOSENRES%% *} \ -# --output ${OUTPUTNAMES[1]} --mode ${CHOSENRES%% *} \ -# --same-as ${OUTPUTNAMES[0]} -# -# # in case the mode is unknown -# if [ $? != 0 ] -# then -# xrandr \ -# --addmode ${OUTPUTNAMES[0]} ${CHOSENRES%% *} \ -# --addmode ${OUTPUTNAMES[1]} ${CHOSENRES%% *} -# xrandr \ -# --output ${OUTPUTNAMES[0]} --mode ${CHOSENRES%% *} --primary \ -# --output ${OUTPUTNAMES[1]} --mode ${CHOSENRES%% *} --same-as ${OUTPUTNAMES[0]} -# -# #CVT="$(cvt $(echo ${CHOSENRES%% *} | cut -d " " -f1 | tr "x" " ") | grep Modeline)" -# #MODENAME=echo $CVT | cut -d " " -f2) -# #MODELINE=echo $CVT | cut -d " " -f3-) -# fi -# -# zenity --question \ -# --text="Do you want to stay with this resolution?" \ -# --ok-label "Yes" \ -# --cancel-label "No" -# -# # In case of timeout -# #if [ $? -eq 5]; then ;fi -# -# done -#} -# # If the beamer fits in the monitor, teach the monitor the preferred -# # mode of the beamer -# xrandr --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} $BEAMERPREF -# xrandr --output ${OUTPUTNAMES[$((1-$BEAMER))]} \ -# --mode $BEAMERPREF \ -# --primary \ -# --output ${OUTPUTNAMES[$BEAMER]} \ -# --mode $BEAMERPREF \ -# --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} -# echo -e "\e[32mPERFECTMATCH\e[0m=$BEAMERPREF" -# -# # If the monitor fits in the beamer, teach the beamer the preferred -# # mode of the monitor -# xrandr --addmode ${OUTPUTNAMES[$BEAMER]} $MONITORPREF -# xrandr --output ${OUTPUTNAMES[$((1-$BEAMER))]} \ -# --mode $MONITORPREF \ -# --primary \ -# --output ${OUTPUTNAMES[$BEAMER]} \ -# --mode $MONITORPREF \ -# --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} -# -# -# -# -# -# Offer a mode selection -# 1920x1080, 1366x768, 1280x800 and 1024x800 have to be available. -# Check if the TFT supports the resolution -# if echo "$XRANDRV" \ -# | grep -Pzo "^${OUTPUTNAMES[$((1-$BEAMER))]}\N*\n((\ |\t)+\N*\n)+" \ -# | grep $MODE > /dev/null -# then -# -# # If so, just assign the beamers preferred resolution to the TFT -# xrandr \ -# --output ${OUTPUTNAMES[0]} --mode $MODE \ -# --output ${OUTPUTNAMES[1]} --mode $MODE \ -# --same-as ${OUTPUTNAMES[0]} -# else -# -# # If not, teach the TFT the mode -# xrandr \ -# --addmode ${OUTPUTNAMES[$((1-$BEAMER))]} $MODE -# --output ${OUTPUTNAMES[0]} --mode $MODE \ -# --output ${OUTPUTNAMES[1]} --mode $MODE \ -# --same-as ${OUTPUTNAMES[0]} -# fi -# -# #OfferChoice -# #echo "Offered choice" -- cgit v1.2.3-55-g7522 From b248c1711cf9ac08673274a5530e22004f27b66f Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Thu, 12 Dec 2013 15:52:37 +0100 Subject: [beamergui] Start beamergui with X. Config for beamergui. --- .../beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script | 5 +++++ server/configs/freiburg/beamer-freiburg | 1 + server/modules/beamer-freiburg/opt/openslx/beamergui/beamer.conf | 2 ++ 3 files changed, 8 insertions(+) create mode 100755 remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script create mode 120000 server/configs/freiburg/beamer-freiburg create mode 100644 server/modules/beamer-freiburg/opt/openslx/beamergui/beamer.conf (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script b/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script new file mode 100755 index 00000000..232578ac --- /dev/null +++ b/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script @@ -0,0 +1,5 @@ +#!/bin/ash + +CONFIGFILE="/opt/openslx/beamergui/beamer.conf" + +/opt/openslx/bin/beamergui "$CONFIGFILE" diff --git a/server/configs/freiburg/beamer-freiburg b/server/configs/freiburg/beamer-freiburg new file mode 120000 index 00000000..d59c77af --- /dev/null +++ b/server/configs/freiburg/beamer-freiburg @@ -0,0 +1 @@ +../../modules/beamer-freiburg/ \ No newline at end of file diff --git a/server/modules/beamer-freiburg/opt/openslx/beamergui/beamer.conf b/server/modules/beamer-freiburg/opt/openslx/beamergui/beamer.conf new file mode 100644 index 00000000..52fc0033 --- /dev/null +++ b/server/modules/beamer-freiburg/opt/openslx/beamergui/beamer.conf @@ -0,0 +1,2 @@ +[SpecificSettings] +132.230.4.100=1280x800 -- cgit v1.2.3-55-g7522 From 39521a9a09b896aa2fa7452d9f5af25641a2de6e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 Dec 2013 16:44:06 +0100 Subject: [kernel] Fix bug that makes the pc speaker play weird melodies --- remote/modules/kernel/kernel.build | 3 --- 1 file changed, 3 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build index ae1b7694..197935f7 100644 --- a/remote/modules/kernel/kernel.build +++ b/remote/modules/kernel/kernel.build @@ -27,9 +27,6 @@ fetch_source() { pinfo "aufs detected in kernel source :)" fi - # fix pc speaker - ./patch-speaker - # remember the current kernel version echo "${KERNEL_CURRENT_VERSION}" > ksrc/KVERSION -- cgit v1.2.3-55-g7522 From 20ce232c145199d32e9ee3b38367023caa2cf0bd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 Dec 2013 19:08:04 +0100 Subject: [pam] Fix session cleanup after last logout: su/sudo would not create a new session with logind, so an active user session could have been killed --- remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close index 535cd0d6..198d2efe 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close @@ -13,6 +13,10 @@ slxlog "session-close" "$PAM_USER logged out on $PAM_TTY" OPENSESSION=$(loginctl show-user "$PAM_USER" | grep "Sessions=" | cut -c 10-) SESSIONCOUNT=$(echo "$OPENSESSION" | wc -w) +# When using su/sudo there is no session created, so count up by one +if [ "x$PAM_SERVICE" = "xsu" -o "x$PAM_SERVICE" = "xsudo" ]; then + SESSIONCOUNT=$(( $SESSIONCOUNT + 1 )) +fi if [ "$SESSIONCOUNT" = "1" ]; then # last sessions, close all ghost user processes -- cgit v1.2.3-55-g7522 From 0012b64ec1a080051ed41f5b4f19bc68c0f0af12 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 Dec 2013 20:39:53 +0100 Subject: [vmchooser] Fix NFS fallback once again --- remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt index 43880a2c..2d6dfb41 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -485,8 +485,8 @@ else fi if [ -z "$vm_diskfile" ]; then - new_vmpath=$(ls "${vmpath}.r"* | grep -E '\.r[0-9]+$' | grep -o -E '[0-9]+' | sort -n | tail -1) - [ -n "$new_vmpath" ] && vmpath="$vmpath$new_vmpath" + new_vmpath=$(ls "${vmpath}.r"* | grep -E -o '\.r[0-9]+$' | grep -o -E '[0-9]+' | sort -n | tail -1) + [ -n "$new_vmpath" ] && vmpath="${vmpath}.r${new_vmpath}" vm_diskfile="$vmpath" fi -- cgit v1.2.3-55-g7522 From c0afbbbbbf7a74756a31a09c8d0e7f1b2e9c8fa2 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 13 Dec 2013 11:15:31 +0100 Subject: [beamergui] Send beamergui to bg --- .../beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script b/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script index 232578ac..0d3e4ed6 100755 --- a/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script +++ b/remote/modules/beamergui/data/etc/X11/Xsession.d/99-beamergui-starter_script @@ -2,4 +2,4 @@ CONFIGFILE="/opt/openslx/beamergui/beamer.conf" -/opt/openslx/bin/beamergui "$CONFIGFILE" +/opt/openslx/bin/beamergui "$CONFIGFILE" & -- cgit v1.2.3-55-g7522 From 6aa283f43f1328af3ea6bd4f85e3a282204389b8 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 13 Dec 2013 14:46:31 +0100 Subject: [beamergui] wrapper for beamergui-mode_setter --- .../data/etc/X11/Xsetup.d/99-beamergui-mode_setter | 93 ---------------------- .../X11/Xsetup.d/99-beamergui-mode_setter_wrapper | 5 ++ .../data/opt/openslx/scripts/beamergui-mode_setter | 93 ++++++++++++++++++++++ 3 files changed, 98 insertions(+), 93 deletions(-) delete mode 100755 remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter create mode 100755 remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter_wrapper create mode 100755 remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter b/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter deleted file mode 100755 index f58933e2..00000000 --- a/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter +++ /dev/null @@ -1,93 +0,0 @@ -#! /bin/bash -# This script explicitely needs bash for the arrays - -## This script adds the common resolutions to the Xserver if and only if there -## is a beamer connected. If additionally the preferred resolution is known -## (i.e. the Xserver received a proper EDID) the latter will be applied. - -################################################################################ -# Add or remove additional modes here. -declare -a MODES -MODES=("${MODES[@]}" "1280x800 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync") -MODES=("${MODES[@]}" "1440x1050 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync") -MODES=("${MODES[@]}" "1680x1200 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync") -MODES=("${MODES[@]}" "1920x1200 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync") -MODES=("${MODES[@]}" "1280x720 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync") -MODES=("${MODES[@]}" "1368x768 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync") -MODES=("${MODES[@]}" "1600x900 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync") -MODES=("${MODES[@]}" "1920x1080 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync") -MODES=("${MODES[@]}" "800x600 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync") -MODES=("${MODES[@]}" "1024x768 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync") -MODES=("${MODES[@]}" "1152x864 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync") -MODES=("${MODES[@]}" "1280x960 101.25 1280 1360 1488 1696 960 963 967 996 -hsync +vsync") -MODES=("${MODES[@]}" "1280x1024 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync") -################################################################################ - -# Get initial information about the screend from xrandr -XRANDR=$( xrandr --current ) -XRANDRV=$( xrandr --current --verbose ) - -# Get the names of the connected outputs -declare -a OUTPUTNAMES -while read line; do - OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") -done < <( echo "$XRANDR" | grep -i " connected" ) -echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" - -## The goal is to add more modelines to the X server. While this is done the -# screen is flickering. Hence this is just necessary if there is a beamer, do -# the flickering magic only if there are two outputs and one is a projector. -if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then - if ! ( echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null \ - && echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[1]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null ) - then - - # Create all modes, so that X knows them by name "x" - for i in "${MODES[@]}"; do - xrandr --current --newmode $i > /dev/null 2>&1 - done - - # Add the modes to the outputs, this means that, if this action is - # successful they can be applied to the screens. - for i in "${OUTPUTNAMES[@]}"; do - for j in "${MODES[@]}"; do - xrandr --current --addmode $i $(echo $j| awk '{print $1;}') - done - done - - # Check which of the outputs is the beamer. Just for reference. - if [[ -z "$(echo "$XRANDR" | egrep \ - "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm")" ]]; then - BEAMER=0; - else - BEAMER=1; - fi - # echo -ne "${OUTPUTNAMES[$BEAMER]} is a beamer. " - - ## Finally if the EDID is present apply a proper resolution. - # Find out, if the beamer transmits reliable EDID data. The data in xrandr - # should be reliable if the EDID is present. - if echo "$XRANDRV" | grep -Pzo \ - "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep EDID > /dev/null ; then - - #echo "EDID present" - - - # If the breamer transmits the EDID there shall be a preferred resolution. - OPTIMALRES=$(echo "$XRANDRV" \ - | grep -Pzo "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ - | grep preferred | awk '{print $1}') - - # Apply the optimal resolution tho either of the outputs. The beamer has - # to be the secondary output. - xrandr \ - --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $OPTIMALRES \ - --primary \ - --output ${OUTPUTNAMES[$BEAMER]} --mode $OPTIMALRES \ - --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} - fi - fi -fi diff --git a/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter_wrapper b/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter_wrapper new file mode 100755 index 00000000..583f7e58 --- /dev/null +++ b/remote/modules/beamergui/data/etc/X11/Xsetup.d/99-beamergui-mode_setter_wrapper @@ -0,0 +1,5 @@ +#! /bin/ash + +# This script explicitely calls bash for the xrandr wrappe script + +/bin/bash /opt/openslx/scripts/beamergui-mode_setter diff --git a/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter b/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter new file mode 100755 index 00000000..f58933e2 --- /dev/null +++ b/remote/modules/beamergui/data/opt/openslx/scripts/beamergui-mode_setter @@ -0,0 +1,93 @@ +#! /bin/bash +# This script explicitely needs bash for the arrays + +## This script adds the common resolutions to the Xserver if and only if there +## is a beamer connected. If additionally the preferred resolution is known +## (i.e. the Xserver received a proper EDID) the latter will be applied. + +################################################################################ +# Add or remove additional modes here. +declare -a MODES +MODES=("${MODES[@]}" "1280x800 83.50 1280 1352 1480 1680 800 803 809 831 -hsync +vsync") +MODES=("${MODES[@]}" "1440x1050 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync") +MODES=("${MODES[@]}" "1680x1200 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync") +MODES=("${MODES[@]}" "1920x1200 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync") +MODES=("${MODES[@]}" "1280x720 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync") +MODES=("${MODES[@]}" "1368x768 85.25 1368 1440 1576 1784 768 771 781 798 -hsync +vsync") +MODES=("${MODES[@]}" "1600x900 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync") +MODES=("${MODES[@]}" "1920x1080 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync") +MODES=("${MODES[@]}" "800x600 38.25 800 832 912 1024 600 603 607 624 -hsync +vsync") +MODES=("${MODES[@]}" "1024x768 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync") +MODES=("${MODES[@]}" "1152x864 81.75 1152 1216 1336 1520 864 867 871 897 -hsync +vsync") +MODES=("${MODES[@]}" "1280x960 101.25 1280 1360 1488 1696 960 963 967 996 -hsync +vsync") +MODES=("${MODES[@]}" "1280x1024 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync") +################################################################################ + +# Get initial information about the screend from xrandr +XRANDR=$( xrandr --current ) +XRANDRV=$( xrandr --current --verbose ) + +# Get the names of the connected outputs +declare -a OUTPUTNAMES +while read line; do + OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )") +done < <( echo "$XRANDR" | grep -i " connected" ) +echo -e "Connected outputs: \e[32m${OUTPUTNAMES[@]}\e[0m" + +## The goal is to add more modelines to the X server. While this is done the +# screen is flickering. Hence this is just necessary if there is a beamer, do +# the flickering magic only if there are two outputs and one is a projector. +if [ ${#OUTPUTNAMES[@]} -eq 2 ]; then + if ! ( echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null \ + && echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[1]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm" > /dev/null ) + then + + # Create all modes, so that X knows them by name "x" + for i in "${MODES[@]}"; do + xrandr --current --newmode $i > /dev/null 2>&1 + done + + # Add the modes to the outputs, this means that, if this action is + # successful they can be applied to the screens. + for i in "${OUTPUTNAMES[@]}"; do + for j in "${MODES[@]}"; do + xrandr --current --addmode $i $(echo $j| awk '{print $1;}') + done + done + + # Check which of the outputs is the beamer. Just for reference. + if [[ -z "$(echo "$XRANDR" | egrep \ + "^${OUTPUTNAMES[0]}.*[[:digit:]]{2,}mm x [[:digit:]]{2,}mm")" ]]; then + BEAMER=0; + else + BEAMER=1; + fi + # echo -ne "${OUTPUTNAMES[$BEAMER]} is a beamer. " + + ## Finally if the EDID is present apply a proper resolution. + # Find out, if the beamer transmits reliable EDID data. The data in xrandr + # should be reliable if the EDID is present. + if echo "$XRANDRV" | grep -Pzo \ + "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ + | grep EDID > /dev/null ; then + + #echo "EDID present" + + + # If the breamer transmits the EDID there shall be a preferred resolution. + OPTIMALRES=$(echo "$XRANDRV" \ + | grep -Pzo "^${OUTPUTNAMES[$BEAMER]}\N*\n((\ |\t)+\N*\n)+" \ + | grep preferred | awk '{print $1}') + + # Apply the optimal resolution tho either of the outputs. The beamer has + # to be the secondary output. + xrandr \ + --output ${OUTPUTNAMES[$((1-$BEAMER))]} --mode $OPTIMALRES \ + --primary \ + --output ${OUTPUTNAMES[$BEAMER]} --mode $OPTIMALRES \ + --same-as ${OUTPUTNAMES[$((1-$BEAMER))]} + fi + fi +fi -- cgit v1.2.3-55-g7522 From ca96f22bd4c4e96c0dbfb877d1de542244359513 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 13 Dec 2013 15:25:40 +0100 Subject: [beamergui] kill process on session start --- .../data/opt/openslx/vmchooser/sessionstart.d/99-kill_beamergui | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 remote/modules/beamergui/data/opt/openslx/vmchooser/sessionstart.d/99-kill_beamergui (limited to 'remote/modules') diff --git a/remote/modules/beamergui/data/opt/openslx/vmchooser/sessionstart.d/99-kill_beamergui b/remote/modules/beamergui/data/opt/openslx/vmchooser/sessionstart.d/99-kill_beamergui new file mode 100644 index 00000000..012246ba --- /dev/null +++ b/remote/modules/beamergui/data/opt/openslx/vmchooser/sessionstart.d/99-kill_beamergui @@ -0,0 +1,3 @@ +#!/bin/ash +killall beamergui + -- cgit v1.2.3-55-g7522 From 508602d56856a7d1a8b70376abbb984c444a790f Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 13 Dec 2013 16:01:28 +0100 Subject: [kmd/xorg] Use only xorg scripts (xsetup, xsession, ...). Ignore kdm scripts. --- remote/modules/kdm/data/etc/kde4/kdm/Xreset | 17 ---------- remote/modules/kdm/data/etc/kde4/kdm/Xsession | 49 --------------------------- remote/modules/kdm/data/etc/kde4/kdm/Xsetup | 13 ------- remote/modules/kdm/data/etc/kde4/kdm/Xstartup | 19 ----------- remote/modules/kdm/data/etc/kde4/kdm/kdmrc | 8 ++--- remote/modules/xorg/data/etc/X11/Xreset | 7 ++-- remote/modules/xorg/data/etc/X11/Xsession | 8 +++++ remote/modules/xorg/data/etc/X11/Xsetup | 7 ++++ remote/modules/xorg/data/etc/X11/Xstartup | 12 +++++++ 9 files changed, 35 insertions(+), 105 deletions(-) delete mode 100755 remote/modules/kdm/data/etc/kde4/kdm/Xreset delete mode 100755 remote/modules/kdm/data/etc/kde4/kdm/Xsession delete mode 100755 remote/modules/kdm/data/etc/kde4/kdm/Xsetup delete mode 100755 remote/modules/kdm/data/etc/kde4/kdm/Xstartup create mode 100755 remote/modules/xorg/data/etc/X11/Xstartup (limited to 'remote/modules') diff --git a/remote/modules/kdm/data/etc/kde4/kdm/Xreset b/remote/modules/kdm/data/etc/kde4/kdm/Xreset deleted file mode 100755 index 64194a64..00000000 --- a/remote/modules/kdm/data/etc/kde4/kdm/Xreset +++ /dev/null @@ -1,17 +0,0 @@ -#! /bin/ash -# Xreset - run as root after session exits -# -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" - -# Reassign ownership of the console to root, this should disallow -# assignment of console output to any random users's xterm. See Xstartup. -# -#chown root /dev/console -#chmod 622 /dev/console - -# XDM configurations typically have sessreg here. KDM has it built-in. - -# Use common Xreset framework if it exist -if [ -x /etc/X11/Xreset ] ; then - /etc/X11/Xreset -fi diff --git a/remote/modules/kdm/data/etc/kde4/kdm/Xsession b/remote/modules/kdm/data/etc/kde4/kdm/Xsession deleted file mode 100755 index 79d3a06d..00000000 --- a/remote/modules/kdm/data/etc/kde4/kdm/Xsession +++ /dev/null @@ -1,49 +0,0 @@ -#! /bin/ash -# Xsession - run as user -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" - -session=$1 - -# Note that the respective logout scripts are not sourced. -case $SHELL in - */bash) - [ -z "$BASH" ] && exec $SHELL $0 "$@" - set +o posix - [ -f /etc/profile ] && . /etc/profile - if [ -f $HOME/.bash_profile ]; then - . $HOME/.bash_profile - elif [ -f $HOME/.bash_login ]; then - . $HOME/.bash_login - elif [ -f $HOME/.profile ]; then - . $HOME/.profile - fi - ;; - */zsh) - [ -z "$ZSH_NAME" ] && exec $SHELL $0 "$@" - emulate -R zsh - [ -d /etc/zsh ] && zdir=/etc/zsh || zdir=/etc - zhome=${ZDOTDIR:-$HOME} - # zshenv is always sourced automatically. - [ -f $zdir/zprofile ] && . $zdir/zprofile - [ -f $zhome/.zprofile ] && . $zhome/.zprofile - [ -f $zdir/zlogin ] && . $zdir/zlogin - [ -f $zhome/.zlogin ] && . $zhome/.zlogin - setopt shwordsplit noextendedglob - ;; - */csh|*/tcsh) - # [t]cshrc is always sourced automatically. - # Note that sourcing csh.login after .cshrc is non-standard. - xsess_tmp=`mktemp /tmp/xsess-env-XXXXXX` - $SHELL -c "if (-f /etc/csh.login) source /etc/csh.login; if (-f ~/.login) source ~/.login; /bin/sh -c 'export -p' >! $xsess_tmp" - . $xsess_tmp - rm -f $xsess_tmp - ;; - *) # Plain sh, ksh, and anything we do not know. - [ -f /etc/profile ] && . /etc/profile - [ -f $HOME/.profile ] && . $HOME/.profile - ;; -esac - -# invoke global X session script -. /etc/X11/Xsession - diff --git a/remote/modules/kdm/data/etc/kde4/kdm/Xsetup b/remote/modules/kdm/data/etc/kde4/kdm/Xsetup deleted file mode 100755 index 14ebe761..00000000 --- a/remote/modules/kdm/data/etc/kde4/kdm/Xsetup +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/ash -# Xsetup - run as root before the login dialog appears -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" - -#xconsole -geometry 480x130-0-0 -notify -verbose -fn fixed -exitOnFail -file /dev/xconsole & - -#/sbin/initctl -q emit login-session-start DISPLAY_MANAGER=kdm - -# Use common Xreset framework if it exist -if [ -x /etc/X11/Xsetup ] ; then - /etc/X11/Xsetup -fi - diff --git a/remote/modules/kdm/data/etc/kde4/kdm/Xstartup b/remote/modules/kdm/data/etc/kde4/kdm/Xstartup deleted file mode 100755 index 5ca1683b..00000000 --- a/remote/modules/kdm/data/etc/kde4/kdm/Xstartup +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/ash -# Xstartup - run as root before session starts - -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" - -if [ -e /etc/nologin ]; then - # always display the nologin message, if possible - if [ -s /etc/nologin ] && which xmessage > /dev/null 2>&1; then - xmessage -file /etc/nologin -geometry 640x480 - fi - if [ "$(id -u)" != "0" ] && \ - ! grep -qs '^ignore-nologin' /etc/kde4/kdm/kdm.options; then - exit 1 - fi -fi - -#/sbin/initctl -q emit desktop-session-start DISPLAY_MANAGER=kdm USER=$USER - -# NOTE: The session is aborted if the last command returns non-zero. diff --git a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc index 1b59915a..88139796 100644 --- a/remote/modules/kdm/data/etc/kde4/kdm/kdmrc +++ b/remote/modules/kdm/data/etc/kde4/kdm/kdmrc @@ -33,13 +33,13 @@ SessionsDirs=/opt/openslx/xsessions # Session is executed to start the user's session (as the user) # "One of the keywords failsafe, default or custom, or a string to eval by a Bourne-compatible shell is passed as the first argument." -Session=/etc/kde4/kdm/Xsession +Session=/etc/X11/Xsession # Reset is run after a session terminates (as root) -Reset=/etc/kde4/kdm/Xreset +Reset=/etc/X11/Xreset # Setup is executed once before the greeter starts (as root) -Setup=/etc/kde4/kdm/Xsetup +Setup=/etc/X11/Xsetup # Startup is executed on successful authentication, before the session is opened (as root) -Startup=/etc/kde4/kdm/Xstartup +Startup=/etc/X11/Xstartup [Shutdown] AllowFifo=false diff --git a/remote/modules/xorg/data/etc/X11/Xreset b/remote/modules/xorg/data/etc/X11/Xreset index a77cf2c0..4ed680ce 100755 --- a/remote/modules/xorg/data/etc/X11/Xreset +++ b/remote/modules/xorg/data/etc/X11/Xreset @@ -1,10 +1,11 @@ -#!/bin/sh +#!/bin/ash # # /etc/X11/Xreset # -# global Xreset file -- for use by display managers +# Xreset - run as root after session exits +# -# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $ +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" set -e diff --git a/remote/modules/xorg/data/etc/X11/Xsession b/remote/modules/xorg/data/etc/X11/Xsession index dc64cf77..914dd2e8 100755 --- a/remote/modules/xorg/data/etc/X11/Xsession +++ b/remote/modules/xorg/data/etc/X11/Xsession @@ -1,4 +1,12 @@ #!/bin/ash +# +# /etc/X11/Xsession +# +# Xsession is executed to start the user's session (as the user) +# + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" + #Workaround to start Xsession. The original Xsession script includes error handling functionality and sources other scrips from the Xsession.d/ directory. diff --git a/remote/modules/xorg/data/etc/X11/Xsetup b/remote/modules/xorg/data/etc/X11/Xsetup index f57fe3be..524f7d84 100755 --- a/remote/modules/xorg/data/etc/X11/Xsetup +++ b/remote/modules/xorg/data/etc/X11/Xsetup @@ -1,4 +1,11 @@ #!/bin/ash +# +# /etc/X11/Xsetup +# +# Xsetup is executed once before the greeter starts (as root) +# + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" SESSIONDIR="/etc/X11/Xsetup.d" diff --git a/remote/modules/xorg/data/etc/X11/Xstartup b/remote/modules/xorg/data/etc/X11/Xstartup new file mode 100755 index 00000000..5631fa65 --- /dev/null +++ b/remote/modules/xorg/data/etc/X11/Xstartup @@ -0,0 +1,12 @@ +#!/bin/ash +# +# /etc/X11/Xstartup +# +# Xstartup is executed on successful authentication, before the session is opened (as root) +# + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" + + + + -- cgit v1.2.3-55-g7522 From e8f98ce4198f1234b022147931087df5bcfea821 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 13 Dec 2013 16:26:53 +0100 Subject: [vmchooser] Add sessionstart script that will source everything in sessionstart.d Needed for beamergui. This is pretty much the same as Xsession with Xsession.d, since the vmchooser is technically the session, but we might want to run things when the actual session selected in the vmchooser starts. --- .../modules/vmchooser/data/opt/openslx/vmchooser/sessionstart | 10 ++++++++++ remote/modules/vmchooser/vmchooser.build | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 remote/modules/vmchooser/data/opt/openslx/vmchooser/sessionstart (limited to 'remote/modules') diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/sessionstart b/remote/modules/vmchooser/data/opt/openslx/vmchooser/sessionstart new file mode 100755 index 00000000..aa7e54c6 --- /dev/null +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/sessionstart @@ -0,0 +1,10 @@ +#!/bin/ash + +SOURCEPATH="/opt/openslx/vmchooser/sessionstart.d" + +if [ -d "$SOURCEPATH" ]; then + for file in $SOURCEPATH/*; do + . "$file" || slxlog "vmchooser-sessionstart" "Could not source $file at session start!" "$file" + done +fi + diff --git a/remote/modules/vmchooser/vmchooser.build b/remote/modules/vmchooser/vmchooser.build index 58f5986e..eb0a2d48 100644 --- a/remote/modules/vmchooser/vmchooser.build +++ b/remote/modules/vmchooser/vmchooser.build @@ -1,4 +1,3 @@ -#!/bin/bash fetch_source() { git clone "${REQUIRED_GIT}" src -- cgit v1.2.3-55-g7522 From efe0c7ed3df1146be1b90428848f9786747cb894 Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 13 Dec 2013 17:14:05 +0100 Subject: [cups] added ghostscript-cups --- remote/modules/cups/cups.conf.ubuntu | 2 ++ 1 file changed, 2 insertions(+) (limited to 'remote/modules') diff --git a/remote/modules/cups/cups.conf.ubuntu b/remote/modules/cups/cups.conf.ubuntu index 6eeb9aeb..ff5a23d7 100644 --- a/remote/modules/cups/cups.conf.ubuntu +++ b/remote/modules/cups/cups.conf.ubuntu @@ -1,8 +1,10 @@ REQUIRED_INSTALLED_PACKAGES=" cups cups-daemon + ghostscript-cups " REQUIRED_CONTENT_PACKAGES=" cups cups-daemon + ghostscript-cups " -- cgit v1.2.3-55-g7522