https://github.com/chazeon/my-bitbar-scripts
My BitBar scripts.
https://github.com/chazeon/my-bitbar-scripts
bitbar bitbar-plugin bitbar-plugins hpc macos-status ncov ncov-2019 ncov-data-visual slurm squeue
Last synced: 3 months ago
JSON representation
My BitBar scripts.
- Host: GitHub
- URL: https://github.com/chazeon/my-bitbar-scripts
- Owner: chazeon
- License: mit
- Created: 2020-02-12T05:09:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-12T06:26:08.000Z (over 5 years ago)
- Last Synced: 2025-01-28T05:11:13.163Z (4 months ago)
- Topics: bitbar, bitbar-plugin, bitbar-plugins, hpc, macos-status, ncov, ncov-2019, ncov-data-visual, slurm, squeue
- Language: Python
- Homepage: https://github.com/chazeon/my-bitbar-scripts
- Size: 1.06 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# My BitBar Scripts
Here are my Python scripts and a library for [BitBar][bitbar-home].
## Usage
Create a soft link from `scripts` to enabled
```bash
ln -s scripts/XXX.py enabled/XXX.??m.py
```
or just copy it there.## The Library
The [`libs/bitbar.py`](/libs/bitbar.py) automates the generation of output.
Simply create a `BitBarMessagePack` and `append()` any message to it, attributes like color, font or href is attached as a `dict`.
### Examples
Further examples refer to published scripts.
#### Multi-line plugin with extra data
```bash
#!/bin/bash
echo "One"
echo "Two"
echo "Three"
echo "---"
echo "Four"
echo "Five"
echo "Six"
```
equals
```python
pkg = BitBarMessagePack("One\nTwo\nThree")
echo "---"
pkg.append("Four")
pkg.append(Five")
pkg.append("Six")
```## Scripts
### [📺 Slurm Queue](/scripts/squeue.py)
List [Slurm][slurm] queue on a HPC.
#### Requires
[`fabric`][fabfile]
#### Edit
```python
user = "USER"
server = "example.com"
prefix = ""
```[fabfile]: http://www.fabfile.org
[slurm]: https://slurm.schedmd.com/squeue.html### [🦠 nCov-2019 Statistics in NYC](/scripts/nCov-2019-NYC.py)
Data from [NYCHealth-ncov].
[NYCHealth-ncov]: https://www1.nyc.gov/site/doh/health/health-topics/coronavirus.page
### [😷 nCov-2019 Statistics in China](/scripts/nCov-2019-CHN.py)
数据来源[丁香园][dxy-ncov]。
[dxy-ncov]: https://ncov.dxy.cn/ncovh5/view/pneumonia
[bitbar-home]: https://getbitbar.com
[bitbar-github]: https://github.com/matryer/bitbar