diff options
| author | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 18:10:49 +0100 |
|---|---|---|
| committer | Vito Graffagnino <vito@graffagnino.xyz> | 2020-09-08 18:10:49 +0100 |
| commit | 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 (patch) | |
| tree | 2116c49a845dfc0945778f2aa3e2118d72be428b /.i3/scripts | |
| parent | 8cc927e930d5b6aafe3e9862a61e81705479a1b4 (diff) | |
Added the relevent parts of the .config directory. Alss add ssh config
Diffstat (limited to '.i3/scripts')
65 files changed, 3202 insertions, 0 deletions
diff --git a/.i3/scripts/audio b/.i3/scripts/audio new file mode 100755 index 0000000..cb630c8 --- /dev/null +++ b/.i3/scripts/audio @@ -0,0 +1,27 @@ +#!/bin/bash + +# This script records audio. +# It runs an appropriate record script for either ALSA and Pulseaudio. +# It also names files smartly to prevent overwrites. + +# Picks a file name for the output file based on availability: +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" + +# For Pulseaudio with ALSA: +record_pulse() { \ +ffmpeg \ +-f alsa -i default \ +-c:a flac \ +$filename ;} + +# For ALSA: +record_alsa() { \ +ffmpeg -y \ +-f alsa -ar 44100 -i hw:1 \ +$filename ;} + +if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi diff --git a/.i3/scripts/bandwidth.sh b/.i3/scripts/bandwidth.sh new file mode 100755 index 0000000..22414e9 --- /dev/null +++ b/.i3/scripts/bandwidth.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2015 James Murphy +# Licensed under the terms of the GNU GPL v2 only. +# +# i3blocks blocklet script to monitor bandwidth usage + +iface="${BLOCK_INSTANCE:-$(ip route | awk '/^default/ {print $5; exit}')}" +dt=3 +unit=Mb +printf_command='printf "%-5.1f/%5.1f %s/s\n", rx, wx, unit;' + +function check_proc_net_dev { + if [ ! -f "/proc/net/dev" ]; then + echo "/proc/net/dev not found" + exit 1 + fi +} + +function list_interfaces { + check_proc_net_dev + echo "Interfaces in /proc/net/dev:" + grep -o "^[^:]\\+:" /proc/net/dev | tr -d " :" +} + +while getopts i:t:u:p:lh opt; do + case "$opt" in + i) iface="$OPTARG" ;; + t) dt="$OPTARG" ;; + u) unit="$OPTARG" ;; + p) printf_command="$OPTARG" ;; + l) list_interfaces && exit 0 ;; + h) printf \ +"Usage: bandwidth [-i interface] [-t time] [-u unit] [-p printf_command] [-l] [-h] +Options: +-i\tNetwork interface to measure. Default determined using \`ip route\`. +-t\tTime interval in seconds between measurements. Default: 3 +-u\tUnits to measure bytes in. Default: Mb +\tAllowed units: Kb, KB, Mb, MB, Gb, GB, Tb, TB +\tUnits may have optional it/its/yte/ytes on the end, e.g. Mbits, KByte +-p\tAwk command to be called after a measurement is made. +\tDefault: printf \"%%-5.1f/%%5.1f %%s/s\\\\n\", rx, wx, unit; +\tExposed variables: rx, wx, tx, unit, iface +-l\tList available interfaces in /proc/net/dev +-h\tShow this help text +" && exit 0;; + esac +done + +check_proc_net_dev + +if [ -z "$iface" ]; then + echo Could not determine default interface + exit 1 +fi + +case "$unit" in + Kb|Kbit|Kbits) bytes_per_unit=$((1024 / 8));; + KB|KByte|KBytes) bytes_per_unit=$((1024));; + Mb|Mbit|Mbits) bytes_per_unit=$((1024 * 1024 / 8));; + MB|MByte|MBytes) bytes_per_unit=$((1024 * 1024 / 8));; + Gb|Gbit|Gbits) bytes_per_unit=$((1024 * 1024 * 1024 / 8));; + GB|GByte|GBytes) bytes_per_unit=$((1024 * 1024 * 1024));; + Tb|Tbit|Tbits) bytes_per_unit=$((1024 * 1024 * 1024 * 1024 / 8));; + TB|TByte|TBytes) bytes_per_unit=$((1024 * 1024 * 1024 * 1024));; + *) echo Bad unit "$unit" && exit 1;; +esac + +scalar=$((bytes_per_unit * dt)) +init_line=$(cat /proc/net/dev | grep "^[ ]*$iface:") +if [ -z "$init_line" ]; then + echo Interface not found in /proc/net/dev: "$iface" + exit 1 +fi + +init_received=$(awk '{print $2}' <<< $init_line) +init_sent=$(awk '{print $10}' <<< $init_line) +sleep "$dt" + +(while true; do cat /proc/net/dev; sleep "$dt"; done) |\ + stdbuf -oL grep "^[ ]*$iface:" |\ + awk -v scalar="$scalar" -v unit="$unit" -v iface="$iface" ' +BEGIN{old_received='"$init_received"';old_sent='"$init_sent"'} +{ + received=$2 + sent=$10 + rx=(received-old_received)/scalar; + wx=(sent-old_sent)/scalar; + tx=rx+wr; + old_received=received; + old_sent=sent; + if(rx >= 0 && wx >= 0){ + '"$printf_command"'; + fflush(stdout); + } +} +' diff --git a/.i3/scripts/battery.sh b/.i3/scripts/battery.sh new file mode 100755 index 0000000..5ba6498 --- /dev/null +++ b/.i3/scripts/battery.sh @@ -0,0 +1,74 @@ +#!/usr/bin/perl +# +# Copyright 2014 Pierre Mavro <deimos@deimos.fr> +# Copyright 2014 Vivien Didelot <vivien@didelot.org> +# +# Licensed under the terms of the GNU GPL v3, or any later version. +# +# This script is meant to use with i3blocks. It parses the output of the "acpi" +# command (often provided by a package of the same name) to read the status of +# the battery, and eventually its remaining time (to full charge or discharge). +# +# The color will gradually change for a percentage below 85%, and the urgency +# (exit code 33) is set if there is less that 5% remaining. + +use strict; +use warnings; +use utf8; + +my $acpi; +my $status; +my $percent; +my $full_text; +my $short_text; +my $bat_number = $ENV{BLOCK_INSTANCE} || 0; + +# read the first line of the "acpi" command output +open (ACPI, "acpi -b | grep 'Battery $bat_number' |") or die; +$acpi = <ACPI>; +close(ACPI); + +# fail on unexpected output +if ($acpi !~ /: (\w+), (\d+)%/) { + die "$acpi\n"; +} + +$status = $1; +$percent = $2; +$full_text = "$percent%"; + +if ($status eq 'Discharging') { + $full_text .= ' DIS'; +} elsif ($status eq 'Charging') { + $full_text .= ' CHR'; +} + +$short_text = $full_text; + +if ($acpi =~ /(\d\d:\d\d):/) { + $full_text .= " ($1)"; +} + +# print text +print "$full_text\n"; +print "$short_text\n"; + +# consider color and urgent flag only on discharge +if ($status eq 'Discharging') { + + if ($percent < 20) { + print "#FF0000\n"; + } elsif ($percent < 40) { + print "#FFAE00\n"; + } elsif ($percent < 60) { + print "#FFF600\n"; + } elsif ($percent < 85) { + print "#A8FF00\n"; + } + + if ($percent < 5) { + exit(33); + } +} + +exit(0); diff --git a/.i3/scripts/batterybar.sh b/.i3/scripts/batterybar.sh new file mode 100755 index 0000000..e583aab --- /dev/null +++ b/.i3/scripts/batterybar.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +# batterybar; displays battery percentage as a bar on i3blocks +# +# Copyright 2015 Keftaa <adnan.37h@gmail.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# + + + +output=$(acpi battery) +percentage=$(echo "$output" | grep -o -m1 '[0-9]\{1,3\}%' | tr -d '%') +status=$(echo "$output" | egrep -o -m1 'Discharging|Charging|AC|Full|Unknown') +remaining=$( echo "$output" | egrep -o -m1 '[0-9][0-9]:[0-9][0-9]') +[[ -n $remaining ]] && remaining_formatted=" ($remaining)" +squares="■" + + +#There are 8 colors that reflect the current battery percentage when +#discharging +dis_colors=("#FF0027" "#FF3B05" "#FFB923" "#FFD000" "#E4FF00" "#ADFF00" + "#6DFF00" "#10BA00") +charging_color="#00AFE3" +full_color="#FFFFFF" +ac_color="#535353" + + +while getopts 1:2:3:4:5:6:7:8:c:f:a:h opt; do + case "$opt" in + 1) dis_colors[0]="$OPTARG";; + 2) dis_colors[1]="$OPTARG";; + 3) dis_colors[2]="$OPTARG";; + 4) dis_colors[3]="$OPTARG";; + 5) dis_colors[4]="$OPTARG";; + 6) dis_colors[5]="$OPTARG";; + 7) dis_colors[6]="$OPTARG";; + 8) dis_colors[7]="$OPTARG";; + c) charging_color="$OPTARG";; + f) full_color="$OPTARG";; + a) ac_color="$OPTARG";; + h) printf "Usage: batterybar [OPTION] color + When discharging, there are 8 [1-8] levels colors. + You can specify custom colors, for example: + + batterybar -1 red -2 \"#F6F6F6\" -8 green + + You can also specify the colors for the charging, AC and + charged states: + + batterybar -c green -f white -a \"#EEEEEE\"\n"; + exit 0; + esac +done + + + +if (( percentage > 0 && percentage < 20 )); then + squares="■" +elif (( percentage >= 20 && percentage < 40 )); then + squares="■■" +elif (( percentage >= 40 && percentage < 60 )); then + squares="■■■" +elif (( percentage >= 60 && percentage < 80 )); then + squares="■■■■" +elif (( percentage >=80 )); then + squares="■■■■■" +fi + +if [[ "$status" = "Unknown" ]]; then + squares="<sup>?</sup>$squares" +fi + +case "$status" in +"Charging") + color="$charging_color" +;; +"Full") + color="$full_color" +;; +"AC") + color="$ac_color" +;; +"Discharging"|"Unknown") + if (( percentage >= 0 && percentage < 10 )); then + color="${dis_colors[0]}" + elif (( percentage >= 10 && percentage < 20 )); then + color="${dis_colors[1]}" + elif (( percentage >= 20 && percentage < 30 )); then + color="${dis_colors[2]}" + elif (( percentage >= 30 && percentage < 40 )); then + color="${dis_colors[3]}" + elif (( percentage >= 40 && percentage < 60 )); then + color="${dis_colors[4]}" + elif (( percentage >= 60 && percentage < 70 )); then + color="${dis_colors[5]}" + elif (( percentage >= 70 && percentage < 80 )); then + color="${dis_colors[6]}" + elif (( percentage >= 80 )); then + color="${dis_colors[7]}" + fi +;; +esac + +if [[ "$BLOCK_BUTTON" -eq 1 ]]; then + echo "$status <span foreground=\"$color\">$percentage%$remaining_formatted</span>" +fi + echo "<span foreground=\"$color\">$squares</span>" diff --git a/.i3/scripts/bottomleft b/.i3/scripts/bottomleft new file mode 100755 index 0000000..5f05beb --- /dev/null +++ b/.i3/scripts/bottomleft @@ -0,0 +1,17 @@ +#!/bin/bash + +# This script move the selected window to the bottom left of the screen. + +current=$(xdotool getwindowfocus) + +# The window will take up no more than a third of +# the width or height of the screen. +newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) +newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3)) + +xdotool windowsize $(xdotool getwindowfocus) $newheight $newwidth + +newsize=$(xdotool getwindowgeometry $(xdotool getwindowfocus) | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') + +height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) +xdotool windowmove $current 0 $height diff --git a/.i3/scripts/camtoggle b/.i3/scripts/camtoggle new file mode 100755 index 0000000..1e39dec --- /dev/null +++ b/.i3/scripts/camtoggle @@ -0,0 +1,2 @@ +#!/bin/bash +pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" /dev/video0 diff --git a/.i3/scripts/clear.sh b/.i3/scripts/clear.sh new file mode 100755 index 0000000..af13a73 --- /dev/null +++ b/.i3/scripts/clear.sh @@ -0,0 +1 @@ +find . -maxdepth 1 -regextype gnu-awk -regex "^.*\.(pyc|p yo|bak|swp|aux|log|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete diff --git a/.i3/scripts/compiler b/.i3/scripts/compiler new file mode 100755 index 0000000..cf628aa --- /dev/null +++ b/.i3/scripts/compiler @@ -0,0 +1,50 @@ +#!/bin/sh + +# This script will compile or run another finishing operation on a document. I +# have this script run via vim. +# +# tex files: Compiles to pdf, including bibliography if necessary +# md files: Compiles to pdf via pandoc +# rmd files: Compiles via R Markdown +# c files: Compiles via whatever compiler is set to cc. Usually gcc. +# py files: runs via python command +# go files: compiles and runs with "go run" +# config.h files: (For suckless utils) recompiles and installs program. +# all others: run `sent` to show a presentation + +file=$(readlink -f "$1") +dir=$(dirname "$file") +base="${file%.*}" +shebang=$(sed -n 1p "$file") + +cd "$dir" || exit + +textype() { \ + command="pdflatex" + ( sed 5q "$file" | grep -i -q 'xelatex' ) && command="xelatex" + $command --output-directory="$dir" "$base" && + grep -i addbibresource "$file" >/dev/null && + biber --input-directory "$dir" "$base" && + $command --output-directory="$dir" "$base" && + $command --output-directory="$dir" "$base" + } + +shebangtest() { + case "$shebang" in + \#\!*) "$file" ;; + *) sent "$file" 2>/dev/null & ;; + esac +} + +case "$file" in + *\.ms) refer -PS -e "$file" | groff -me -ms -kejpt -T pdf > "$base".pdf ;; + *\.mom) refer -PS -e "$file" | groff -mom -kejpt -T pdf > "$base".pdf ;; + *\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;; + *\.tex) textype "$file" ;; + *\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;; + *config.h) make && sudo make install ;; + *\.c) cc "$file" -o "$base" && "$base" ;; + *\.py) python "$file" ;; + *\.go) go run "$file" ;; + *) shebangtest ;; +esac diff --git a/.i3/scripts/ddspawn b/.i3/scripts/ddspawn new file mode 100755 index 0000000..0871a59 --- /dev/null +++ b/.i3/scripts/ddspawn @@ -0,0 +1,25 @@ +#!/bin/sh + +# This script simplifies dropdown windows in i3. +# Shows/hides a scratchpad of a given name, if it doesn't exist, creates it. +# Usage: +# argument 1: script to run in dropdown window +# all other args are interpreted as options for your terminal +# My usage: +# ddpawn +# bindsym $mod+u exec --no-startup-id ddspawn tmuxdd +# Will hide/show window running the `tmuxdd` script when I press mod+u in i3 +# bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24 +# Similar to above but with `dropdowncalc` and the other args are interpretated as for my terminal emulator (to increase font) + +[ -z "$1" ] && exit + +if xwininfo -tree -root | grep "(\"$1\" "; +then + echo "Window detected." +else + echo "Window not detected... spawning." + i3 "exec --no-startup-id $TERMINAL -n $1 $(echo "$@" | cut -d ' ' -f2-) -e $1" && i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" + sleep .25 # This sleep is my laziness, will fix later (needed for immediate appearance after spawn). +fi +i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center" diff --git a/.i3/scripts/disk-io.sh b/.i3/scripts/disk-io.sh new file mode 100755 index 0000000..c27b60d --- /dev/null +++ b/.i3/scripts/disk-io.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2016 James Murphy +# Licensed under the terms of the GNU GPL v2 only. +# +# i3blocks blocklet script to monitor disk io + +label="" +dt=5 +MB_only=0 +kB_only=0 +width=4 +MB_precision=1 +kB_precision=0 +regex="${BLOCK_INSTANCE:-/^(s|h)d[a-zA-Z]+/}" +threshold=0 +warn_color="#FF0000" +sep="/" +unit_suffix="B/s" + +function list_devices { + echo "Devices iostat reports that match our regex:" + iostat | awk '$1~/^(s|h)d[a-zA-Z]+/{print $1}' +} + +while getopts L:t:w:p:P:R:s:ST:C:lLMmKkh opt; do + case "$opt" in + L) label="$OPTARG" ;; + t) dt="$OPTARG" ;; + w) width="$OPTARG" ;; + p) kB_precision="$OPTARG" ;; + P) MB_precision="$OPTARG" ;; + R) regex="$OPTARG" ;; + s) sep="$OPTARG" ;; + S) unit_suffix="" ;; + T) threshold="$OPTARG" ;; + C) warn_color="$OPTARG" ;; + l) list_devices; exit 0 ;; + M|m) MB_only=1 ;; + K|k) kB_only=1 ;; + h) printf \ +"Usage: disk-io [-t time] [-w width] [-p kB_precision] [-P MB_precision] [-R regex] [-s separator] [-S] [-T threshold [-C warn_color]] [-k|-M] [-l] [-h] +Options: +-L\tLabel to put in front of the text. Default: $label +-t\tTime interval in seconds between measurements. Default: $dt +-w\tThe width of printed floats. Default: $width +-p\tThe precision of kB/s floats. Default: $kB_precision +-P\tThe precision of MB/s floats. Default: $MB_precision +-R\tRegex that devices must match. Default: $regex +-s\tSeparator to put between rates. Default: $sep +-S\tShort units, omit B/s in kB/s and MB/s. +-T\tRate in kB/s to exceed to trigger a warning. Default: not enabled +-C\tColor to change the blocklet to warn the user. Default: $warn_color +-l\tList devices that iostat reports +-M\tDo not switch between MB/s and kB/s, use only MB/s +-k\tDo not switch between MB/s and kB/s, use only kB/s +-h\tShow this help text +" && exit 0;; + esac +done + +iostat -dyz "$dt" | awk -v sep="$sep" " + BEGIN { + rx = wx = 0; + } + { + if(\$0 == \"\") { + if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) { + printf \"<span color='$warn_color'>\"; + } + printf \"$label\"; + if(!$kB_only && ($MB_only || rx >= 1024 || wx >= 1024)) { + printf \"%-$width.${MB_precision}f%s%$width.${MB_precision}f M$unit_suffix\", rx/1024, sep, wx/1024; + } + else { + printf \"%-$width.${kB_precision}f%s%$width.${kB_precision}f k$unit_suffix\", rx, sep, wx; + } + if ($threshold > 0 && (rx >= $threshold || wx >= $threshold)) { + printf \"</span>\"; + } + printf \"\n\"; + fflush(stdout); + } + else if(\$1~/^Device:/) { + rx = wx = 0; + } + else if(\$1~$regex) { + rx += \$3; + wx += \$4; + } + }" diff --git a/.i3/scripts/displayselect b/.i3/scripts/displayselect new file mode 100755 index 0000000..f1f12c1 --- /dev/null +++ b/.i3/scripts/displayselect @@ -0,0 +1,16 @@ +#!/bin/sh + +choices="laptop\nlaptopdual\nVGA\nHDMI\nManual selection" + +chosen=$(echo -e "$choices" | dmenu -i) + +case "$chosen" in + laptopdual) xrandr --output LVDS-1 --auto --output VGA-1 --auto --right-of LVDS-1 ;; + laptop) xrandr --output LVDS-1 --auto --output VGA-1 --off ;; + VGA) xrandr --output VGA-1 --auto --output LVDS-1 --off ;; + HDMI) xrandr --output HDMI-1 --auto --output LVDS-1 --off ;; + "Manual selection") arandr ;; +esac + +# Relaunch polybar if there was a selection. +[ "$chosen" == "" ] || polybar_launch diff --git a/.i3/scripts/dmenuhandler b/.i3/scripts/dmenuhandler new file mode 100755 index 0000000..f00178b --- /dev/null +++ b/.i3/scripts/dmenuhandler @@ -0,0 +1,15 @@ +#!/bin/sh +# Feed this script a link and it will give dmenu +# some choice programs to use to open it. + +case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in + "copy url") echo "$1" | xclip -selection clipboard ;; + mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; + "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;; + "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; + "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; + browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;; + feh) setsid feh "$1" >/dev/null 2>&1 & ;; + w3m) w3m "$1" >/dev/null 2>&1 ;; + "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; +esac diff --git a/.i3/scripts/dmenumount b/.i3/scripts/dmenumount new file mode 100755 index 0000000..e0bb500 --- /dev/null +++ b/.i3/scripts/dmenumount @@ -0,0 +1,25 @@ +#!/bin/sh + +# Gives a dmenu prompt to mount unmounted drives. +# If they're in /etc/fstab, they'll be mounted automatically. +# Otherwise, you'll be prompted to give a mountpoint from already existsing directories. +# If you input a novel directory, it will prompt you to create that directory. + +pgrep -x dmenu && exit + +mountable=$(lsblk -lp | grep part | grep -v "t /" | awk '{print $1, "(" $4 ")"}') +[[ "$mountable" = "" ]] && exit 1 +chosen=$(echo "$mountable" | dmenu -i -p "Mount which drive?" | awk '{print $1}') +[[ "$chosen" = "" ]] && exit 1 +sudo mount "$chosen" && exit 0 +# You may want to change the line below for more suggestions for mounting. +# I.e. you can increase the depth of the search, or add directories. +# This will increase the load time briefly though. +dirs=$(find /mnt /media /mount /home -type d -maxdepth 5 2>/dev/null) +mountpoint=$(echo "$dirs" | dmenu -i -p "Type in mount point.") +[[ "$mountpoint" = "" ]] && exit 1 +if [[ ! -d "$mountpoint" ]]; then + mkdiryn=$(echo -e "No\nYes" | dmenu -i -p "$mountpoint does not exist. Create it?") + [[ "$mkdiryn" = Yes ]] && sudo mkdir -p "$mountpoint" +fi +sudo mount $chosen $mountpoint && pgrep -x dunst && notify-send "$chosen mounted to $mountpoint." diff --git a/.i3/scripts/dmenurecord b/.i3/scripts/dmenurecord new file mode 100755 index 0000000..75cc6ff --- /dev/null +++ b/.i3/scripts/dmenurecord @@ -0,0 +1,24 @@ +#!/bin/bash + +# A dmenu recording prompt for my different recording scripts. + +# Asks for type of recording and uses one of my three different scripts. +asktype() { \ +case $(echo -e "Screencast\nVideo only\nAudio only" | dmenu -i -p "Select recording style:") in + Screencast) screencast ;; + "Audio only") audio ;; + "Video only") video ;; +esac ;} + +# If already running, will ask to end previous recording. + +asktoend() { \ +response=$(echo -e "No\nYes" | dmenu -i -p "Recording still active. End recording?") && +if [[ "$response" = "Yes" ]]; then killall ffmpeg; fi ;} + +if (( $(pgrep dmenurecord | wc -l) > 2 )); then +asktoend; +else +asktype; +fi +echo $response diff --git a/.i3/scripts/dmenuumount b/.i3/scripts/dmenuumount new file mode 100755 index 0000000..d333e2a --- /dev/null +++ b/.i3/scripts/dmenuumount @@ -0,0 +1,14 @@ +#!/bin/sh + +# A dmenu prompt to unmount drives. +# Provides you with mounted partitions, select one to unmount. + +# Drives mounted at /, /boot and /home will not be options to unmount. +# This can be changed by modifying $exclusionregex. + +exclusionregex="\(/boot\|/home\|/\)$" +drives=$(lsblk -lp | grep "t /" | grep -v "$exclusionregex" | awk '{print $1, "(" $4 ")", "on", $7}') +[[ "$drives" = "" ]] && exit +chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}') +[[ "$chosen" = "" ]] && exit +sudo umount $chosen && pgrep -x dunst && notify-send "$chosen unmounted." diff --git a/.i3/scripts/dmenuunicode b/.i3/scripts/dmenuunicode new file mode 100755 index 0000000..a4ab828 --- /dev/null +++ b/.i3/scripts/dmenuunicode @@ -0,0 +1,18 @@ +#!/bin/sh +# Give dmenu list of all unicode characters to copy. +# Shows the selected character in dunst if running. + +# Must have xclip installed to even show menu. +xclip -h >/dev/null || exit + +chosen=$(grep -v "#" ~/.emoji | dmenu -i -l 10 -fn Monospace-12) + +[ "$chosen" != "" ] || exit + +c=$(echo "$chosen" | sed "s/ .*//") +echo "$c" | tr -d '\n' | xclip -selection clipboard +notify-send "'$c' copied to clipboard." & + +s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}') +echo "$s" | tr -d '\n' | xclip +notify-send "'$s' copied to primary." & diff --git a/.i3/scripts/dropdowncalc b/.i3/scripts/dropdowncalc new file mode 100755 index 0000000..fee8f07 --- /dev/null +++ b/.i3/scripts/dropdowncalc @@ -0,0 +1,5 @@ +#!/bin/sh +# This script ensures that i3 will spawn a calculator. +# If R is installed, it will run R, otherwise it will run +# Python. +([ -e /usr/bin/R ] && R -q --no-save) || python -q diff --git a/.i3/scripts/ducksearch b/.i3/scripts/ducksearch new file mode 100755 index 0000000..13a1e19 --- /dev/null +++ b/.i3/scripts/ducksearch @@ -0,0 +1,15 @@ +#!/bin/sh + +# Gives a dmenu prompt to search DuckDuckGo. +# Without input, will open DuckDuckGo.com. +# Anything else, it search it. + +pgrep -x dmenu && exit + +choice=$(echo "🦆" | dmenu -i -p "Search DuckDuckGo:") || exit 1 + +if [ "$choice" = "🦆" ]; then + $BROWSER "https://duckduckgo.com" +else + $BROWSER "https://duckduckgo.com/?q=$choice&t=ffab&atb=v1-1" +fi diff --git a/.i3/scripts/ext b/.i3/scripts/ext new file mode 100755 index 0000000..c214583 --- /dev/null +++ b/.i3/scripts/ext @@ -0,0 +1,41 @@ +#!/bin/sh +# A general, all-purpose extraction script. +# +# Default behavior: Extract archive into new directory +# Behavior with `-c` option: Extract contents into current directory + +while getopts "hc" o; do case "${o}" in + c) extracthere="True" ;; + *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;; +esac done + +if [ -z "$extracthere" ]; then + archive="$(readlink -f "$*")" && + directory=${archive%.*} && + mkdir -p "$directory" && + cd "$directory" || exit +else + archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")" +fi + +[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit + +if [ -f "$archive" ] ; then + case "$archive" in + *.tar.bz2|*.tar.xz|*.tbz2) tar xvjf "$archive" ;; + *.tar.gz|*.tgz) tar xvzf "$archive" ;; + *.lzma) unlzma "$archive" ;; + *.bz2) bunzip2 "$archive" ;; + *.rar) unrar x -ad "$archive" ;; + *.gz) gunzip "$archive" ;; + *.tar) tar xvf "$archive" ;; + *.zip) unzip "$archive" ;; + *.Z) uncompress "$archive" ;; + *.7z) 7z x "$archive" ;; + *.xz) unxz "$archive" ;; + *.exe) cabextract "$archive" ;; + *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; + esac +else + printf "File \"%s\" not found.\\n" "$archive" +fi diff --git a/.i3/scripts/extract b/.i3/scripts/extract new file mode 100755 index 0000000..c214583 --- /dev/null +++ b/.i3/scripts/extract @@ -0,0 +1,41 @@ +#!/bin/sh +# A general, all-purpose extraction script. +# +# Default behavior: Extract archive into new directory +# Behavior with `-c` option: Extract contents into current directory + +while getopts "hc" o; do case "${o}" in + c) extracthere="True" ;; + *) printf "Options:\\n -c: Extract archive into current directory rather than a new one.\\n" && exit ;; +esac done + +if [ -z "$extracthere" ]; then + archive="$(readlink -f "$*")" && + directory=${archive%.*} && + mkdir -p "$directory" && + cd "$directory" || exit +else + archive="$(readlink -f "$(echo "$*" | cut -d' ' -f2)")" +fi + +[ "$archive" = "" ] && printf "Give archive to extract as argument.\\n" && exit + +if [ -f "$archive" ] ; then + case "$archive" in + *.tar.bz2|*.tar.xz|*.tbz2) tar xvjf "$archive" ;; + *.tar.gz|*.tgz) tar xvzf "$archive" ;; + *.lzma) unlzma "$archive" ;; + *.bz2) bunzip2 "$archive" ;; + *.rar) unrar x -ad "$archive" ;; + *.gz) gunzip "$archive" ;; + *.tar) tar xvf "$archive" ;; + *.zip) unzip "$archive" ;; + *.Z) uncompress "$archive" ;; + *.7z) 7z x "$archive" ;; + *.xz) unxz "$archive" ;; + *.exe) cabextract "$archive" ;; + *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; + esac +else + printf "File \"%s\" not found.\\n" "$archive" +fi diff --git a/.i3/scripts/getbib b/.i3/scripts/getbib new file mode 100755 index 0000000..bf02694 --- /dev/null +++ b/.i3/scripts/getbib @@ -0,0 +1,21 @@ +#!/bin/sh + +# Give this script a .pdf and it will attempt +# to return a proper .bib citation via doi. +# Internet connection required. + +if [ -f "$1" ]; +then + # Get the doi from metadata, if not possible, get + # doi from pdftotext output, if not possible, exit. + doi=$(pdfinfo "$1" | grep -io "doi:.*") || + doi=$(pdftotext "$1" 2>/dev/null - | grep -o "doi:.*" -m 1) || + exit 1 +else + # If not given file, assume argument is doi + doi="$1" +fi + +# Check crossref.org for the bib citation. +curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" | + sed -e "/^[^\\(\\t\\|@\\|}\\)]/d" diff --git a/.i3/scripts/getkeys b/.i3/scripts/getkeys new file mode 100755 index 0000000..928e435 --- /dev/null +++ b/.i3/scripts/getkeys @@ -0,0 +1,5 @@ +#!/bin/sh + +cat ~/.scripts/.getkeys/"$1" 2>/dev/null && exit +echo Run command with one of the following arguments for info about that program: +ls ~/.scripts/.getkeys diff --git a/.i3/scripts/i3battery b/.i3/scripts/i3battery new file mode 100755 index 0000000..c140da2 --- /dev/null +++ b/.i3/scripts/i3battery @@ -0,0 +1,2 @@ +#!/bin/sh +acpi | cut -d " " -f3-5 | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g" diff --git a/.i3/scripts/i3iface b/.i3/scripts/i3iface new file mode 100755 index 0000000..e354f50 --- /dev/null +++ b/.i3/scripts/i3iface @@ -0,0 +1,70 @@ +#!/bin/bash +# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> +# Copyright (C) 2014 Alexander Keller <github@nycroth.com> + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +#------------------------------------------------------------------------ + +# Use the provided interface, otherwise the device used for the default route. +if [[ -n $BLOCK_INSTANCE ]]; then + IF=$BLOCK_INSTANCE +else + IF=$(ip route | awk '/^default/ { print $5 ; exit }') +fi + +#------------------------------------------------------------------------ + +# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless +# connection (think desktop), the corresponding block should not be displayed. +[[ ! -d /sys/class/net/${IF} ]] && exit + +#------------------------------------------------------------------------ + +AF=inet6? +LABEL="" + +for flag in "$1" "$2"; do + case "$flag" in + -4) + AF=inet ;; + -6) + AF=inet6 ;; + -L) + if [[ "$IF" = "" ]]; then + LABEL="iface " + else + LABEL="$IF: " + fi ;; + esac +done + +if [[ "$IF" = "" ]] || [[ "$(cat /sys/class/net/$IF/operstate)" = 'down' ]]; then + echo "${LABEL}down" # full text + echo "${LABEL}down" # short text + echo \#FF0000 # color + exit +fi + +# if no interface is found, use the first device with a global scope +IPADDR=$(ip addr show $IF | perl -n -e "/$AF ([^\/]+).* scope global/ && print \$1 and exit") + +case $BLOCK_BUTTON in + 3) echo -n "$IPADDR" | xclip -q -se c ;; +esac + +#------------------------------------------------------------------------ + +echo "$LABEL$IPADDR" # full text +echo "$LABEL$IPADDR" # short text diff --git a/.i3/scripts/i3mail b/.i3/scripts/i3mail new file mode 100755 index 0000000..9b4aa3e --- /dev/null +++ b/.i3/scripts/i3mail @@ -0,0 +1,5 @@ +#!/bin/sh +case $BLOCK_BUTTON in + 1) $TERMINAL -e neomutt ;; +esac +echo $(find ~/.mail -wholename */INBOX/new/* | wc -l) diff --git a/.i3/scripts/i3mpd b/.i3/scripts/i3mpd new file mode 100755 index 0000000..b66f4c8 --- /dev/null +++ b/.i3/scripts/i3mpd @@ -0,0 +1,24 @@ +#!/bin/bash + +# Pass the password in the block instance +#if [[ -n $BLOCK_INSTANCE ]]; then + #password=("-h" "$BLOCK_INSTANCE@localhost") +#fi + +filter() { +# tr '\n' ' ' | grep -Po '.*(?= \[playing\])|paused' | tr -d '\n' + sed 2q | tac | sed -e "s/\&/&/g;/volume:/d;s/\[paused\].*/<span color=\"gray\" font_style=\"italic\">/g;s/\[playing\].*/<span>/g" | tr -d '\n' | sed -e "s/$/<\/span>/g" +} + +case $BLOCK_BUTTON in + 1) mpc status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause + 3) mpc toggle | filter ;; # right click, pause/unpause + 4) mpc prev | filter ;; # scroll up, previous + 5) mpc next | filter ;; # scroll down, next + *) mpc status | filter ;; + #1) mpc $password status | filter && $TERMINAL -e ncmpcpp & disown ;; # right click, pause/unpause + #3) mpc $password toggle | filter ;; # right click, pause/unpause + #4) mpc $password prev | filter ;; # scroll up, previous + #5) mpc $password next | filter ;; # scroll down, next + #*) mpc $password status | filter ;; +esac diff --git a/.i3/scripts/i3mpdupdate b/.i3/scripts/i3mpdupdate new file mode 100755 index 0000000..881b68f --- /dev/null +++ b/.i3/scripts/i3mpdupdate @@ -0,0 +1,6 @@ +#!/bin/bash +while : ; do + mpc idle > /dev/null + pkill -RTMIN+11 i3blocks ; +done + diff --git a/.i3/scripts/i3volume b/.i3/scripts/i3volume new file mode 100755 index 0000000..b47a6fa --- /dev/null +++ b/.i3/scripts/i3volume @@ -0,0 +1,12 @@ +#!/bin/bash + +case $BLOCK_BUTTON in + 1) $TERMINAL -e ncpamixer & disown ;; + 3) pamixer -t ;; + 4) pamixer -i 5 ;; + 5) pamixer -d 5 ;; +esac + +printpastatus() { [[ $(pamixer --get-mute) = "true" ]] && echo -n 🔇 && exit +echo 🔊 $(pamixer --get-volume)% ;} +printpastatus diff --git a/.i3/scripts/i3vpn b/.i3/scripts/i3vpn new file mode 100755 index 0000000..61caff7 --- /dev/null +++ b/.i3/scripts/i3vpn @@ -0,0 +1,23 @@ +#!/bin/bash +#Check VPN status + +GET_VPN=$(nmcli con show | grep tun0 | cut -d ' ' -f1) + +#Store status in STATUS + +if [[ $GET_VPN == *"tun0"* ]] +then + STATUSMSG=" `wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'`" + color=#00ff00 + echo "$STATUSMSG" + echo + echo $color +else + STATUSMSG="VPN OFF" + color=#ff0000 + echo "$STATUSMSG" + echo + echo $color +fi + + diff --git a/.i3/scripts/i3weather b/.i3/scripts/i3weather new file mode 100755 index 0000000..7aee4f3 --- /dev/null +++ b/.i3/scripts/i3weather @@ -0,0 +1,16 @@ +#!/bin/bash + +[[ $BLOCK_BUTTON = "1" ]] && st -e w3m wttr.in/~london + +ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit + +### This is only if your location isn't automatically detected, otherwise you can leave it blank. +loc="hatfield" +location=${loc// /+} + +curl wttr.in/~$location > ~/.weatherreport + +echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d') + +cat ~/.weatherreport | sed -n 13p | sed -e 's/[^m]*m//g;s/[^0-9]/ /g;s/ /\n/g;/^s*$/d' | grep [0-9] | sort -n | sed -e 1b -e '$!d' | tr '\n' ' ' | awk '{print " ❄️",$1 "°","☀️",$2 "°"}' + diff --git a/.i3/scripts/iface-down.png b/.i3/scripts/iface-down.png new file mode 100644 index 0000000..fc52879 --- /dev/null +++ b/.i3/scripts/iface-down.png @@ -0,0 +1,566 @@ + + + + + + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <link rel="dns-prefetch" href="https://assets-cdn.github.com"> + <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com"> + <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> + <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> + + + + <link crossorigin="anonymous" media="all" integrity="sha512-hqbuBb0QOOmiWgl8a1V1N5q6TI/G0A2hVt/lCFYafR+fYsuXeRUcsdcb/yUyVEHYXktmUXl0Mx9s/BOUNZVq4w==" rel="stylesheet" href="https://assets-cdn.github.com/assets/frameworks-23c9e7262eee71bc6f67f6950190a162.css" /> + <link crossorigin="anonymous" media="all" integrity="sha512-elrcfQA6O59ztZagZ8cAOxGBBl3W1LD9cHCZYAlZYGvEmf7DQFKtSZH+aQAgGJkZVNtXvUSgfyuhMCUlJa+qnw==" rel="stylesheet" href="https://assets-cdn.github.com/assets/github-96998038581f9d275d4a4a841c12e652.css" /> + + + <link crossorigin="anonymous" media="all" integrity="sha512-cCY9KKeDzfGd+snVDZwcOIrTjK+JAFW4FR1c4OGJo1Z2QZNbAGVD6JlcnHL19LBcdByWHVxwrAPwigT/v/DWyQ==" rel="stylesheet" href="https://assets-cdn.github.com/assets/site-7472e7b4603d4095447d49d428375ab8.css" /> + + + <meta name="viewport" content="width=device-width"> + + <title>i3blocks-contrib/iface-down.png at master · vivien/i3blocks-contrib · GitHub</title> + <meta name="description" content="GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects."> + <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> + <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> + <meta property="fb:app_id" content="1401488693436528"> + + + <meta property="og:image" content="https://avatars1.githubusercontent.com/u/285808?s=400&v=4" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="vivien/i3blocks-contrib" /><meta property="og:url" content="https://github.com/vivien/i3blocks-contrib" /><meta property="og:description" content="i3blocks-contrib - Official repository for community contributed blocklets" /> + + <link rel="assets" href="https://assets-cdn.github.com/"> + + <meta name="pjax-timeout" content="1000"> + + <meta name="request-id" content="E2CA:59D6:39F8654:69BA4FD:5AF9DDAC" data-pjax-transient> + + + + + <meta name="selected-link" value="repo_source" data-pjax-transient> + + <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> + <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> + <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> + <meta name="google-analytics" content="UA-3769691-2"> + +<meta name="octolytics-host" content="collector.githubapp.com" /><meta name="octolytics-app-id" content="github" /><meta name="octolytics-event-url" content="https://collector.githubapp.com/github-external/browser_event" /><meta name="octolytics-dimension-request_id" content="E2CA:59D6:39F8654:69BA4FD:5AF9DDAC" /><meta name="octolytics-dimension-region_edge" content="iad" /><meta name="octolytics-dimension-region_render" content="iad" /> +<meta name="analytics-location" content="/<user-name>/<repo-name>/blob/show" data-pjax-transient="true" /> + + + + + <meta class="js-ga-set" name="dimension1" content="Logged Out"> + + + + + <meta name="hostname" content="github.com"> + <meta name="user-login" content=""> + + <meta name="expected-hostname" content="github.com"> + <meta name="js-proxy-site-detection-payload" content="YjRkNWRmNjljMGY3Njc2ZTkzODAyODg2NzcxM2JiNmY5MThhNGQ2OTNjNDg3NmU3NzlkMTU0ODZiNDU2NzY4N3x7InJlbW90ZV9hZGRyZXNzIjoiMjE3LjE1MS45OC4xNjgiLCJyZXF1ZXN0X2lkIjoiRTJDQTo1OUQ2OjM5Rjg2NTQ6NjlCQTRGRDo1QUY5RERBQyIsInRpbWVzdGFtcCI6MTUyNjMyNDY1MywiaG9zdCI6ImdpdGh1Yi5jb20ifQ=="> + + <meta name="enabled-features" content="UNIVERSE_BANNER,FREE_TRIALS,MARKETPLACE_INSIGHTS,MARKETPLACE_SELF_SERVE,MARKETPLACE_FREE_APPS,MARKETPLACE_INSIGHTS_CONVERSION_PERCENTAGES"> + + <meta name="html-safe-nonce" content="f71badab740469551fca6e4a4dcc1b60fa7e9620"> + + <meta http-equiv="x-pjax-version" content="b458851e8418d0ed3493c36c4d0efee5"> + + + <link href="https://github.com/vivien/i3blocks-contrib/commits/master.atom" rel="alternate" title="Recent Commits to i3blocks-contrib:master" type="application/atom+xml"> + + <meta name="description" content="i3blocks-contrib - Official repository for community contributed blocklets"> + <meta name="go-import" content="github.com/vivien/i3blocks-contrib git https://github.com/vivien/i3blocks-contrib.git"> + + <meta name="octolytics-dimension-user_id" content="285808" /><meta name="octolytics-dimension-user_login" content="vivien" /><meta name="octolytics-dimension-repository_id" content="39731454" /><meta name="octolytics-dimension-repository_nwo" content="vivien/i3blocks-contrib" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="39731454" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vivien/i3blocks-contrib" /><meta name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" content="false" /> + + + <link rel="canonical" href="https://github.com/vivien/i3blocks-contrib/blob/master/iface/iface-down.png" data-pjax-transient> + + + <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> + + <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> + + <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000"> + <link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://assets-cdn.github.com/favicon.ico"> + +<meta name="theme-color" content="#1e2327"> + + + +<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> + + </head> + + <body class="logged-out env-production page-blob"> + + + <div class="position-relative js-header-wrapper "> + <a href="#start-of-content" tabindex="1" class="px-2 py-4 bg-blue text-white show-on-focus js-skip-to-content">Skip to content</a> + <div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div> + + + + + + + + <header class="Header header-logged-out position-relative f4 py-3" role="banner"> + <div class="container-lg d-flex px-3"> + <div class="d-flex flex-justify-between flex-items-center"> + <a class="header-logo-invertocat my-0" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark"> + <svg height="32" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> + </a> + + </div> + + <div class="HeaderMenu HeaderMenu--bright d-flex flex-justify-between flex-auto"> + <nav class="mt-0"> + <ul class="d-flex list-style-none"> + <li class="ml-2"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:features" data-selected-links="/features /features/project-management /features/code-review /features/project-management /features/integrations /features" href="/features"> + Features +</a> </li> + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:business" data-selected-links="/business /business/security /business/customers /business" href="/business"> + Business +</a> </li> + + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:explore" data-selected-links="/explore /trending /trending/developers /integrations /integrations/feature/code /integrations/feature/collaborate /integrations/feature/ship showcases showcases_search showcases_landing /explore" href="/explore"> + Explore +</a> </li> + + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:marketplace" data-selected-links=" /marketplace" href="/marketplace"> + Marketplace +</a> </li> + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:pricing" data-selected-links="/pricing /pricing/developer /pricing/team /pricing/business-hosted /pricing/business-enterprise /pricing" href="/pricing"> + Pricing +</a> </li> + </ul> + </nav> + + <div class="d-flex"> + <div class="d-lg-flex flex-items-center mr-3"> + <div class="header-search scoped-search site-scoped-search js-site-search" role="search"> + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" data-scope-type="Repository" data-scope-id="39731454" data-scoped-search-url="/vivien/i3blocks-contrib/search" data-unscoped-search-url="/search" action="/vivien/i3blocks-contrib/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /> + <label class="form-control header-search-wrapper js-chromeless-input-container"> + <a class="header-search-scope no-underline" href="/vivien/i3blocks-contrib/blob/master/iface/iface-down.png">This repository</a> + <input type="text" + class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable" + data-hotkey="s,/" + name="q" + value="" + placeholder="Search" + aria-label="Search this repository" + data-unscoped-placeholder="Search GitHub" + data-scoped-placeholder="Search" + autocapitalize="off" + > + <input type="hidden" class="js-site-search-type-field" name="type" > + </label> +</form></div> + + </div> + + <span class="d-inline-block"> + <div class="HeaderNavlink px-0 py-2 m-0"> + <a class="text-bold text-white no-underline" href="/login?return_to=%2Fvivien%2Fi3blocks-contrib%2Fblob%2Fmaster%2Fiface%2Fiface-down.png" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a> + <span class="text-gray">or</span> + <a class="text-bold text-white no-underline" href="/join?source=header-repo" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a> + </div> + </span> + </div> + </div> + </div> +</header> + + </div> + + <div id="start-of-content" class="show-on-focus"></div> + + <div id="js-flash-container"> +</div> + + + + <div role="main" class="application-main "> + <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> + <div id="js-repo-pjax-container" data-pjax-container > + + + + + + + + + <div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav "> + <div class="repohead-details-container clearfix container"> + + <ul class="pagehead-actions"> + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to watch a repository" rel="nofollow"> + <svg class="octicon octicon-eye" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> + Watch + </a> + <a class="social-count" href="/vivien/i3blocks-contrib/watchers" + aria-label="24 users are watching this repository"> + 24 + </a> + + </li> + + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to star a repository" rel="nofollow"> + <svg class="octicon octicon-star" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"/></svg> + Star + </a> + + <a class="social-count js-social-count" href="/vivien/i3blocks-contrib/stargazers" + aria-label="285 users starred this repository"> + 285 + </a> + + </li> + + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to fork a repository" rel="nofollow"> + <svg class="octicon octicon-repo-forked" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> + Fork + </a> + + <a href="/vivien/i3blocks-contrib/network" class="social-count" + aria-label="96 users forked this repository"> + 96 + </a> + </li> +</ul> + + <h1 class="public "> + <svg class="octicon octicon-repo" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg> + <span class="author" itemprop="author"><a class="url fn" rel="author" href="/vivien">vivien</a></span><!-- +--><span class="path-divider">/</span><!-- +--><strong itemprop="name"><a data-pjax="#js-repo-pjax-container" href="/vivien/i3blocks-contrib">i3blocks-contrib</a></strong> + +</h1> + + </div> + +<nav class="reponav js-repo-nav js-sidenav-container-pjax container" + itemscope + itemtype="http://schema.org/BreadcrumbList" + role="navigation" + data-pjax="#js-repo-pjax-container"> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a class="js-selected-navigation-item selected reponav-item" itemprop="url" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages /vivien/i3blocks-contrib" href="/vivien/i3blocks-contrib"> + <svg class="octicon octicon-code" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg> + <span itemprop="name">Code</span> + <meta itemprop="position" content="1"> +</a> </span> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a itemprop="url" data-hotkey="g i" class="js-selected-navigation-item reponav-item" data-selected-links="repo_issues repo_labels repo_milestones /vivien/i3blocks-contrib/issues" href="/vivien/i3blocks-contrib/issues"> + <svg class="octicon octicon-issue-opened" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg> + <span itemprop="name">Issues</span> + <span class="Counter">15</span> + <meta itemprop="position" content="2"> +</a> </span> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a data-hotkey="g p" itemprop="url" class="js-selected-navigation-item reponav-item" data-selected-links="repo_pulls checks /vivien/i3blocks-contrib/pulls" href="/vivien/i3blocks-contrib/pulls"> + <svg class="octicon octicon-git-pull-request" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> + <span itemprop="name">Pull requests</span> + <span class="Counter">20</span> + <meta itemprop="position" content="3"> +</a> </span> + + <a data-hotkey="g b" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /vivien/i3blocks-contrib/projects" href="/vivien/i3blocks-contrib/projects"> + <svg class="octicon octicon-project" viewBox="0 0 15 16" version="1.1" width="15" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg> + Projects + <span class="Counter" >0</span> +</a> + <a class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /vivien/i3blocks-contrib/wiki" href="/vivien/i3blocks-contrib/wiki"> + <svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg> + Wiki +</a> + + <a class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors dependency_graph pulse /vivien/i3blocks-contrib/pulse" href="/vivien/i3blocks-contrib/pulse"> + <svg class="octicon octicon-graph" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg> + Insights +</a> + +</nav> + + + </div> + +<div class="container new-discussion-timeline experiment-repo-nav "> + <div class="repository-content "> + + + <a class="d-none js-permalink-shortcut" data-hotkey="y" href="/vivien/i3blocks-contrib/blob/72e7afea8e35f63cee5956c84206d5c7b70ddae5/iface/iface-down.png">Permalink</a> + + <!-- blob contrib key: blob_contributors:v21:117bbdfe28c55630230299ddf394bb80 --> + + <div class="file-navigation"> + +<div class="select-menu branch-select-menu js-menu-container js-select-menu float-left"> + <button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w" + + type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true"> + <i>Branch:</i> + <span class="js-select-button css-truncate-target">master</span> + </button> + + <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax> + + <div class="select-menu-modal"> + <div class="select-menu-header"> + <svg class="octicon octicon-x js-menu-close" role="img" aria-label="Close" viewBox="0 0 12 16" version="1.1" width="12" height="16"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + <span class="select-menu-title">Switch branches/tags</span> + </div> + + <div class="select-menu-filters"> + <div class="select-menu-text-filter"> + <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Filter branches/tags"> + </div> + <div class="select-menu-tabs"> + <ul> + <li class="select-menu-tab"> + <a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a> + </li> + <li class="select-menu-tab"> + <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a> + </li> + </ul> + </div> + </div> + + <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu"> + + <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> + + + <a class="select-menu-item js-navigation-item js-navigation-open selected" + href="/vivien/i3blocks-contrib/blob/master/iface/iface-down.png" + data-name="master" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> + master + </span> + </a> + <a class="select-menu-item js-navigation-item js-navigation-open " + href="/vivien/i3blocks-contrib/blob/next/iface/iface-down.png" + data-name="next" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> + next + </span> + </a> + </div> + + <div class="select-menu-no-results">Nothing to show</div> + </div> + + <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags"> + <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> + + + <a class="select-menu-item js-navigation-item js-navigation-open " + href="/vivien/i3blocks-contrib/tree/v1.4.0/iface/iface-down.png" + data-name="v1.4.0" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target" title="v1.4.0"> + v1.4.0 + </span> + </a> + </div> + + <div class="select-menu-no-results">Nothing to show</div> + </div> + + </div> + </div> +</div> + + <div class="BtnGroup float-right"> + <a href="/vivien/i3blocks-contrib/find/master" + class="js-pjax-capture-input btn btn-sm BtnGroup-item" + data-pjax + data-hotkey="t"> + Find file + </a> + <clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item"> + Copy path + </clipboard-copy> + </div> + <div id="blob-path" class="breadcrumb"> + <span class="repo-root js-repo-root"><span class="js-path-segment"><a data-pjax="true" href="/vivien/i3blocks-contrib"><span>i3blocks-contrib</span></a></span></span><span class="separator">/</span><span class="js-path-segment"><a data-pjax="true" href="/vivien/i3blocks-contrib/tree/master/iface"><span>iface</span></a></span><span class="separator">/</span><strong class="final-path">iface-down.png</strong> + </div> + </div> + + + <include-fragment src="/vivien/i3blocks-contrib/contributors/master/iface/iface-down.png" class="commit-tease"> + <div> + Fetching contributors… + </div> + + <div class="commit-tease-contributors"> + <img alt="" class="loader-loading float-left" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif" width="16" height="16" /> + <span class="loader-error">Cannot retrieve contributors at this time</span> + </div> +</include-fragment> + + + <div class="file"> + <div class="file-header"> + <div class="file-actions"> + + <div class="BtnGroup"> + <a id="raw-url" class="btn btn-sm BtnGroup-item" href="/vivien/i3blocks-contrib/raw/master/iface/iface-down.png">Download</a> + <a rel="nofollow" class="btn btn-sm BtnGroup-item" href="/vivien/i3blocks-contrib/commits/master/iface/iface-down.png">History</a> + </div> + + + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="inline-form" action="/vivien/i3blocks-contrib/delete/master/iface/iface-down.png" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="authenticity_token" value="rkIxbHS/riwl3JY191MlJDlI3CKSXs9h5RTsXZalhGPRDZFxSXUJ6Ebk2ySf+AtM0FiNdnGbqga632necwjPUw==" /> + <button class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw" type="submit" + aria-label="You must be signed in to make or propose changes" data-disable-with> + <svg class="octicon octicon-trashcan" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg> + </button> +</form> </div> + + <div class="file-info"> + 459 Bytes + </div> +</div> + + + + <div itemprop="text" class="blob-wrapper data type-text"> + <div class="image"> + <span class="border-wrap"><img src="/vivien/i3blocks-contrib/blob/master/iface/iface-down.png?raw=true" alt="iface-down.png"></span> + </div> + </div> + + </div> + + <button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button> + <div id="jump-to-line" style="display:none"> + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-jump-to-line-form" action="" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /> + <input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" aria-label="Jump to line" autofocus> + <button type="submit" class="btn">Go</button> +</form> </div> + + + </div> + <div class="modal-backdrop js-touch-events"></div> +</div> + + </div> + </div> + + </div> + + +<div class="footer container-lg px-3" role="contentinfo"> + <div class="position-relative d-flex flex-justify-between pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light "> + <ul class="list-style-none d-flex flex-wrap "> + <li class="mr-3">© 2018 <span title="0.26529s from unicorn-570656551-l7df6">GitHub</span>, Inc.</li> + <li class="mr-3"><a data-ga-click="Footer, go to terms, text:terms" href="https://github.com/site/terms">Terms</a></li> + <li class="mr-3"><a data-ga-click="Footer, go to privacy, text:privacy" href="https://github.com/site/privacy">Privacy</a></li> + <li class="mr-3"><a href="https://help.github.com/articles/github-security/" data-ga-click="Footer, go to security, text:security">Security</a></li> + <li class="mr-3"><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li> + <li><a data-ga-click="Footer, go to help, text:help" href="https://help.github.com">Help</a></li> + </ul> + + <a aria-label="Homepage" title="GitHub" class="footer-octicon" href="https://github.com"> + <svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> +</a> + <ul class="list-style-none d-flex flex-wrap "> + <li class="mr-3"><a data-ga-click="Footer, go to contact, text:contact" href="https://github.com/contact">Contact GitHub</a></li> + <li class="mr-3"><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li> + <li class="mr-3"><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li> + <li class="mr-3"><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li> + <li class="mr-3"><a href="https://blog.github.com" data-ga-click="Footer, go to blog, text:blog">Blog</a></li> + <li><a data-ga-click="Footer, go to about, text:about" href="https://github.com/about">About</a></li> + + </ul> + </div> + <div class="d-flex flex-justify-center pb-6"> + <span class="f6 text-gray-light"></span> + </div> +</div> + + + + <div id="ajax-error-message" class="ajax-error-message flash flash-error"> + <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg> + <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> + <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + </button> + You can’t perform that action at this time. + </div> + + + <script crossorigin="anonymous" integrity="sha512-2GVr5rsbbfKbHM6oRrri41+qJ2ltJBCqluASS29fj+9yHGLFmFhq0C64VMdL57UJ34G2+FXU+8FZhaAOnsCEhw==" type="application/javascript" src="https://assets-cdn.github.com/assets/compat-bb7abfb15ed4ffb0da9056d4c980fba5.js"></script> + <script crossorigin="anonymous" integrity="sha512-Aff3pZ4kxDZQtwoDgGXK3pyN4iQf3iacjHCHaTq0uvu7OAGAVBmvy1B9BIl72Yr4elhuVbdYlkDdCLOERCA3sw==" type="application/javascript" src="https://assets-cdn.github.com/assets/frameworks-69305c61e4ce67cdef4a70845fc0e959.js"></script> + + <script crossorigin="anonymous" async="async" integrity="sha512-lR6qGUwl+E+II1nTIoUOEsiPPSiFXngO9f8qpYgVtj4Qpz3Txge9KdIdqLMLrpdpVLzkTgyB3Un3aexsxttJ8Q==" type="application/javascript" src="https://assets-cdn.github.com/assets/github-bed113001abefcd143ae6f67ad18ff59.js"></script> + + + + + <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none"> + <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg> + <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span> + <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span> + </div> + <div class="facebox" id="facebox" style="display:none;"> + <div class="facebox-popup"> + <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description"> + </div> + <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal"> + <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + </button> + </div> +</div> + + <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> + <div class="Popover-message Popover-message--bottom-left Popover-message--large Box box-shadow-large" style="width:360px;"> + </div> +</div> + +<div id="hovercard-aria-description" class="sr-only"> + Press h to open a hovercard with more details. +</div> + + + </body> +</html> + diff --git a/.i3/scripts/iface-up.png b/.i3/scripts/iface-up.png new file mode 100644 index 0000000..cb82ac5 --- /dev/null +++ b/.i3/scripts/iface-up.png @@ -0,0 +1,566 @@ + + + + + + +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <link rel="dns-prefetch" href="https://assets-cdn.github.com"> + <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com"> + <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com"> + <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> + <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/"> + + + + <link crossorigin="anonymous" media="all" integrity="sha512-hqbuBb0QOOmiWgl8a1V1N5q6TI/G0A2hVt/lCFYafR+fYsuXeRUcsdcb/yUyVEHYXktmUXl0Mx9s/BOUNZVq4w==" rel="stylesheet" href="https://assets-cdn.github.com/assets/frameworks-23c9e7262eee71bc6f67f6950190a162.css" /> + <link crossorigin="anonymous" media="all" integrity="sha512-elrcfQA6O59ztZagZ8cAOxGBBl3W1LD9cHCZYAlZYGvEmf7DQFKtSZH+aQAgGJkZVNtXvUSgfyuhMCUlJa+qnw==" rel="stylesheet" href="https://assets-cdn.github.com/assets/github-96998038581f9d275d4a4a841c12e652.css" /> + + + <link crossorigin="anonymous" media="all" integrity="sha512-cCY9KKeDzfGd+snVDZwcOIrTjK+JAFW4FR1c4OGJo1Z2QZNbAGVD6JlcnHL19LBcdByWHVxwrAPwigT/v/DWyQ==" rel="stylesheet" href="https://assets-cdn.github.com/assets/site-7472e7b4603d4095447d49d428375ab8.css" /> + + + <meta name="viewport" content="width=device-width"> + + <title>i3blocks-contrib/iface-up.png at master · vivien/i3blocks-contrib · GitHub</title> + <meta name="description" content="GitHub is where people build software. More than 27 million people use GitHub to discover, fork, and contribute to over 80 million projects."> + <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub"> + <link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub"> + <meta property="fb:app_id" content="1401488693436528"> + + + <meta property="og:image" content="https://avatars1.githubusercontent.com/u/285808?s=400&v=4" /><meta property="og:site_name" content="GitHub" /><meta property="og:type" content="object" /><meta property="og:title" content="vivien/i3blocks-contrib" /><meta property="og:url" content="https://github.com/vivien/i3blocks-contrib" /><meta property="og:description" content="i3blocks-contrib - Official repository for community contributed blocklets" /> + + <link rel="assets" href="https://assets-cdn.github.com/"> + + <meta name="pjax-timeout" content="1000"> + + <meta name="request-id" content="B4A0:59D3:2A3610C:4FCF2E5:5AF9DDBA" data-pjax-transient> + + + + + <meta name="selected-link" value="repo_source" data-pjax-transient> + + <meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU"> + <meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA"> + <meta name="google-site-verification" content="GXs5KoUUkNCoaAZn7wPN-t01Pywp9M3sEjnt_3_ZWPc"> + <meta name="google-analytics" content="UA-3769691-2"> + +<meta name="octolytics-host" content="collector.githubapp.com" /><meta name="octolytics-app-id" content="github" /><meta name="octolytics-event-url" content="https://collector.githubapp.com/github-external/browser_event" /><meta name="octolytics-dimension-request_id" content="B4A0:59D3:2A3610C:4FCF2E5:5AF9DDBA" /><meta name="octolytics-dimension-region_edge" content="iad" /><meta name="octolytics-dimension-region_render" content="iad" /> +<meta name="analytics-location" content="/<user-name>/<repo-name>/blob/show" data-pjax-transient="true" /> + + + + + <meta class="js-ga-set" name="dimension1" content="Logged Out"> + + + + + <meta name="hostname" content="github.com"> + <meta name="user-login" content=""> + + <meta name="expected-hostname" content="github.com"> + <meta name="js-proxy-site-detection-payload" content="ZWVhNWU3OTM1N2E2NTM0NDkzOGI3MDIwNTlkYWYzYzY2MjdkZjdjNDhjMDY5MDU4Y2VlODY0NTRiNzc1ZjVjY3x7InJlbW90ZV9hZGRyZXNzIjoiMjE3LjE1MS45OC4xNjgiLCJyZXF1ZXN0X2lkIjoiQjRBMDo1OUQzOjJBMzYxMEM6NEZDRjJFNTo1QUY5RERCQSIsInRpbWVzdGFtcCI6MTUyNjMyNDY2NywiaG9zdCI6ImdpdGh1Yi5jb20ifQ=="> + + <meta name="enabled-features" content="UNIVERSE_BANNER,FREE_TRIALS,MARKETPLACE_INSIGHTS,MARKETPLACE_SELF_SERVE,MARKETPLACE_FREE_APPS,MARKETPLACE_INSIGHTS_CONVERSION_PERCENTAGES"> + + <meta name="html-safe-nonce" content="05d40f24d38bfbd71ae717619ec73b2102c17ff8"> + + <meta http-equiv="x-pjax-version" content="b458851e8418d0ed3493c36c4d0efee5"> + + + <link href="https://github.com/vivien/i3blocks-contrib/commits/master.atom" rel="alternate" title="Recent Commits to i3blocks-contrib:master" type="application/atom+xml"> + + <meta name="description" content="i3blocks-contrib - Official repository for community contributed blocklets"> + <meta name="go-import" content="github.com/vivien/i3blocks-contrib git https://github.com/vivien/i3blocks-contrib.git"> + + <meta name="octolytics-dimension-user_id" content="285808" /><meta name="octolytics-dimension-user_login" content="vivien" /><meta name="octolytics-dimension-repository_id" content="39731454" /><meta name="octolytics-dimension-repository_nwo" content="vivien/i3blocks-contrib" /><meta name="octolytics-dimension-repository_public" content="true" /><meta name="octolytics-dimension-repository_is_fork" content="false" /><meta name="octolytics-dimension-repository_network_root_id" content="39731454" /><meta name="octolytics-dimension-repository_network_root_nwo" content="vivien/i3blocks-contrib" /><meta name="octolytics-dimension-repository_explore_github_marketplace_ci_cta_shown" content="false" /> + + + <link rel="canonical" href="https://github.com/vivien/i3blocks-contrib/blob/master/iface/iface-up.png" data-pjax-transient> + + + <meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats"> + + <meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors"> + + <link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000"> + <link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://assets-cdn.github.com/favicon.ico"> + +<meta name="theme-color" content="#1e2327"> + + + +<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials"> + + </head> + + <body class="logged-out env-production page-blob"> + + + <div class="position-relative js-header-wrapper "> + <a href="#start-of-content" tabindex="1" class="px-2 py-4 bg-blue text-white show-on-focus js-skip-to-content">Skip to content</a> + <div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div> + + + + + + + + <header class="Header header-logged-out position-relative f4 py-3" role="banner"> + <div class="container-lg d-flex px-3"> + <div class="d-flex flex-justify-between flex-items-center"> + <a class="header-logo-invertocat my-0" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark"> + <svg height="32" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> + </a> + + </div> + + <div class="HeaderMenu HeaderMenu--bright d-flex flex-justify-between flex-auto"> + <nav class="mt-0"> + <ul class="d-flex list-style-none"> + <li class="ml-2"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:features" data-selected-links="/features /features/project-management /features/code-review /features/project-management /features/integrations /features" href="/features"> + Features +</a> </li> + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:business" data-selected-links="/business /business/security /business/customers /business" href="/business"> + Business +</a> </li> + + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:explore" data-selected-links="/explore /trending /trending/developers /integrations /integrations/feature/code /integrations/feature/collaborate /integrations/feature/ship showcases showcases_search showcases_landing /explore" href="/explore"> + Explore +</a> </li> + + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:marketplace" data-selected-links=" /marketplace" href="/marketplace"> + Marketplace +</a> </li> + <li class="ml-4"> + <a class="js-selected-navigation-item HeaderNavlink px-0 py-2 m-0" data-ga-click="Header, click, Nav menu - item:pricing" data-selected-links="/pricing /pricing/developer /pricing/team /pricing/business-hosted /pricing/business-enterprise /pricing" href="/pricing"> + Pricing +</a> </li> + </ul> + </nav> + + <div class="d-flex"> + <div class="d-lg-flex flex-items-center mr-3"> + <div class="header-search scoped-search site-scoped-search js-site-search" role="search"> + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" data-scope-type="Repository" data-scope-id="39731454" data-scoped-search-url="/vivien/i3blocks-contrib/search" data-unscoped-search-url="/search" action="/vivien/i3blocks-contrib/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /> + <label class="form-control header-search-wrapper js-chromeless-input-container"> + <a class="header-search-scope no-underline" href="/vivien/i3blocks-contrib/blob/master/iface/iface-up.png">This repository</a> + <input type="text" + class="form-control header-search-input js-site-search-focus js-site-search-field is-clearable" + data-hotkey="s,/" + name="q" + value="" + placeholder="Search" + aria-label="Search this repository" + data-unscoped-placeholder="Search GitHub" + data-scoped-placeholder="Search" + autocapitalize="off" + > + <input type="hidden" class="js-site-search-type-field" name="type" > + </label> +</form></div> + + </div> + + <span class="d-inline-block"> + <div class="HeaderNavlink px-0 py-2 m-0"> + <a class="text-bold text-white no-underline" href="/login?return_to=%2Fvivien%2Fi3blocks-contrib%2Fblob%2Fmaster%2Fiface%2Fiface-up.png" data-ga-click="(Logged out) Header, clicked Sign in, text:sign-in">Sign in</a> + <span class="text-gray">or</span> + <a class="text-bold text-white no-underline" href="/join?source=header-repo" data-ga-click="(Logged out) Header, clicked Sign up, text:sign-up">Sign up</a> + </div> + </span> + </div> + </div> + </div> +</header> + + </div> + + <div id="start-of-content" class="show-on-focus"></div> + + <div id="js-flash-container"> +</div> + + + + <div role="main" class="application-main "> + <div itemscope itemtype="http://schema.org/SoftwareSourceCode" class=""> + <div id="js-repo-pjax-container" data-pjax-container > + + + + + + + + + <div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav "> + <div class="repohead-details-container clearfix container"> + + <ul class="pagehead-actions"> + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to watch a repository" rel="nofollow"> + <svg class="octicon octicon-eye" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6C13 14 16 8 16 8s-3-6-7.94-6zM8 12c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4zm2-4c0 1.11-.89 2-2 2-1.11 0-2-.89-2-2 0-1.11.89-2 2-2 1.11 0 2 .89 2 2z"/></svg> + Watch + </a> + <a class="social-count" href="/vivien/i3blocks-contrib/watchers" + aria-label="24 users are watching this repository"> + 24 + </a> + + </li> + + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to star a repository" rel="nofollow"> + <svg class="octicon octicon-star" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M14 6l-4.9-.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14 7 11.67 11.33 14l-.93-4.74L14 6z"/></svg> + Star + </a> + + <a class="social-count js-social-count" href="/vivien/i3blocks-contrib/stargazers" + aria-label="285 users starred this repository"> + 285 + </a> + + </li> + + <li> + <a href="/login?return_to=%2Fvivien%2Fi3blocks-contrib" + class="btn btn-sm btn-with-count tooltipped tooltipped-n" + aria-label="You must be signed in to fork a repository" rel="nofollow"> + <svg class="octicon octicon-repo-forked" viewBox="0 0 10 16" version="1.1" width="10" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8 1a1.993 1.993 0 0 0-1 3.72V6L5 8 3 6V4.72A1.993 1.993 0 0 0 2 1a1.993 1.993 0 0 0-1 3.72V6.5l3 3v1.78A1.993 1.993 0 0 0 5 15a1.993 1.993 0 0 0 1-3.72V9.5l3-3V4.72A1.993 1.993 0 0 0 8 1zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3 10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zm3-10c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> + Fork + </a> + + <a href="/vivien/i3blocks-contrib/network" class="social-count" + aria-label="96 users forked this repository"> + 96 + </a> + </li> +</ul> + + <h1 class="public "> + <svg class="octicon octicon-repo" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M4 9H3V8h1v1zm0-3H3v1h1V6zm0-2H3v1h1V4zm0-2H3v1h1V2zm8-1v12c0 .55-.45 1-1 1H6v2l-1.5-1.5L3 16v-2H1c-.55 0-1-.45-1-1V1c0-.55.45-1 1-1h10c.55 0 1 .45 1 1zm-1 10H1v2h2v-1h3v1h5v-2zm0-10H2v9h9V1z"/></svg> + <span class="author" itemprop="author"><a class="url fn" rel="author" href="/vivien">vivien</a></span><!-- +--><span class="path-divider">/</span><!-- +--><strong itemprop="name"><a data-pjax="#js-repo-pjax-container" href="/vivien/i3blocks-contrib">i3blocks-contrib</a></strong> + +</h1> + + </div> + +<nav class="reponav js-repo-nav js-sidenav-container-pjax container" + itemscope + itemtype="http://schema.org/BreadcrumbList" + role="navigation" + data-pjax="#js-repo-pjax-container"> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a class="js-selected-navigation-item selected reponav-item" itemprop="url" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches repo_packages /vivien/i3blocks-contrib" href="/vivien/i3blocks-contrib"> + <svg class="octicon octicon-code" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"/></svg> + <span itemprop="name">Code</span> + <meta itemprop="position" content="1"> +</a> </span> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a itemprop="url" data-hotkey="g i" class="js-selected-navigation-item reponav-item" data-selected-links="repo_issues repo_labels repo_milestones /vivien/i3blocks-contrib/issues" href="/vivien/i3blocks-contrib/issues"> + <svg class="octicon octicon-issue-opened" viewBox="0 0 14 16" version="1.1" width="14" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"/></svg> + <span itemprop="name">Issues</span> + <span class="Counter">15</span> + <meta itemprop="position" content="2"> +</a> </span> + + <span itemscope itemtype="http://schema.org/ListItem" itemprop="itemListElement"> + <a data-hotkey="g p" itemprop="url" class="js-selected-navigation-item reponav-item" data-selected-links="repo_pulls checks /vivien/i3blocks-contrib/pulls" href="/vivien/i3blocks-contrib/pulls"> + <svg class="octicon octicon-git-pull-request" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 11.28V5c-.03-.78-.34-1.47-.94-2.06C9.46 2.35 8.78 2.03 8 2H7V0L4 3l3 3V4h1c.27.02.48.11.69.31.21.2.3.42.31.69v6.28A1.993 1.993 0 0 0 10 15a1.993 1.993 0 0 0 1-3.72zm-1 2.92c-.66 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2zM4 3c0-1.11-.89-2-2-2a1.993 1.993 0 0 0-1 3.72v6.56A1.993 1.993 0 0 0 2 15a1.993 1.993 0 0 0 1-3.72V4.72c.59-.34 1-.98 1-1.72zm-.8 10c0 .66-.55 1.2-1.2 1.2-.65 0-1.2-.55-1.2-1.2 0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2zM2 4.2C1.34 4.2.8 3.65.8 3c0-.65.55-1.2 1.2-1.2.65 0 1.2.55 1.2 1.2 0 .65-.55 1.2-1.2 1.2z"/></svg> + <span itemprop="name">Pull requests</span> + <span class="Counter">20</span> + <meta itemprop="position" content="3"> +</a> </span> + + <a data-hotkey="g b" class="js-selected-navigation-item reponav-item" data-selected-links="repo_projects new_repo_project repo_project /vivien/i3blocks-contrib/projects" href="/vivien/i3blocks-contrib/projects"> + <svg class="octicon octicon-project" viewBox="0 0 15 16" version="1.1" width="15" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M10 12h3V2h-3v10zm-4-2h3V2H6v8zm-4 4h3V2H2v12zm-1 1h13V1H1v14zM14 0H1a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1z"/></svg> + Projects + <span class="Counter" >0</span> +</a> + <a class="js-selected-navigation-item reponav-item" data-hotkey="g w" data-selected-links="repo_wiki /vivien/i3blocks-contrib/wiki" href="/vivien/i3blocks-contrib/wiki"> + <svg class="octicon octicon-book" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M3 5h4v1H3V5zm0 3h4V7H3v1zm0 2h4V9H3v1zm11-5h-4v1h4V5zm0 2h-4v1h4V7zm0 2h-4v1h4V9zm2-6v9c0 .55-.45 1-1 1H9.5l-1 1-1-1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h5.5l1 1 1-1H15c.55 0 1 .45 1 1zm-8 .5L7.5 3H2v9h6V3.5zm7-.5H9.5l-.5.5V12h6V3z"/></svg> + Wiki +</a> + + <a class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors dependency_graph pulse /vivien/i3blocks-contrib/pulse" href="/vivien/i3blocks-contrib/pulse"> + <svg class="octicon octicon-graph" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M16 14v1H0V0h1v14h15zM5 13H3V8h2v5zm4 0H7V3h2v10zm4 0h-2V6h2v7z"/></svg> + Insights +</a> + +</nav> + + + </div> + +<div class="container new-discussion-timeline experiment-repo-nav "> + <div class="repository-content "> + + + <a class="d-none js-permalink-shortcut" data-hotkey="y" href="/vivien/i3blocks-contrib/blob/72e7afea8e35f63cee5956c84206d5c7b70ddae5/iface/iface-up.png">Permalink</a> + + <!-- blob contrib key: blob_contributors:v21:00be70e057fac8faca0df3c6ddb9e4be --> + + <div class="file-navigation"> + +<div class="select-menu branch-select-menu js-menu-container js-select-menu float-left"> + <button class=" btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w" + + type="button" aria-label="Switch branches or tags" aria-expanded="false" aria-haspopup="true"> + <i>Branch:</i> + <span class="js-select-button css-truncate-target">master</span> + </button> + + <div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax> + + <div class="select-menu-modal"> + <div class="select-menu-header"> + <svg class="octicon octicon-x js-menu-close" role="img" aria-label="Close" viewBox="0 0 12 16" version="1.1" width="12" height="16"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + <span class="select-menu-title">Switch branches/tags</span> + </div> + + <div class="select-menu-filters"> + <div class="select-menu-text-filter"> + <input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="form-control js-filterable-field js-navigation-enable" placeholder="Filter branches/tags"> + </div> + <div class="select-menu-tabs"> + <ul> + <li class="select-menu-tab"> + <a href="#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a> + </li> + <li class="select-menu-tab"> + <a href="#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a> + </li> + </ul> + </div> + </div> + + <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu"> + + <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> + + + <a class="select-menu-item js-navigation-item js-navigation-open selected" + href="/vivien/i3blocks-contrib/blob/master/iface/iface-up.png" + data-name="master" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> + master + </span> + </a> + <a class="select-menu-item js-navigation-item js-navigation-open " + href="/vivien/i3blocks-contrib/blob/next/iface/iface-up.png" + data-name="next" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target js-select-menu-filter-text"> + next + </span> + </a> + </div> + + <div class="select-menu-no-results">Nothing to show</div> + </div> + + <div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags"> + <div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring"> + + + <a class="select-menu-item js-navigation-item js-navigation-open " + href="/vivien/i3blocks-contrib/tree/v1.4.0/iface/iface-up.png" + data-name="v1.4.0" + data-skip-pjax="true" + rel="nofollow"> + <svg class="octicon octicon-check select-menu-item-icon" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z"/></svg> + <span class="select-menu-item-text css-truncate-target" title="v1.4.0"> + v1.4.0 + </span> + </a> + </div> + + <div class="select-menu-no-results">Nothing to show</div> + </div> + + </div> + </div> +</div> + + <div class="BtnGroup float-right"> + <a href="/vivien/i3blocks-contrib/find/master" + class="js-pjax-capture-input btn btn-sm BtnGroup-item" + data-pjax + data-hotkey="t"> + Find file + </a> + <clipboard-copy for="blob-path" class="btn btn-sm BtnGroup-item"> + Copy path + </clipboard-copy> + </div> + <div id="blob-path" class="breadcrumb"> + <span class="repo-root js-repo-root"><span class="js-path-segment"><a data-pjax="true" href="/vivien/i3blocks-contrib"><span>i3blocks-contrib</span></a></span></span><span class="separator">/</span><span class="js-path-segment"><a data-pjax="true" href="/vivien/i3blocks-contrib/tree/master/iface"><span>iface</span></a></span><span class="separator">/</span><strong class="final-path">iface-up.png</strong> + </div> + </div> + + + <include-fragment src="/vivien/i3blocks-contrib/contributors/master/iface/iface-up.png" class="commit-tease"> + <div> + Fetching contributors… + </div> + + <div class="commit-tease-contributors"> + <img alt="" class="loader-loading float-left" src="https://assets-cdn.github.com/images/spinners/octocat-spinner-32-EAF2F5.gif" width="16" height="16" /> + <span class="loader-error">Cannot retrieve contributors at this time</span> + </div> +</include-fragment> + + + <div class="file"> + <div class="file-header"> + <div class="file-actions"> + + <div class="BtnGroup"> + <a id="raw-url" class="btn btn-sm BtnGroup-item" href="/vivien/i3blocks-contrib/raw/master/iface/iface-up.png">Download</a> + <a rel="nofollow" class="btn btn-sm BtnGroup-item" href="/vivien/i3blocks-contrib/commits/master/iface/iface-up.png">History</a> + </div> + + + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="inline-form" action="/vivien/i3blocks-contrib/delete/master/iface/iface-up.png" accept-charset="UTF-8" method="post"><input name="utf8" type="hidden" value="✓" /><input type="hidden" name="authenticity_token" value="MZmDWDObtREjPfRx5mScjdITJoYbp2Nm14yo94+c8EtUs8M7uoDs9QDtWO9/kFEufweJZO5PhZzlsmogu0em4Q==" /> + <button class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw" type="submit" + aria-label="You must be signed in to make or propose changes" data-disable-with> + <svg class="octicon octicon-trashcan" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M11 2H9c0-.55-.45-1-1-1H5c-.55 0-1 .45-1 1H2c-.55 0-1 .45-1 1v1c0 .55.45 1 1 1v9c0 .55.45 1 1 1h7c.55 0 1-.45 1-1V5c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm-1 12H3V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9zm1-10H2V3h9v1z"/></svg> + </button> +</form> </div> + + <div class="file-info"> + 856 Bytes + </div> +</div> + + + + <div itemprop="text" class="blob-wrapper data type-text"> + <div class="image"> + <span class="border-wrap"><img src="/vivien/i3blocks-contrib/blob/master/iface/iface-up.png?raw=true" alt="iface-up.png"></span> + </div> + </div> + + </div> + + <button type="button" data-facebox="#jump-to-line" data-facebox-class="linejump" data-hotkey="l" class="d-none">Jump to Line</button> + <div id="jump-to-line" style="display:none"> + <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-jump-to-line-form" action="" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓" /> + <input class="form-control linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" aria-label="Jump to line" autofocus> + <button type="submit" class="btn">Go</button> +</form> </div> + + + </div> + <div class="modal-backdrop js-touch-events"></div> +</div> + + </div> + </div> + + </div> + + +<div class="footer container-lg px-3" role="contentinfo"> + <div class="position-relative d-flex flex-justify-between pt-6 pb-2 mt-6 f6 text-gray border-top border-gray-light "> + <ul class="list-style-none d-flex flex-wrap "> + <li class="mr-3">© 2018 <span title="0.28781s from unicorn-3245507942-jb7sd">GitHub</span>, Inc.</li> + <li class="mr-3"><a data-ga-click="Footer, go to terms, text:terms" href="https://github.com/site/terms">Terms</a></li> + <li class="mr-3"><a data-ga-click="Footer, go to privacy, text:privacy" href="https://github.com/site/privacy">Privacy</a></li> + <li class="mr-3"><a href="https://help.github.com/articles/github-security/" data-ga-click="Footer, go to security, text:security">Security</a></li> + <li class="mr-3"><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li> + <li><a data-ga-click="Footer, go to help, text:help" href="https://help.github.com">Help</a></li> + </ul> + + <a aria-label="Homepage" title="GitHub" class="footer-octicon" href="https://github.com"> + <svg height="24" class="octicon octicon-mark-github" viewBox="0 0 16 16" version="1.1" width="24" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg> +</a> + <ul class="list-style-none d-flex flex-wrap "> + <li class="mr-3"><a data-ga-click="Footer, go to contact, text:contact" href="https://github.com/contact">Contact GitHub</a></li> + <li class="mr-3"><a href="https://developer.github.com" data-ga-click="Footer, go to api, text:api">API</a></li> + <li class="mr-3"><a href="https://training.github.com" data-ga-click="Footer, go to training, text:training">Training</a></li> + <li class="mr-3"><a href="https://shop.github.com" data-ga-click="Footer, go to shop, text:shop">Shop</a></li> + <li class="mr-3"><a href="https://blog.github.com" data-ga-click="Footer, go to blog, text:blog">Blog</a></li> + <li><a data-ga-click="Footer, go to about, text:about" href="https://github.com/about">About</a></li> + + </ul> + </div> + <div class="d-flex flex-justify-center pb-6"> + <span class="f6 text-gray-light"></span> + </div> +</div> + + + + <div id="ajax-error-message" class="ajax-error-message flash flash-error"> + <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg> + <button type="button" class="flash-close js-ajax-error-dismiss" aria-label="Dismiss error"> + <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + </button> + You can’t perform that action at this time. + </div> + + + <script crossorigin="anonymous" integrity="sha512-2GVr5rsbbfKbHM6oRrri41+qJ2ltJBCqluASS29fj+9yHGLFmFhq0C64VMdL57UJ34G2+FXU+8FZhaAOnsCEhw==" type="application/javascript" src="https://assets-cdn.github.com/assets/compat-bb7abfb15ed4ffb0da9056d4c980fba5.js"></script> + <script crossorigin="anonymous" integrity="sha512-Aff3pZ4kxDZQtwoDgGXK3pyN4iQf3iacjHCHaTq0uvu7OAGAVBmvy1B9BIl72Yr4elhuVbdYlkDdCLOERCA3sw==" type="application/javascript" src="https://assets-cdn.github.com/assets/frameworks-69305c61e4ce67cdef4a70845fc0e959.js"></script> + + <script crossorigin="anonymous" async="async" integrity="sha512-lR6qGUwl+E+II1nTIoUOEsiPPSiFXngO9f8qpYgVtj4Qpz3Txge9KdIdqLMLrpdpVLzkTgyB3Un3aexsxttJ8Q==" type="application/javascript" src="https://assets-cdn.github.com/assets/github-bed113001abefcd143ae6f67ad18ff59.js"></script> + + + + + <div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none"> + <svg class="octicon octicon-alert" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"/></svg> + <span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span> + <span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span> + </div> + <div class="facebox" id="facebox" style="display:none;"> + <div class="facebox-popup"> + <div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description"> + </div> + <button type="button" class="facebox-close js-facebox-close" aria-label="Close modal"> + <svg class="octicon octicon-x" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48L7.48 8z"/></svg> + </button> + </div> +</div> + + <div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0"> + <div class="Popover-message Popover-message--bottom-left Popover-message--large Box box-shadow-large" style="width:360px;"> + </div> +</div> + +<div id="hovercard-aria-description" class="sr-only"> + Press h to open a hovercard with more details. +</div> + + + </body> +</html> + diff --git a/.i3/scripts/larbs.png b/.i3/scripts/larbs.png Binary files differnew file mode 100644 index 0000000..0dbc687 --- /dev/null +++ b/.i3/scripts/larbs.png diff --git a/.i3/scripts/linkhandler b/.i3/scripts/linkhandler new file mode 100755 index 0000000..4f364fc --- /dev/null +++ b/.i3/scripts/linkhandler @@ -0,0 +1,27 @@ +#!/bin/sh + +# Feed script a url or file location. +# If an image, it will view in feh, +# if a video or gif, it will view in mpv +# if a music file or pdf, it will download, +# otherwise it opens link in browser. + +# Sci-Hub's domain occasionally changes due to shutdowns: +scihub="http://sci-hub.tw/" + +# If no url given. Opens browser. For using script as $BROWSER. +[ -z "$1" ] && { "$TRUEBROWSER"; exit; } + +case "$1" in + *mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) + setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; + *png|*jpg|*jpe|*jpeg) + setsid feh "$1" >/dev/null 2>&1 & ;; + *mp3|*flac|*opus|*mp3?source) + setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; + *springer.com*) + setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;; + *) + if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" + else setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & fi ;; +esac diff --git a/.i3/scripts/lmc b/.i3/scripts/lmc new file mode 100755 index 0000000..45cfcd9 --- /dev/null +++ b/.i3/scripts/lmc @@ -0,0 +1,43 @@ +#!/bin/sh + +# A general audio interface for LARBS. + +newvol="pkill -RTMIN+10 i3blocks" + +[ -z "$2" ] && num="2" || num="$2" + +case "$1" in + u*) pulsemixer --change-volume +"$num" ; $newvol ;; + d*) pulsemixer --change-volume -"$num" ; $newvol ;; + m*) pulsemixer --toggle-mute ; $newvol ;; + truemute) pulsemixer --mute ; $newvol ;; + play) mpc play ;; + n*) mpc next ;; + prev) mpc prev ;; + t*) mpc toggle ;; + p*) mpc pause ; pauseallmpv ;; + f*) mpc seek +"$num" ;; + b*) mpc seek -"$num" ;; + r*) mpc seek 0% ;; + *) cat << EOF +lmc: cli music interface for mpd and pulse for those with divine intellect too +grand to remember the mpc/pamixer commands. + +Allowed options: + up NUM Increase volume (2 secs default) + down NUM Decrease volume (2 secs default) + mute Toggle mute + truemute Mute + next Next track + prev Previous track + toggle Toggle pause + truepause Pause + foward NUM Seek foward in song (2 secs default) + back NUM Seek back in song (2 secs default) + restart Restart current song + all else Print this message + +All of these commands, except for \`truemute\`, \`prev\` and \`play\` can be truncated, +i.e. \`lmc r\` for \`lmc restart\`. +EOF +esac diff --git a/.i3/scripts/load_average.sh b/.i3/scripts/load_average.sh new file mode 100755 index 0000000..37a5c71 --- /dev/null +++ b/.i3/scripts/load_average.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info> + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +load="$(cut -d ' ' -f1 /proc/loadavg)" +cpus="$(nproc)" + +# full text +echo "$load" + +# short text +echo "$load" + +# color if load is too high +awk -v cpus=$cpus -v cpuload=$load ' + BEGIN { + if (cpus <= cpuload) { + print "#FF0000"; + exit 33; + } + } +' diff --git a/.i3/scripts/lock.sh b/.i3/scripts/lock.sh new file mode 100755 index 0000000..0377cb1 --- /dev/null +++ b/.i3/scripts/lock.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +icon="$HOME/Pictures/Icons/lock.png" +tmpbg='/tmp/screen.png' + +(( $# )) && { icon=$1; } + +scrot "$tmpbg" +convert "$tmpbg" -scale 10% -scale 1000% "$tmpbg" +convert "$tmpbg" "$icon" -gravity center -composite -matte "$tmpbg" +i3lock -i "$tmpbg" diff --git a/.i3/scripts/lockscreen b/.i3/scripts/lockscreen new file mode 100755 index 0000000..c628938 --- /dev/null +++ b/.i3/scripts/lockscreen @@ -0,0 +1,19 @@ +#!/bin/sh + +rm -f /tmp/locked.png + +# If `imagemagick` is not installed, use a blank screen. +[ -f /usr/bin/convert ] && +scrot -m -z /tmp/base.png && +pgrep -x dunst && notify-send -i ~/Pictures/Icons/lock.png "Locking computer..." && +convert /tmp/base.png -blur 0x8 /tmp/locked.png + +# Pause music (mocp, mpd and send the pause key to all mpv videos): +mocp -P >/dev/null 2>&1 +mpc pause >/dev/null 2>&1 +~/.i3/scripts/pauseallmpv >/dev/null 2>&1 + +i3lock -e -f -c 000000 -i /tmp/locked.png + +# In five seconds, turn off display unless key press in last 4 seconds. +sleep 5 && [ 4000 -lt "$(xssstate -i)" ] && pgrep -x i3lock && xset dpms force off diff --git a/.i3/scripts/mailbox b/.i3/scripts/mailbox new file mode 100755 index 0000000..c0794e5 --- /dev/null +++ b/.i3/scripts/mailbox @@ -0,0 +1,16 @@ +#!/bin/sh + +# i3blocks mail module. +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e neomutt ;; + 2) setsid $HOME/.config/mutt/etc/mailsync.sh >/dev/null & ;; + 3) pgrep -x dunst >/dev/null && notify-send "📬 Mail module" "\- Shows unread mail +- Shows 🔃 if syncing mail +- Left click opens neomutt +- Middle click syncs mail" ;; +esac + +echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon 2>/dev/null)" diff --git a/.i3/scripts/mediaplayer.sh b/.i3/scripts/mediaplayer.sh new file mode 100755 index 0000000..705e4df --- /dev/null +++ b/.i3/scripts/mediaplayer.sh @@ -0,0 +1,126 @@ +#!/usr/bin/perl +# Copyright (C) 2014 Tony Crisci <tony@dubstepdish.com> +# Copyright (C) 2015 Thiago Perrotta <perrotta dot thiago at poli dot ufrj dot br> + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Requires playerctl binary to be in your path (except cmus) +# See: https://github.com/acrisci/playerctl + +# Set instance=NAME in the i3blocks configuration to specify a music player +# (playerctl will attempt to connect to org.mpris.MediaPlayer2.[NAME] on your +# DBus session). + +use Time::HiRes qw(usleep); +use Env qw(BLOCK_INSTANCE); + +use constant DELAY => 50; # Delay in ms to let network-based players (spotify) reflect new data. +use constant SPOTIFY_STR => 'spotify'; + +my @metadata = (); +my $player_arg = ""; + +if ($BLOCK_INSTANCE) { + $player_arg = "--player='$BLOCK_INSTANCE'"; +} + +sub buttons { + my $method = shift; + + if($method eq 'mpd') { + if ($ENV{'BLOCK_BUTTON'} == 1) { + system("mpc prev"); + } elsif ($ENV{'BLOCK_BUTTON'} == 2) { + system("mpc toggle"); + } elsif ($ENV{'BLOCK_BUTTON'} == 3) { + system("mpc next"); + } + } elsif ($method eq 'cmus') { + if ($ENV{'BLOCK_BUTTON'} == 1) { + system("cmus-remote --prev"); + } elsif ($ENV{'BLOCK_BUTTON'} == 2) { + system("cmus-remote --pause"); + } elsif ($ENV{'BLOCK_BUTTON'} == 3) { + system("cmus-remote --next"); + } + } elsif ($method eq 'playerctl') { + if ($ENV{'BLOCK_BUTTON'} == 1) { + system("playerctl $player_arg previous"); + usleep(DELAY * 1000) if $BLOCK_INSTANCE eq SPOTIFY_STR; + } elsif ($ENV{'BLOCK_BUTTON'} == 2) { + system("playerctl $player_arg play-pause"); + } elsif ($ENV{'BLOCK_BUTTON'} == 3) { + system("playerctl $player_arg next"); + usleep(DELAY * 1000) if $BLOCK_INSTANCE eq SPOTIFY_STR; + } + } +} + +sub cmus { + my @cmus = split /^/, qx(cmus-remote -Q); + if ($? == 0) { + foreach my $line (@cmus) { + my @data = split /\s/, $line; + if (shift @data eq 'tag') { + my $key = shift @data; + my $value = join ' ', @data; + + @metadata[0] = $value if $key eq 'artist'; + @metadata[1] = $value if $key eq 'title'; + } + } + + if (@metadata) { + buttons('cmus'); + + # metadata found so we are done + print(join ' - ', @metadata); + exit 0; + } + } +} + +sub mpd { + my $data = qx(mpc current); + if (not $data eq '') { + buttons("mpd"); + print($data); + exit 0; + } +} + +sub playerctl { + buttons('playerctl'); + + my $artist = qx(playerctl $player_arg metadata artist); + # exit status will be nonzero when playerctl cannot find your player + exit(0) if $? || $artist eq '(null)'; + + push(@metadata, $artist) if $artist; + + my $title = qx(playerctl $player_arg metadata title); + exit(0) if $? || $title eq '(null)'; + + push(@metadata, $title) if $title; + + print(join(" - ", @metadata)) if @metadata; +} + +if ($player_arg eq '' or $player_arg =~ /mpd/) { + mpd; +} +if ($player_arg =~ /cmus/) { + cmus; +} +playerctl; diff --git a/.i3/scripts/note b/.i3/scripts/note new file mode 100755 index 0000000..09186ea --- /dev/null +++ b/.i3/scripts/note @@ -0,0 +1,8 @@ +#!/bin/sh +# This is a general notification command for my own ease. +# $1 should be a message +# $2 is an optional image for notify-send +# Echos content on terminal and if dunst is running, shows notification. + +[ -z "$2" ] || img="-i $2" +echo "$1" && pgrep -x dunst >/dev/null && notify-send $img "$1" diff --git a/.i3/scripts/offlineimap-daemon.py b/.i3/scripts/offlineimap-daemon.py new file mode 100755 index 0000000..fea76fc --- /dev/null +++ b/.i3/scripts/offlineimap-daemon.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python3 + +import subprocess +import signal +import threading +import sys + +import dbus +from dbus.mainloop.glib import DBusGMainLoop +from gi.repository import GLib + + +class OfflineimapCtl(object): + def __init__(self): + self.daemon_proc = None + self.run_ev = threading.Event() + self.run_daemon = False + + def run(self): + t = threading.Thread(target=self._watch_daemon, daemon=True) + t.start() + + def _watch_daemon(self): + while True: + self.run_ev.wait() + self.run_ev.clear() + if self.run_daemon: + self.is_running = True + print('offlineimap is being started') + self._spawn_daemon() + print('offlineimap has stopped') + self.run_ev.set() # check state and restart if needed + + def _spawn_daemon(self): + self.daemon_proc = subprocess.Popen(['offlineimap', '-u', 'basic'], shell=False) + self.daemon_proc.wait() + self.daemon_proc = None + + def start(self): + print('starting offlineimap') + self.run_daemon = True + self.run_ev.set() + + def stop(self): + print('stopping offlineimap') + self.run_daemon = False + if self.daemon_proc: + try: + self.daemon_proc.send_signal(signal.SIGUSR2) + except OSError: + print('Unable to stop offlineimap') + + def restart(self): + print('restarting offlineimap') + if self.run_daemon: + self.stop() + self.start() + + def onConnectivityChanged(self, state): + # 70 means fully connected + if state == 70: + self.start() + else: + self.stop() + +def main(): + oi_ctl = OfflineimapCtl() + oi_ctl.run() + + try: + bus = dbus.SystemBus(mainloop=DBusGMainLoop()) + network_manager = bus.get_object( + 'org.freedesktop.NetworkManager', + '/org/freedesktop/NetworkManager') + network = dbus.Interface(network_manager, + dbus_interface='org.freedesktop.NetworkManager') + + network.connect_to_signal('StateChanged', oi_ctl.onConnectivityChanged) + + # send current state as first event + state = network.state() + oi_ctl.onConnectivityChanged(state) + + except dbus.exceptions.DBusException: + print('Unable to connect to dbus') + sys.exit(3) + + # start receiving events from dbus + loop = GLib.MainLoop() + loop.run() + +if __name__ == '__main__': + main() diff --git a/.i3/scripts/offlineimap-daemonctl.sh b/.i3/scripts/offlineimap-daemonctl.sh new file mode 100755 index 0000000..18daf3d --- /dev/null +++ b/.i3/scripts/offlineimap-daemonctl.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# this script runs offline imap as daemon (configured to check periodically) + +LOG=~/.offlineimap/sync.log +PIDFILE=~/.offlineimap/pid + +# if not present on PATH, those vars must point to proper locations +THIS_SCRIPT=offlineimap-daemonctl.sh +PYTHON_DAEMON=offlineimap-daemon.py + +daemon(){ + $PYTHON_DAEMON 2>&1 | + # add timestamps to logs + (while read line; do + echo `date` "$line" >> $LOG + done) +} + +stop(){ + kill -USR2 `cat $PIDFILE` +} + +refresh(){ + kill -USR1 `cat $PIDFILE` +} + +case "$1" in + '--daemon' | '-d' ) + nohup $THIS_SCRIPT < /dev/null > /dev/null 2>&1 & + ;; + '--kill' | '-k' ) + stop + ;; + '--refresh' | '-r' ) + refresh + ;; + * ) + daemon + ;; +esac
\ No newline at end of file diff --git a/.i3/scripts/openvpn.sh b/.i3/scripts/openvpn.sh new file mode 100755 index 0000000..f1d4e29 --- /dev/null +++ b/.i3/scripts/openvpn.sh @@ -0,0 +1,150 @@ +#!/usr/bin/perl +# Made by Pierre Mavro/Deimosfr <deimos@deimos.fr> +# Minor contribution by Thor K. H. <thor@roht.no> +# Licensed under the terms of the GNU GPL v3, or any later version. +# Version: 0.3 + +# Usage: +# 1. The configuration name of OpenVPN should be familiar for you (home,work...) +# 2. The device name in your configuration file should be fully named (tun0,tap1...not only tun or tap) +# 3. When you launch one or multiple OpenVPN connexion, be sure the PID file is written in the correct folder (ex: --writepid /run/openvpn/home.pid) + +use strict; +use warnings; +use utf8; +use Getopt::Long; + +my $openvpn_enabled='/dev/shm/openvpn_i3blocks_enabled'; +my $openvpn_disabled='/dev/shm/openvpn_i3blocks_disabled'; + +# Print output +sub print_output { + my $ref_pid_files = shift; + my @pid_files = @$ref_pid_files; + my $change=0; + + # Total pid files + my $total_pid = @pid_files; + if ($total_pid == 0) { + print "down\n"x2; + # Delete OpenVPN i3blocks temp files + if (-f $openvpn_enabled) { + unlink $openvpn_enabled or die "Can't delete $openvpn_enabled\n"; + # Colorize if VPN has just went down + print '#FF0000\n'; + } + unless (-f $openvpn_disabled) { + open(my $shm, '>', $openvpn_disabled) or die "Can't write $openvpn_disabled\n"; + } + exit(0); + } + + # Check if interface device is present + my $vpn_found=0; + my $pid; + my $cmd_line; + my @config_name; + my @config_path; + my $interface; + my $current_config_path; + my $current_config_name; + foreach (@pid_files) { + # Get current PID + $pid=0; + open(PID, '<', $_); + while(<PID>) { + chomp $_; + $pid = $_; + } + close(PID); + # Check if PID has been found + if ($pid ==0) { + print "Can't get PID $_: $!\n"; + } + + # Check if PID is still alive + $cmd_line='/proc/'.$pid.'/cmdline'; + if (-f $cmd_line) { + # Get config name + open(CMD_LINE, '<', $cmd_line); + while(<CMD_LINE>) { + chomp $_; + if ($_ =~ /--config\s*(.*\.conf)/) { + # Get interface from config file + $current_config_path = $1; + # Remove unwanted escape chars + $current_config_path =~ s/\x{00}//g; + $interface = 'null'; + # Get configuration name + if ($current_config_path =~ /(\w+).conf/) { + $current_config_name=$1; + } else { + $current_config_name='unknow'; + } + # Get OpenVPN interface device name + open(CONFIG, '<', $current_config_path) or die "Can't read config file '$current_config_path': $!\n"; + while(<CONFIG>) { + chomp $_; + if ($_ =~ /dev\s+(\w+)/) { + $interface=$1; + last; + } + } + close(CONFIG); + # check if interface exist + unless ($interface eq 'null') { + if (-d "/sys/class/net/$interface") { + push @config_name, $current_config_name; + $vpn_found=1; + # Write enabled file + unless (-f $openvpn_enabled) { + open(my $shm, '>', $openvpn_enabled) or die "Can't write $openvpn_enabled\n"; + $change=1; + } + } + } + } + } + close(CMD_LINE); + } + } + + # Check if PID found + my $names; + my $short_status; + if ($vpn_found == 1) { + $names = join('/', @config_name); + $short_status='up'; + } else { + $short_status='down'; + $names = $short_status; + } + + print "$names\n"; + print "$short_status\n"; + + # Print color if there were changes + print "#00FF00\n" if ($change == 1); + + exit(0); +} + +sub check_opts { + # Vars + my @pid_file=glob '/run/openvpn/*.pid'; + + # Set options + GetOptions( "help|h" => \&help, + "p=s" => \@pid_file); + + print_output(\@pid_file); +} + +sub help { + print "Usage: openvpn [-d pid folder files]\n"; + print "-d : pid folder files (default /run/openvpn/*.pid)\n"; + print "Note: devices in configuration file should be named with their number (ex: tun0, tap1)\n"; + exit(1); +} + +&check_opts; diff --git a/.i3/scripts/opout b/.i3/scripts/opout new file mode 100755 index 0000000..d52f285 --- /dev/null +++ b/.i3/scripts/opout @@ -0,0 +1,11 @@ +#!/bin/sh +# opout: "open output": A general handler for opening a file's intended output. +# I find this useful especially running from vim. + +basename="${1%.*}" + +case "$1" in + *.tex|*.md|*.rmd|*.ms|*.me|*.mom) setsid "$READER" "$basename".pdf >/dev/null 2>&1 & ;; + *.html) setsid "$BROWSER" --new-window "$basename".html >/dev/null 2>&1 & ;; + *.sent) setsid sent "$1" >/dev/null 2>&1 & ;; +esac diff --git a/.i3/scripts/pauseallmpv b/.i3/scripts/pauseallmpv new file mode 100755 index 0000000..08241b5 --- /dev/null +++ b/.i3/scripts/pauseallmpv @@ -0,0 +1,4 @@ +#!/bin/sh +# Sends a , key to all mpv instances, pausing them at the last frame. + +xdotool search --class mpv | xargs -I % xdotool key --window % comma diff --git a/.i3/scripts/polybar_launch b/.i3/scripts/polybar_launch new file mode 100755 index 0000000..2af56ab --- /dev/null +++ b/.i3/scripts/polybar_launch @@ -0,0 +1,16 @@ +#!/bin/sh +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -x polybar >/dev/null; do sleep 1; done + +# Launch bar1 and bar2 +#polybar example & + +for i in $(polybar -m | awk -F: '{print $1}'); do MONITOR=$i polybar example -c ~/.config/polybar/config & done +feh --bg-scale ~/.config/wall.png + +echo "Bars launched..." diff --git a/.i3/scripts/prompt b/.i3/scripts/prompt new file mode 100755 index 0000000..0a2aba9 --- /dev/null +++ b/.i3/scripts/prompt @@ -0,0 +1,8 @@ +#!/bin/sh +# A dmenu binary prompt script. +# Gives a dmenu prompt labeled with $1 to perform command $2. +# For example: +# `./prompt "Do you want to shutdown?" "shutdown -h now"` + +[ $(echo -e "No\nYes" | dmenu -i -p "$1" -nb darkred -sb red -sf white -nf gray -fn mono) \ +== "Yes" ] && $2 diff --git a/.i3/scripts/remaps b/.i3/scripts/remaps new file mode 100755 index 0000000..74c1057 --- /dev/null +++ b/.i3/scripts/remaps @@ -0,0 +1,19 @@ +#!/bin/sh + +# This script is called by i3 on startup. + +# Increase key speed via a rate change +xset r rate 300 50 +# Map the caps lock key to super... +#setxkbmap -layout us -variant altgr-intl -option caps:super +# If you don't want a us international keyboard, rather whatever keyboard +# you set in your installation, comment out the above line and uncomment +# the one below. +setxkbmap -option caps:super + +# But when it is pressed only once, treat it as escape. +killall xcape ; xcape -e 'Super_L=Escape' + +# Map the menu button to right super as well. +xmodmap -e 'keycode 135 = Super_R' +#keycode 135 = Super_R NoSymbol Super_R diff --git a/.i3/scripts/screen.sh b/.i3/scripts/screen.sh new file mode 100755 index 0000000..03a8e79 --- /dev/null +++ b/.i3/scripts/screen.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +#Feed this script either: +# "l" for laptop screen only, +# "v" for vga screen only, +# or "d" for dual vga/laptop. + +d() { if [[ $(xrandr -q | grep VGA1\ con) ]] + then param $1 + else echo "No VGA input detected." + fi ;} +dual() { xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1 ;} +laptop() { xrandr --output LVDS1 --auto --output VGA1 --off ;} +vga() { xrandr --output VGA1 --auto --output LVDS1 --off ;} +#mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;} + +param() { +case $1 in + d) dual ;; + v) vga ;; + l) laptop ;; + *) echo -e "Invalid parameter. Add one of the following:\n\"d\" for dualscreen laptop and VGA.\n\"l\" for laptop only\n\"v\" for VGA only." ;; +esac ;} +d $1 diff --git a/.i3/scripts/screencast b/.i3/scripts/screencast new file mode 100755 index 0000000..cd37ab9 --- /dev/null +++ b/.i3/scripts/screencast @@ -0,0 +1,36 @@ +#!/bin/bash + +# This script records a screencast with audio and video. +# It runs an appropriate record script for either ALSA and Pulseaudio. +# It also names files smartly to prevent overwrites. + +# Picks a file name for the output file based on availability: +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" + +# For Pulseaudio with ALSA: +record_pulse() { \ +ffmpeg -y \ +-f x11grab \ +-framerate 60 \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ +-f alsa -i default \ +-r 30 \ + -c:v libx264rgb -crf 0 -preset ultrafast -c:a flac $filename ;} + +# For ALSA: +record_alsa() { \ +ffmpeg -y \ +-f x11grab \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ +-thread_queue_size 1024 \ + -f alsa -ar 44100 -i hw:1 \ + -c:v libx264 -r 30 -c:a flac $filename ;} + + +if [[ $(pgrep -x pulseaudio) ]]; then record_pulse; else record_alsa; fi diff --git a/.i3/scripts/shortcuts b/.i3/scripts/shortcuts new file mode 100755 index 0000000..5ccb114 --- /dev/null +++ b/.i3/scripts/shortcuts @@ -0,0 +1,38 @@ +#!/bin/bash + +# Shell rc file (i.e. bash vs. zsh, etc.) +shellrc="$HOME/.bashrc" + +# Bookmark file locations +bmdirs="$HOME/.bmdirs" +bmfiles="$HOME/.bmfiles" + +# Output locations. Unactivated progs should go to /dev/null. +shell_shortcuts="$HOME/.shortcuts" +ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" +qute_shortcuts="/dev/null" +fish_shortcuts="/dev/null" + +# Remove, prepare files +rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null +#echo "abbr \\" > "$fish_shortcuts" +echo "alias \\" > "$shell_shortcuts" + +# Ensure text of argument 1 exists in the file argument 2 +ensure() { (grep "$1" "$2")>/dev/null 2>&1 || echo "$1" >> "$2" ;} + +ensure "source $shell_shortcuts" "$shellrc" +ensure "source $HOME/.config/ranger/shortcuts.conf" "$HOME/.config/ranger/rc.conf" +#ensure "config.source('shortcuts.py')" "$HOME/.config/qutebrowser/config.py" +#ensure "source $HOME/.config/fish/shortcuts.fish" "$HOME/.config/fish/config.fish" + +# Format the `bmdirs` file in the correct syntax and sent it to all three configs. +sed "s/#.*$//;/^$/d" "$bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \ + >(awk '{print $1, "\"cd " $2 "; and ls -a\" \\"}' >> "$fish_shortcuts") \ + >(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \ + | awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts" + +# Format the `configs` file in the correct syntax and sent it to both configs. +sed "s/#.*$//;/^$/d" "$bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \ + >(awk '{print $1, "\"$EDITOR "$2"\" \\"}' >> "$fish_shortcuts") \ + | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts" diff --git a/.i3/scripts/spawndl b/.i3/scripts/spawndl new file mode 100755 index 0000000..a419041 --- /dev/null +++ b/.i3/scripts/spawndl @@ -0,0 +1,2 @@ +#!/bin/bash +i3 exec "st -n dl -e youtube-dl $1" diff --git a/.i3/scripts/speedvid.sh b/.i3/scripts/speedvid.sh new file mode 100755 index 0000000..ba3a4f6 --- /dev/null +++ b/.i3/scripts/speedvid.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +base=$(basename $1) +ext="${base##*.}" +base="${base%.*}" + +ffmpeg -i $1 -vf "setpts=$2*PTS" -an $base'_sped.'$ext diff --git a/.i3/scripts/texclear b/.i3/scripts/texclear new file mode 100755 index 0000000..20f435c --- /dev/null +++ b/.i3/scripts/texclear @@ -0,0 +1,14 @@ +#!/bin/sh + +# Clears the build files of a LaTeX/XeLaTeX build. +# I have vim run this file whenever I exit a .tex file. + +case "$1" in + *.tex) + file=$(readlink -f "$1") + dir=$(dirname "$file") + base="${file%.*}" + find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;; + *) printf "Give .tex file as argument.\\n" ;; +esac + diff --git a/.i3/scripts/tmuxdd b/.i3/scripts/tmuxdd new file mode 100755 index 0000000..e821057 --- /dev/null +++ b/.i3/scripts/tmuxdd @@ -0,0 +1,4 @@ +#!/bin/sh +# This is the script that i3 runs to either start tmux in +# the dropdown terminal or log into a previous session. +tmux a || TERM="screen-256color" tmux diff --git a/.i3/scripts/tmuxinit b/.i3/scripts/tmuxinit new file mode 100755 index 0000000..68a4b86 --- /dev/null +++ b/.i3/scripts/tmuxinit @@ -0,0 +1,4 @@ +#!/bin/bash +# This is the script that i3 runs to either start tmux in +# the dropdown terminal or log into a previous session. +tmux a || tmux diff --git a/.i3/scripts/torrent b/.i3/scripts/torrent new file mode 100755 index 0000000..0ab811c --- /dev/null +++ b/.i3/scripts/torrent @@ -0,0 +1,28 @@ +#!/bin/sh + +transmission-remote -l | grep % | + sed " # This first sed command is to ensure a desirable order with sort + s/.*Stopped.*/A/g; + s/.*Seeding.*/Z/g; + s/.*100%.*/N/g; + s/.*Idle.*/B/g; + s/.*Uploading.*/L/g; + s/.*%.*/M/g" | + sort -h | uniq -c | sed " # Now we replace the standin letters with icons. + s/A/🛑/g; + s/B/⌛️/g; + s/L/🔼/g; + s/M/🔽/g; + s/N/✅/g; + s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g" + +case $BLOCK_BUTTON in + 1) $TERMINAL -e transmission-remote-cli ;; + 3) pgrep -x dunst >/dev/null && notify-send "Torrent module" "🛑: paused +⏳: idle (seeds needed) +🔼: uploading (unfinished) +🔽: downloading +✅: done +🌱: done and seeding" ;; +esac + diff --git a/.i3/scripts/tpb b/.i3/scripts/tpb new file mode 100755 index 0000000..7a2913a --- /dev/null +++ b/.i3/scripts/tpb @@ -0,0 +1,169 @@ +#!/bin/sh +# +# by Sairon Istyar, 2012 +# distributed under the GPLv3 license +# http://www.opensource.org/licenses/gpl-3.0.html +# + +### CONFIGURATION ### +# program to use for torrent download +# magnet link to torrent will be appended +# you can add -- at the end to indicate end of options +# (if your program supports it, most do) +program='/usr/bin/transmission-remote -a' +daemon='transmission-daemon' +TPB="https://thepiratebay.org" + +# show N first matches by default +limit=50 + +# colors +numbcolor='\x1b[1;35m' +namecolor='\x1b[1;33m' +sizecolor='\x1b[1;36m' +seedcolor='\x1b[1;31m' +peercolor='\x1b[1;32m' +errocolor='\x1b[1;31m' +mesgcolor='\x1b[1;37m' +nonecolor='\x1b[0m' + +# default ordering method +# 1 - name ascending; 2 - name descending; +# 3 - recent first; 4 - oldest first; +# 5 - size descending; 6 - size ascending; +# 7 - seeds descending; 8 - seeds ascending; +# 9 - leechers descending; 10 - leechers ascending; +orderby=7 +### END CONFIGURATION ### + +thisfile="$0" + +printhelp() { + echo -e "Usage:" + echo -e "\t$thisfile [options] search query" + echo + echo + echo -e "Available options:" + echo -e "\t-h\t\tShow help" + echo -e "\t-n [num]\tShow only first N results (default 15; max 100 [top] or 30 [search])" + echo -e "\t-C\t\tDo not use colors" + echo -e "\t-P [prog]\tSet torrent client command (\`-P torrent-client\` OR \`-P \"torrent-client --options\"\`)" + echo + echo -e "Current client settings: $program [magnet link]" +} + +# change torrent client +chex() { + sed "s!^program=.*!program=\'$program\'!" -i "$thisfile" + if [ $? -eq 0 ] ; then + echo "Client changed successfully." + exit 0 + else + echo -e "${errocolor}(EE) ${mesgcolor}==> Something went wrong!${nonecolor}" + exit 1 + fi +} + +# script cmdline option handling +while getopts :hn:CP:: opt ; do + case "$opt" in + h) printhelp; exit 0;; + n) limit="$OPTARG";; + C) unset numbcolor namecolor sizecolor seedcolor peercolor nonecolor errocolor mesgcolor;; + P) program="$OPTARG"; chex;; + *) echo -e "Unknown option(s)."; printhelp; exit 1;; + esac +done + +shift `expr $OPTIND - 1` + +# correctly encode query +q=`echo "$*" | tr -d '\n' | od -t x1 -A n | tr ' ' '%'` + +# if not searching, show top torrents +if [ -z "$q" ] ; then + url="top/all" +else + url='search/'"$q"'/0/'"$orderby"'/0' +fi + +# get results +# Here be dragons! +r=`curl -k -A Mozilla -b "lw=s" -m 15 -s "$TPB/$url" \ + | grep -Eo '^<td><a href=\"/torrent/[^>]*>.*|^<td><nobr><a href=\"[^"]*|<td align=\"right\">[^<]*' \ + | sed 's!^<td><a href=\"/torrent/[^>]*>!!; \ + s!</a>$!!; \ + s!^<td><nobr><a href=\"!!; \ + s!^<td [^>]*>!!; \ + s! !\ !g; \ + s/|/!/g' \ + | sed 'N;N;N;N;s!\n!|!g'` + +# number of results +n=`echo "$r" | wc -l` + +IFS=$'\n' + +# print results +echo "$r" \ + | head -n "$limit" \ + | awk -v N=1 \ + -v NU="$numbcolor" \ + -v NA="$namecolor" \ + -v SI="$sizecolor" \ + -v SE="$seedcolor" \ + -v PE="$peercolor" \ + -v NO="$nonecolor" \ + -F '|' \ + '{print NU N ") " NA $1 " " SI $3 " " SE $4 " " PE $5 NO; N++}' + +# read ID(s), expand ranges, ignore everything else +read -p ">> Torrents to download (eg. 1 3 5-7): " selection +IFS=$'\n\ ' +for num in $selection ; do + if [ "$num" = "`echo $num | grep -o '[[:digit:]][[:digit:]]*'`" ] ; then + down="$down $num" + elif [ "$num" = "`echo $num | grep -o '[[:digit:]][[:digit:]]*-[[:digit:]][[:digit:]]*'`" ] ; then + seqstart="${num%-*}" + seqend="${num#*-}" + if [ $seqstart -le $seqend ] ; then + down="$down `seq $seqstart $seqend`" + fi + fi +done + +# normalize download list, sort it and remove dupes +down="$(echo $down | tr '\ ' '\n' | sort -n | uniq)" +IFS=$'\n' + +# check whether we're downloading something, else exit +if [ -z "$down" ] ; then + exit 0 +fi + +# starts daemon if it was not already running and download all torrents in list +echo -n "Downloading torrent(s): " +if ! [ "$(pidof $daemon)" ]; then + $daemon + for torrent in $down ; do + # check if ID is valid and in range of results, download torrent + if [ $torrent -ge 1 ] ; then + if [ $torrent -le $limit ] ; then + echo -n "$torrent " + command="$program `echo "$r" | awk -F '|' 'NR=='$torrent'{print $2; exit}'`" + status=$(eval "$command" 2>&1) + if [ $? -ne 0 ] ; then + echo -n '(failed!) ' + report="$report\n(#$torrent) $status" + fi + fi + fi + done +fi + +echo +if [ -n "$report" ] ; then + echo -n "Exited with errors:" + echo -e "$report" +fi +unset IFS diff --git a/.i3/scripts/tpb.sh b/.i3/scripts/tpb.sh new file mode 100755 index 0000000..fb1b5b6 --- /dev/null +++ b/.i3/scripts/tpb.sh @@ -0,0 +1,164 @@ +#!/bin/sh +# +# by Sairon Istyar, 2012 +# distributed under the GPLv3 license +# http://www.opensource.org/licenses/gpl-3.0.html +# + +### CONFIGURATION ### +# program to use for torrent download +# magnet link to torrent will be appended +# you can add -- at the end to indicate end of options +# (if your program supports it, most do) +program='/usr/bin/transmission-remote -a' +TPB="https://thepiratebay.org" + +# show N first matches by default +limit=50 + +# colors +numbcolor='\x1b[1;35m' +namecolor='\x1b[1;33m' +sizecolor='\x1b[1;36m' +seedcolor='\x1b[1;31m' +peercolor='\x1b[1;32m' +errocolor='\x1b[1;31m' +mesgcolor='\x1b[1;37m' +nonecolor='\x1b[0m' + +# default ordering method +# 1 - name ascending; 2 - name descending; +# 3 - recent first; 4 - oldest first; +# 5 - size descending; 6 - size ascending; +# 7 - seeds descending; 8 - seeds ascending; +# 9 - leechers descending; 10 - leechers ascending; +orderby=7 +### END CONFIGURATION ### + +thisfile="$0" + +printhelp() { + echo -e "Usage:" + echo -e "\t$thisfile [options] search query" + echo + echo + echo -e "Available options:" + echo -e "\t-h\t\tShow help" + echo -e "\t-n [num]\tShow only first N results (default 15; max 100 [top] or 30 [search])" + echo -e "\t-C\t\tDo not use colors" + echo -e "\t-P [prog]\tSet torrent client command (\`-P torrent-client\` OR \`-P \"torrent-client --options\"\`)" + echo + echo -e "Current client settings: $program [magnet link]" +} + +# change torrent client +chex() { + sed "s!^program=.*!program=\'$program\'!" -i "$thisfile" + if [ $? -eq 0 ] ; then + echo "Client changed successfully." + exit 0 + else + echo -e "${errocolor}(EE) ${mesgcolor}==> Something went wrong!${nonecolor}" + exit 1 + fi +} + +# script cmdline option handling +while getopts :hn:CP:: opt ; do + case "$opt" in + h) printhelp; exit 0;; + n) limit="$OPTARG";; + C) unset numbcolor namecolor sizecolor seedcolor peercolor nonecolor errocolor mesgcolor;; + P) program="$OPTARG"; chex;; + *) echo -e "Unknown option(s)."; printhelp; exit 1;; + esac +done + +shift `expr $OPTIND - 1` + +# correctly encode query +q=`echo "$*" | tr -d '\n' | od -t x1 -A n | tr ' ' '%'` + +# if not searching, show top torrents +if [ -z "$q" ] ; then + url="top/all" +else + url='search/'"$q"'/0/'"$orderby"'/0' +fi + +# get results +# Here be dragons! +r=`curl -k -A Mozilla -b "lw=s" -m 15 -s "$TPB/$url" \ + | grep -Eo '^<td><a href=\"/torrent/[^>]*>.*|^<td><nobr><a href=\"[^"]*|<td align=\"right\">[^<]*' \ + | sed 's!^<td><a href=\"/torrent/[^>]*>!!; \ + s!</a>$!!; \ + s!^<td><nobr><a href=\"!!; \ + s!^<td [^>]*>!!; \ + s! !\ !g; \ + s/|/!/g' \ + | sed 'N;N;N;N;s!\n!|!g'` + +# number of results +n=`echo "$r" | wc -l` + +IFS=$'\n' + +# print results +echo "$r" \ + | head -n "$limit" \ + | awk -v N=1 \ + -v NU="$numbcolor" \ + -v NA="$namecolor" \ + -v SI="$sizecolor" \ + -v SE="$seedcolor" \ + -v PE="$peercolor" \ + -v NO="$nonecolor" \ + -F '|' \ + '{print NU N ") " NA $1 " " SI $3 " " SE $4 " " PE $5 NO; N++}' + +# read ID(s), expand ranges, ignore everything else +read -p ">> Torrents to download (eg. 1 3 5-7): " selection +IFS=$'\n\ ' +for num in $selection ; do + if [ "$num" = "`echo $num | grep -o '[[:digit:]][[:digit:]]*'`" ] ; then + down="$down $num" + elif [ "$num" = "`echo $num | grep -o '[[:digit:]][[:digit:]]*-[[:digit:]][[:digit:]]*'`" ] ; then + seqstart="${num%-*}" + seqend="${num#*-}" + if [ $seqstart -le $seqend ] ; then + down="$down `seq $seqstart $seqend`" + fi + fi +done + +# normalize download list, sort it and remove dupes +down="$(echo $down | tr '\ ' '\n' | sort -n | uniq)" +IFS=$'\n' + +# check whether we're downloading something, else exit +if [ -z "$down" ] ; then + exit 0 +fi + +# download all torrents in list +echo -n "Downloading torrent(s): " +for torrent in $down ; do + # check if ID is valid and in range of results, download torrent + if [ $torrent -ge 1 ] ; then + if [ $torrent -le $limit ] ; then + echo -n "$torrent " + command="$program `echo "$r" | awk -F '|' 'NR=='$torrent'{print $2; exit}'`" + status=$(eval "$command" 2>&1) + if [ $? -ne 0 ] ; then + echo -n '(failed!) ' + report="$report\n(#$torrent) $status" + fi + fi + fi +done +echo +if [ -n "$report" ] ; then + echo -n "Exited with errors:" + echo -e "$report" +fi +unset IFS diff --git a/.i3/scripts/transadd b/.i3/scripts/transadd new file mode 100755 index 0000000..8cc7e80 --- /dev/null +++ b/.i3/scripts/transadd @@ -0,0 +1,12 @@ +#!/bin/sh + +# Mimeapp script for adding torrent to transmission-daemon, but will also start +# the daemon first if not running. + +# Optionally requires my `note` script. The sleep of 3 seconds is because the +# transmission-daemon sometimes fails to take remote requests in its first +# moments. + +pgrep -x transmission-da || (transmission-daemon && note "Starting daemon..." "$PIX/dl.png" && sleep 3 && pkill -RTMIN+7 i3blocks) + +transmission-remote -a "$@" && note "Torrent added." "$PIX/dl.png" diff --git a/.i3/scripts/transmission.sh b/.i3/scripts/transmission.sh new file mode 100755 index 0000000..794f6bb --- /dev/null +++ b/.i3/scripts/transmission.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ -f $(pgrep transmission) ]; + then + urxvt -e transmission-remote-cli + else + transmission-daemon && urxvt -e transmission-remote-cli +fi diff --git a/.i3/scripts/video b/.i3/scripts/video new file mode 100755 index 0000000..357464f --- /dev/null +++ b/.i3/scripts/video @@ -0,0 +1,18 @@ +#!/bin/bash + +# This script records video. +# It also names files smartly to prevent overwrites. + +# Picks a file name for the output file based on availability: +while [[ -f $HOME/video$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/video$n.mkv" + +# The actual ffmpeg command: +ffmpeg \ +-f x11grab \ +-s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ +-i :0.0 \ + -c:v libx264 -qp 0 -r 30 $filename diff --git a/.i3/scripts/volume.sh b/.i3/scripts/volume.sh new file mode 100755 index 0000000..69fb4a4 --- /dev/null +++ b/.i3/scripts/volume.sh @@ -0,0 +1,11 @@ +pavu_status=$(pulseaudio-ctl full-status) +pavu_status=($pavu_status) + +volume=${pavu_status[0]} +muted=${pavu_status[1]} + +if [ "$muted" == "yes" ]; then + echo '<span foreground="#Cd3f45">Mute</span>' +else + echo $volume +fi diff --git a/.i3/scripts/welcome b/.i3/scripts/welcome new file mode 100755 index 0000000..2e33713 --- /dev/null +++ b/.i3/scripts/welcome @@ -0,0 +1,4 @@ +#!/bin/bash +dialog --title "Welcome to LARBS!" --msgbox "If you're new to the system, hold down the Windows key and press F1 for a full tutorial! + +(This infobox will greet you at each login until you run the command \"hello-larbs\" in the terminal.)" 10 60 |
