-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
keymap.go
42 lines (35 loc) · 1.36 KB
/
keymap.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package action
import (
"strings"
"github.com/carapace-sh/carapace"
)
func ActionKeymaps() carapace.Action {
return carapace.ActionExecCommand("localectl", "list-keymaps")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
})
}
func ActionKeymapModels() carapace.Action {
return carapace.ActionExecCommand("localectl", "list-x11-keymap-models")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
})
}
func ActionKeymapLayouts() carapace.Action {
return carapace.ActionExecCommand("localectl", "list-x11-keymap-layouts")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
})
}
func ActionKeymapVariants() carapace.Action {
return carapace.ActionExecCommand("localectl", "list-x11-keymap-variants")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
})
}
func ActionKeymapOptions() carapace.Action {
return carapace.ActionExecCommand("localectl", "list-x11-keymap-options")(func(output []byte) carapace.Action {
lines := strings.Split(string(output), "\n")
return carapace.ActionValues(lines[:len(lines)-1]...)
})
}