Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| #!/bin/bash | |
| # Cloudflare as Dynamic DNS | |
| # From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/ | |
| # Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/ | |
| # Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/ | |
| # Update these with real values | |
| auth_email="email@example.com" | |
| auth_key="global_api_key_goes_here" | |
| zone_name="example.com" |
| // It turns out people don't really know how to handle Alt+ch, or F[1, 12] keys | |
| // etc. in ncurses apps. Even StackOverflow is full of wrong answers and ideas. | |
| // The key idea is to skip ncurses' key handling and read stuff from the stdin | |
| // buffer manually. Here's a demo. Run this and start typing. ESC to exit. | |
| // | |
| // To compile: | |
| // | |
| // $ gcc demo.c -o demo -lncurses -std=gnu11 | |
| #include <ncurses.h> |
| #include <iostream> | |
| #include <chrono> | |
| #include <future> | |
| #include <string> | |
| std::string GetLineFromCin() { | |
| std::string line; | |
| std::getline(std::cin, line); | |
| return line; | |
| } |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |