power menu, redshift, polybar
This commit is contained in:
3
.config/polybar/scripts/inbox-pop3-shellnetrc/.netrc
Normal file
3
.config/polybar/scripts/inbox-pop3-shellnetrc/.netrc
Normal file
@@ -0,0 +1,3 @@
|
||||
machine mail.server.tld
|
||||
login username
|
||||
password supersecretpw
|
||||
22
.config/polybar/scripts/inbox-pop3-shellnetrc/README.md
Normal file
22
.config/polybar/scripts/inbox-pop3-shellnetrc/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Script: inbox-pop3-shellnetrc
|
||||
|
||||
A script that shows if there are unread mails in your POP3 inbox.
|
||||
|
||||
This script actually use POP3s. `curl` can also handle unencrypted POP3. You only need to change the protocol in the command.
|
||||
|
||||
The login data is stored in a `.netrc`. This is more secure because the password is not visible in the process list.
|
||||
|
||||
|
||||
## Dependencies
|
||||
|
||||
* `curl`
|
||||
|
||||
|
||||
## Module
|
||||
|
||||
```ini
|
||||
[module/inbox-pop3-shellnetrc]
|
||||
type = custom/script
|
||||
exec = ~/polybar-scripts/inbox-pop3-shellnetrc.sh
|
||||
interval = 60
|
||||
```
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
SERVER=""
|
||||
NETRC=".netrc"
|
||||
|
||||
inbox=$(curl -sf --netrc-file "$NETRC" pop3s://"$SERVER" | wc -l)
|
||||
|
||||
if [ "$inbox" -gt 0 ]; then
|
||||
echo "# $inbox"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
Reference in New Issue
Block a user