Skip to content

Commit

Permalink
Merge pull request #2063 from rsteube/xdotool-mv-actions
Browse files Browse the repository at this point in the history
xdotool: move actions
  • Loading branch information
rsteube authored Dec 10, 2023
2 parents be05799 + 2bb682e commit 3a4efa7
Show file tree
Hide file tree
Showing 31 changed files with 78 additions and 65 deletions.
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/behave.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -19,7 +19,7 @@ func init() {

carapace.Gen(behaveCmd).PositionalCompletion(
carapace.Batch(
action.ActionWindows(),
xdotool.ActionWindows(),
carapace.ActionValues("%1", "%@"),
).ToA(),
carapace.ActionValuesDescribed(
Expand Down
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/click.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -23,7 +23,7 @@ func init() {
rootCmd.AddCommand(clickCmd)

carapace.Gen(clickCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(clickCmd).PositionalCompletion(
Expand Down
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/getDesktopForWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(getDesktopForWindowCmd)

carapace.Gen(getDesktopForWindowCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/getwindowclassname.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(getwindowclassnameCmd)

carapace.Gen(getwindowclassnameCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/getwindowgeometry.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -19,6 +19,6 @@ func init() {
rootCmd.AddCommand(getwindowgeometryCmd)

carapace.Gen(getwindowgeometryCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/getwindowname.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(getwindownameCmd)

carapace.Gen(getwindownameCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/getwindowpid.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(getwindowpidCmd)

carapace.Gen(getwindowpidCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
6 changes: 3 additions & 3 deletions completers/xdotool_completer/cmd/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -21,10 +21,10 @@ func init() {
rootCmd.AddCommand(keyCmd)

carapace.Gen(keyCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(keyCmd).PositionalAnyCompletion(
action.ActionKeys().UniqueList("+"),
xdotool.ActionKeys().UniqueList("+"),
)
}
6 changes: 3 additions & 3 deletions completers/xdotool_completer/cmd/keydown.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -21,10 +21,10 @@ func init() {
rootCmd.AddCommand(keydownCmd)

carapace.Gen(keydownCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(keydownCmd).PositionalAnyCompletion(
action.ActionKeys().UniqueList("+"),
xdotool.ActionKeys().UniqueList("+"),
)
}
6 changes: 3 additions & 3 deletions completers/xdotool_completer/cmd/keyup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -21,10 +21,10 @@ func init() {
rootCmd.AddCommand(keyupCmd)

carapace.Gen(keyupCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(keyupCmd).PositionalAnyCompletion(
action.ActionKeys().UniqueList("+"),
xdotool.ActionKeys().UniqueList("+"),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/mousedown.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -23,7 +23,7 @@ func init() {
rootCmd.AddCommand(mousedownCmd)

carapace.Gen(mousedownCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(mousedownCmd).PositionalCompletion(
Expand Down
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/mousemove.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -25,6 +25,6 @@ func init() {

carapace.Gen(mousemoveCmd).FlagCompletion(carapace.ActionMap{
"screen": os.ActionScreens(true),
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/mouseup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -23,7 +23,7 @@ func init() {
rootCmd.AddCommand(mouseupCmd)

carapace.Gen(mouseupCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})

carapace.Gen(mouseupCmd).PositionalCompletion(
Expand Down
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/actions/ps"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -33,7 +33,7 @@ func init() {
rootCmd.AddCommand(searchCmd)

carapace.Gen(searchCmd).FlagCompletion(carapace.ActionMap{
"desktop": action.ActionDesktops(),
"desktop": xdotool.ActionDesktops(),
"pid": ps.ActionProcessIds(),
"screen": os.ActionScreens(true),
})
Expand Down
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/setDesktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -19,6 +19,6 @@ func init() {
rootCmd.AddCommand(setDesktopCmd)

carapace.Gen(setDesktopCmd).PositionalCompletion(
action.ActionDesktops(),
xdotool.ActionDesktops(),
)
}
6 changes: 3 additions & 3 deletions completers/xdotool_completer/cmd/setDesktopForWindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,7 +18,7 @@ func init() {
rootCmd.AddCommand(setDesktopForWindowCmd)

carapace.Gen(setDesktopForWindowCmd).PositionalCompletion(
action.ActionWindows(),
action.ActionDesktops(),
xdotool.ActionWindows(),
xdotool.ActionDesktops(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -21,6 +21,6 @@ func init() {
rootCmd.AddCommand(typeCmd)

carapace.Gen(typeCmd).FlagCompletion(carapace.ActionMap{
"window": action.ActionWindows(),
"window": xdotool.ActionWindows(),
})
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/windowactivate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -19,6 +19,6 @@ func init() {
rootCmd.AddCommand(windowactivateCmd)

carapace.Gen(windowactivateCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/windowclose.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(windowcloseCmd)

carapace.Gen(windowcloseCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/windowfocus.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -19,6 +19,6 @@ func init() {
rootCmd.AddCommand(windowfocusCmd)

carapace.Gen(windowfocusCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
4 changes: 2 additions & 2 deletions completers/xdotool_completer/cmd/windowkill.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/xdotool_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/actions/tools/xdotool"
"github.com/spf13/cobra"
)

Expand All @@ -18,6 +18,6 @@ func init() {
rootCmd.AddCommand(windowkillCmd)

carapace.Gen(windowkillCmd).PositionalCompletion(
action.ActionWindows(),
xdotool.ActionWindows(),
)
}
Loading

0 comments on commit 3a4efa7

Please sign in to comment.