Liberty by Bada is a compact native C++/Win32 tray panel for Windows 10/11 x64. Version: 0.1.4.
The whole product surface is the single control panel below. Features outside this panel have intentionally been removed.
- 使用MacOS快捷键 — enables macOS-style shortcuts on Windows. Cmd/Alt/Control can each be assigned to a physical key in Settings.
- 关闭显示器并防止电脑休眠 — turns the display off immediately while keeping the computer awake until the switch is turned off.
- 防止电脑休眠 — keeps Windows awake until the switch is turned off.
- 防止自动锁屏 — keeps an already-unlocked session active while enabled; manual locking remains available.
- 清理缓存 → — opens the built-in Windows Disk Cleanup experience.
- 将截图保存至桌面而不是剪贴板 — saves incoming clipboard screenshot bitmaps as PNG files on the Desktop, then clears that screenshot from the clipboard.
- 定时关机 → — save several 24-hour times that repeat every day, or use a one-time 1–10080-minute countdown.
- 设置 → — controls startup, shortcut mapping, and the interface language.
- The footer opens About Liberty by Bada.
The display-off hotkey is Ctrl+Alt+F10. Start with Windows is enabled by default and can be changed in Settings.
The macOS shortcut layer supports common Cmd shortcuts through their Windows equivalents, including copy/paste/select-all, Cmd+Tab, Cmd+Q, Cmd+H/M, Cmd+arrow navigation, Cmd+Space, and Cmd+Shift+3/4. Option+Left/Right/Backspace uses word-wise navigation or deletion. The default physical mapping is left Windows = Cmd, left Alt = Alt/Option, and left Control = Control. Duplicate physical assignments are rejected.
The tray panel has eight left-aligned rows, native Windows checkbox controls, restrained dividers, and a fixed Liberty by Bada footer. Saved checkbox states are applied during window creation. The parent paint does not overwrite child controls, and the popup uses its own monitor's DPI.
Prevent automatic lock is off by default. While enabled, Liberty requests an awake system and, after 45 seconds of inactivity, submits a zero-distance mouse activity event. It checks the Windows session and input desktop first, never unlocks an already-locked session, and does not change lock, screen-saver, or organization policies. Manual locking, Dynamic Lock, and enforced organization restrictions are not overridden. The display can briefly wake when activity is submitted; if display-off mode is enabled Liberty requests display-off again.
The following earlier experimental features are no longer included in the shipped binary: startup-item management, OneDrive/NVIDIA/AMD/Windows Security changes, desktop image overlay, direct cache purging, and persistent system policy changes. Liberty only manages its own Windows startup entry.
Open 定时关机 / Scheduled shutdown and choose a mode:
- 每日定时关机 / Daily schedule: choose a 24-hour time, click 添加 / Add, and repeat for every time you need. The list is sorted and deduplicated and accepts up to 24 times. Click 保存计划 / Save schedule once to replace the current Windows task. Each listed time repeats every day across Liberty and Windows restarts. 停用计划 / Disable schedule removes the Windows task but retains the list for later; deleting every item and saving clears the stored list.
- 倒计时关机 / After a duration: choose 15/30/60/120 minutes or enter 1–10080 whole minutes, then click 开始计时 / Start timer.
The daily schedule follows the computer's local time zone. At each selected time, Task Scheduler starts Liberty with a private --daily-shutdown action and Liberty begins a 60-second Windows shutdown countdown. The computer must be on, signed in and awake at the trigger time; Liberty does not wake a sleeping or powered-off computer. Moving the portable EXE requires opening the schedule and saving again so Windows learns the new path. Unsaved applications are not forced closed and may block shutdown.
The duration mode remains a one-time Windows countdown. 取消关机 / Cancel timer cancels that countdown; 返回 / Back closes the panel without cancelling it. Existing pending Windows shutdowns are never silently replaced.
Liberty submits shutdown through Windows InitiateSystemShutdownExW, with forced application closure disabled. The daily schedule is one current-user Task Scheduler task with one daily trigger per listed time; it runs only while that user is logged on and does not request wake-from-sleep. The one-time countdown uses volatile session state and is discarded at reboot.
Invalid inputs, missing privilege and Task Scheduler errors are shown in the interface. Liberty changes only its own scheduled task and shutdown countdown; it does not change Windows power or lock policies.
Install Visual Studio Build Tools 2022 with Desktop development with C++ and CMake tools for Windows, then run:
powershell -ExecutionPolicy Bypass -File .\build.ps1
The portable output is Liberty.exe. Both Release x64 and Debug x64 build without warnings.
Run the automated regression suite with ctest --test-dir build -C Release --output-on-failure. Tests use an isolated registry branch and never send keyboard input or schedule a real shutdown. CI runs them before publishing.
For an interactive debugging session, use build\Debug\LibertyDebugSession.exe build\Debug\Liberty.exe --window 180. The last argument is the debugger duration in seconds; it detaches and leaves Liberty running. --window opens the same application menu as a visible window for desktop inspection. The separately invoked LibertyShutdownIntegration.exe creates a real 60-minute Windows shutdown, verifies persisted state, and cancels it immediately. Add --at-time to test a specific local time one hour ahead. Both real-shutdown tests are deliberately excluded from automatic CI tests.
Liberty by Bada has no telemetry, updater, network client, installer, or service. Settings are stored under HKCU\Software\LibertyByBada. When startup is enabled, Liberty writes its own entry under the current user's Windows Run key. Enabling daily shutdown creates only Liberty by Bada - Daily Shutdown in the current user's Windows Task Scheduler; disabling or clearing the plan removes it.
Released under the MIT License.
Liberty by Bada 是一个单页 Windows 托盘控制面板。本版在草图的六项功能上增加“定时关机”和“防止自动锁屏”,共八项。菜单使用 Windows 原生复选组件。
设置页提供“开机启动”(默认开启)、界面语言以及 Cmd/Alt/Control 三个物理按键映射。默认映射为左 Windows = Cmd、左 Alt = Alt/Option、左 Control = Control;三个角色不能选择同一个物理按键。
定时关机支持 15/30 分钟、1/2 小时和自定义 1–10080 分钟,开始后显示倒计时并允许取消。按 Enter 开始,按 Esc 或“返回”回到主菜单。关闭窗口或退出 Liberty 后 Windows 仍会执行计划,不会强制关闭有未保存内容的应用。请通过“取消关机”结束倒计时。重新打开 Liberty 可查看本次 Windows 会话中已保存的计划;重启电脑后旧计划不会恢复。
“每日定时关机”使用电脑本地时区和 24 小时制。选择时间后点“添加”,可以继续添加多个时间;列表自动排序和去重,最多 24 个。点“保存计划”后,每个时间都会每天重复,关闭 Liberty 或重启 Windows 也不会丢失。到点时 Liberty 启动 60 秒 Windows 关机倒计时。电脑必须保持开机、登录且未休眠;未保存的工作仍可能阻止关机。移动便携版 EXE 后需要重新保存一次计划。
“停用计划”会删除 Windows 任务但保留时间列表,方便以后重新启用。逐项删除并保存空列表可以彻底清除时间。“倒计时关机”仍是一轮有效的临时计划,并可随时取消。
“防止自动锁屏”默认关闭。开启后,在已解锁的会话中定期维持活动,不会移动指针。关闭该开关即停止维持。手动锁定、动态锁和组织强制策略仍然有效;不会修改 Windows 锁屏策略,也不会自动解锁。
0.1.4 的 Debug/Release 回归、两个每日触发器的实机创建、重启恢复、停用及清理均已验证。测试任务和测试时间已删除,系统没有待执行关机。详情见 本版测试记录。0.1.3 的一次性指定时间实现保留在 旧版测试记录。