aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkatherine <shmibs@shmibbles.me>2016-02-02 05:55:28 -0700
committerkatherine <shmibs@shmibbles.me>2016-02-02 05:55:28 -0700
commit2ece2a2987dcbb28283f2337c466f755cdb9c007 (patch)
tree93fcd74f106b3b0c083fb13e53d512e34aca75d8
parent8262c40af6678c9737c1c3874c8f813597c0395a (diff)
downloaddotfiles-2ece2a2987dcbb28283f2337c466f755cdb9c007.tar.gz
local function variables
i feel dumb
-rw-r--r--.zshrc-freebsd6
-rw-r--r--.zshrc-linux6
-rw-r--r--.zshrc-linux-desktop15
3 files changed, 18 insertions, 9 deletions
diff --git a/.zshrc-freebsd b/.zshrc-freebsd
index 0525972..04cc950 100644
--- a/.zshrc-freebsd
+++ b/.zshrc-freebsd
@@ -16,9 +16,9 @@ export PAGER="less -R"
# bits to human readable value
b2h() {
- suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' )
- sindex=1
- val=$1
+ local suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' )
+ local sindex=1
+ local val=$1
[[ -z $(echo $1 | grep "^[0-9]*$") ]] && read val
while [[ $(echo $val / 1024 | bc) -ne 0 ]]; do
diff --git a/.zshrc-linux b/.zshrc-linux
index 46d325f..03ab373 100644
--- a/.zshrc-linux
+++ b/.zshrc-linux
@@ -23,9 +23,9 @@ export PAGER="less -R"
# bits to human readable value
b2h() {
- suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' )
- sindex=1
- val=$1
+ local suffixes=( 'B' 'K' 'M' 'G' 'T' 'P' 'E' 'Z' 'Y' )
+ local sindex=1
+ local val=$1
[[ -z $(echo $1 | grep "^[0-9]*$") ]] && read val
while [[ $(echo $val / 1024 | bc) -ne 0 ]]; do
diff --git a/.zshrc-linux-desktop b/.zshrc-linux-desktop
index f52a02d..b85fab0 100644
--- a/.zshrc-linux-desktop
+++ b/.zshrc-linux-desktop
@@ -19,6 +19,7 @@ mpd-sleep() {
# leaks memory for some reason, so don't run on a clean library
# or it'll crash everything
mpd-cover-convert() {
+ local d
find ~/music -type f -regextype posix-extended -regex ".*cover\.(png|jpg)"\
| while read file; do
d=$(dirname "$file")
@@ -142,6 +143,8 @@ scap() {
# quickly send a file to hosted tmp dir
send() {
+ local name
+ local basename
if [[ "$1" ]]; then
scp $@ shmibbles.me:http/tmp/
if [[ $? -eq 0 ]]; then
@@ -164,6 +167,7 @@ send() {
ssh-scrot() {
archey3
+ local name
if [[ "$1" != "" ]]; then
name=$1
else
@@ -171,9 +175,9 @@ ssh-scrot() {
read name
fi
- date=$(date +'%Y-%m-%d')
+ local date=$(date +'%Y-%m-%d')
- folder="http/img/scrot"
+ local folder="http/img/scrot"
ssh shmibbles.me "mkdir -p $folder/$date"
if [[ "${?#0}" != "" ]]; then
@@ -221,12 +225,14 @@ make-gif() {
ln -s "$1" make-gif-in
+ local start
echo -n "start [00:00:00]: "
read start
if [[ -z "$start" ]]; then
start="00:00:00"
fi
+ local length
echo -n "length [full]: "
read length
if [[ -z "$length" ]]; then
@@ -236,18 +242,21 @@ make-gif() {
t="-t"
fi
+ local fps
echo -n "fps [10]: "
read fps
if [[ -z "$fps" ]]; then
fps="10"
fi
+ local width
echo -n "width [480]: "
read width
if [[ -z "$width" ]]; then
width="480"
fi
+ local subs
echo -n "use subtitles? [y/N]: "
read subs
if [[ "$subs" == "y" || "$subs" == "Y" ]]; then
@@ -277,7 +286,7 @@ make-gif() {
# um...
fuck() {
- fuck="fuck"
+ local fuck="fuck"
while true; do
echo -en "\e[$((RANDOM%2));$((RANDOM%8+30))m"