all repos — dotfiles @ 412a0aece5ecf9198975ed80f163a56ec86457c5

my *nix dotfiles

bin: Move to separate repo

Signed-off-by: Anirudh Oppiliappan <x@icyphox.sh>
Anirudh Oppiliappan x@icyphox.sh
Sun, 01 Mar 2020 10:02:21 +0530
commit

412a0aece5ecf9198975ed80f163a56ec86457c5

parent

d2748809cd14853cba6fe6058a5e940f82d7336b

17 files changed, 1 insertions(+), 329 deletions(-)

jump to
M bash/.bashrcbash/.bashrc

@@ -23,13 +23,7 @@ bind 'set colored-stats on'

bind 'set completion-display-width 1' bind 'TAB:menu-complete' -if ! shopt -oq posix; then - if [ -f /usr/share/bash-completion/bash_completion ]; then - . /usr/share/bash-completion/bash_completion - elif [ -f /etc/bash_completion ]; then - . /etc/bash_completion - fi -fi +complete -cf doas # z source ~/leet/z/z.sh
D bin/bar.sh

@@ -1,6 +0,0 @@

-#!/bin/bash -killall -q polybar - -while pgrep -x polybar > /dev/null; do sleep 1; done - -polybar top
D bin/bat.sh

@@ -1,18 +0,0 @@

-#!/usr/bin/env bash - -fg="$(xres color15)" -light="$(xres color8)" - -cap=$(cat /sys/class/power_supply/BAT0/capacity) -status=$(cat /sys/class/power_supply/BAT0/status) - -if [[ "$1" == "-n" ]]; then - echo "$cap%" -else - if [[ "$status" = "Charging" ]] - then - echo -ne "%{F$light}+bat %{F$fg}$cap%" - else - echo -ne "%{F$light}bat %{F$fg}$cap%" - fi -fi
D bin/browser

@@ -1,3 +0,0 @@

-#!/bin/sh - -tabbed -df vimb -e > /tmp/tabbed.xid
D bin/durl

@@ -1,11 +0,0 @@

-#!/usr/bin/env bash - -regex='(https?|ftp|mailto)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]' -url=$(grep -Eo "$regex" | dmenu -p "url:" -w "$WINDOWID" | tr -d '\n') -[[ "$url" = "" ]] && exit - -if [[ "$(pgrep vimb)" != "" ]]; then - vimb -e $(</tmp/tabbed.xid) "$url" & -else - firefox --new-tab "$url" -fi
D bin/get_xres

@@ -1,3 +0,0 @@

-#!/usr/bin/env bash - -xrdb -query | grep -w $1 | awk '{print $2}'
D bin/icyup.sh

@@ -1,22 +0,0 @@

-#!/usr/bin/env bash - -n=3; fn=$(tr -cd '[:alnum:]' < /dev/urandom | head -c$n) - -latest="$HOME/pics/scrots/latest.png" - -upload() { - file=$1 - ext="${file##*.}" - fullname="$fn.$ext" - scp -P 443 "$1" emerald:icywww/uploads/"$fullname" - echo "https://x.icyphox.sh/$fullname" - echo "https://x.icyphox.sh/$fullname" | xclip -selection clipboard -} - -if [ "$1" == "l" ]; then - upload "$latest" -elif [ "$1" != "l" ]; then - upload "$1" -else - echo "no path specified :v" -fi
D bin/info

@@ -1,82 +0,0 @@

-#!/usr/bin/env bash -# icyinfo, but better - -export BLK="\e[30m" -export RED="\e[31m" -export GRN="\e[32m" -export YLW="\e[33m" -export BLU="\e[34m" -export PUR="\e[35m" -export CYN="\e[36m" -export BRED="\e[31m" -export BGRN="\e[32m" -export BYLW="\e[33m" -export BBLU="\e[34m" -export BPUR="\e[35m" -export BCYN="\e[36m" -export WHT="\e[37m" -export RST="\e[0m" - -#BAR="████" -#((LEN = ${#BAR} * 6)) -#COLOR_BARS="$RED$BAR$GRN$BAR$YLW$BAR$BLU$BAR$PUR$BAR$CYN$BAR$RST" - -basename() { - # Usage: basename "path" ["suffix"] - local tmp - - tmp=${1%"${1##*[!/]}"} - tmp=${tmp##*/} - tmp=${tmp%"${2/"$tmp"}"} - - printf '%s\n' "${tmp:-/}" -} - -prinfo() { - # 1 - field - # 2 - info - # 3 - prev line - prev_line="$1$2" - export prev_line - - - printf '\e[%sD\e[B' "${#3}" - printf '%b' "${YLW}$1${RST}$2" -} - -user="$USER" -host="$HOSTNAME" -kernel="$(uname -r)" -shell="$(basename "$SHELL")" - -art=" -${GRN} - o -.oo.Oo. - O. - Ooo'${RST} - ${RED}___${RST}${GRN}O${RST}${RED}___ - \ / - \___/${RST} -" - -. /etc/os-release -os="$ID" -pkgs="$(kiss l | wc -l)" - -printf '\e[2J' -printf '\e[?25l' - -printf '%b\n' "$art" - -printf '%b\n' "${CYN}$user${RST}@${CYN}$host${RST}" - -prinfo "os" " $os" -prinfo "kernel" " $kernel" "$prev_line" -prinfo "pkgs" " $pkgs" "$prev_line" -prinfo "shell" " $shell" "$prev_line" - - -# Pause -read -rsn1 _ -reset
D bin/lock.sh

@@ -1,24 +0,0 @@

-#!/usr/bin/env bash - -import -window root /tmp/lock.png -convert /tmp/lock.png -scale 10% -scale 1000% /tmp/lock.png - -# stolen from xero -function datamosh() { - fileSize=$(wc -c < "$file") - headerSize=10 - skip=$(shuf -i "$headerSize"-"$fileSize" -n 1) - count=$(shuf -i 1-10 -n 1) - for i in $(seq 1 $count);do byteStr=$byteStr'\x'$(shuf -i 0-255 -n 1); done; - printf $byteStr | dd of="$file" bs=1 seek=$skip count=$count conv=notrunc >/dev/null 2>&1 -} - -#steps=$(shuf -i 20-30 -n 1) -#for i in $(seq 1 $steps);do datamosh "$file"; done - -#convert /tmp/lock.jpg /tmp/lock.png >/dev/null 2>&1 -#rm /tmp/lock.jpg -#file=/tmp/lock.png - -i3lock -u -i /tmp/lock.png -rm /tmp/lock.png
D bin/pwmenu.sh

@@ -1,8 +0,0 @@

-#!/usr/bin/env bash - -pass="$(pw -l | dmenu)" -if [[ -z "$pass" ]]; then - exit -else - pw -c "$pass" -fi
D bin/scr

@@ -1,42 +0,0 @@

-#!/usr/bin/env bash -# scr: screenshot tool - -scr_path=~/pics/scrots -n=6; output=$(tr -cd '[:alnum:]' < /dev/urandom | head -c$n) - -usage() { - echo "usage:" - echo " scr [option]" - echo "options:" - echo " -f full screenshot" - echo " -w window screenshot" - echo " -s selection screenshot" -} - -while getopts fws option -do - case $option in - f) - import -window root "$scr_path/$output.png" - ;; - w) - import -window "$(xdotool getwindowfocus)" "$scr_path/$output.png" - ;; - s) - import "$scr_path/$output.png" - ;; - * | ?) - usage - exit;; - esac -done - -if [ $OPTIND -eq 1 ]; then - echo "scr: missing argument" - usage - exit -fi - - -xclip -selection clipboard -t image/png -i "$scr_path/$output.png" -cp "$scr_path/$output.png" "$scr_path/latest.png"
D bin/time.sh

@@ -1,25 +0,0 @@

-#!/usr/bin/env bash - -fg="$(xres color15)" -light="$(xres color8)" - -raw_date="$(date +"%a, %d %b" | tr A-Z a-z)" -raw_time="$(date +%I:%M)" - -time="%{F$light}time %{F$fg}$raw_time" -date="%{F$light}date %{F$fg}$raw_date" - -while getopts dtn options -do - case $options in - d) - printf "%s" "$date" - ;; - t) - printf "%s" "$time" - ;; - n) - printf "%s\n" "$raw_date" - printf "%s" "$raw_time" - esac -done
D bin/vol.sh

@@ -1,23 +0,0 @@

-#!/usr/bin/env bash - -fg="$(xres color15)" -light="$(xres color8)" - -while getopts idqn options -do - case $options in - i) - pamixer -i 2 - ;; - - d) - pamixer -d 2 - ;; - q) - cur_vol="$(pamixer --get-volume-human)" - echo -ne "%{F$light}vol %{F$fg}$cur_vol" - ;; - n) - echo "$(pamixer --get-volume-human)" - esac -done
D bin/vpnon.sh

@@ -1,8 +0,0 @@

-#!/usr/bin/env bash - -ssh -D 8008 emerald -fN - -sudo cp /etc/resolv.conf /etc/resolv.conf.bk -sudo cp ~/dotfiles/resolv.conf /etc/resolv.conf -sudo openvpn --config ~/client.ovpn -sudo cp /etc/resolv.conf.bk /etc/resolv.conf
D bin/wpa.sh

@@ -1,5 +0,0 @@

-#!/usr/bin/env bash - -sudo wpa_supplicant -i wlp2s0 -B -c /etc/wpa_supplicant.conf -sudo wpa_cli -i wlp2s0 select_network "$1" -sudo dhcpcd wlp2s0
D bin/xres

@@ -1,4 +0,0 @@

-#!/usr/bin/env bash -# stolen from nerdy - -xrdb -query | grep -w $1 | awk '{print $2}'
D bin/zatheme.sh

@@ -1,38 +0,0 @@

-#!/usr/bin/env bash - -# stolen from @nerdypepper - -echo 'set incremental-search true - -set recolor "true" - -set default-bg "'$( get_xres color0 )'" -set default-fg "'$( get_xres color7 )'" - -set completion-bg "'$( get_xres color0 )'" -set completion-fg "'$( get_xres color7 )'" -set completion-highlight-bg "'$( get_xres color4 )'" -set completion-highlight-fg "'$( get_xres color7 )'" - -set statusbar-bg "'$( get_xres color4 )'" -set statusbar-fg "'$( get_xres color0 )'" - -set inputbar-bg "'$( get_xres color0 )'" -set inputbar-fg "'$( get_xres color7 )'" - -set recolor-darkcolor "'$( get_xres color7 )'" -set recolor-lightcolor "'$( get_xres color0 )'" - -set window-height "800" -set window-width "600" - -set adjust-open "width" -set smooth-scroll true -set statusbar-home-tilde "true" -set statusbar-h-padding "50" -set statusbar-v-padding "50" - -set font "SF Mono Semibold 12" - -' > ~/.config/zathura/zathurarc -