This card shows an hours input card while charger is off and a countdown when charger is running for the hours selected.
Also, it shows a popup for scheduling running hours at certain time by long tap in the card.
This card shows an hours input card while charger is off and a countdown when charger is running for the hours selected.
There's another version that adds a simple scheduling feature in top of this here.
| #!/bin/bash | |
| # brightness: Change all monitors brightness in software. | |
| # by hackerb9, 2019 | |
| # Examples: brightness 75; brightness -5; brightness +10 | |
| # Usage: | |
| # brightess [n] [+n] [-n] | |
| # n An integer from 0 to 100 specifies a brightness level. | |
| # +n Increase brightness by n. | |
| # -n Decrease brightness by n. |
| { | |
| "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json", | |
| "blocks": [ | |
| { | |
| "type": "prompt", | |
| "alignment": "left", | |
| "segments": [ | |
| { | |
| "type": "os", | |
| "style": "diamond", |
| // Needed in AndroidManifest: | |
| <!-- Permission for using NFC hardware --> | |
| <uses-permission android:name="android.permission.NFC"/> | |
| <!-- Forcing device to have NFC hardware --> | |
| <uses-feature android:name="android.hardware.nfc" android:required="true"/> | |
| <!-- Registering app for receiving NFC's TAG_DISCOVERED intent --> | |
| <intent-filter> | |
| <action android:name="android.nfc.action.TAG_DISCOVERED"/> | |
| <category android:name="android.intent.category.DEFAULT"/> | |
| </intent-filter> |
| public Location getLastKnownLocation() { | |
| // variable for keeping most up to date location: | |
| Location lastLocation = null; | |
| // getting location manager: | |
| LocationManager locationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE); | |
| // getting list of providers: | |
| List<String> providers = locationManager.getAllProviders(); | |
| // getting most up to date location from any enabled provider: | |
| if (providers != null && !providers.isEmpty()) { | |
| for (String provider:providers) { |
| // Permission needed in Manifest: | |
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
| // Code: | |
| public boolean isDataConnectionAvailable() { | |
| ConnectivityManager connManager = (ConnectivityManager)this.getSystemService(Context.CONNECTIVITY_SERVICE); | |
| NetworkInfo netInfo = connManager.getActiveNetworkInfo(); | |
| return (netInfo != null && netInfo.isConnected()); | |
| } |
| public class RestClient { | |
| private ArrayList<NameValuePair> params; | |
| private ArrayList<NameValuePair> headers; | |
| private String url; | |
| private int responseCode; | |
| private String message; | |