File: ScreenResolution

package info (click to toggle)
fvwm-crystal 3.4.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 21,700 kB
  • ctags: 1,494
  • sloc: sh: 3,265; cs: 1,335; python: 875; makefile: 214
file content (14 lines) | stat: -rwxr-xr-x 443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

LC_ALL=C

ORIGINAL_MODE=( $( xrandr | grep -E "^ *[0-9]" | grep + | sed -e 's:\(^ *\)\([0-9]*x[0-9]*\).*:\2:' ) )
echo AddToMenu /ScreenResolution ${ORIGINAL_MODE} "X xrandr -s ${ORIGINAL_MODE}"
echo AddToMenu /ScreenResolution \"\" Nop

ALL_MODES=( $( xrandr | grep -E "^ *[0-9]" | sed -e 's:\(^ *\)\([0-9]*x[0-9]*\).*:\2:' | sort -grs ) )

for i in ${ALL_MODES[*]}
	do echo AddToMenu /ScreenResolution $i "X xrandr -s $i"
done