Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdtrooper/powerline_dice
A toy Powerline segment. This segment shows result of a dice.
https://github.com/mdtrooper/powerline_dice
dice powerline powerline-segment toy
Last synced: about 1 month ago
JSON representation
A toy Powerline segment. This segment shows result of a dice.
- Host: GitHub
- URL: https://github.com/mdtrooper/powerline_dice
- Owner: mdtrooper
- License: gpl-3.0
- Created: 2019-11-18T22:11:43.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-19T21:55:57.000Z (almost 5 years ago)
- Last Synced: 2024-08-04T17:36:37.643Z (2 months ago)
- Topics: dice, powerline, powerline-segment, toy
- Language: Python
- Size: 161 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# POWERLINE DICE
A toy [Powerline](https://powerline.readthedocs.io/en/master/) segment. This segment shows a result of dice combination.
By [Miguel de Dios Matias](https://github.com/mdtrooper).
## 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`:```json
{
"function": "powerline_dice.roll",
"priority": 90
}
```By default shows a roll of d6 (dice of six faces).
![screenshot roll six faces](https://raw.githubusercontent.com/mdtrooper/powerline_dice/master/powerline_dice_six.jpg "screenshot roll six faces")
### Arguments
* **diceCombination (string)**: The combination of dices in [dice notation format](https://github.com/borntyping/python-dice#notation) or [wikipedia: Dice notation](https://en.wikipedia.org/wiki/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.
```json
{
"function": "powerline_dice.roll",
"priority": 30,
"args": {
"diceCombination": "2d20",
"critical": 30,
"fumble": 15
}
},
```![screenshot roll d20 critical and fumble](https://raw.githubusercontent.com/mdtrooper/powerline_dice/master/powerline_dice_critical.jpg "screenshot roll d20 critical and fumble")
Flip a coin with the tail đ and head ī¸âšī¸.
```json
{
"function": "powerline_dice.roll",
"priority": 30,
"args": {
"diceCombination": "d2",
"facesDice": ["đ", "âšī¸"],
"postContent": ""
}
},
```![screenshot flip a coin](https://raw.githubusercontent.com/mdtrooper/powerline_dice/master/powerline_flip_coin.jpg "screenshot flip a coin")
## Thanks
* [Python Dice](https://github.com/borntyping/python-dice): for great library to parse dice combination.
## License
Licensed under [the GPL3 License](https://github.com/mdtrooper/powerline_slotmachine/blob/master/LICENSE).