Skip to content

Commit

Permalink
Use dashes instead of underline for commands
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitabobko committed Oct 4, 2023
1 parent 14c069e commit 18ed447
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
94 changes: 47 additions & 47 deletions config-examples/default-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tray-icon-content = 'active_workspaces' # Possible values: (active_workspace|act
tray-icon-workspaces-separator = ''

[mode.main.binding]
alt-enter = 'exec_and_forget open -n /System/Applications/Utilities/Terminal.app'
alt-enter = 'exec-and-forget open -n /System/Applications/Utilities/Terminal.app'

alt-slash = 'layout h_list v_list'
alt-comma = 'layout h_accordion v_accordion'
Expand All @@ -29,14 +29,14 @@ alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'

alt-backslash = 'close_all_windows_but_current'
alt-backslash = 'close-all-windows-but-current'

# Move window

alt-shift-k = 'move_through up'
alt-shift-h = 'move_through left'
alt-shift-j = 'move_through down'
alt-shift-l = 'move_through right'
alt-shift-k = 'move-through up'
alt-shift-h = 'move-through left'
alt-shift-j = 'move-through down'
alt-shift-l = 'move-through right'

# Resize window
# alt-shift-minus = 'resize shrink height 2 px'
Expand Down Expand Up @@ -79,49 +79,49 @@ alt-z = 'workspace ZZZ'

alt-shift-semicolon = 'mode service'

alt-shift-0 = 'move_container_to_workspace 000'
alt-shift-1 = 'move_container_to_workspace 111'
alt-shift-2 = 'move_container_to_workspace 222'
alt-shift-3 = 'move_container_to_workspace 333'
alt-shift-4 = 'move_container_to_workspace 444'
alt-shift-5 = 'move_container_to_workspace 555'
alt-shift-6 = 'move_container_to_workspace 666'
alt-shift-7 = 'move_container_to_workspace 777'
alt-shift-8 = 'move_container_to_workspace 888'
alt-shift-9 = 'move_container_to_workspace 999'
alt-shift-a = 'move_container_to_workspace AAA'
alt-shift-b = 'move_container_to_workspace BBB'
alt-shift-c = 'move_container_to_workspace CCC'
alt-shift-d = 'move_container_to_workspace DDD'
alt-shift-e = 'move_container_to_workspace EEE'
alt-shift-f = 'move_container_to_workspace FFF'
alt-shift-g = 'move_container_to_workspace GGG'
alt-shift-i = 'move_container_to_workspace III'
alt-shift-m = 'move_container_to_workspace MMM'
alt-shift-n = 'move_container_to_workspace NNN'
alt-shift-o = 'move_container_to_workspace OOO'
alt-shift-p = 'move_container_to_workspace PPP'
alt-shift-q = 'move_container_to_workspace QQQ'
alt-shift-r = 'move_container_to_workspace RRR'
alt-shift-s = 'move_container_to_workspace SSS'
alt-shift-t = 'move_container_to_workspace TTT'
alt-shift-u = 'move_container_to_workspace UUU'
alt-shift-v = 'move_container_to_workspace VVV'
alt-shift-w = 'move_container_to_workspace WWW'
alt-shift-x = 'move_container_to_workspace XXX'
alt-shift-y = 'move_container_to_workspace YYY'
alt-shift-z = 'move_container_to_workspace ZZZ'

alt-tab = 'workspace_back_and_forth'

# alt-shift-slash.alt-shift-k = 'move_in up'
# alt-shift-slash.alt-shift-h = 'move_in left'
# alt-shift-slash.alt-shift-j = 'move_in down'
# alt-shift-slash.alt-shift-l = 'move_in right'
alt-shift-0 = 'move-container-to-workspace 000'
alt-shift-1 = 'move-container-to-workspace 111'
alt-shift-2 = 'move-container-to-workspace 222'
alt-shift-3 = 'move-container-to-workspace 333'
alt-shift-4 = 'move-container-to-workspace 444'
alt-shift-5 = 'move-container-to-workspace 555'
alt-shift-6 = 'move-container-to-workspace 666'
alt-shift-7 = 'move-container-to-workspace 777'
alt-shift-8 = 'move-container-to-workspace 888'
alt-shift-9 = 'move-container-to-workspace 999'
alt-shift-a = 'move-container-to-workspace AAA'
alt-shift-b = 'move-container-to-workspace BBB'
alt-shift-c = 'move-container-to-workspace CCC'
alt-shift-d = 'move-container-to-workspace DDD'
alt-shift-e = 'move-container-to-workspace EEE'
alt-shift-f = 'move-container-to-workspace FFF'
alt-shift-g = 'move-container-to-workspace GGG'
alt-shift-i = 'move-container-to-workspace III'
alt-shift-m = 'move-container-to-workspace MMM'
alt-shift-n = 'move-container-to-workspace NNN'
alt-shift-o = 'move-container-to-workspace OOO'
alt-shift-p = 'move-container-to-workspace PPP'
alt-shift-q = 'move-container-to-workspace QQQ'
alt-shift-r = 'move-container-to-workspace RRR'
alt-shift-s = 'move-container-to-workspace SSS'
alt-shift-t = 'move-container-to-workspace TTT'
alt-shift-u = 'move-container-to-workspace UUU'
alt-shift-v = 'move-container-to-workspace VVV'
alt-shift-w = 'move-container-to-workspace WWW'
alt-shift-x = 'move-container-to-workspace XXX'
alt-shift-y = 'move-container-to-workspace YYY'
alt-shift-z = 'move-container-to-workspace ZZZ'

alt-tab = 'workspace-back-and-forth'

# alt-shift-slash.alt-shift-k = 'move-in up'
# alt-shift-slash.alt-shift-h = 'move-in left'
# alt-shift-slash.alt-shift-j = 'move-in down'
# alt-shift-slash.alt-shift-l = 'move-in right'

[mode.service.binding]
r = ['flatten_workspace_tree', 'mode main']
o = ['reload_config', 'mode main']
r = ['flatten-workspace-tree', 'mode main']
o = ['reload-config', 'mode main']
s = ['layout sticky', 'mode main']
f = ['layout floating', 'mode main']
k = 'focus parent'
Expand Down
12 changes: 6 additions & 6 deletions config-examples/i3-like-config-example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
auto-flatten-containers = false

[mode.main.binding]
alt-enter = 'exec_and_forget open /System/Applications/Utilities/Terminal.app'
alt-enter = 'exec-and-forget open /System/Applications/Utilities/Terminal.app'

alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'

alt-shift-h = 'move_through left'
alt-shift-j = 'move_through down'
alt-shift-k = 'move_through up'
alt-shift-l = 'move_through right'
alt-shift-h = 'move-through left'
alt-shift-j = 'move-through down'
alt-shift-k = 'move-through up'
alt-shift-l = 'move-through right'

# alt-h = 'split h' # todo support split command?
# alt-v = 'split v' # todo support split command?
Expand Down Expand Up @@ -57,7 +57,7 @@ alt-0 = 'workspace 10'
#alt-shift-9 = 'move container to workspace 9'
#alt-shift-0 = 'move container to workspace 10'

alt-shift-c = 'reload_config'
alt-shift-c = 'reload-config'

alt-r = 'mode resize'

Expand Down
16 changes: 8 additions & 8 deletions src/command/parseCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ private func parseSingleCommand(_ raw: String, _ backtrace: TomlBacktrace) -> Co
let firstWord = String(words.first ?? "")
if firstWord == "workspace" {
return WorkspaceCommand(workspaceName: parseSingleArg(args, firstWord, backtrace))
} else if firstWord == "move_container_to_workspace" {
} else if firstWord == "move-container-to-workspace" {
return MoveContainerToWorkspaceCommand(targetWorkspaceName: parseSingleArg(args, firstWord, backtrace))
} else if firstWord == "mode" {
return ModeCommand(idToActivate: parseSingleArg(args, firstWord, backtrace))
} else if firstWord == "exec_and_wait" {
} else if firstWord == "exec-and-wait" {
return ExecAndWaitCommand(bashCommand: raw.removePrefix(firstWord))
} else if firstWord == "exec_and_forget" {
} else if firstWord == "exec-and-forget" {
return ExecAndForgetCommand(bashCommand: raw.removePrefix(firstWord))
} else if firstWord == "focus" {
let direction = FocusCommand.Direction(rawValue: parseSingleArg(args, firstWord, backtrace))
?? errorT("\(backtrace): Can't parse '\(firstWord)' direction")
return FocusCommand(direction: direction)
} else if firstWord == "move_through" {
} else if firstWord == "move-through" {
let direction = CardinalDirection(rawValue: parseSingleArg(args, firstWord, backtrace))
?? errorT("\(backtrace): Can't parse '\(firstWord)' direction")
return MoveThroughCommand(direction: direction)
} else if firstWord == "layout" {
return LayoutCommand(toggleBetween: args.map { parseLayout(String($0), backtrace) })
?? errorT("\(backtrace): Can't create layout command") // todo nicer message
} else if raw == "workspace_back_and_forth" {
} else if raw == "workspace-back-and-forth" {
return WorkspaceBackAndForthCommand()
} else if raw == "reload_config" {
} else if raw == "reload-config" {
return ReloadConfigCommand()
} else if raw == "flatten_workspace_tree" {
} else if raw == "flatten-workspace-tree" {
return FlattenWorkspaceTreeCommand()
} else if raw == "close_all_windows_but_current" {
} else if raw == "close-all-windows-but-current" {
return CloseAllWindowsButCurrentCommand()
} else if raw == "" {
error("\(backtrace): Can't parse empty string command")
Expand Down

0 comments on commit 18ed447

Please sign in to comment.