Switch Linux virtual terminals (TTYs) from a Wayland/Hyprland session via the `vt` alias (wraps `chvt` with a NOPASSWD sudoers rule)
vt is a shell alias for sudo chvt that lets the user jump between Linux virtual terminals without being prompted for a password. Source lives at ~/git/github.com/mbarlow/skills/vt/; install.sh wires it up on a new machine.
Ctrl+Alt+F<n> VT switching is handled by the kernel VT subsystem, not the Wayland compositor. Tools like wtype, hyprctl dispatch, and xdotool cannot trigger it — they only send events to userspace clients.chvt (from the kbd package) calls the VT_ACTIVATE ioctl directly and is the correct tool.chvt needs CAP_SYS_TTY_CONFIG, which unprivileged users don't have. A NOPASSWD sudoers rule scoped to /usr/bin/chvt is the simplest way to avoid typing a password every switch.tty group does not grant VT switching. It only grants read/write on tty device files. Don't suggest adding users to for this purpose.ttyvt <n> # switch to TTY<n>, e.g. `vt 3`
vt 1 # typically returns to the graphical session (Hyprland, GDM, etc.)
fgconsole # print the current VT number (needs access to /dev/tty0)
Ctrl+Alt+F3 behavior is inconsistent, or why wtype / hyprctl can't send VT switch chords.vt alias or mentions chvt.Run the setup script from the source repo:
~/git/github.com/mbarlow/skills/vt/install.sh
It:
chvt is installed (part of the kbd package).visudo -c./etc/sudoers.d/chvt-$USER via sudo install (prompts for password once).SKILL.md into ~/.claude/skills/vt/ so Claude Code picks it up at runtime.sudo -K && sudo -n chvt 99 (expects No such device or address from chvt itself, not a sudo password error).source ~/git/github.com/mbarlow/skills/vt/aliases.sh line to add to ~/.bashrc.The script is idempotent — re-running it is safe. Existing non-symlink files at the destination are backed up as *.bak.
~/git/github.com/mbarlow/skills/vt/uninstall.sh
Removes /etc/sudoers.d/chvt-$USER and the ~/.claude/skills/vt/SKILL.md symlink. Leaves the repo itself alone; the user strips the source line from their shell rc by hand.
install.sh prompts for a sudo password; don't run it through a non-interactive channel (it will fail silently on credential prompts).kbd package upgrades, the file-capability alternative (setcap cap_sys_tty_config+ep /usr/bin/chvt) gets wiped. The sudoers approach survives upgrades, which is why this skill uses it.User: "how do I switch to a TTY from Hyprland?"
→ Explain vt <n> / sudo chvt <n>, point to this skill if setup is needed.
User: "set up passwordless VT switching on this machine"
→ Run ~/git/github.com/mbarlow/skills/vt/install.sh (interactively, so sudo can prompt).
User: "go to TTY3"
→ Suggest running vt 3 themselves — Claude can't usefully switch VTs on behalf of the user because once the switch happens, the terminal Claude is running in is no longer foregrounded.