A Powerline segment shows the time tracked in watson.
Project description
POWERLINE WATSON
A Powerline segment shows the time tracked in watson.
Installation
Using pip
pip install powerline-watson
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_swissarmyknife.execute",
"priority": 30,
"args": {
"commandLine": "ps aux --no-headers | wc -l",
"postContent": "⚙️"
}
},
Show the number of processes running in your system.
Arguments
- commandLine (string): The command line to execute, it can be complex (with pipes) (remember python3 runs as /bin/sh, not bash).
- line (string): The string to format the content of segment.
- Default: "{preContent}{output}{err}{postContent}"
- preContent (string): The string to show before the result.
- Default: ""
- postContent (string): The string to show after the result.
- Default: "🤖"
- successCodes (list(int) or None): The values are success code return (normally 0), the background change to critical success.
- Default: None
- failureCodes (list(int) or None): The values are fail code return, the background change to critical failture.
- Default: None
Examples
Shows the upload and download rate and count of torrents download in Deluge.
{
"function": "powerline_swissarmyknife.execute",
"priority": 30,
"args": {
"commandLine": "deluge-console status | awk '/Total upload:/{print $3$4} /Total download:/{print $3$4} /Downloading:/{print $2\"D\"}' | tr '\n' ' '",
"postContent": "️"
}
},
Show a random pornstar from redtube api.
{
"function": "powerline_swissarmyknife.execute",
"priority": 30,
"args": {
"commandLine": "if [ -f /tmp/list.redtube.json ]; then list=$(cat /tmp/list.redtube.json); else list=$(curl 'https://api.redtube.com/?data=redtube.Stars.getStarList&output=json'); echo $list > /tmp/list.redtube.json; fi; list_length=$(echo $list | jq '.stars | length'); rand=$(echo 'ibase=16;' $(openssl rand -hex 4 | tr '[a-z]' '[A-Z]') | bc); echo $list | jq \".stars[$(echo \\\"$rand % $list_length\\\" | bc)].star.star_name\" -r",
"postContent": " 🎥"
}
},
License
Licensed under the GPL3 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
powerline_watson-1.0.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for powerline_watson-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5366acbed55bcf87ec1b7c007beec2fcecc96fdb6e2096ffb761a99890bec3dd |
|
MD5 | 179a8ead858592c6451ced60165d27a1 |
|
BLAKE2b-256 | bffc0f61559ae99e70692ae62bb99bf3099bffc322f0c9d8f80625d4640d0b61 |