Skip to main content

A toy Powerline segment. This segment shows a result of dice combination.

Project description

POWERLINE DICE

A toy Powerline segment. This segment shows a result of dice combination.

By Miguel de Dios Matias.

Installation

Using pip

pip install powerline-dice

Configuration

You can activate the Powerline Slotmachine segment by adding it to your segment configuration, for example in .config/powerline/themes/shell/default.json:

{
    "function": "powerline_dice.roll",
    "priority": 90
}

By default shows a roll of d6 (dice of six faces).

screenshot roll six faces

Arguments

  • diceCombination (string): The combination of dices in dice notation format or wikipedia: Dice notation.
    • Default: "d6"
  • preContent (string): The string to show before the result.
    • Default: ""
  • postContent (string): The string to show after the result.
    • Default: "🎲"
  • facesDice list(string) or None: The faces of dice as list of string (can be emojis).
    • Default: None
  • critical int or list(int) or None: The minimum or exact values to critical hit, the background change to critical success.
    • Default: None
  • fumble int or list(int) or None: The maximum or exact values to critical fumble, the background change to critical failture.
    • Default: None

Examples

Rolls two dices of twenty faces and get critical hit with 40 and critical fumble with 1.

{
    "function": "powerline_dice.roll",
    "priority": 30,
    "args": {
        "diceCombination": "2d20",
        "critical": 30,
        "fumble": 15
    }
},

screenshot roll d20 critical and fumble

Flip a coin with the tail 🙂 and head ️☹️.

{
    "function": "powerline_dice.roll",
    "priority": 30,
    "args": {
        "diceCombination": "d2",
        "facesDice": ["🙂", "☹️"],
        "postContent": ""
    }
},

screenshot flip a coin

Thanks

  • Python Dice: for great library to parse dice combination.

License

Licensed under the GPL3 License.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for powerline-dice, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size powerline_dice-1.0.0-py2-none-any.whl (16.5 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size powerline_dice-1.0.0.tar.gz (3.3 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page