mirror of
https://github.com/alrayyes/i3blocks
synced 2023-11-13 18:16:40 +00:00
initial import
This commit is contained in:
commit
925c00e41d
12
archupdates
Executable file
12
archupdates
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Arch upgradeable packages
|
||||||
|
|
||||||
|
list=`pacman -Sup 2> /dev/null`
|
||||||
|
|
||||||
|
if [ "$list" == ":: Starting full system upgrade..." ]; then
|
||||||
|
count=""
|
||||||
|
else
|
||||||
|
count=`echo "$list" | wc -l`
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$count"
|
3
container
Executable file
3
container
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
docker ps -q | wc -l | sed -r 's/^0$//g'
|
25
gmail
Executable file
25
gmail
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Requires https://www.google.com/settings/security/lesssecureapps for gmail.
|
||||||
|
|
||||||
|
CONFIG_FILE="${BLOCK_INSTANCE}"
|
||||||
|
CONFIG_FILE=${CONFIG_FILE/\~/$HOME}
|
||||||
|
|
||||||
|
# Config file needs the following settings:
|
||||||
|
#MAIL_USER="user@domain.tld"
|
||||||
|
#MAIL_PASSWORD="secret"
|
||||||
|
|
||||||
|
if [[ ! -f "${CONFIG_FILE}" ]]; then
|
||||||
|
echo "${CONFIG_FILE}"
|
||||||
|
exit 33
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "${CONFIG_FILE}"
|
||||||
|
|
||||||
|
COUNT=`curl -su $MAIL_USER:$MAIL_PASSWORD https://mail.google.com/mail/feed/atom || echo "<fullcount>unknown number of</fullcount>"`
|
||||||
|
COUNT=`echo "$COUNT" | grep -oPm1 "(?<=<fullcount>)[^<]+" `
|
||||||
|
if [ "$COUNT" = "0" ]; then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo $COUNT
|
||||||
|
fi
|
11
whatismyip
Executable file
11
whatismyip
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
ip=$(curl -s icanhazip.com);
|
||||||
|
|
||||||
|
if [[ "$BLOCK_BUTTON" -eq 1 ]];
|
||||||
|
then
|
||||||
|
netname=$(whois $ip | grep '^netname:' | awk '{print $2}' | tail -1);
|
||||||
|
echo "$netname"
|
||||||
|
else
|
||||||
|
echo "$ip"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user