Exemple #1
0
func (cmd RenameWorkspace) Run() gribble.Value {
	return syncRun(func() gribble.Value {
		withWorkspace(cmd.Workspace, func(wrk *workspace.Workspace) {
			oldName := wrk.String()
			if err := wm.RenameWorkspace(wrk, cmd.NewName); err != nil {
				wm.PopupError("Could not rename workspace '%s': %s", wrk, err)
				return
			}

			wm.FYI("Workspace %s renamed to %s.", oldName, cmd.NewName)
		})
		return nil
	})
}
Exemple #2
0
func (cmd RemoveWorkspace) Run() gribble.Value {
	return syncRun(func() gribble.Value {
		withWorkspace(cmd.Workspace, func(wrk *workspace.Workspace) {
			if err := wm.RemoveWorkspace(wrk); err != nil {
				wm.PopupError("Could not remove workspace '%s': %s", wrk, err)
				return
			}

			wm.FYI("Workspace %s removed.", wrk)
			wm.FocusFallback()
		})
		return nil
	})
}