mirror of
https://github.com/alrayyes/i3blocks
synced 2023-11-13 18:16:40 +00:00
added readme & license
This commit is contained in:
parent
925c00e41d
commit
8be614e5e8
22
LICENSE.md
Normal file
22
LICENSE.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Copyright (c) `2016` `Ryan Kes`
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
138
README.md
Normal file
138
README.md
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
# i3Blocks
|
||||||
|
|
||||||
|
![Screenshot](screenshots/screenshot.png)
|
||||||
|
|
||||||
|
Some handy scripts I wrote to customize [i3blocks](https://vivien.github.io/i3blocks/)
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
|
||||||
|
* [i3](https://i3wm.org/)
|
||||||
|
* [i3blocks](https://vivien.github.io/i3blocks/)
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone https://github.com/alrayyes/i3blocks.git
|
||||||
|
```
|
||||||
|
|
||||||
|
# Arch Updates
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Lists number of [Arch Linux](https://www.archlinux.org/) package updates available
|
||||||
|
|
||||||
|
## Source
|
||||||
|
```shell
|
||||||
|
#!/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"
|
||||||
|
```
|
||||||
|
|
||||||
|
## i3blocks config
|
||||||
|
```shell
|
||||||
|
[arch-updates]
|
||||||
|
command=~/i3blocks/archupdates
|
||||||
|
label=
|
||||||
|
color=#FF0000
|
||||||
|
interval=3600
|
||||||
|
```
|
||||||
|
|
||||||
|
# Docker Containers
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Lists number of [Docker](https://www.docker.com/) containers running
|
||||||
|
|
||||||
|
## Source
|
||||||
|
```shell
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
docker ps -q | wc -l | sed -r 's/^0$//g'
|
||||||
|
```
|
||||||
|
|
||||||
|
## i3blocks config
|
||||||
|
```shell
|
||||||
|
[docker-containers]
|
||||||
|
label=
|
||||||
|
command=~/i3blocks/container
|
||||||
|
interval=5
|
||||||
|
```
|
||||||
|
# Gmail
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Lists number of unread emails in [Gmail](https://www.google.com/gmail) inbox
|
||||||
|
## Source
|
||||||
|
```shell
|
||||||
|
#!/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
|
||||||
|
```
|
||||||
|
|
||||||
|
## i3blocks config
|
||||||
|
```shell
|
||||||
|
[gmail]
|
||||||
|
command=~/i3blocks/gmail
|
||||||
|
label=G
|
||||||
|
instance=~/.mysupersecretgmaillogin
|
||||||
|
interval=60
|
||||||
|
color=#00FF00
|
||||||
|
```
|
||||||
|
## ~/.mysupersecretgmaillogin
|
||||||
|
```shell
|
||||||
|
MAIL_USER="john.doe@gmail.com"
|
||||||
|
MAIL_PASSWORD="password123"
|
||||||
|
```
|
||||||
|
|
||||||
|
# What is My Ip
|
||||||
|
|
||||||
|
## Description
|
||||||
|
Prints your external ip address
|
||||||
|
|
||||||
|
## Source
|
||||||
|
```shell
|
||||||
|
#!/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
|
||||||
|
```
|
||||||
|
|
||||||
|
## i3blocks config
|
||||||
|
```shell
|
||||||
|
[whatismyip]
|
||||||
|
label=
|
||||||
|
command=~/i3blocks/whatismyip
|
||||||
|
color=#00FF00
|
||||||
|
interval=30
|
||||||
|
```
|
||||||
|
|
||||||
|
# License
|
||||||
|
|
||||||
|
This theme is released under the MIT License. For more information read the [license][license].
|
||||||
|
|
||||||
|
[license]: https://github.com/alrayyes/i3blocks/blob/master/LICENSE.md
|
BIN
screenshots/screenshot.png
Normal file
BIN
screenshots/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
Loading…
Reference in New Issue
Block a user