Skip to content

feat: add rename-workspace command #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mzhu-zx
Copy link

@mzhu-zx mzhu-zx commented Apr 23, 2025

It seems that there isn't a command to rename workspace yet... So, this commit adds a simple command rename-workspace.

Usage:

  • Using GlazeWM's term:
    • rename-workspace --name 1 --display-name hello
    • rename-workspace --name 1: rename to "1" without a display name
    • rename-workspace --display-name hello: set the display name to "hello"
  • It also supports a simpler i3-ish way to rename:
    • rename-workspace 1:hello == rename-workspace --name 1 --display-name hello
    • rename-workspace 1 == rename-workspace --name 1
  • To rename another workspace that isn't focused, specify the workspace by its name:
    rename-workspace --workspace 1 1:hello
  • Since a name doesn't need to be a number, the following are valid
    rename-workspace hello:world
    rename-workspace --workspace hello 2:hello-world
    

Related: #776

@github-project-automation github-project-automation bot moved this to 📬 Needs triage in glazewm Apr 23, 2025
@mzhu-zx mzhu-zx force-pushed the feat/rename_workspace branch from 362cbb3 to da55c3f Compare April 24, 2025 01:37
@SimpsonGSD
Copy link

This would be great to have!

@lars-berger
Copy link
Member

Thanks for working on this! 💜 I have a couple of suggestions to consider:

  • Instead of rename-workspace, what do you think about making this a more general update-workspace-config command? This would let us modify other workspace options (like keep_alive) without needing separate commands for each property. Your structure with the clap args looks really nice, we could keep it the exact same way and just add extra optional args for the other properties:
    update-workspace-config --name <name> --display-name <display-name> --keep-alive <bool> ... --workspace <name>
    
  • a bit of a nitpick, but I reckon requiring explicit --name and --display-name args is a bit clearer than also allowing the shorthand version, especially with the proposed update-workspace-config change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📬 Needs triage
Development

Successfully merging this pull request may close these issues.

3 participants