Fix substitution ":=" ➡️ ":-"

This commit is contained in:
gardouille 2024-03-27 08:27:56 +01:00
parent 07865b0013
commit c3956e1305
Signed by: gardouille
GPG Key ID: E759BAA22501AF32

20
ecran
View File

@ -155,29 +155,29 @@ define_vars
case "${1}" in
primary | off )
## TODO: One command to enable primary screen and a loop to disable all other connected output
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
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
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}
#xrandr --output VGA-1 --mode 1024x768 --left-of "${PRIMARY_OUTPUT_NAME:-/dev/null}" --output "${PRIMARY_OUTPUT_NAME:-/dev/null}" --mode 1366x768
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 )
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}
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 )
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}
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 )
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" ${second_output_mode} --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --off
xrandr --output "${SECOND_OUTPUT_NAME:-/dev/null}" ${second_output_mode} --output "${PRIMARY_OUTPUT_NAME:-/dev/null}" --off
printf "%b\n" 'Xrandr for second output only'
;;
primary_off | first_off | main_off | laptop_off )
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --off
xrandr --output "${PRIMARY_OUTPUT_NAME:-/dev/null}" --off
printf "%b\n" 'Xrandr to disable primary output'
;;
* )
@ -186,8 +186,8 @@ case "${1}" in
;;
esac
main
# }}}
main
exit 0