From 8be614e5e8d2ab569cf290dda33ad36a8b51cdc7 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 21 Nov 2016 22:36:49 +0100 Subject: [PATCH] added readme & license --- LICENSE.md | 22 ++++++ README.md | 138 +++++++++++++++++++++++++++++++++++++ screenshots/screenshot.png | Bin 0 -> 2719 bytes 3 files changed, 160 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 screenshots/screenshot.png diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..d53ed8d --- /dev/null +++ b/LICENSE.md @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7447bf3 --- /dev/null +++ b/README.md @@ -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 diff --git a/screenshots/screenshot.png b/screenshots/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..1e41da3f4d17c993ba8d1e0748bf704f47c33518 GIT binary patch literal 2719 zcmV;Q3Sjk#P)VU_jNV|`WS;A-d8u4Q%TaHqB1 zhMVuLTD6tUzHD{t@vPm$Zne{$T3h9`v+FuHJ-Q0I3Qn*JLRG9n2#}BmdEeZ}zH1PZ z+}x0WZ81lAXqMn&iIoGbde&bD@) zZ0kJNYTsn$p?92jvJJ@eJzPUdk$aR{_?FSsxF8-Aw#MF9;dW#bxEDbh#j+RFS=R+4 ze1ArxarW%l``&u1p|QbOSlD*);{0#VudG~rrtwU-xjW|SA>!i2OUld3wOXw|;BRed zeRKEjp5C4~_ynhX_Yc@N^@#o}&H9cJFZEIB5qaG6ki+$Ze!SREi|G8Ki3!SN!@wyW zKkp6EX)!hMV=JYg(*CR^47j9D&LjD3mJo$Y0sB)uzH%3lha*l@dNeJ4haPb=(WkSy zl~P1(!Ej$O+9QaNkJ9!HJ?=#g&_q%%S8vHdtt<~o0K=sl*Iw9k)~aC;FM^(w$iUAk z2khSn_}I)qsgue-lq>sDOhJ+B?0tXeyS^aD7!x@xQ6La_eZJXcWvkb$K~WUP@iS-6 zzⅅQxe2BpKGeGuX8$`QknGoOR6?)-n?$z+F_TA0|*)ewwi8QOl#NW3OYnQoF6Ro z3ob>3ZN!c$_Gl?JVXHC65fy)miO0(a6A_=_%lE5YRW|oxoBMlqh?BY zKxqi|^I3vRVlpdeeWla3wOhO10748?N_aP&-2RLib`7Vko*zG@uOkM-~9 zvc7sfv#KCUfkZG|x^eA=O^=tyGl^iC*FDqgu9wPlh~N~zht1z4l6DA0P6Rb$f^JMu zfCt!^L@29QuLgh0&(EJUX%aXkun2|188c=;6x_LUCq%?JLfYHfO(v7u?Y3I1R;wi^ zCnpX#{uHGoZNKd9d*gF?txCVR0K%1Xxdl81FA4}g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