Skip to content
loooinfoPublic
forked from henkman/virgo

About

♍Virtual desktops for Windows 虚拟桌面

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

60 Commits

Folders and files

Repository files navigation

virgo

Virtual Desktop Manager for Windows — 虚拟桌面管理器

Download / 下载 · 中文说明

Version 1.8.3

A tiny, fast virtual desktop manager. virgo emulates 4 desktops by hiding/showing windows — no undocumented APIs, so it keeps working across Windows updates. One tray icon shows the desktop you are on.

轻量快速的虚拟桌面管理器。virgo 通过隐藏/显示窗口模拟 4 个桌面,不使用未 公开 API,不会因 Windows 更新而失效。托盘图标显示当前桌面编号。


English

Features

  • tiny: exe is ~110kb (with built-in icon packs), uses <1mb memory
  • 4 virtual desktops (more if you change a constant and recompile)
  • tray icon shows the current desktop number, auto-recovery after explorer restarts
  • per-desktop focus memory: switching back to a desktop restores the window you were using
  • window pinning: pinned windows show on every desktop
  • built-in icon packs (from enria/virgo-icon) plus custom .ico support, switchable from the tray menu
  • bilingual tray menu: English or 中文
  • settings (icon pack, language) persist in the registry

Hotkeys

Hotkey Action
ALT + 1..4 switch to desktop 1..4
CTRL + 1..4 move active window to desktop 1..4
ALT + BACKSPACE switch back to the previous desktop
ALT + LEFT / ALT + RIGHT previous / next desktop (cycles)
ALT + CTRL + SHIFT + T pin/unpin the active window
ALT + CTRL + SHIFT + S pause/resume hotkeys
ALT + CTRL + SHIFT + Q exit

Tray menu

Right-click the tray icon:

  • Desktop 1..4 — switch directly
  • Previous desktop
  • Pin/unpin active window (checkmark shows the state)
  • Pause/Resume hotkeys
  • Icons — pick a tray icon pack:
    • Built-in — the drawn icon (blue rounded square with a number)
    • Number / Number Bold / Circle Number / Function — embedded packs from enria/virgo-icon
    • Custom (1.ico..4.ico) — loads 1.ico .. 4.ico from virgo.exe's folder; sample files are in the icons/ folder of this repository. missing files fall back to the drawn icon
  • Language — English or 中文
  • Exit — restores all hidden windows

Custom tray icons

Choose Icons → Custom and put 1.ico .. 4.ico (any style, high resolution) next to virgo.exe. without the files virgo keeps drawing its built-in icon, so nothing else is needed. the icon pack choice is remembered across restarts.

Notes on Windows 10/11

  • windows cloaked by a native virtual desktop (win+ctrl+left/right) are detected via DWM and left alone. avoid using both desktop systems on the same windows: virgo cannot tell a window's native desktop once it becomes visible
  • UWP apps (Settings, Calculator, ...) are handled through their real top-level window; they no longer get stuck or duplicated
  • if a hotkey is taken by another program (input methods often grab ctrl+1..4), virgo shows one message listing the conflicts and keeps running with the remaining keys
  • pausing (alt+ctrl+shift+s) releases every switching hotkey — browsers regain alt+left/alt+right — while pause/resume (S) and exit (Q) stay active
  • on logoff/shutdown all hidden windows are restored first; exiting via alt+ctrl+shift+q does the same. killing the process from task manager does not (hidden windows stay hidden until logoff/reboot)

Build

msys2 on Windows:

  1. install msys2 from http://msys2.github.io/
  2. in the msys2 shell, pacman -S mingw-w64-i686-gcc mingw-w64-i686-make
  3. copy C:\msys32\mingw32\bin\mingw32-make.exe to make.exe
  4. cd virgo && make

Cross compile from Linux (mingw-w64):

    make clean && make CC=i686-w64-mingw32-gcc \
         WINDRES=i686-w64-mingw32-windres                          # 32 bit
    make clean && make ARCH=64 CC=x86_64-w64-mingw32-gcc \
         WINDRES=x86_64-w64-mingw32-windres                       # 64 bit

中文说明

特性

  • 极其轻量:exe 约 110kb(含内置图标包),运行内存 <1mb
  • 4 个虚拟桌面(修改代码常量并重新编译即可支持更多)
  • 托盘图标显示当前桌面编号,explorer 崩溃/重启后自动恢复
  • 每桌面焦点记忆:切回某个桌面时自动恢复之前使用的窗口
  • 窗口钉住:被钉住的窗口在所有桌面都显示
  • 内置 4 套图标包(来自 enria/virgo-icon),并支持自定义 .ico,可在托盘菜单中切换
  • 托盘菜单支持中英文双语
  • 设置(图标包、语言)保存在注册表中,重启后依然生效

快捷键

快捷键 功能
ALT + 1..4 切换到桌面 1..4
CTRL + 1..4 将活动窗口移动到桌面 1..4
ALT + BACKSPACE 切回上一个桌面
ALT + LEFT / ALT + RIGHT 上一个 / 下一个桌面(循环)
ALT + CTRL + SHIFT + T 钉住/取消钉住活动窗口
ALT + CTRL + SHIFT + S 暂停/恢复快捷键
ALT + CTRL + SHIFT + Q 退出

托盘菜单

右键点击托盘图标:

  • 桌面 1..4 —— 直接切换
  • 上一个桌面
  • 钉住/取消钉住活动窗口(勾选状态会显示)
  • 暂停/恢复快捷键
  • 图标 —— 选择托盘图标包:
    • 内置 —— 代码绘制的图标(蓝色圆角方块 + 数字)
    • 数字 / 粗体数字 / 圆圈数字 / 功能 —— 内置图标包,来自 enria/virgo-icon
    • 自定义 (1.ico..4.ico) —— 从 virgo.exe 同目录加载 1.ico .. 4.ico;现成文件见仓库 icons/ 目录。文件缺失时回退到 代码绘制的图标
  • 语言 —— English 或 中文
  • 退出 —— 恢复所有被隐藏的窗口

自定义托盘图标

在「图标」菜单中选择「自定义」,然后把 1.ico .. 4.ico(任意风格、高 分辨率)放到 virgo.exe 同目录即可。不放这些文件时 virgo 使用代码绘制的 内置图标,无需其他配置。图标包选择会被记住,重启后依然生效。

Windows 10/11 注意事项

  • 被系统原生虚拟桌面(win+ctrl+左右方向键)遮挡(cloaked)的窗口会通过 DWM 检测并放任不管。请不要对同一个窗口同时使用两套桌面系统:窗口变为 可见后,virgo 无法判断它属于哪个原生桌面
  • UWP 应用(设置、计算器等)通过其真正的顶层窗口处理,不会再卡死或重复
  • 快捷键被其他程序占用时(输入法经常占用 ctrl+1..4),virgo 弹出一次 提示列出冲突项,并继续使用其余快捷键运行
  • 暂停(alt+ctrl+shift+s)会释放所有切换类热键——浏览器重新可用 alt+left / alt+right——暂停/恢复(S)和退出(Q)保持可用
  • 注销/关机时先恢复所有被隐藏的窗口;用 alt+ctrl+shift+q 退出也一样。 在任务管理器中直接结束进程则不会(被隐藏的窗口会一直隐藏到注销/重启)

编译

Windows 上使用 msys2:

  1. 前往 http://msys2.github.io/ 安装
  2. 在 msys2 shell 中 pacman -S mingw-w64-i686-gcc mingw-w64-i686-make
  3. 复制 C:\msys32\mingw32\bin\mingw32-make.exe 并命名为 make.exe
  4. cd virgo && make

从 Linux 交叉编译(mingw-w64):

    make clean && make CC=i686-w64-mingw32-gcc \
         WINDRES=i686-w64-mingw32-windres                          # 32 位
    make clean && make ARCH=64 CC=x86_64-w64-mingw32-gcc \
         WINDRES=x86_64-w64-mingw32-windres                       # 64 位

Differences from the original

This project is a fork of henkman/virgo. Upstream has been inactive for years (last release v1.4.2, 2018) and does not work reliably on modern Windows. This fork continues from upstream commit 17d7093 and adds:

  • Windows 10/11 compatibility — reworked window hiding/showing, DWM cloak detection, proper UWP handling
  • Robust hotkeys — conflicts are reported in one message instead of exiting; pause releases every switching hotkey
  • Tray icon overhaul — desktop number icon, auto-recovery after explorer restarts, right-click menu (desktops, pause/resume, icon packs, language, exit)
  • Per-desktop focus restore, alt+backspace, alt+left/right, window pinning — quality-of-life features adopted from other forks (see credits below)
  • Built-in icon packs and bilingual menu — icons from enria/virgo-icon compiled into the exe; menu/messages in English or 中文; settings persist in the registry
  • Safety — all hidden windows restored on logoff/shutdown
  • Toolchain & CI — builds with modern mingw-w64 (msys2 and Linux cross compile); GitHub Actions builds both exes on every v*.*.* tag

Credits — where each feature comes from

Besides fixes developed in this fork, several features were adopted from other forks of the same upstream project — thanks to their authors:


与原版的区别

本项目复刻自 henkman/virgo。上游多年未 更新(最后一个版本 v1.4.2,2018 年),在现代 Windows 上无法稳定工作。本 复刻基于上游提交 17d7093 继续开发,主要改动:

  • Windows 10/11 兼容 —— 重写窗口隐藏/显示逻辑,DWM 遮挡检测, UWP 应用正确处理
  • 快捷键更健壮 —— 与其他程序冲突时弹出一次提示并继续运行,不再 退出;暂停会释放所有切换类热键
  • 托盘图标全面改进 —— 显示桌面编号,explorer 崩溃/重启后自动恢复, 右键菜单(切换桌面、暂停/恢复、图标包、语言、退出)
  • 每桌面焦点恢复、alt+backspace、alt+left/right、窗口钉住 —— 实用功能,改编自其他复刻(见下方致谢)
  • 内置图标包与双语菜单 —— 来自 enria/virgo-icon 的图标编译进 exe; 菜单/提示信息支持 English / 中文;设置保存在注册表
  • 安全性 —— 注销/关机时恢复所有被隐藏的窗口
  • 工具链与 CI —— 可用现代 mingw-w64 编译(msys2 及 Linux 交叉 编译);GitHub Actions 在每次打 v*.*.* 标签时自动构建双版本 exe

各功能的来源 / 致谢

除本复刻自行开发的修复外,部分功能借鉴自同一上游项目的其他复刻, 感谢这些作者:

  • 每桌面焦点记忆与恢复(1.6.0)—— 改编自 jzhsiao/virgo; kitty-panics/virgo(#20)和 wwxiaoqi/virgo 也合并了同样的思路
  • Alt+Backspace 切回上一个桌面(1.6.0)—— 改编自 jzhsiao/virgo
  • CI 自动构建发行版(1.6.0)—— 工作流形式参考 FrancescElies/virgo,并按 本项目的 mingw-w64 交叉编译流程重新实现
  • 自定义 .ico 托盘图标(1.7.0/1.8.0)—— 机制与图标包来自 enria/virgo-icon;图标包现已 编译进 exe
  • 窗口钉住(pinning)(1.7.0)—— 改编自 kitty-panics/virgo(#21, wwxiaoqi/virgo 同样实现);快捷键 改为 alt+ctrl+shift+T 并整合进托盘菜单
  • Alt+Left / Alt+Right 循环切换相邻桌面(1.7.0)—— 改编自 wwxiaoqi/virgo

About

♍Virtual desktops for Windows 虚拟桌面

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages