Skip to content

bzglve/runcat-text

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

runcat-text

Is a runcat port for Linux to place it somewhere of your bar

(Another useless cat here..)

⚠️ This was written mostly for waybar and has not yet been tested on others.

requirements

  • python
  • asyncio
  • pyjson5 (recommended)

table of contents

install/build

example

git clone ...
mkdir ~/.config/waybar/modules
cp -r runcat-text ~/.config/waybar/modules/
cd ~/.config/waybar/modules/runcat-text
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

font installation

cp -r runcat.ttf ~/.local/share/fonts
fc-cache -f

start

~/.config/waybar/config

    ...,
    "modules-right": [
        ...,
        "custom/runcat",
        ...,
    ],
    ...,
    "custom/runcat": {
        "exec": "~/.config/waybar/modules/runcat-text/main.py",
        "return-type": "json"
    },
    ...,

configuration

Here is some info about waybar's config options and some that personal for the module. If you are searching for more check your bar's wiki.

~/.config/waybar/config

option typeof default description
exec string path to python script
return-type string json if you want to use waybar's CSS-classes or tooltips.
Nothing or anything if you want to use with polybar
restart-interval int The restart interval (in seconds).
Can't be used with the interval option, so only with continuous scripts.
Once the script exit, it'll be re-executed after the restart-interval.
format string {} The format, how information should be displayed. On {} data gets inserted.

module/config.json

option typeof default description
icons string
array[any]
Icons to use for animation.
I've converted original svg's to ttf-font so you don't need to (check above)
return-type string json if you want to use waybar's CSS-classes or tooltips.
Nothing or anything if you want to use with polybar
tooltip-format string Custom format for your tooltip
Valid values are: percentage
ui object Some UI setting
Check below
cpu object Some CPU setting
Check below

UI settings

option typeof default description
fps_l int 6 Minimal FPS
fps_h int 90 Maximum FPS

CPU settings

option typeof default description
interval float 1 CPU info update time
stat-file string /proc/stat Path to proc stats file.
dunno if it need somebody
states object State-classes used for styling
check

states

You can define here your custom classes to use it with waybar.

Format like {"class-name": lower-percent}

For example

    "cpu": {
        "states": {
            "high": 90,
            "medium": 40,
            "low": 10
        },
        ...,
    },
    ...

With states like that your module will gets classes like

percent class
1 default
10 low
20 low
40 medium
89 medium
90 high
100 high

styling

#custom-runcat {
    font-family: 'runcat';
    font-size: 18px;
}

#custom-runcat.low {
    font-family: 'runcat';
    color: green;
}

#custom-runcat.medium {
    font-family: 'runcat';
    color: blue;
}

#custom-runcat.high {
    font-family: 'runcat';
    color: red;
}

todo

  • MORE CATS!!!
  • test with other bars
  • check font for line-height or something
  • refactor

resources

The default resources are from internet.

motivation

Cute little kitty running anywhere in the bar and not just in the tray

Rewrite C-code to python to easily modify and distribute

plans

  • refactor and reformat
  • maybe rewrite in something like C but more user-friendly (Rust?)

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%