Allow to source local config file
This commit is contained in:
parent
0aecd90642
commit
f2373a325a
22
ecran
22
ecran
|
@ -53,6 +53,10 @@ The second output is: ${SECOND_OUTPUT_NAME}."
|
||||||
fi
|
fi
|
||||||
## }}}
|
## }}}
|
||||||
|
|
||||||
|
[ -f "${HOME}/.config/xrandr.conf" ] && \
|
||||||
|
. "${HOME}/.config/xrandr.conf" && \
|
||||||
|
printf "%b\n" 'Use local config file.'
|
||||||
|
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
get_primary_output_name() { # {{{
|
get_primary_output_name() { # {{{
|
||||||
|
@ -131,7 +135,11 @@ define_vars
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
primary | off )
|
primary | off )
|
||||||
## TODO : One command to enable primary screen and a loop to disable all other connected output
|
## TODO : One command to enable primary screen and a loop to disable all other connected output
|
||||||
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||||
|
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode "${PRIMARY_OUTPUT_MODE}"
|
||||||
|
else
|
||||||
|
xrandr --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
||||||
|
fi
|
||||||
if [ -n "${SECOND_OUTPUT_NAME}" ]; then xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --off ; fi
|
if [ -n "${SECOND_OUTPUT_NAME}" ]; then xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --off ; fi
|
||||||
printf "%b\n" 'Enable only primary output'
|
printf "%b\n" 'Enable only primary output'
|
||||||
;;
|
;;
|
||||||
|
@ -141,11 +149,19 @@ case "${1}" in
|
||||||
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
||||||
;;
|
;;
|
||||||
rightof | right-of | home )
|
rightof | right-of | home )
|
||||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||||
|
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode "${PRIMARY_OUTPUT_MODE}"
|
||||||
|
else
|
||||||
|
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --right-of "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
||||||
|
fi
|
||||||
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
printf "%b\n" 'Xrandr for second output left-of primary screen'
|
||||||
;;
|
;;
|
||||||
above )
|
above )
|
||||||
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
if [ -n "${PRIMARY_OUTPUT_MODE}" ]; then
|
||||||
|
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --mode "${PRIMARY_OUTPUT_MODE}"
|
||||||
|
else
|
||||||
|
xrandr --output "${SECOND_OUTPUT_NAME:=/dev/null}" --auto --above "${PRIMARY_OUTPUT_NAME:=/dev/null}" --output "${PRIMARY_OUTPUT_NAME:=/dev/null}" --auto
|
||||||
|
fi
|
||||||
printf "%b\n" 'Xrandr for second output above primary screen'
|
printf "%b\n" 'Xrandr for second output above primary screen'
|
||||||
;;
|
;;
|
||||||
out | game | second )
|
out | game | second )
|
||||||
|
|
Loading…
Reference in New Issue