A simple waybar module to display the status of the ICE you are currently in using the ICE Portals JSON API.

Overview

waybar-iceportal

A simple waybar module to display the status of the ICE you are currently in using the ICE Portals JSON API.

Installation

  1. Ensure python[^pyver] is installed: python3 --version
  2. Clone the git repository to a location of your choosing: git clone https://github.com/e1mo/waybar-iceportal.git
  3. Install the python dependencies: pip install -r requirements.txt
  4. Add the snipped below to your waybar configuration (usually ~/.config/waybar/config)
  5. Reload your waybar (either restart your WM such as sway or just run waybar)
    "modules-right": [
      // Your other modules
      "custom/iceportal-wifi"
    ]
    // Simply append at the bottom
    "custom/iceportal-wifi": {
        "interval": 15,
        "return-type": "json",
        "exec": "path/to/waybar-iceportal/waybar-iceportal",
        "tooltip": true,
    },

For further information on custom waybar modules, refer to the waybar wiki on custom modules.

Developing / testing

The script has a couple of parameters to help with developing / debugging outside of ICEs or on those with broken WiFi. They can be shown using --help. As of writing this, the output looks like this:

$ ./waybar-iceportal --help
usage: waybar-iceportal [-h] [--dummy-data DUMMY_DATA] [--dump [DUMP]]

Waybar module for the ICE Portal (Train Info, Stops, WIFI Status). Nothing will be displayed if the
iceportal is not reachable (e.G. you are not in an ICE or the WIFI is down)

optional arguments:
  -h, --help            show this help message and exit
  --dummy-data DUMMY_DATA
                        Folder to load dummy data from. {status,trip}.json must be present.
  --dump [DUMP]         Dump trip / status json to a subfolder within the specified folder. If no value
                        is specified, will create a folder 'data-dump' besides the script.

Using the --dummy-data option, previously saved data (e.g. from --dump) will be used instead of fetching new data. For convenience, there is a dump included in this repository under data/2021-08-31-12-02-55-ice1601.

To aid with debugging (since I unfortunately don't have a BC100 :/ ) you can dump the data by passing --dump. Either a option can be specified, otherwise the data will be written to a timestamped folder, located in the data-dump located next to the script, so it will look like this: data-dump/2021-08-31-22-24-35.

Outlook

Whats next? Well, I don't know. Overall it's done I think, but some minor improovments could be made.

  • Display the WiFi status directly in the waybar
    • Either by passing a class to change the background color using styles
    • Or using emojis, but there are no reception unicocdes
  • Add different output modes
    • Simple text output for debugging
    • i3blocks style output
  • Maybe even porting this to be a gnome extension? (But I don't think this is going to happen)

[^pyver]: I have only tested this script in Python 3.9, but it should work on older versions.

You might also like...
Automatically copy the Discord Status of a Friend you share a server with (conditions have to be satisfied to work)
Automatically copy the Discord Status of a Friend you share a server with (conditions have to be satisfied to work)

CopyDiscordStatusOfUser-SelfBot Basic Function Automatically copy the Discord Status of a friend User whom you share a server with (These conditions h

Wrapper around the UPS API for creating shipping labels and fetching a package's tracking status.

ClassicUPS: A Useful UPS Library ClassicUPS is an Apache2 Licensed wrapper around the UPS API for creating shipping labels and fetching a package's tr

Changes the Telegram bio, profile picture, first and last name to the song that the user is currently listening to.

TGBIOFY - Telegram & Spotify integration Changes the Telegram bio, profile picture, first and last name to the song that the user is currently listeni

CloudFormation template and CDK stack that contains a CustomResource with Lambda function to allow the setting of the targetAccountIds attribute of the EC2 Image Builder AMI distribution settings which is not currently supported (as of October 2021) in CloudFormation or CDK. Rich presence app for playstation 3. Display what game you are playing on the PS3 via Discord
Rich presence app for playstation 3. Display what game you are playing on the PS3 via Discord

PS3-Rich-Presence-for-Discord Discord Rich Presence script for PS3 consoles on HFW&HEN or CFW. Written in Python. Display what you are playing on your

Telegram bot that search for the classrooms status of the chosen day and then return all the free classrooms using your preferred time slot
Telegram bot that search for the classrooms status of the chosen day and then return all the free classrooms using your preferred time slot

Aule Libere Polimi Since the PoliMi site no longer allows people to search for free classrooms this bot was necessary! It simply search for the classr

A bot which provides online/offline and player status for Thicc SMP, using Replit.

AlynaaStatus A bot which provides online/offline and player status for Thicc SMP. Currently being hosted on Replit. How to use? Create a repl on Repli

Check your bot status automatically using userbot, simply and easy

Status Checker Userbot check your bot status automatically using userbot, simply and easy. Mandatory Vars API_ID : Telegram API_ID, get it from my.tel

Spotify Top Lists - get the current top lists of a user from the Spotify API and display them in a Flask app
Spotify Top Lists - get the current top lists of a user from the Spotify API and display them in a Flask app

Spotify Top Lists This is a simple script that will get the current top lists of a user from the Spotify API and display them in a Flask app. Requirem

Comments
  • FR: Improve by checking for WLAN SSID before requesting

    FR: Improve by checking for WLAN SSID before requesting

    Hey, great script you implemented here for waybar. Here's a little feature I thought about adding to this little script:

    I think checking the WLAN SSID before sending requests to the server could improve this little script even more. This should decrease resource usage for most of the time (e.g. when not using an ICE) and would also increase privacy because not all users would send requests to the public DB server (see here when not using an IC/ICE, it shows "Your device cannot reach the portal" and explains how to fix this.).

    I would implement this by adding another flag (to make this optional) and check NetworkManager (using D-Bus) for the both common WLAN SSIDs the ICE WiFi is using "WIFIonICE" or "WIFI@DB". Based on the check, the script could also interpret if a VPN is blocking the access to the ICE Portal and could inform the user based on this.

    If you or anyone else is faster than me to implement this on their own, please do so. If not, I hopefully will find some time to implement it on my own (this issue shall be a reminder to myself as well).

    enhancement 
    opened by Zocker1999NET 2
Owner
Moritz
Moritz
Discord bot that displays Jazz Jackrabbit 2 server status, current gamemode as "Playing.." status

JJ2-server-status-discord-bot Discord bot that displays Jazz Jackrabbit 2 server status, current gamemode as "Playing.." status How to setup: 0. Downl

null 2 Dec 9, 2021
A really easy way to display your spotify listening status on spotify.

Spotify playing README A really easy way to display your spotify listening status on READMEs and Websites too! Demo Here's the embed from the site. Cu

Sunrit Jana 21 Nov 6, 2022
Ice-Userbot adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy

Ice-Userbot Telegram Ice-Userbot adalah userbot Telegram modular yang berjalan di Python3 dengan database sqlalchemy. Berbasis Paperplane dan ProjectB

null 6 Apr 29, 2022
API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

API which uses discord+mojang api to scrape NameMC searches/droptime/dropping status of minecraft names, and texture links

null 2 Dec 22, 2021
This is a simple bot that can be used to upload images to a third-party cloud (image hosting). Currently, only the imgbb.com website supports the bot. I Will do future updates

TGImageHosting This is a simple bot that can be used to upload images to a third party cloud (image hosting). Currently, only the imgbb.com website su

Abhijith N T 0 Dec 26, 2021
A simple Discord bot wrote with Python. Kizmeow let you track your NFT project and display some useful information

Kizmeow-OpenSea-and-Etherscan-Discord-Bot 中文版 | English Ver A Discord bot wrote with Python. Kizmeow let you track your NFT project and display some u

Xeift 93 Dec 31, 2022
A simple Discord Bot that uses the free CryptoCompare API to display cryptocurrency prices

What is this? This is a simple Discord Bot coded in Python that uses the free CryptoCompare API to display cryptocurrency prices Download Use git to c

Kevin 10 Apr 17, 2022
A code to match you with the perfect Taylor Swift song for your mood and relationship status.

taylorswift A package for matching your current mood and relationship status to a suitable Taylor Swift song. Requirements: Python 2 or 3, and the num

Megan Mansfield 82 Dec 9, 2022
A telegram bot which can show you the status of telegram bot

BotStatus-Ts-Bot An open source telegram Bot Status bot For demo you can check here The status is updated in every 1 hour About Bot This is a Bot stat

Ts_Bots 8 Nov 17, 2022
A script that takes what you're listening too on Spotify and sets it as your Nertivia custom status.

nertivia-spotify-listening-status A script that takes what you're listening too on Spotify and sets it as your Nertivia custom status. setup Install r

Ben Tettmar 2 Feb 3, 2022