Skip to content

About

Портативные часы и таймер для Windows x86: панель управления, цифры поверх окон на выбранных мониторах, полноэкранный режим и широкие настройки. //// Portable clock and timer for Windows x86: control panel, digital overlay windows on selected monitors, full-screen mode, and extensive settings.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Полное руководство (for English look lines 118-394)

Что это

ClockTimer.exe — портативные часы и таймер для Windows x86: панель управления, цифры поверх окон на выбранных мониторах, полноэкранный режим и настройки.

The ClockTimer panel with a timer running and two screens lit

Запуск и настройки

Запустите EXE в папке с правом записи. Настройки читаются и сохраняются только в ClockTimer.ini рядом с EXE. Если папка защищена, сохранение завершится сообщением об ошибке; изменения останутся активными до конца сеанса. Запись выполняется кнопками «Сохранить» или «ОК»; другие секции и порядок строк вашего INI сохраняются как есть. ClockTimer-defaults.ini — справочный пример, автоматически он не копируется, поэтому перед правкой сделайте резервную копию работающего файла.

Чтение понимает UTF-16LE с BOM, UTF-8 (с BOM и без) и обычный ANSI; запись всегда UTF-16LE. Файл открывается с разделением на чтение и запись, так что незакрытый редактор не мешает сохранению. Подпись, путь и любое значение с кавычками, пробелами или непечатаемыми символами сохраняются в экранированном виде @ClockTimerTextV1:… и читаются обратно без потерь.

Повторный запуск программы не создаёт второй экземпляр, a выводит первый на передний план. Значок в трее не обязателен для работы — если оболочка его не приняла, программа пробует добавить его снова, а панель функционирует как обычно.

Если путь к звуку не задан, программа ищет blam_sound.wav рядом с EXE; иначе используется встроенный сигнал. Поддерживается PCM WAV (8/16 бит, 1/2 канала, пустой завершающий блок data игнорируется). Пустой Sound, относительный путь к WAV и относительный путь фона разрешаются относительно папки EXE, а в INI остаётся короткая форма, которую вы ввели.

Панель и экраны

Панель открывается на мониторе, где находится указатель, и остаётся на нём при перетаскивании. Если монитор отключён, используется основной. Крестик или выход через трей показывают тихое подтверждение; кнопка − сворачивает панель в трей.

Нижнее табло переключается кнопкой ⇄ рядом с ним: ТАЙМЕР - АКТ показывает активный отсчёт (зелёным при ходе, жёлтым на паузе и при 00:00), ЧАСЫ показывает текущее время тем же зелёным, что и кнопка ЧАСЫ. Подпись над табло меняется вместе с режимом, а картинка clock-header берётся из того же рисунка панели, поэтому шов не виден.

После пяти секунд без действий в окнах ClockTimer фон панели становится примерно на 7 % прозрачнее; кнопки, лампы и оба табло остаются непрозрачными. Любое действие в окнах приложения возвращает исходный вид; работа в других программах таймер не сбрасывает.

В настройках «Экраны и положение» нажмите «Определить экраны», затем для каждой кнопки 1, 2 и 3 задайте номер физического монитора в поле «Кнопка → монитор». Соответствие сохраняется кнопками «Сохранить» или «ОК». Номера могут измениться при переподключении мониторов.

Размер панели меняется перетаскиванием за правый нижний угол; во время перетаскирования рисунок считается в 1×, а после отпускания — в обычном 5×. Ширина не запоминается: при следующем запуске используется PanelWidth из INI (по умолчанию 1301). Это осознанное поведение — размер считается временным, настройки от него не зависят.

Пользовательские кнопки

На вкладке «Все кнопки» показана схема панели: встроенные кнопки описываются по нажатию, программируемые обозначены ★. Кнопки ★1–★4 принимают Unicode-подпись, которая масштабируется под границы самих символов. При запуске ★1 подсвечивается зелёным, ★2–★4 — красным; маленькие кнопки 5 и 6 сохраняют исходный рисунок, для них задаётся только постоянный цвет линзы в HEX (по умолчанию 363735). Уже сохранённые цвета не перезаписываются. Путь может быть абсолютным, UNC или относительным к папке EXE. Изменения применяются через «Сохранить» или «ОК».

Первое нажатие запускает отдельный процесс, второе запрашивает остановку.

Подтверждение не показывается: ваш код запускается с правами текущего пользователя — выбирайте только доверенные файлы. Если процесс завершился с ошибкой, его вывод показывается в сообщении и в журнале. Для ★2…★4 янтарная линза означает «запуск затянулся» или «процесс ждут больше 150 мс»; для ★1 и маленьких кнопок об этом сообщает янтарная точка. Готовность процесса протоколом не подтверждается: старт считается по созданию процесса. При выходе общее ожидание процессов — до пяти секунд; принудительного завершения нет. Для .ps1 временно применяется -ExecutionPolicy Bypass только для этого процесса, корпоративные политики могут запретить запуск. желательно использовать .exe.

Протокол пользовательской программы: ей передаются два аргумента — имя именованного события Windows и PID ClockTimer. Программа открывает событие, остаётся запущенной, отслеживает событие или завершение родителя и сама отменяет свои изменения перед выходом. Обычные программы, которые аргументы игнорируют, могут не отреагировать на повторное нажатие.

plugins/mute.exe (исходник plugins/mute.cpp) по умолчанию назначен кнопке ★2. Он отключает устройство вывода, которое было основным в момент нажатия, а при остановке восстанавливает его сохранённые общий уровень и состояние mute. Папка plugins должна лежать рядом с EXE. Если устройство сменится во время работы, новое автоматически не отключается. Аварийное завершение программы или компьютера может помешать восстановлению — при необходимости включите звук вручную.

Сборка и генерация графики

sh build.sh                                       # ClockTimer.exe + plugins/mute.exe
pip install -r requirements.txt
python3 make_assets.py                            # ui_layout.h, master SVG и все спрайты
python3 make_preview.py                           # docs/hero.png для этой страницы

Для Windows — build-msvc.cmd в x86 Native Tools Command Prompt. Оба скрипта собирают plugins/mute.exe, компилируют с -Wall -Wextra -Werror (/W4), включают --large-address-aware / /LARGEADDRESSAWARE и подсистему 6.01. Ассеты нужны только для сборки: в EXE они встроены через src/resources.rc (1× BMP, 3× PNG для увеличенной панели, WAV сигнала и манифест).

assets/panel-editable-text.svg — исходный рисунок; все спрайты состояний вырезаются из него. make_transition_assets.py перекрашивает те же линзы в янтарный для состояния ожидания. Геометрия красных клавиш в SVG и в C++ берётся из одного файла ui_layout.py (src/ui_layout.h), поэтому рисунок и код не разъезжаются. Контуры цифр в src/embedded_font.inc генерируются из assets/numerals/*.svg (vector_font.py), латиница и кириллица — из assets/fonts/DejaVuSans*.ttf.

Замечания

Спрайты перерисовываются детерминированно, так что повторная генерация не меняет ни пикселя. Фоновые буферы панели зависят от размера: 5× сэмплирование большой панели занимает десятки мегабайт; при неудаче остаётся работоспособный вариант в 1×. EXE не подписан.

ClockTimer — a portable clock and countdown panel for Windows

The ClockTimer panel with a timer running and two screens lit

Download: grab ClockTimer.exe (and the plugins folder) from the Releases page, put them in a folder Windows lets you write to, and double-click. One EXE — no installer, no runtime, nothing else to install.

The build is not code-signed, so Windows SmartScreen may warn the first time — choose More info → Run anyway. ClockTimer never opens a network connection, never touches the registry, and the whole thing builds from the source in this repo.

File What it is
ClockTimer.exe the whole app: panel, per-monitor overlays, fullscreen timer, settings — artwork embedded, ~6 MB
plugins/mute.exe optional helper for a programmable button: mutes the default output device, restores it on stop
ClockTimer.ini created next to the EXE the first time you press Save; the only place settings live

Why this exists

Presentations, rehearsals, classes, broadcast runs: you want the remaining time big and dumb on the wall, and a clock the room can also read. Existing on-screen timers either hide their settings in a dialog or only cover the primary monitor, so this one puts the routing on the panel itself — three numbered keys pick which monitors show the digits, and one key fills a whole screen with them.


Install

There is one file to install, and it has to sit somewhere it can write.

  1. Copy the folder somewhere permanent, e.g. Documents\ClockTimer\. The settings file is created next to the EXE, so don't leave it in the downloads folder or inside a zip preview.
  2. Double-click ClockTimer.exe. The panel appears on the monitor your cursor was on and stays on that monitor while you drag it.

Starting a second copy does nothing except bring the first copy's panel to the front.

What it writes, and how to remove it

location what goes there
ClockTimer.ini next to the EXE your settings — written only when you press Save or OK in the settings window, atomically, as UTF-16LE
your own files only the ones you point at: a WAV for the signal, a background image, and any .exe / .ps1 bound to a ★ key

To remove it: close the app, then delete the folder. Any programmable-button process you started keeps doing whatever that program does — the ★ keys launch your files with your own rights and never force-kill them.


The panel

Key What it does
+15 +30 add seconds to the prepared time (top display, red)
+1 +2 +3 +5 +7 +10 add minutes to the prepared time
−1 мин take a minute back out of the prepared time
ЧАСЫ show or hide the wall clock on the selected monitors
ТАЙМЕР show or hide the countdown on the selected monitors
ПРЯМ. ⇄ ОБР. count up from zero, or count down to it
⚠️ warning: play the signal N seconds before zero (in countdown mode), and skip the signal at zero
ФОН put a solid or inverted plate behind the digits instead of bare overlay
1 2 3 which monitors carry the digits at all — one key per monitor slot
Fullscreen fullscreen timer on its own monitor
▶ start, add the prepared time, or pause
СБРОС (small, red, over the top display) clear the prepared time
СБРОС (right column) reset the running time
ЗВУК play the signal once
⇄ (next to the bottom display) swap the bottom display between the active timer and the wall clock
★ your own program, on your own key
⚙ (bottom left) settings, straight on the quick-keys page
− / × / ↘ hide to tray / quit / drag to resize

Both displays share the seven-segment digits, and both have a colon you can nudge a dozen pixels in either direction. The top display is what you have prepared; the bottom one shows whatever the ⇄ key selects — the live countdown (green while it runs, amber when paused or back at 00:00) or the wall clock in the same green as the ЧАСЫ key. The status line under ▶ says ЗАПУЩЕНО / ПАУЗА / 00:00 / ЗВУК in the same colours.

Two displays, three screens, one fullscreen

Digits live in their own layered windows, so they sit on top of anything, can be dragged (turn Drag on), and are re-composited only when the minute or second actually changes.

  • 1 2 3 are monitor slots, not screen numbers. In settings page Screens and position you map each slot to a physical monitor and fine-tune the clock's and timer's offset on it (from the left edge for the clock, from the right for the timer).
  • Определить экраны flashes the monitor numbers for three seconds so you know what you are mapping.
  • The fullscreen timer takes over its own monitor completely: solid colour or a PNG / JPEG / BMP of your choice, its own digit colour and height, and it replaces only the corner timer on that monitor — the clock there stays. If its monitor disappears it hides itself and comes back when the monitor does.

Settings

Six pages: Вид и фон (digit height, opacity, outline, colon nudge, colours, ФОН padding), Экраны и положение (slot → monitor, offsets), Таймер и звук (warning window, WAV, test play), Быстрые кнопки (the eight +N values and the label printed under each), Полный экран (monitor, digit height, colours, background image), Все кнопки (a schematic of the panel — click any key to read what it does, and bind the ★ keys).

Buttons Save and OK write the INI; Открыть журнал shows the in-memory diagnostic log (nothing is written to disk) and Сбросить вкладку refills only the page you are looking at.

Sound and FullscreenImage accept a full path or a path relative to the EXE folder, and the INI keeps the short relative form you typed. Same for the ★ keys, which is how plugins\mute.exe keeps working when you move the whole folder.

INI keys

[ClockTimer]
Height=100            ; digit height, px (20–400)
Opacity=100           ; overlay opacity, % (1–100)
Outline=0             ; digit outline, px (0–6)
WarningSeconds=10     ; ! lead time, s (0–5999)
Drag=0                ; let the overlays be dragged
ShowClock=0
ShowTimer=1
Background=0          ; ФОН
Warning=0             ; !
Reverse=1             ; 1 = count down
TimerColor=16777215   ; decimal RGB
ClockColor=16777215
BackgroundColor=0
OutlineColor=0
ScreenMask=1          ; which of slots 1/2/3 are on (bits 0..2)
ColonX=0
ColonY=0              ; colon nudge, ±12 px
BackgroundPreset=0    ; 0 white plate, 1 black plate, 2 own colours
BackgroundPaddingX=8
BackgroundPaddingY=8
Monitor1=0
Monitor2=1
Monitor3=2            ; slot → physical monitor, 1-based in the dialog
Quick1=15
Quick2=30             ; seconds keys (0–5999)
Quick3=1
…
Quick8=10             ; minutes keys (0–99)
QuickLabel1=
QuickLabel2=СЕКУНДЫ
…                     ; printed under the key, up to 48 chars
QuickLabel7=СОДОКЛАД
Slot1ClockX=40
Slot1ClockY=40
Slot1TimerX=40
Slot1TimerY=40
…                     ; per-slot offsets, also for Slots 2 and 3
FullscreenEnabled=0
FullscreenMonitor=1
FullscreenDigitHeight=250
FullscreenDigitColor=0
FullscreenBackground=16777215
FullscreenImageMode=0
FullscreenImage=      ; local PNG/JPEG/BMP, or relative to the EXE
PanelWidth=1301       ; startup width only; dragging a resize is not persisted
Sound=                ; WAV next to the EXE, or relative to it; empty = blam_sound.wav, then built-in
CustomButton1File=
CustomButton1Label=
CustomButton2File=plugins\mute.exe
CustomButton2Label=🔇
…                     ; labels for ★1–★4, HEX colour for the small ★5/★6
CustomButton5Color=3553077

The booleans you toggle on the panel (ShowClock, ShowTimer, Background, Warning, Reverse, plus the fullscreen key) are deliberately not rewritten on save, so hand-editing them in the INI still means something and saving never overwrites the state you started from. Labels, paths and anything with quotes, spaces or emoji are stored escaped (@ClockTimerTextV1: + hex) so they survive the round trip. ClockTimer-defaults.ini is the reference copy above — nothing is copied automatically, so back up a working INI before you edit it by hand.

Programmable buttons (★1 … ★6)

★1 lights green like the СБРОС/ЗВУК keys, ★2–★4 light red like ! and ФОН, and ★5/★6 are the two small lenses whose colour you set as HEX. ★1–★4 also take a Unicode label (an emoji works) that is scaled to the key face from its own ink bounds.

The first press starts your file; the second asks it to stop, and the key shows an amber "still waiting" state while the process is winding down — for ★1 as a dot in the corner, for ★2–★4 as the amber lens. There is no confirmation dialog any more: your code runs with your rights, so bind only files you trust.

The protocol is two arguments: the name of a Windows event and the PID of ClockTimer. Your program opens the event, stays alive, and when the event fires (or its parent dies) it undoes whatever it did and exits — that is all there is to it. Plain programs that ignore the arguments simply keep running until they finish, and ClockTimer never kills them; on exit it waits up to five seconds in total. .ps1 files are run by Windows PowerShell with -ExecutionPolicy Bypass for that one process only, which corporate policy may still block.

plugins/mute.exe (source in plugins/mute.cpp) is bound to ★2 by default. It mutes the output device that was default when you pressed the key and restores its volume and mute state when it is asked to stop. Keep the plugins folder next to the EXE. If the default device changes while it is running, the new one is not muted; if the process or the machine dies mid-flight, unmute by hand.

Requirements

  • Windows 7 SP1 and later, 32-bit or 64-bit (the binary is x86 and runs everywhere, including Windows on Arm).
  • Nothing to install: user32 / gdi32 / winmm / windowscodecs / msimg32 only, no .NET, no VC++ redist, no fonts to register, no admin rights.
  • Bahnschrift is used for the printed legends when present, otherwise Segoe UI. The digits themselves are embedded vector outlines, so they never depend on an installed font.
  • Large-address-aware: a very large panel is sampled at 5×, which is tens of megabytes of surface. If an allocation still fails, the panel drops to 1× sampling and finally to plain client-size blits rather than flashing black.

Offline

No sockets, no shares, no shell extensions, no startup entry, no keyboard hooks. The panel is a non-activating layered window, so it never steals focus from what you are presenting, and after five seconds without input its background dims by about 7% so it stops fighting the slide deck. The diagnostic log exists only in memory and is yours to read, copy or ignore.

Rebuild

sh build.sh          # Linux: i686-w64-mingw32-g++ + windres → ClockTimer.exe, plugins/mute.exe

In Windows, run build-msvc.cmd from an x86 Native Tools Command Prompt for VS 2019/2022. Both scripts build plugins/mute.exe first, compile with -Wall -Wextra -Werror (/W4), link /LARGEADDRESSAWARE, and target Windows 7 subsystem 6.01. The artwork is embedded through src/resources.rc, so the assets folder is needed to build but not to run.

Regenerating the artwork

pip install -r requirements.txt     # Pillow, fonttools, CairoSVG
python3 make_assets.py              # rewrites src/ui_layout.h and every sprite in assets/
python3 make_preview.py             # renders docs/hero.png from the same drawing

assets/panel-editable-text.svg is the master drawing — renumbered labels, reworked legends, the ⇄ key: everything is one crop away. make_assets.py builds it, then crops the state sprites out of it (so a lit key and its bezel can never drift apart), and chains make_transition_assets.py, which recolours the same lenses amber for the "still waiting" state. src/ui_layout.h and the geometry in the SVG come from one file, ui_layout.py, so the native code and the artwork cannot disagree. The digits in src/embedded_font.inc are generated from assets/numerals/*.svg (with assets/fonts/DejaVuSans*.ttf for the Latin and Cyrillic legends) by vector_font.py; assets/DejaVu-LICENSE.txt covers them.

Files

build.sh, build-msvc.cmd          two build routes, same flags
src/main.cpp                      window classes, panel layout, click routing
src/*.inc, src/*.h                audio, overlays, fullscreen, panel art, cache, INI, settings
src/resources.rc                  what gets embedded: 1× BMP, 3× PNG, the WAV, the manifest
assets/*.bmp, *-3x.png            the embedded artwork (generated — do not hand-edit)
assets/panel-editable-text.svg    the master drawing
assets/numerals/*.svg             digit outlines used to generate the embedded font
make_assets.py, make_transition_assets.py, ui_layout.py, vector_font.py, make_preview.py
plugins/mute.cpp                  the ★2 helper, ~40 KB of COM
ClockTimer-defaults.ini           every key, with the defaults
docs/hero.png                     the picture at the top of this page
LICENSE, README.md, CHANGES.md    legal, this page, what changed

Credits

Drawn, coded and documented by Covelight. Digit shapes follow the DejaVu Sans outlines (assets/DejaVu-LICENSE.txt, free to use and to embed). plugins/mute.cpp uses nothing but the Windows Core Audio interfaces shipped with the OS.

Licence

MIT — see LICENSE. Short version: use it, change it, ship it, as long as the copyright line and the licence text come along.

Made by Covelight · Covelight's Workshop

About

Портативные часы и таймер для Windows x86: панель управления, цифры поверх окон на выбранных мониторах, полноэкранный режим и широкие настройки. //// Portable clock and timer for Windows x86: control panel, digital overlay windows on selected monitors, full-screen mode, and extensive settings.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages