All Projects → liclac → ambient

liclac / ambient

Licence: Unlicense license
What can a public hotspot tell you?

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to ambient

1c http
Подсистема 1С для работы с HTTP
Stars: ✭ 48 (-15.79%)
Mutual labels:  curl
r2curl
Node.js Request Wrapper (axios, fetch, ..) to cURL Command String
Stars: ✭ 30 (-47.37%)
Mutual labels:  curl
dotfiles
My work setup
Stars: ✭ 14 (-75.44%)
Mutual labels:  fish
easyhttp
EasyHttp 是一个轻量级、语义化、对IDE友好的HTTP客户端,支持常见的HTTP请求、异步请求和并发请求,让你可以快速地使用 HTTP 请求与其他 Web 应用进行通信。
Stars: ✭ 31 (-45.61%)
Mutual labels:  curl
curl2ab
Convert cURL command line to ab (apache bench)
Stars: ✭ 22 (-61.4%)
Mutual labels:  curl
FSA
FSA (Fisheries Stock Assessment) package provides R functions to conduct typical introductory fisheries analyses.
Stars: ✭ 54 (-5.26%)
Mutual labels:  fish
textics
📉 JavaScript Text Statistics that counts lines, words, chars, and spaces.
Stars: ✭ 36 (-36.84%)
Mutual labels:  curl
CwsShareCount
PHP class to get social share count for Delicious, Facebook, Google+, Linkedin, Pinterest, Reddit, StumbleUpon and Twitter.
Stars: ✭ 13 (-77.19%)
Mutual labels:  curl
pg curl
PostgreSQL curl allows most curl actions, including data transfer with URL syntax via HTTP, HTTPS, FTP, FTPS, GOPHER, TFTP, SCP, SFTP, SMB, TELNET, DICT, LDAP, LDAPS, FILE, IMAP, SMTP, POP3, RTSP and RTMP
Stars: ✭ 30 (-47.37%)
Mutual labels:  curl
homebrew-portable-ruby
🚗 Versions of Ruby that can be installed and run from anywhere on the filesystem.
Stars: ✭ 96 (+68.42%)
Mutual labels:  curl
dotfiles
macOS / Linux / Codespaces dotfiles with 1-line setup script. Tested on Apple Silicon Macs. Supports both zsh and fish. Now managed with https://github.com/twpayne/chezmoi
Stars: ✭ 82 (+43.86%)
Mutual labels:  fish
Speedport-Plus-Cosmote-Router-hacks
Exploring the Sercomm made router of Cosmote - OTE Group (Deutsche Telekom in Greece)
Stars: ✭ 64 (+12.28%)
Mutual labels:  curl
curl
cURL command in full java. Any argument/option you need raise an issue here.
Stars: ✭ 103 (+80.7%)
Mutual labels:  curl
fish-symnav
Symbolic link navigation for Fish shell
Stars: ✭ 11 (-80.7%)
Mutual labels:  fish
fishrc
Fish shell customizations
Stars: ✭ 16 (-71.93%)
Mutual labels:  fish
fortran-curl
Fortran 2008 interface bindings to libcurl
Stars: ✭ 25 (-56.14%)
Mutual labels:  curl
FAIRY
Fast and scalable search of whole-slide images via self-supervised deep learning - Nature Biomedical Engineering
Stars: ✭ 43 (-24.56%)
Mutual labels:  fish
fishline
A powerline prompt framework for the fish-shell built in fish-shell.
Stars: ✭ 66 (+15.79%)
Mutual labels:  fish
domcurl
cUrl-like utility for fetching a resource (in this case we will run JS and return after network is idle) - great for JS heavy apps
Stars: ✭ 84 (+47.37%)
Mutual labels:  curl
gohit
Run curl commands from yaml files
Stars: ✭ 19 (-66.67%)
Mutual labels:  curl

ambient

This is a script which captures ambient information available on certain public networks, such as the route, speed and delay information available on:

  • German ICE trains
  • Eurostar
  • Austrian RailJet trains

If you spot a network with some tidbits of information available, please open a PR to add it!

Requirements

The set of dependencies is intentionally kept small:

  • fish (the shell)
  • iw (to check what network you're on)
  • jq
  • The POSIX standard tools, such as grep and sed (On macOS, you'll need to install the GNU coreutils with brew install coreutils)

Usage

If you just run ambient on its own, it'll output all the data it can find in KEY=VALUE format, such that it can be given to env.

As a convenience, running eg. ambient myscript.py will run the given command with all of this data in the environment.

Example output (abbreviated):

$ ./ambient
AMBIENT_DE_ICE_SPEED=158
AMBIENT_DE_ICE_SPEED_UNIT=km/h
AMBIENT_DE_ICE_TZN=Tz4652
AMBIENT_DE_ICE_SERIES=406
AMBIENT_DE_ICE_WAGON_CLASS=SECOND
AMBIENT_DE_ICE_TRAIN_TYPE=ICE
AMBIENT_DE_ICE_TRIP_DATE=2020-01-02
AMBIENT_DE_ICE_VZN=14
AMBIENT_DE_ICE_STOP_FIRST=Frankfurt (Main) Hbf
AMBIENT_DE_ICE_STOP_FIRST_DEPART_SCHEDULED=2020-01-02T13:29:00Z
AMBIENT_DE_ICE_STOP_FIRST_DEPART_ACTUAL=2020-01-02T13:54:00Z
AMBIENT_DE_ICE_STOP_FIRST_DEPART_DELAY=+25
AMBIENT_DE_ICE_STOP_LAST=Bruxelles Midi
AMBIENT_DE_ICE_STOP_LAST_ARRIVE_SCHEDULED=2020-01-02T16:35:00Z
AMBIENT_DE_ICE_STOP_LAST_ARRIVE_ACTUAL=2020-01-02T17:32:00Z
AMBIENT_DE_ICE_STOP_LAST_ARRIVE_DELAY=+57
AMBIENT_DE_ICE_STOP_NEXT=Bruxelles-Nord
AMBIENT_DE_ICE_STOP_NEXT_DEPART_SCHEDULED=2020-01-02T16:28:00Z
AMBIENT_DE_ICE_STOP_NEXT_DEPART_ACTUAL=2020-01-02T17:25:00Z
AMBIENT_DE_ICE_STOP_NEXT_DEPART_DELAY=+57
AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_SCHEDULED=2020-01-02T16:26:00Z
AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_ACTUAL=2020-01-02T17:23:00Z
AMBIENT_DE_ICE_STOP_NEXT_ARRIVE_DELAY=+57

Running ambient-widgets will run the built-in widget scripts (WIP, uses Font Awesome):

$ ./ambient-widgets
 Bruxelles-Nord
 ICE-14
 219 km/h

Status bar usage

Do you want to see how late your current train is, from the comfort of your status bar? Look no further!

i3status-rs

[[block]]
block = "custom"
command = "/path/to/ambient/ambient-widgets | tr '\n' ' '"
interval = 120
hide_when_empty = true

awesomewm (+ vicious)

Create a custom widget which calls the widget script, and replace all newlines with spaces.

myambien = wibox.widget.textbox()
vicious.register(myambien, function(format, warg)
    local f = io.popen("echo -n ' '; " .. os.getenv("HOME") .. "/path/to/ambient/ambient-widgets")
    local out = f:read("*all")
    f:close()
    return { out:gsub('\n', ' ') }
end, "$1", 31)

Remember to add it to your wibox list! Search for mytextclock with a default configuration.

BitBar

Link bitbar/ambient.60s.sh into your BitBar plugin directory.

ln -s $(pwd)/bitbar/ambient.60s.sh ~/.bitbar

You can put a file named bitbar/plugins/ambient.json in one of the usual locations (e.g. ~/.config) to configure the plugin:

  • If showIfEmpty is false, the plugin will disappear entirely from your menu bar as long as you're not in a known network. Note that BitBar displays its own menu if none of the plugins are active. (Default: true)

Why fish? Why not bash or zsh?

First of all, this was written on a horribly delayed ICE train, and I happen to use fish as my daily driver.

Second, it's quite fast and has a number of nice features like lazy-loaded functions, and semantics that make it harder to shoot yourself in the foot.

If people want it migrated to bash or zsh, that's totally doable.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].