command/map: layout-pinned mappings

e.g. `riverctl map -layout 0 normal Super Y spawn foot`

When this mapping is checked against a pressed key, layout 0 will be used to translate the pressed key instead of the currently active layout.

The number denotes to an index of the layouts set with
`XKB_DEFAULT_LAYOUT`.
This commit is contained in:
Peter Kaplan
2022-04-20 15:38:18 +02:00
committed by Isaac Freund
parent 8f59075bc5
commit 44aaee3a51
9 changed files with 131 additions and 56 deletions

View File

@ -56,7 +56,7 @@ function __riverctl_completion ()
"focus-output"|"focus-view"|"send-to-output"|"swap") OPTS="next previous" ;;
"move"|"snap") OPTS="up down left right" ;;
"resize") OPTS="horizontal vertical" ;;
"map") OPTS="-release -repeat" ;;
"map") OPTS="-release -repeat -layout" ;;
"unmap") OPTS="-release" ;;
"attach-mode") OPTS="top bottom" ;;
"focus-follows-cursor") OPTS="disabled normal" ;;

View File

@ -70,7 +70,7 @@ complete -c riverctl -x -n '__fish_seen_subcommand_from resize' -a
complete -c riverctl -x -n '__fish_seen_subcommand_from snap' -a 'up down left right'
complete -c riverctl -x -n '__fish_seen_subcommand_from send-to-output' -a 'next previous'
complete -c riverctl -x -n '__fish_seen_subcommand_from swap' -a 'next previous'
complete -c riverctl -x -n '__fish_seen_subcommand_from map' -a '-release -repeat'
complete -c riverctl -x -n '__fish_seen_subcommand_from map' -a '-release -repeat -layout'
complete -c riverctl -x -n '__fish_seen_subcommand_from unmap' -a '-release'
complete -c riverctl -x -n '__fish_seen_subcommand_from attach-mode' -a 'top bottom'
complete -c riverctl -x -n '__fish_seen_subcommand_from focus-follows-cursor' -a 'disabled normal'

View File

@ -169,7 +169,7 @@ _riverctl()
snap) _alternative 'arguments:args:(up down left right)' ;;
send-to-output) _alternative 'arguments:args:(next previous)' ;;
swap) _alternative 'arguments:args:(next previous)' ;;
map) _alternative 'arguments:optional:(-release -repeat)' ;;
map) _alternative 'arguments:optional:(-release -repeat -layout)' ;;
unmap) _alternative 'arguments:optional:(-release)' ;;
attach-mode) _alternative 'arguments:args:(top bottom)' ;;
focus-follows-cursor) _alternative 'arguments:args:(disabled normal)' ;;