# Using Hyprctl in Terminal

**URL:** <http://forum.hypr.land/t/using-hyprctl-in-terminal/1654>\
**Category:** Ricing\
**Tags:** question, hyprland, script, other\
**Created:** [June 1, 2026, 6:49am UTC](http://forum.hypr.land/t/using-hyprctl-in-terminal/1654 "2026-06-01T06:49:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcme](http://forum.hypr.land/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@alcme](http://forum.hypr.land/u/alcme)\
**Post date:** [June 1, 2026, 6:49am UTC](http://forum.hypr.land/t/using-hyprctl-in-terminal/1654/1 "2026-06-01T06:49:23Z")

</div>

I’m trying to automate switching between workspaces using hyperctl, and have just been testing out the commands in the terminal to make sure they work. However, I keep getting this error about syntax (see the blockquote below for my terminal outputs) and I’m not sure of a way around it. Does anyone here know the correct syntax?

> [alcme@stupid-twinkpad~]$ hyprctl dispatch focus{workspace=3}  
> error: [string “return hl.dispatch(focus{workspace=3})”]:1: attempt to call a nil value (global ‘focus’)
> 
> -\> Note: dispatch in lua is a shorthand for hl.dispatch(…), your syntax might need to be updated.  
> [alcme@stupid-twinkpad~]$ hyprctl dispatch workspace 3  
> error: [string “return hl.dispatch(workspace 3)”]:1: ‘)’ expected near ‘3’
> 
> -\> Note: dispatch in lua is a shorthand for hl.dispatch(…), your syntax might need to be updated.

(I’ve tried other variations than the ones shown, none have worked :c)

---

<div class="post-metadata">

**Author:** ![alcme](http://forum.hypr.land/letter_avatar_proxy/v4/letter/a/f9ae1b/32.png) [@alcme](http://forum.hypr.land/u/alcme)\
**Post date:** [June 1, 2026, 6:50am UTC](http://forum.hypr.land/t/using-hyprctl-in-terminal/1654/2 "2026-06-01T06:50:16Z")

</div>

should add that im on hyprland 0.55.2

---

<div class="post-metadata">

**Author:** ![hyprm3](http://forum.hypr.land/letter_avatar_proxy/v4/letter/h/919ad9/32.png) [@hyprm3](http://forum.hypr.land/u/hyprm3)\
**Post date:** [June 1, 2026, 9:01am UTC](http://forum.hypr.land/t/using-hyprctl-in-terminal/1654/3 "2026-06-01T09:01:12Z")

</div>

> hyprctl eval ‘hl.dispatch(hl.dsp.focus({ workspace = “+1” }))’

That will move to the next workspace (use “-1” for previous)

You may change “+1” with any workspace number i.e. “3” or “7” etc.
