Nothing Special   »   [go: up one dir, main page]

Skip to content

A xsecurelock screensaver module that can run game of life.

Notifications You must be signed in to change notification settings

rmb122/xsecurelock-saver-game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xsecurelock-saver-game-of-life

A xsecurelock screensaver module that can run game of life.

output.mp4

Usage

Clone this repository and run cargo build --release to get compiled bianry.
Add export XSECURELOCK_SAVER="${PATH_OF_COMPILED_BINARY}" to your lock script.

#!/bin/sh
# omit other settings ... 

export XSECURELOCK_SAVER="${PATH_OF_COMPILED_BINARY}"
xsecurelock

Settings

The module also have some options can be passed by environment variables.

env name default value meaning
CGOL_CELL_SIZE 5 How many pixel per cell have. Smaller size allows more cells to be displayed on the screen.
CGOL_INIT_ALIVE_PROBABILITY 0.2 Initialize cells by random, this value will be the alive probability of cell.
CGOL_INIT_RLE_FILE Use RLE file to initialize cells, this setting will override CGOL_INIT_ALIVE_PROBABILITY.
CGOL_MUTATION_ROUND_INTERVAL 0 How many rounds between mutations, if it is equals zero, the mutation will never be triggered. The mutation will randomly flip the cell's status, letting the game won't be stuck in a repeating loop.
CGOL_MUTATION_PROBABILITY 0.001 The probability of cell mutation.
CGOL_ROUND_SLEEP_TIME 0.1 Sleep time between rounds.

RLE

The default position of pattern is the top-left corner. You can use base_x and base_y to adjust the position of pattern.
e.g. x = 19, y = 10, rule = b3/s23, base_x = 10, base_y = 20, will move pattern 10 cells to the right and move pattern 20 cells down.

You can also change the base coordinate by using center. e.g. x = 19, y = 10, rule = b3/s23, base_x = 1, base_y = 0, center = true.
Now the base_x / base_y's movement are based on the center point of monitor.

About

A xsecurelock screensaver module that can run game of life.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages