{"id":13610785,"url":"https://github.com/UtkarshVerma/i3blocklets","last_synced_at":"2025-04-13T01:32:48.943Z","repository":{"id":117786743,"uuid":"134019270","full_name":"UtkarshVerma/i3blocklets","owner":"UtkarshVerma","description":":pushpin: Custom scripts for i3blocks written in bash.","archived":false,"fork":false,"pushed_at":"2020-04-22T01:28:34.000Z","size":83,"stargazers_count":15,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T17:45:24.589Z","etag":null,"topics":["gmail-checker","i3","i3bar","i3blocklets","i3blocks","i3wm","oauth2-client"],"latest_commit_sha":null,"homepage":null,"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/UtkarshVerma.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}},"created_at":"2018-05-19T01:30:11.000Z","updated_at":"2024-10-14T23:18:04.000Z","dependencies_parsed_at":"2024-01-22T00:03:10.642Z","dependency_job_id":null,"html_url":"https://github.com/UtkarshVerma/i3blocklets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtkarshVerma%2Fi3blocklets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtkarshVerma%2Fi3blocklets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtkarshVerma%2Fi3blocklets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UtkarshVerma%2Fi3blocklets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UtkarshVerma","download_url":"https://codeload.github.com/UtkarshVerma/i3blocklets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654037,"owners_count":21140236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["gmail-checker","i3","i3bar","i3blocklets","i3blocks","i3wm","oauth2-client"],"created_at":"2024-08-01T19:01:47.986Z","updated_at":"2025-04-13T01:32:48.633Z","avatar_url":"https://github.com/UtkarshVerma.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# i3blocklets\n![Demo](/scrot.png)\n\nThis repository contains the bash scripts which I use with [i3blocks](https://github.com/vivien/i3blocks).\n\n## Dependencies\nTo use these scripts, the following dependencies need to be satisfied:\n\n* **Volume Block:**\n  - pamixer - [cdemoulins/pamixer](https://github.com/cdemoulins/pamixer)\n\n* **Music Block:**\n  - playerctl - [acrisci/playerctl](https://github.com/acrisci/playerctl)\n  - ~~formatTime - [UtkarshVerma/scripts/formatTime](https://github.com/UtkarshVerma/scripts/blob/master/formatTime)~~\n\n* **Gmail Block:**\n  - jq - [stedolan/js](https://github.com/stedolan/jq)\n\n* **[FontAwesome](https://fontawesome.com/)** fonts(tested with v4.7.0) are required to render the unicode emojis, therefore specify it in i3bar config as shown:\n```\nbar {\n    # .... other stuff\n    font pango:DejaVu Sans Mono, FontAwesome 9\n}\n```\n\n## Installation\n  * Place [`example.conf`](/resources/example.conf) as `i3blocks.conf` in your i3 config directory.\n  * Replace `PATH_TO_BLOCKLETS` in the `i3blocks.conf` file with the directory's path which contains your blocklets.\n\n## Usage\n### Music Block\n```\n[music]\nlabel= 🎧\ninterval=1\ninstance=\"\"\nsignal=3\n```\nYou can also pass arguments to `playerctl` through the `instance` config variable. For example, `instance=\"-p audacious\"` will be interpreted as `playerctl -p audacious \u003crandom command\u003e`.\n\n#### The following actions can be performed via the mouse\n* Left click - Switch to the previous song;\n* Right click - Switch to the next song;\n* Middle click - Pause/play the current song.\n* Scroll up - Seek song forward by 5 seconds;\n* Scroll down - Seek song backward by 5 seconds.\n\n~~This seeking capability is only available for `audacious` currently.~~\n\nThe seeking capability has now been extended to all music players.\n\nThis script focuses only on MPRIS media players. Therefore this script won't work for `cmus`\u003c v2.8.0. You may either update `cmus` or just add a bit of code as a workaround as done in this [older commit](https://github.com/UtkarshVerma/i3blocklets/blob/77ec353d01a12539edb3a3b211dd06f275807d2d/music).\n\n---\n\n### Gmail Block\n```\n[gmail]\nlabel=📧\ninterval=1800\ninstance=.gmail\n```\nThis block will check your gmail account for mails every 1800 seconds, that is the `interval` time.\nThis blocket uses [OAuth2](https://oauth.net/2/) for authorizing itself. To use this blocklet:\n* Create a project on [Google API Console](https://console.developers.google.com/), [enable Gmail API](https://developers.google.com/identity/protocols/OAuth2InstalledApp#enable-apis) for your project, and [create authorization credentials](https://developers.google.com/identity/protocols/OAuth2InstalledApp#creatingcred) for this blocklet. Choose **Other** as *Application Type* while creating the OAuth client ID. Make sure to provide your application `read-only` access.\n* Once created, take note of the **Client ID** and **Client Secret**. These will be used later on.\n* Edit the [`configFile`](/resources/gmail/configFile) for this blocklet according to your needs and place it in the `$HOME` directory. You may rename it if you like. I personally prefer `.gmail`.\n  \u003e The `tokenFile` variable must contain the path to the file which you want to create for storing access tokens for the API.\n* Now, generate your access token using [genToken.sh](/resources/gmail/genToken.sh) by running `./genToken.sh -c \u003cconfigFile\u003e` in the terminal. For example:\n\n  ```bash\n  # Specify config file using -c flag\n  ./genToken.sh -c \u003cpath to config file\u003e\n  # Or simply use ~/.gmail as config file\n  ./genToken.sh\n  ```\n  Google's user consent webpage will open up in your default browser. Allow this application there. This will generate a JSON file at the path specified in `tokenFile` variable in `configFile`.\n\nEverything's done now. Just add the `gmail` block to your `i3blocks` config as shown above.\n\u003e Note that the `instance` variable holds the path of the config file relative to the home directory, therefore *.gmail* is implicitly expanded to *~/.gmail*. \n\n#### The following actions can be performed via the mouse\n* Left click - Open GMail in the default browser;\n* Right click - Update mail count.\n\n---\n\n### Average Load Block\n```\n[loadavg]\nlabel=\ninterval=10\nmarkup=pango\ninstance=3\n```\nShows the average load of the processor. The output is colored **red** if the *average load* exceeds the *threshold value*. The threshold value can be provided through `instance` variable, which defaults to `5`.\n\n#### The following actions can be performed via the mouse:\n* Left click- Refresh average load value.\n\n---\n\n### Storage Block\n```\n[disk]\nlabel=🗄\ninterval=3600\nmarkup=pango\ninstance=\"\"\n```\nThis block shows the remaining space on your disk. By default, the free space of `$HOME` partition will be shown, however, you may specify other partitions as well using the `instance` config variable. For exampe, `instance=\"/dev/sda2\"`.\n\n---\n\n### Volume Block\n```\n[volume]\ninterval=once\nsignal=1\n```\nThis block shows the volume level in percent. To reduce load, this script is loaded only once and then triggered on the press of **media keys** and block clicks. Therefore, it is **highly important** to bind the following command to your *volume keys* on the keyboard, otherwise the changes won't appear on the i3bar.\n```\npkill -RTMIN+1 i3blocks\n```\n#### The following actions can be performed via the mouse\n* Left click - Mute;\n* Scroll up - Increase volume by 5%;\n* Scroll down - Decrease volume by 5%.\n\n---\n\n### Internet Block\n```\n[internet]\ninterval=1800\nmarkup=pango\n```\nThis block shows whether your PC is connected to the internet or not. It relies on the `ping` command.\n\n#### The following actions can be performed via the mouse\n* Left click - Refresh internet status.\n\n---\n\nFor additional insight, you may also look into my i3blocks config file: [i3blocks.conf](https://github.com/UtkarshVerma/dotfiles/blob/master/i3/i3blocks.conf).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUtkarshVerma%2Fi3blocklets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FUtkarshVerma%2Fi3blocklets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FUtkarshVerma%2Fi3blocklets/lists"}