I added multi-display support to this program, but adding/removing monitors while program is running is not supported, and you should not do this.
If you run this program in windowed mode (-w
), only one display is supported. Multi-display is only supported in fullscreen mode.
- Arch Linux: You can install from AUR.
- Install sdl2, sdl2_ttf.
mkdir build && cd build && meson setup . .. && meson compile
./flipclock -f ../dists/flipclock.ttf
- If you want to install this to your system, it is suggested to build with
mkdir build && cd build && meson setup --prefix=/usr --buildtype=release . .. && meson compile && sudo meson install
.
- Install sdl2, sdl2_ttf.
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug .. && make
./flipclock -f ../dists/flipclock.ttf
- If you want to install this to your system, it is suggested to build with
mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make && sudo make install
.
Just download file with win
in its name from lastest release page, extract it and right click flipclock.scr
to install it as a screensaver.
Meson has a tool called wrap that can download and compile dependencies automatically on Windows, but SDL2 is always failed to build. So I cannot make a static linked program.
- Install Meson, Ninja, Visual Studio.
- Download SDL2 and SDL2_ttf devel files and extract and rename. Please refer to
deps/README.md
for links. - Open
x64 Native Tools Command Prompt for VS 2019
from Start Menu, or other architectures you need. - Change dir to where you put this project. Run
mkdir build && cd build && meson setup --prefix=d:/ --buildtype=release . .. && meson compile && meson install
. You can change prefix to other path, but you need to use UNIX style slash instead of backslash because it's escape character in C. - Go to
flipclock
dir under your prefix, you can now findflipclock.scr
and right click it to install it as a screensaver.
- Install CMake, Visual Studio.
- Download SDL2 and SDL2_ttf devel files and extract. Please refer to
deps/README.md
for links. - Open CMake GUI, select source as this project, then choose build path, press Configure and Finish.
- When Configure failed, set
CMAKE_INSTALL_PREFIX
to where you want to save all runtime files, fillSDL2_DIR
to where you extract SDL2 devel files, then press Configure again. When Configure failed again, fillSDL2_TTF_DIR
to where you extract SDL2_ttf devel files, then press Configure again. - When Configure finished, press Generate, then press Open Project to open Visual Studio.
- Select
Release
, and right clickINSTALL
in the right panel, and build it. - Go to
flipclock
dir under yourCMAKE_INSTALL_PREFIX
, you can now findflipclock.scr
and right click it to install it as a screensaver.
See flipclock-android.
On Linux, program will first use $XDG_CONFIG_HOME/flipclock.conf
, if XDG_CONFIG_HOME
is not set, it will use $HOME/.config/flipclock.conf
.
On Windows, program will use flipclock.conf
under the same directory as program.
flipclock.conf
will be automatically created if program does not find it, so please run program once before editing configuration file.
If you want some features and you can implement it, a PR is always welcome, but there are some rules or personal habits:
- If you are writing multi-line comment, please use the same style with existing comments. Comments should always occupy a new line. If your comment is longer than Column 80, break it into block comment with
/* */
(but don't break lone URL, it's fine), don't use//
for block comment. - You can use all C11 features freely.
- Try to use C standard functions only and first, until you are implementing some platform-dependent features that libc does not support. Do use preprocessor (
_WIN32
,__ANDROID__
,__linux__
) for platform-dependent code. - Try not to pull new dependency into project other than SDL2 and SDL2_ttf, it's too brain damage to add dependency when building on Windows, building on this platform is a disaster and packaging on this platform is a mistery.
- When you are coding please use Linux kernel coding style. There is a
.clang-format
for this project, please runclang-format
yourself before committing something. It will keep most coding style consistent. - There are still some coding style
clang-format
cannot change, please keep the same as existing code. For example, add period for all comments and printed text, add\n
yourself for logging. - Prefer to
++i
, except when you really needi
before increasement. - I prefer to write commit message in past tense, capitalize the first character and add period. For example "Added new feature.", "Updated README.md.".
- If you added new options to configuration file and you are able to write Chinese, please also update
dists/请先读我.txt
. This file is a README for Chinese Windows users and should use GB2312 as encoding and CRLF as return.