Skip to content

Commit e32f56c

Browse files
authored
Merge pull request #3501 from cmitu/runcommand-xrandr-fix
runcommand: check only active displays on X11
2 parents 527a956 + 8eb8e40 commit e32f56c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scriptmodules/supplementary/runcommand/runcommand.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,9 @@ function get_x11_mode_info() {
397397

398398
if [[ -z "$mode_id" ]]; then
399399
# determine current output
400-
mode_id[0]="$($XRANDR --verbose | awk '/ connected/ { print $1;exit }')"
400+
mode_id[0]="$($XRANDR --verbose | awk '/ connected.*\(0x[a-f0-9]{1,}\)/ { print $1;exit }')"
401401
# determine current mode id & strip brackets
402-
mode_id[1]="$($XRANDR --verbose | awk '/ connected/ {print;exit}' | grep -o "(0x[a-f0-9]\{1,\})")"
402+
mode_id[1]="$($XRANDR --verbose | awk '/ connected.*\(0x[a-f0-9]{1,}\)/ {print;exit}' | grep -o "(0x[a-f0-9]\{1,\})")"
403403
mode_id[1]="$(echo ${mode_id[1]:1:-1})"
404404
fi
405405

0 commit comments

Comments
 (0)