• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    C
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A flip clock screensaver supported by SDL2.

FlipClock

A flip clock screensaver supported by SDL2.

Project Website

Screenshot

Notice

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.

Installation

Distribution Package (Recommended)

Arch Linux

Install From AUR

You can get PKGBUILD from FlipClock's AUR page and build it manually, or use some AUR helpers.

$ paru flipclock

Install From archlinuxcn Repo

First add archlinuxcn repo to your system, then use pacman to install it.

# pacman -S flipclock

Flatpak

FlipClock is also available as Flatpak on Flathub, you can get it from FlipClock's Flathub page, or using flatpak CLI tool.

# flatpak install flathub one.alynx.FlipClock && flatpak run one.alynx.FlipClock

Other Linux Distributions

Please help package FlipClock to your distribution!

Windows

Just download file with win in its name from release page, extract it and right click flipclock.scr to install it as a screensaver. Please note I may not have time to build every version for Windows, just pick the latest available one.

Build From Source

Linux

With Meson (Recommended)

  1. Install a C compiler, Meson, Ninja, libc, libm, SDL2 and SDL2_ttf.
  2. mkdir build && cd build && meson setup . .. && meson compile
  3. ./flipclock -f ../dists/flipclock.ttf
  4. 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.

Windows

NOTICE: I saw a windows user says "This program has dlls in its folder so it's not simple!" and I got angry. Anyone who knows something about compiling, linking and loading won't complain. It might be quite hard for some Windows users to understand how complicated building static libraries is and what dynamically libraries are. Windows is a horrible platform for developers: no package manager for easy distribution, slowly visual studio, complicated tool chains. But thanks to Meson which handles all dirty things for me, it's SDL2 wrap works now and I managed to tweak it to build a static linked program automatically if no pre-built dependency found.

With Meson (Recommended)

  1. Install Meson, Ninja, Visual Studio.
  2. Create a prefix directory, for example d:/flipclock-prefix, program files will be installed into it.
  3. Open x64 Native Tools Command Prompt for VS 2019 from Start Menu, or other architectures you need.
  4. Change dir to where you put this project. Run mkdir build && cd build && meson setup --prefix=d:/flipclock-prefix --buildtype=release . .. && meson compile && meson install. You can change prefix argument to other path you created in Step 2, but you need to use UNIX style slash instead of backslash because it's escape character in C.
  5. Go to flipclock dir under your prefix directory, you can now find flipclock.scr and right click it to install it as a screensaver.

Android

See flipclock-android. It may be obsolete because I don't have enough time to update the Android wrapper.

Configuration

On Linux, program will first use $XDG_CONFIG_HOME/flipclock.conf, if XDG_CONFIG_HOME is not set or file does not exist, it will use $HOME/.config/flipclock.conf. If per-user configuration file does not exist, it will use /etc/flipclock.conf or flipclock.conf under sysconfdir you choosed while building.

On Windows, program will use flipclock.conf under the same directory as program.

flipclock.conf should be installed with the binary by Meson.

Contribution

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 long URL, it's fine), don't use // for block comment.
  • You can use all C11 features freely.
  • Try to use C standard functions first, until you are implementing some platform-dependent features that libc does not support. Do use preprocessor (_WIN32, __ANDROID__ and __linux__) for platform-dependent code. (Note: Android will also define __linux__, so if you are targeting traditional Linux distributions, please use defined(__linux__) && !defined(__ANDROID__).)
  • Use RETURN_IF_FAIL(EXPR) or RETURN_VAL_IF_FAIL(EXPR, VAL) from flipclock.h to check arguments for newly added functions.
  • Try not to pull new dependencies 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 run clang-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 need i 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.

License

Apache-2.0

More Repositories

1

gnome-shell-extension-inotch

Add a useless notch to your screen.
JavaScript
942
star
2

showmethekey

Show keys you typed on screen.
C
284
star
3

hexo-theme-aria

A Hexo theme inspired by Kalafina's song ARIA.
HTML
153
star
4

alynx-live-wallpaper

An android app that allows you choose a video as wallpaper.
Java
91
star
5

flipclock-android

The Android wrapper of FlipClock.
C
89
star
6

Harmonica

Sheets of Harmonica Music
CoffeeScript
40
star
7

gnome-shell-extension-net-speed

Show current net speed on panel.
JavaScript
34
star
8

hikaru-theme-aria

A Hikaru theme inspired by Kalafina's song ARIA.
Nunjucks
21
star
9

hikaru

A static site generator that generates routes based on directories naturally.
JavaScript
18
star
10

hikaru-coffee

A static site generator that generates routes based on directories naturally.
CoffeeScript
14
star
11

alynx-rime-config

12
star
12

azpiano-react

JavaScript
10
star
13

gnome-shell-extension-sb-counter

A counter to count how many times you are interrupted by SBs.
JavaScript
10
star
14

gnome-shell-extension-always-show-workspace-thumbnails

Always show workspace thumbnails even there is only one workspace.
JavaScript
9
star
15

AlynxZhou.github.io

喵's Homepage
HTML
7
star
16

atom-code-music

Play music notes like a piano while coding in Atom.
CoffeeScript
7
star
17

gnome-shell-extension-fixed-ime-list

Make the IME list in fixed sequence instead of MRU.
JavaScript
7
star
18

alynx-zsh-config

Alynx's zsh configuration files.
Shell
6
star
19

alynx-emacs-config

Alynx's Emacs configurations.
Emacs Lisp
5
star
20

rpi-lcd

JavaScript
5
star
21

hexo-renderer-nunjucks

Yet another Nunjucks renderer for Hexo.
JavaScript
5
star
22

azsh

A TOY shell for operating system homework.
C
4
star
23

azgallery

A static gallery website.
JavaScript
4
star
24

coffee-danmaku-server

Danmaku server based on Fastify. Written in CoffeeScript.
CSS
4
star
25

wakana

A Wayland compositer implemention.
C
3
star
26

azbot-telegram

Alynx Zhou's zero-dependency Telegram Bot API implemention.
JavaScript
3
star
27

coffee-telegram-bot

A Telegram Bot framework, written in CoffeeScript.
CoffeeScript
3
star
28

azpiano

AZPiano in vanilla JavaScript.
JavaScript
3
star
29

stackharbor

喵's StackHarbor
C
3
star
30

kouichi100

JavaScript
3
star
31

telebot

Telegram Bot Starter Kit.
Python
3
star
32

vala-danmaku-client

A danmaku client on desktop, written in Vala and using GTK+, Cairo.
Vala
2
star
33

railgun.ismyonly.one

某科学的标志生成器
HTML
2
star
34

azrotate

A quick panel button to rotate screen manually.
Java
2
star
35

image-collector-bot

An image collector Telegram bot.
JavaScript
2
star
36

Lab7-elevator

A very silly elevator, using SDL2.
C
1
star
37

mvmath

A simple C implemention of some GLM Matrix and Vector Math functions.
C
1
star
38

gles-loaders

C
1
star
39

atom-counter

A counter for the joke created by AlynxZhou.
CoffeeScript
1
star
40

music.ismyonly.one

JavaScript
1
star
41

namefight

Python
1
star
42

azbutton-pico

A pico-based, single-button USB HID keyboard firmware.
C
1
star
43

GNOMEWallpaperChanger

GNOME Wallpaper Auto Changer
Vala
1
star
44

snakejs

A snake game written in CoffeeScript.
CoffeeScript
1
star
45

hexo-theme-mirror

A hexo theme for creating a mirror's website, used by http://mirror.bjtu.edu.cn/.
CSS
1
star
46

AlynxZhou

A boring GitHub feature because I already have my own website.
1
star