]>
git.siccegge.de Git - dotfiles/zsh.git/blob - functions/cip/sunray_resolution
4 RES
=('1280x1024' '1920x1200')
10 read -A ROOM
<<< $
(${HOME}/bin
/cipmap.sh
-l|
grep ${USER})
11 # Note: Alter the number below such that it reflects the
12 # position of the Room-ID in the cipmap.sh output
13 # for your user; counting from right to left.
16 NEXT
=${RESMAP[${ROOM}]}
19 read -A CURRENT
<<< $
(grep '*' - < <(xrandr
))
22 for INDEX
in {1..
${#RES}}; do
23 if [[ "${CURRENT}" == "${RES[${INDEX}]}" ]]; then
24 if [[ ${INDEX} -lt ${#RES} ]]; then
34 # Try to set new resolution.
36 while [[ ${TRIES} -lt 33 && ${RUN} -eq 1 ]]; do
37 if xrandr
-s ${RES[${NEXT}]} > /dev
/null
; then
40 print
-- 'Error: Failed setting resolution!'
41 print
-- " Current: ${CURRENT} - Next: ${RESOLUTIONS[${NEXT}]}"