power menu, redshift, polybar
This commit is contained in:
28
.config/polybar/scripts/notification-reddit/README.md
Normal file
28
.config/polybar/scripts/notification-reddit/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Script: notification-reddit
|
||||
|
||||
A script that shows if there are unread mails in your reddit inbox.
|
||||
|
||||

|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `curl`
|
||||
* `jq`
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
Open [reddit.com/prefs/feeds/](https://www.reddit.com/prefs/feeds/). Copy the `JSON` link from `your inbox` > `unread messages`.
|
||||
|
||||
Add your username at the end of `USERAGENT` to create a unique string.
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/notification-reddit]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/notification-reddit.sh
|
||||
interval = 60
|
||||
```
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
URL=""
|
||||
USERAGENT="polybar-scripts/notification-reddit:v1.0 u/reddituser"
|
||||
|
||||
notifications=$(curl -sf --user-agent "$USERAGENT" "$URL" | jq '.["data"]["children"] | length')
|
||||
|
||||
if [ -n "$notifications" ] && [ "$notifications" -gt 0 ]; then
|
||||
echo "#1 $notifications"
|
||||
else
|
||||
echo "#2"
|
||||
fi
|
||||
BIN
.config/polybar/scripts/notification-reddit/screenshots/1.png
Normal file
BIN
.config/polybar/scripts/notification-reddit/screenshots/1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Reference in New Issue
Block a user