summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xXModeSetter.sh42
-rw-r--r--src/widget.cpp7
2 files changed, 4 insertions, 45 deletions
diff --git a/XModeSetter.sh b/XModeSetter.sh
deleted file mode 100755
index ae81b28..0000000
--- a/XModeSetter.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# List all modes
-declare -a MODES
-#16:10
-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[@]}" "2560x1600 348.50 2560 2760 3032 3504 1600 1603 1609 1658 -hsync +vsync")
-#16:9
-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[@]}" "2560x1440 312.25 2560 2752 3024 3488 1440 1443 1448 1493 -hsync +vsync")
-#4:3
-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[@]}" "1400x1050 121.75 1400 1488 1632 1864 1050 1053 1057 1089 -hsync +vsync")
-
-# Create all modes
-for i in "${MODES[@]}"; do
- #echo -e "\e[32mxrandr --current --newmode $i\e[0m"
- xrandr --current --newmode $i > /dev/null 2>&1
-done
-
-# Get the connected outputs
-declare -a OUTPUTNAMES
-while read line; do
- OUTPUTNAMES+=("$(echo "$line" | grep -o "^\S*" )")
-done < <( xrandr | grep -i " connected" )
-
-# Add the modes to all outputs
-for i in "${OUTPUTNAMES[@]}"; do
- for j in "${MODES[@]}"; do
- #echo -e "\e[32mxrandr --current --addmode $i $(echo $j| awk '{print $1;}')\e[0m"
- xrandr --current --addmode $i $(echo $j| awk '{print $1;}')
- done
-done
diff --git a/src/widget.cpp b/src/widget.cpp
index 62bf8a9..3e31dbb 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -58,7 +58,7 @@ Widget::Widget(QWidget *parent) :
&& _outputMap[_connectedOutputList[0]]->mm_height == 0 )
&& (_outputMap[_connectedOutputList[1]]->mm_width == 0
&& _outputMap[_connectedOutputList[1]]->mm_height == 0 ))*/) {
- std::cout << "BEAMER CONNECTED!" << std::endl;
+ qDebug() << "BEAMER CONNECTED!";
// Get a human readable reference
if (_outputMap[_connectedOutputList[0]]->mm_width == 0
@@ -76,6 +76,7 @@ Widget::Widget(QWidget *parent) :
struct ifaddrs * ifa=NULL;
void * tmpAddrPtr=NULL;
QString ipV4;
+ qDebug() << "Ip is" << ipV4;
getifaddrs(&ifAddrStruct);
// Iterate through the adresses.
for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) {
@@ -101,12 +102,12 @@ Widget::Widget(QWidget *parent) :
// to be tested on this system and will be applied immediately.
settings.beginGroup(GROUP_SPECIFIC);
if ( settings.contains(ipV4) ) {
- qDebug() << ipV4 ;
// First get a useful representation
unsigned int width, height;
QStringList modeAsStrings =
settings.value(ipV4)
.toString().split("x", QString::SkipEmptyParts);
+ qDebug() << "Found Ip setting" << modeAsStrings;
width = modeAsStrings.at(0).toInt();
height = modeAsStrings.at(1).toInt();
@@ -254,7 +255,7 @@ Widget::Widget(QWidget *parent) :
// }
// }
} else {
- std::cout << "NO EDID!" << std::endl;
+ qDebug() << "NO EDID!";
// Fill widget with data without AR match
// Fill widget with data
for ( QList<XRRModeInfo*>::iterator i = commonModes.begin();