{"id":19975883,"url":"https://github.com/jfjlaros/status","last_synced_at":"2026-06-13T09:33:13.560Z","repository":{"id":80229670,"uuid":"79737212","full_name":"jfjlaros/status","owner":"jfjlaros","description":"Status scripts for i3blocks.","archived":false,"fork":false,"pushed_at":"2021-10-22T12:44:05.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T18:47:08.919Z","etag":null,"topics":["bar","i3","i3blocks","status"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jfjlaros.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-22T18:43:38.000Z","updated_at":"2021-10-22T12:44:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bda9f2f-8436-4761-9ef4-4e816778da94","html_url":"https://github.com/jfjlaros/status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jfjlaros/status","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfjlaros%2Fstatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfjlaros%2Fstatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfjlaros%2Fstatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfjlaros%2Fstatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jfjlaros","download_url":"https://codeload.github.com/jfjlaros/status/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jfjlaros%2Fstatus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34279898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bar","i3","i3blocks","status"],"created_at":"2024-11-13T03:20:48.947Z","updated_at":"2026-06-13T09:33:13.543Z","avatar_url":"https://github.com/jfjlaros.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Status scripts for i3blocks\nVarious status monitoring scrips using a common library.\n\n## Installation\nMake sure to install [Font Awesome](http://fontawesome.io/) for the icons to\nrender correctly.\n\nGet the repository (as root) and install it in the i3blocks directory.\n\n    git clone git://github.com/jfjlaros/status.git /usr/share/i3blocks/status\n\nTo configure your i3blocks behaviour, edit `~/.config/i3blocks/config`. Please\nhave a look at this [sample configuration file](i3blocks_config.sample). The\nresult will look something like this:\n\n![status bar](bar.png)\n\n## API\nTo use the library, simply source the library file from your script.\n\n```bash\n. \"/usr/share/i3blocks/status/lib/status.bash\"\n```\n\nThis imports a number of functions and a wrapper function `format_info`.\n\n### Functions\nThe `scale` function is used to convert a value, given a minimum and a maximum,\nto a percentage. For example, to convert the value 120 in the range 40 to 1000,\nto a percentage:\n\n```bash\n$ scale 120 40 1000\n8\n```\n\nThe `pick_colour` function is used to convert a percentage to an RGB value\nranging from green to red. For example:\n\n```bash\n$ pick_colour 35\n#b2ff00\n```\n\nThe `pick_icon` function is used to convert a percentage to an icon. For\nexample:\n\n```bash\n$ pick_icon 21 ABCDE\nB\n```\n\nThe `set_timer` function records the current time. This can later be used to\nsee how much time has passed.\n\n```bash\n$ set_timer\n$ cat /run/user/${UID}/i3/bash_timer.dat\n1485202697\n```\n\nThe `get_timer` function checks whether a certain amount of time has passed. It\nreturns 1 if the timer is still running, otherwise it will remove the recorded\ntime and return 0.\n\n```bash\n$ set_timer\n$ if get_timer 5; then echo not done yet; fi\nnot done yet\n$ sleep 6\n$ if get_timer 5; then echo not done yet; fi\n```\n\nThe `key_command` function execute a command when a button is pressed, e.g.,\n```bash\n$ BLOCK_BUTTON=\"3\"\n$ key_command 3 set_timer\n$ cat /run/user/${UID}/i3/bash_timer.dat\n1485626146\n```\n\nThe `key_launch` function launches or kills an application when a button is\npressed. The following example will launch `wicd-client -n`, or, if the\napplication is already running, will kill the running instance.\n```bash\n$ BLOCK_BUTTON=\"1\"\n$ key_command 1 wicd-client -n\n```\n\nthe `parse_args` function assigns each word in the `BLOCK_INSTANCE` variable to\na variable.\n```bash\n$ BLOCK_INSTANCE=\"10 wlan0\"\n$ parse_args 10 dev\n$ echo ${dev}\nwlan0\n```\n\n### Wrapper function\nFinally, the wrapper function named `format_info` will pick a colour and an\nicon based on a value and it will echo some additional info back. For simple\nstatus scripts, this function is probably all that is needed. A simple example\nwill look like this:\n\n```bash\n$ format_info ABCDE 21 \"status text\"\nB status text\n\n#6bff00\n```\n\nThis function also accepts the following optional arguments:\n\n- `invert` (default false) inverts the colour.\n- `minimum` (default 0) and `maximum` (default 100) for converting to a\n  percentage.\n\nA more complicated example, where we want to show a value between 10 and 30 and\nwe want the colour to go from red to green:\n\n```bash\n$ format_info ABCDE 21 \"status text\" true 10 30\nC status text\n\n#e5ff00\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfjlaros%2Fstatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjfjlaros%2Fstatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjfjlaros%2Fstatus/lists"}