Previous Workspace Logic

Hyprland version
Hyprland 0.51.1 built from branch  at commit 71a1216abcc7031776630a6d88f105605c4dc1c9  ([gha] Nix: update inputs).
Date: Mon Sep 22 20:54:03 2025
Tag: v0.51.1, commits: 6436
built against:
 aquamarine 0.9.5
 hyprlang 0.6.3
 hyprutils 0.10.0
 hyprcursor 0.1.13
 hyprgraphics 0.2.0


no flags were set

Focusing back and forth with the dispatch workspace previous works well, but when one uses the dispatch movetoworkspace previous to move windows to the previous workspace it will only work once and then it outputs Invalid workspace in moveActiveToWorkspace. This only seems to happen when movetoworkspace previous is called a second time from empty workspace.

Perhaps this is intented behaviour?

One more thing, using the movetoworkspace previous should only focus back and forth between the workspaces(given that these are not empty), right? Because one can make a cycle of n workspaces with the dispatch movetoworkspace previous:

  • have a window open in workspaces “W” through “Wn” (at least one window open otherwise dispatch fails)
  • focus once workspace “W” through “Wn”
  • focus again workspace “W”
  • open a terminal and enter the command hyprctl dispatch movetoworkspace previous
  • enter the command again effectively looping through the workspaces infinitely.

I just wish to send a window to the previous workspace back and forth even if it is empty.

config(options)
general {
    layout = dwindle
    gaps_in = 4
    gaps_out = 8
    gaps_workspaces = 10
    border_size = 1
    no_border_on_floating = false
    col.active_border = $green $yellow 45deg
    col.inactive_border = $inactive
    no_focus_fallback = true
    resize_on_border = true
    hover_icon_on_border = true
    # snap {
    #     enabled = true
    #     window_gap = 100
    #     monitor_gap = 100
    #     respect_gaps = true
    # }
}

input {
    kb_layout = latam
    kb_model = pc105
    repeat_delay = 300
    repeat_rate = 50
    follow_mouse = 1
    mouse_refocus = true
    accel_profile = flat
    sensitivity = 0.1
    special_fallthrough = true

    touchpad {
        tap_button_map = lrm
        natural_scroll = true
        tap-to-click = true
        scroll_factor = 0.20
        drag_lock = false
        tap-and-drag = true
    }
}

device {
    name = elan06fa:00-04f3:31be-touchpad
    accel_profile = flat
    sensitivity = 1
    scroll_method = 2fg
}

device {
    name = logitech-usb-receiver-mouse
    accel_profile = flat
    sensitivity = 0
}

dwindle {
    pseudotile = false
    preserve_split = true
    force_split = 2
    smart_split = false
    smart_resizing = true
}

master {
    mfact = 0.5
    new_status = master
    new_on_top = true
    orientation = left
    inherit_fullscreen = true
    # always_keep_position = true
    # slave_count_for_center_master = 2
}

group {
    insert_after_current = true
    focus_removed_window = true
    col.border_active = $green $yellow 45deg

    groupbar {
        enabled = true
        stacked = false
        scrolling = true
        gradients = true
        keep_upper_gap = false
        priority = 1
        gradient_rounding = 10
        round_only_edges = false
        indicator_height = 0
        height = 16
        rounding = 1
        gaps_in = 10
        gaps_out = 10
        col.active = rgba(63b76cff)
        col.inactive = rgba(63b76c33)
        text_color = rgba(111111ff)
        font_family = Jet Brains Mono Nerd Font
        font_size = 15
    }
}

decoration {
    # rounding = 0
    rounding = 4
    active_opacity = 1.0
    inactive_opacity = 1.0
    fullscreen_opacity = 1.0
    dim_special = 0.4

    shadow {
        enabled = false
    }

    blur {
        enabled = false
    }
}

animations {
    enabled = true
    bezier = curve, 0.0, 0.0, 0.58, 1
    animation = windows, 1, 1.0, curve, slide
    animation = border, 0, 1, curve
    # animation = fade, 1, 2, curve
    animation = fade, 0
    animation = layers, 1, 2, curve
    animation = workspaces, 1, 0.5, curve, slide
    animation = specialWorkspace, 1, 0.5, curve, slidevert
}

binds {
    # workspace_back_and_forth = false
    workspace_center_on = 0
    focus_preferred_method = 0
    movefocus_cycles_fullscreen = true
}

misc {
    force_default_wallpaper = 0
    disable_hyprland_logo = true
    disable_splash_rendering = true
    new_window_takes_over_fullscreen = 1
    exit_window_retains_fullscreen = true
    disable_autoreload = true
    animate_manual_resizes = false
    initial_workspace_tracking = 1
    focus_on_activate = true
    enable_swallow = false
    swallow_regex = (foot|footclient)
    swallow_exception_regex = (wev)
    font_family = Jet Brains Mono Nerd Font
    lockdead_screen_delay = 3000
}

cursor {
    hide_on_key_press = false
    inactive_timeout = 15
    enable_hyprcursor = true
}

gestures {
    workspace_swipe_distance = 300
    workspace_swipe_cancel_ratio = 0.3
    workspace_swipe_min_speed_to_force = 25
    workspace_swipe_create_new = true
    workspace_swipe_forever = false
}

xwayland {
    enabled = false
    use_nearest_neighbor = true
    force_zero_scaling = false
}

render {
    new_render_scheduling = true
    send_content_type = false
}

debug {
    disable_logs = false
}

ecosystem {
    no_donation_nag = true
    no_update_news = true
}

Anyway, hope this helps in any way.

Open a discussion on github with these repro steps :)

Done :)

github discussion