power menu, redshift, polybar

This commit is contained in:
azpsen
2024-01-28 16:37:10 -06:00
parent 89516a6ce1
commit 319b44ecbd
307 changed files with 7642 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
# Script: inbox-imap-shellpass
A script that shows if there are unread mails in your IMAP inbox.
This script actually use IMAPs. `curl` can also handle unencrypted IMAP. You only need to change the protocol in the command.
The login data can be stored in your `pass` password manager.
## Dependencies
* `curl`
## Module
```ini
[module/inbox-imap-shellpass]
type = custom/script
exec = ~/polybar-scripts/inbox-imap-shellpass.sh
interval = 60
```

View File

@@ -0,0 +1,19 @@
#!/bin/sh
SERVER=""
LOGIN=""
PASS=""
KEYGRIP=""
if [ "$(gpg-connect-agent 'keyinfo --list' /bye | grep "$KEYGRIP" | awk '{ print $7 }')" = 1 ]; then
password=$(pass show "$PASS" | head -n 1)
inbox=$(echo "user = \"$LOGIN:$password\"" | curl -sf -K- -X "STATUS INBOX (UNSEEN)" imaps://"$SERVER"/INBOX | tr -d -c "[:digit:]")
if [ "$inbox" ] && [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo ""
fi
else
echo ""
fi