xmobet

Crates.ioxmobet
lib.rsxmobet
version0.1.3
sourcesrc
created_at2023-02-12 14:14:31.013068
updated_at2023-03-07 16:15:09.411246
descriptionSlot machine for xmobar
homepage
repositoryhttps://github.com/impossibletea/xmobet
max_upload_size
id783171
size19,411
(impossibletea)

documentation

README

Xmobet

Slot machine simulator designed for use in menubars. Originally intended for xmobar, hence the name.

Installation

cargo install xmobet

Or like everything else with git:

git clone https://github.com/impossibletea/xmobet.git
cd xmobet
cargo install --path .

Usage

Getting your bar to recognize it

Xmobar:

Config
  { template = "}<action=`killall -SIGCONT xmobet` button=1><action=`killall -SIGUSR1 xmobet` button=4><action=`killall -SIGUSR2 xmobet` button=5><action=`killall -SIGINT xmobet` button=3>%xmobet%</action></action></action></action>{"
  , commands = 
    [ Run CommandReader "~/.cargo/bin/xmobet" "xmobet"
    ]
  }

For other bars you'll have to figure it out yourself.

Actual usage

Since it is made for bars rather than stdin, it makes use of signals.

SIGCONT: Roll the slots, get money for combinations.

SIGUSR{1,2}: Increase or decrease bet.

SIGINT: Show current balance.

Configuration

Default config on linux is ~/.config/xmobet/config.toml. Structure (with default values) is as follows:

drums = 5
symbols = '7JQKA'
init_balance = 100
init_bet = 5
bet_inc = 1
Commit count: 21

cargo fmt