{"id":20571813,"url":"https://github.com/usrme/powerline-tailscale","last_synced_at":"2026-04-20T15:03:13.965Z","repository":{"id":196184316,"uuid":"693483099","full_name":"usrme/powerline-tailscale","owner":"usrme","description":"A Powerline segment for showing the status of Tailscale :zap:","archived":false,"fork":false,"pushed_at":"2023-09-29T18:00:59.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T21:59:11.369Z","etag":null,"topics":["powerline","powerline-segment","python","tailscale"],"latest_commit_sha":null,"homepage":"","language":"Python","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/usrme.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}},"created_at":"2023-09-19T05:51:01.000Z","updated_at":"2023-09-22T09:07:03.000Z","dependencies_parsed_at":"2023-09-22T15:22:28.628Z","dependency_job_id":null,"html_url":"https://github.com/usrme/powerline-tailscale","commit_stats":null,"previous_names":["usrme/powerline-tailscale"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrme%2Fpowerline-tailscale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrme%2Fpowerline-tailscale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrme%2Fpowerline-tailscale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usrme%2Fpowerline-tailscale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usrme","download_url":"https://codeload.github.com/usrme/powerline-tailscale/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242187807,"owners_count":20086224,"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":["powerline","powerline-segment","python","tailscale"],"created_at":"2024-11-16T05:17:22.904Z","updated_at":"2026-04-20T15:03:08.908Z","avatar_url":"https://github.com/usrme.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Powerline Tailscale\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eA Powerline segment for showing the status of Tailscale\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/powerline-tailscale\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/powerline-tailscale?color=%2334D058\u0026label=pypi%20package\" alt=\"Package version\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/powerline-tailscale\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/pyversions/powerline-tailscale.svg?color=%2334D058\" alt=\"Supported Python versions\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n![Powerline Tailscale - animated GIF demo](examples/demo.gif)\n\nSince Tailscale doesn't (seemingly) have a configuration file where it reads and stores state, this segment implementation relies on the `tailscaled` API server. I haven't found any official documentation regarding it, but its capabilities are available [here](https://github.com/tailscale/tailscale/blob/c08cf2a9c6209e4fdef896921af66bbe737b8a24/ipn/localapi/localapi.go). There exists a Python library to interact with this API in limited form called ['tailscale-localapi'](https://github.com/apognu/tailscale-localapi), though I decided against using it because I didn't want to introduce any Python-specific dependencies; this is something I may reconsider in the future keeping in mind that the current implementation relies on `curl` instead.\n\n## Requirements\n\nBesides having Tailscale installed according to the [official documentation](https://tailscale.com/kb/installation/), it is also necessary to install `curl` at either 7.40.0 or above, which is when the `--unix-socket` flag was introduced. You can check your version of `curl` with the `--version` flag:\n\n```console\n$ curl --version\ncurl 7.85.0 (x86_64-redhat-linux-gnu) libcurl/7.85.0 OpenSSL/3.0.9 zlib/1.2.12 brotli/1.0.9 libidn2/2.3.4 libpsl/0.21.1 (+libidn2/2.3.3) libssh/0.10.5/openssl/zlib nghttp2/1.51.0\nRelease-Date: 2022-08-31\nProtocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp \nFeatures: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL threadsafe TLS-SRP UnixSockets\n```\n\nIf `curl` or Tailscale isn't installed or `tailscaled` isn't running, then installing and configuring this segment will have no effect.\n\n## Installation\n\nUsing Pip:\n\n```bash\npip install powerline-tailscale\n```\n\n## Configuration\n\nOnly three highlight groups are necessary to be defined in order for `powerline-tailscale` to work. These can be set up in `~/.config/powerline/colorschemes/default.json`. You are free to choose any colors you want.\n\n```json\n{\n  \"name\": \"Default\",\n    \"groups\": {\n      \"tailscale\":                 { \"fg\": \"white\", \"bg\": \"gray2\",\"attrs\": [] },\n      \"tailscale_exitnode\":        { \"fg\": \"white\", \"bg\": \"steelblue\",\"attrs\": [] },\n      \"tailscale:divider\":         { \"fg\": \"white\", \"bg\": \"steelblue\", \"attrs\": [] }\n    }\n}\n```\n\nAfter that, add the segment's configuration by modifying the relevant Powerline theme. If you are using the default, then in `~/.config/powerline/themes/shell/default.json`:\n\n```json\n{\n  \"function\": \"powerline_tailscale.tailscale\",\n    \"args\": {\n      \"show_profile_name\": true,\n      \"show_exit_node_status\": false,\n      \"show_exit_node\": true\n  }\n}\n```\n\nNow, just reload Powerline using `powerline-daemon --replace`.\n\n### Options\n\n* `show_profile_name` shows either:\n  * \"logged out\" if `tailscaled` is running, but no account is logged in;\n  * \"default\" if no profile is created, i.e. the log-in hasn't been done with `tailscale login --nickname=\u003cname\u003e`;\n  * or the name of the profile itself;\n* `show_exit_node_status` shows a boolean \"exit node (y)\" or \"exit node (n)\" depending on whether connected to an exit node through `tailscale up --exit-node=\"\u003cIP\u003e\"`\n* `show_exit_node` shows the actual IP address of the exit node as given to `tailscale up --exit-node=\"\u003cIP\u003e\"`\n  * the `show_exit_node_status` option needs to be set to `false` when this option is set to `true`\n  * if not connected to an exit node, then \"exit node (n)\" is shown\n\n### Disabling\n\nBy default the segment will always be displayed, but you may wish to toggle it instead. This can be done through a Bash function, which unsets or sets an environment variable that the segment reads:\n\n```bash\nfunction plts() {\n  if [[ $POWERLINE_TAILSCALE = \"0\" ]]; then\n    unset POWERLINE_TAILSCALE\n  else\n    export POWERLINE_TAILSCALE=0\n  fi\n}\n```\n\nYou can add this function to your `~/.bashrc` file, source it using `source ~/.bashrc`, and then toggle the segment using `plts` or whatever you chose for the name of the function. This function name can also be Tab-completed.\n\nIf you want to start your shell sessions _without_ having this segment, then add `export POWERLINE_TAILSCALE=\"0\"` somewhere in `~/.bashrc`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusrme%2Fpowerline-tailscale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusrme%2Fpowerline-tailscale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusrme%2Fpowerline-tailscale/lists"}