Fix: Only one xrandr command by action
This commit is contained in:
parent
fc144471a7
commit
07865b0013
24
ecran
24
ecran
@ -155,37 +155,21 @@ define_vars
|
||||
case "${1}" in
|
||||
primary | off )
|
||||
## TODO : One command to enable primary screen and a loop to disable all other connected output
|
||||
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
else
|
||||
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
fi
|
||||
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
if [ -n "${SECOND_OUTPUT_NAME}" ]; then xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --off ; fi
|
||||
printf "%b\n" 'Enable only primary output'
|
||||
;;
|
||||
leftof | left-of | ds | dock | dockstation | work )
|
||||
#xrandr --output VGA-1 --mode 1024x768 --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode 1366x768
|
||||
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
else
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
fi
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --left-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
||||
;;
|
||||
rightof | right-of | home )
|
||||
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
else
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
fi
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
||||
;;
|
||||
above )
|
||||
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
else
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
fi
|
||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" ${primary_output_mode}
|
||||
printf "%b\n" 'Xrandr for second output above primary screen'
|
||||
;;
|
||||
out | game | second )
|
||||
|
Loading…
Reference in New Issue
Block a user