power menu, redshift, polybar
This commit is contained in:
21
.config/polybar/scripts/notification-spacex/README.md
Normal file
21
.config/polybar/scripts/notification-spacex/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Script: notification-spacex
|
||||
|
||||
A script that shows when the next launch is planned.
|
||||
|
||||

|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `curl`
|
||||
* `jq`
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/notification-spacex]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/notification-spacex.sh
|
||||
interval = 600
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
spacex_launch=$(curl -sf https://api.spacexdata.com/v5/launches/next)
|
||||
|
||||
if [ -n "$spacex_launch" ]; then
|
||||
spacex_precision=$(echo "$spacex_launch" | jq -r '.date_precision' )
|
||||
spacex_timestamp=$(echo "$spacex_launch" | jq -r '.date_unix' )
|
||||
spacex_duration=$((spacex_timestamp - $(date +%s)))
|
||||
|
||||
if [ "$spacex_precision" = "hour" ] && [ "$spacex_duration" -lt 43200 ] && [ "$spacex_duration" -gt 0 ]; then
|
||||
echo "# $(date +"%H:%M" -u --date @$spacex_duration)"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
BIN
.config/polybar/scripts/notification-spacex/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/notification-spacex/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user