Release new version 2.13.0
[grml-scripts.git] / usr_bin / grml-resolution
index 5b334d7..08d075a 100755 (executable)
@@ -23,11 +23,10 @@ COUNTER=0
 STRING=""
 
 # current mode
-CURRENT_NUM=$(xrandr | awk '/\*/ {print $1}' | tr -d '*')
-CURRENT_RESOLUTION=$(xrandr | awk '/\*/ {print $2 $3 $4}')
+CURRENT_RESOLUTION=$(xrandr | awk '/\*/ {print $1"_"$2}')
 
 # menu
-for i in $(xrandr | awk '{print $2$3$4}' | grep "^[0-9]") ; do
+for i in $(xrandr | awk '{print $1"_"$2}' | grep "^[0-9]") ; do
   STRING="$STRING $COUNTER $i"
   ((COUNTER++))
 done
@@ -43,9 +42,7 @@ esac
 
 CHOSE=$(cat "$RESOLUTION")
 
-if [ "$CHOSE" = "$CURRENT_NUM" ] ; then
-   dialog --title "$PN" --msgbox "Chosen resolution corresponds to current resolution. No changes needed." 0 0
-elif [ -n "$CHOSE" ] ; then
+if [ -n "$CHOSE" ] ; then
 # shellcheck disable=SC2015
   xrandr -s "$CHOSE" 2>"$ERROR" && \
   dialog --title "$PN" --msgbox "Running xrandr with resolution was succesful." 0 0 || \