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.
public class RestClient { | |
private ArrayList<NameValuePair> params; | |
private ArrayList<NameValuePair> headers; | |
private String url; | |
private int responseCode; | |
private String message; | |
// 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 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) { |
// 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> |
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ | |
{ | |
"type": "os", | |
"style": "diamond", |
#!/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. |
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.