Commit 5e4f30db authored by Jeff Bilyk's avatar Jeff Bilyk

setup-keymap: add option for variant from command-line

parent 9107a682
......@@ -78,14 +78,14 @@ goodbye() {
exit $1
}
apk_info -e bkeymaps
apk_info -eq bkeymaps
was_installed=$?
pkg_inst bkeymaps
deflayout="$1"
defvariant="$2"
while true; do
if [ -n "$deflayout" ]; then
layout="$deflayout"
unset deflayout
......@@ -93,12 +93,20 @@ while true; do
select_layout
fi
# if there is only one variant, just pick it
count=$(ls $MAPDIR/$layout | wc -l)
if [ $count -eq 1 ]; then
setup_mapfile "$MAPDIR/$layout/$(ls $MAPDIR/$layout)"
continue
if [ -n "$defvariant" ]; then
variant="$defvariant"
fi
select_variant
# if variant is defined, this could match, otherwise we'll have to choose a variant
if [ -f "$MAPDIR/$layout/$variant.bmap" ]; then
setup_mapfile "$MAPDIR/$layout/$variant.bmap"
else
# if there is only one variant, just pick it
count=$(ls $MAPDIR/$layout | wc -l)
if [ $count -eq 1 ]; then
setup_mapfile "$MAPDIR/$layout/$(ls $MAPDIR/$layout)"
continue
fi
select_variant
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment