Jason Ryan avatar Jason Ryan committed 2e24b47

Cleaned up trailing spaces and tabs

Comments (0)

Files changed (23)

 
 lan="$(ip addr | grep .102)"
 
-if [ -n "$lan" ]; then 
+if [ -n "$lan" ]; then
     ssh 200 -t tmux a -d 2>/dev/null
-else 
+else
     ssh sent -t tmux a -d 2>/dev/null
-fi  
+fi
 
 # Snippet lifted from absent: http://aur.archlinux.org/packages.php?ID=50669
 # add /usr/bin/abs to sudoers if you don't want the password prompt
 
-mag=$'\e[1;35m'  
-yel=$'\e[1;33m'  
+mag=$'\e[1;35m'
+yel=$'\e[1;33m'
 cyn=$'\e[1;36m'
 red=$'\e[1;31m'
-end=$'\e[0m'      
+end=$'\e[0m'
 searchdirs=("/var/abs/core" "/var/abs/extra" "/var/abs/community")
 
-for name in "$@"; do 
-    for repo in "${searchdirs[@]}"; do 
+for name in "$@"; do
+    for repo in "${searchdirs[@]}"; do
         if [[ ( -d ${repo}/${name} && -f ${repo}/${name}/PKGBUILD ) ]]; then
         target="${repo}/${name}" 
         repos="${repo##*/}"
         ivers="$(awk '/Version/ {print $3}' <(pacman -Qi ${name} 2>/dev/null))"
 
             # synchronize repo 
-            if [[ "$avers" < "$pvers" ]]; then 
-                sudo abs "${target##*s/}" 
+            if [[ "$avers" < "$pvers" ]]; then
+                sudo abs "${target##*s/}"
             fi
 
-            # print the current version details				
+            # print the current version details
             printf "%s\n%s\n" "${yel}${repos^} version${end}" "$pvers"
             printf "%s\n%s\n" "${mag}ABS version${end}" "$avers"
 
             # locally installed?
-            if [[ -n "$ivers" ]]; then 
-                printf "\n%s\n%s\n" "${cyn}Installed${end}" "$ivers" 
+            if [[ -n "$ivers" ]]; then
+                printf "\n%s\n%s\n" "${cyn}Installed${end}" "$ivers"
             else 
-                printf "\n%s\n" "${red}${name} not installed…${end}" 
-            fi 
-        fi 
-    done 
-done 
+                printf "\n%s\n" "${red}${name} not installed…${end}"
+            fi
+        fi
+    done
+done
 
 
 printf "%s\n" "Beginning sync..."
 
-rsync -Cazs --stats "${dirs[@]}" "${back}" 
+rsync -Cazs --stats "${dirs[@]}" "${back}"
 
 sudo umount $HOME/Centurion
 
 myedit=$(echo $EDITOR)
 mybrowser=$(echo ${BROWSER##*/})
 
-                              
+
 # if X is running
 if [[ "$DISPLAY" ]]; then
     # check for running wm
     for w in "${wms[@]}"; do
         if pidof "$w" &>/dev/null; then
-        wm=$w 
+        wm=$w
         fi
     done
 
     myres=$(awk '/current/ {print $8,$9,+$10}' <(xrandr 2>/dev/null))
-    myfont=$(awk -F: '{print $3}' <(grep "^URxvt.font" .Xresources))
+    myfont=$(awk -F: '{print $3}' <(grep "^URxvt.font" ~/.Xresources))
     # screenshot command
     shot="scrot -cd5 ${machine}-$(date +%d%m%y).png"
 else
 
 # ASCII goodness…
   cat <<EOF
-${lt}                 +      
-                 #             ${tx}Machine:${ec} ${machine}${lt}       
-                ###            ${tx}Architecture:${ec} ${arch}${lt} 
+${lt}                 +
+                 #             ${tx}Machine:${ec} ${machine}${lt}
+                ###            ${tx}Architecture:${ec} ${arch}${lt}
                #####           ${tx}Kernel:${ec} ${mykernel}${lt}
                ######          ${tx}CPU:${ec} ${mycpu}${lt}
               ; #####;         ${tx}Uptime:${ec} ${myuptime}${lt}
             +##########        ${tx}Window Manager:${ec} ${wm}${lt}
            #####${dk}######${lt}##;      ${tx}Shell:${ec} ${myshell^}${lt}
           ###${dk}############${lt}+     ${tx}Terminal:${ec} ${myterm^}${lt}
-         #${dk}######   #######     ${tx}Editor:${ec} ${myedit^}${dk}       
-       .######;     ;###;\`.    ${tx}Browser:${ec} ${mybrowser^}${dk} 
-      .#######;     ;#####.    ${tx}Font:${ec} ${myfont^}${dk} 
-      #########.   .########\`     
-     ######'           '######   
-    ;####                 ####;  
-    ##'                     '##  
-   #'                         \`# 
+         #${dk}######   #######     ${tx}Editor:${ec} ${myedit^}${dk}
+       .######;     ;###;\`.    ${tx}Browser:${ec} ${mybrowser^}${dk}
+      .#######;     ;#####.    ${tx}Font:${ec} ${myfont^}${dk}
+      #########.   .########\`
+     ######'           '######
+    ;####                 ####;
+    ##'                     '##
+   #'                         \`#
   '                            \`${ec}
- 
+
 EOF
 ${shot}

Scripts/autostart

 #!/bin/sh
 # autostart apps
-       
+
 tabbed -d >/tmp/tabbed.xid; vimprobable2 -e $(cat /tmp/tabbed.xid) &
 urxvtc -title "mutt" -e mutt &
 $HOME/Scripts/shux &

Scripts/cacheshot

 rsync -azP --exclude-from=/home/jason/Scripts/excludes.txt \
     --log-file=/home/jason/.logs/rsync/cache-$(date +%d%m%y).log \
     -e ssh --rsync-path="sudo rsync" /var/cache/pacman backups:Backups/Centurion/pacman-$(date +%m%y)
-    
+
 #Script to append correct extensions to files...
 
 for file in *; do
-    	case "$file" in 
-    	*.jpeg) mv "$file" "${file%.*}.jpg"  ;;
-     	*.JPG)  mv "$file" "${file%.*}.jpg"  ;;
-     	*.AVI)  mv "$file" "${file%.*}.avi"  ;;
-    	esac
+	case "$file" in
+	*.jpeg) mv "$file" "${file%.*}.jpg"  ;;
+	*.JPG)  mv "$file" "${file%.*}.jpg"  ;;
+	*.AVI)  mv "$file" "${file%.*}.avi"  ;;
+	esac
 done
 printf "\n%s\n" "All done..."
 
 
 read -p "Remove Build directory? [Y/n]? " yn
 if [ "$yn" = "y" ]; then
-    printf "\n%s\n" "Removing build directory..." 
+    printf "\n%s\n" "Removing build directory..."
     rm -rf "$builddir"
 else
     printf "%s\n" "Build completed."
     printf "%s\n" "Safebox mounted, exiting."
 
 elif [[ -n "$target" ]]; then
-    grep "PID" <(lsof +D "$target" &>/dev/null)
+    grep "PID" <(lsof +d "$target" &>/dev/null)
          if [[ $? -eq 0 ]]; then
             printf "%s\n" "${target##*/} busy..."
             exit 1
         else udiskie-umount -s "$target" &>/dev/null
              exstatus
         fi
-else     
+else
     printf "%s\n" "No drive mounted..."
 fi

Scripts/dwm-start

 
 while true; do
     $HOME/Scripts/dwm-status
-   	sleep 2
+    sleep 2
 done &
 
 while true; do
-	/usr/bin/dwm >/dev/null
-	# to log stderrors to a file 
-	#dwm 2> ~/Build/dwm/dwm.log
-done 
+    /usr/bin/dwm >/dev/null
+    # to log stderrors to a file
+    #dwm 2> ~/Build/dwm/dwm.log
+done
 

Scripts/dwm-status

 }
 
 mem(){
-	mem="$(awk '/^-/ {print $3}' <(free -m))"
-	echo -e "\x04$mem\x01"
+    mem="$(awk '/^-/ {print $3}' <(free -m))"
+    echo -e "\x04$mem\x01"
 }
 
    # CPU line courtesy Procyon:i
    # https://bbs.archlinux.org/viewtopic.php?pid=874333#p874333
 cpu(){
-	read cpu a b c previdle rest < /proc/stat
-	prevtotal=$((a+b+c+previdle))
-	sleep 0.5
-	read cpu a b c idle rest < /proc/stat
-	total=$((a+b+c+idle))
-	cpu="$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))"
-	echo -e "\x05$cpu%\x01"
-	}
+    read cpu a b c previdle rest < /proc/stat
+    prevtotal=$((a+b+c+previdle))
+    sleep 0.5
+    read cpu a b c idle rest < /proc/stat
+    total=$((a+b+c+idle))
+    cpu="$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))"
+    echo -e "\x05$cpu%\x01"
+}
 
 hdd(){
     hd=( $(awk '
 }
 
 eml(){
-	maildirs="$HOME/Mail/*/INBOX/new/"
-	ml="$(find $maildirs -type f | wc -l)"
-	if [[ $ml -eq 0 ]]; then
-		echo "0"
-	else
-		echo -en "\x03$ml\x01"
-	fi
+    maildirs="$HOME/Mail/*/INBOX/new/"
+    ml="$(find $maildirs -type f | wc -l)"
+    if [[ $ml -eq 0 ]]; then
+        echo "0"
+    else
+        echo -en "\x03$ml\x01"
+    fi
 }
 
 pac(){
-	pup="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
-	if [[ $pup -eq 0 ]]; then
-	    echo "0"
-	else
-	    echo -en "\x05$pup\x01"
-	fi
+    pup="$(pacman -Qqu --dbpath /tmp/checkup-db-jason/ | wc -l)"
+    if [[ $pup -eq 0 ]]; then
+        echo "0"
+    else
+        echo -en "\x05$pup\x01"
+    fi
 }
 
 ups(){
 }
 
 dte(){
-	dte="$(date "+%I:%M")"
-	echo -e "\x02$dte\x01"
+    dte="$(date "+%I:%M")"
+    echo -e "\x02$dte\x01"
 }
 
 # Pipe to status bar
 xsetroot -name "$(music) $(mbt) $(gpu) • CPU $(cpu) MEM $(mem) • HDD $(hdd) \
 • EML $(eml) PKG $(pac) AUR $(ups)$(aur) • ETH $(int) • $(dte) "
 
-

Scripts/highlights

 dir="$HOME/Sync/irssi/"
 
 while inotifywait -qqre attrib "$dir" >/dev/null 2>&1; do
-  #  echo "IRC:" "You have been pinged..." | dzen2 -p 5 
+  #  echo "IRC:" "You have been pinged..." | dzen2 -p 5
    notify-send IRC "You have been pinged…" \
        -i /usr/share/icons/gnome/48x48/status/dialog-warning.png
 done

Scripts/mountback

 rsync -azP --delete --exclude-from=Scripts/excludes.txt \
     --log-file=Documents/rsync-$(date +%d%m%y).log \
     /home/jason /etc /var/cache/pacman /media/Sentinel/Archer
-    
+
 if [ "$?" -eq 0 ]; then
     printf '%s\n' "Synched successfully; now unmounting."
     umount /media/Sentinel
 rat=$(awk '/Mouse/ { sub(/id=/,""); print $7 }' <(xinput --list))
 
 case $1 in
-    on) xinput enable "$rat"  
+    on) xinput enable "$rat"
         ;;
-   off) xinput disable "$rat" 
+   off) xinput disable "$rat"
         ;;
-     *) printf '%s\n' 'on OR off…'; exit 1 
+     *) printf '%s\n' 'on OR off…'; exit 1
         ;;
 esac
 

Scripts/mp32youtube

 #!/bin/bash
 # based on http://www.crimulus.com/2010/01/21/linux-bash-script-convert-mp3-to-avi-with-static-image-command-line/
-                      
+
 if [ $# != 3 ] ; then
     echo "Usage: $0 <image_file> <mp3_file> <output_file.avi>";
     exit 0;
 #!/bin/sh
-          
+
 for agent in /tmp/ssh-*/agent.*; do
     export SSH_AUTH_SOCK=$agent
-                 
+
     if ssh-add -l 2>&1 >/dev/null; then
         echo "Found working SSH Agent..."
         ssh-add -l
 tst="-c -f $box-$(date +%d%m%y) --dry-run -v $dir"   # dry run
 del="-d -f $box-"                                    # delete archive
 ext="-x -f $box-"                                    # extract archive
-                      
+
 usage () {
 
     cat <<EOF
     while true; do
         read -p "Which archive? " archive
 
-        # check for an archive number 
+        # check for an archive number
         if [ ! -z "${archive##*[!0-9]*}" ]; then
-            
+
             [ "$opt" = "-d" ] && op="${del}${archive}" || op="${ext}${archive}"
             break
-        
+
         else
             printf "%s\n\n" "Numbers, please..."
         fi
 }
 
 dryrun () {
-    printf "%s\n" "Starting dry run: results saved to tarsnapout.txt" 
-    op="${tst}" 
+    printf "%s\n" "Starting dry run: results saved to tarsnapout.txt"
+    op="${tst}"
 }
 
 opt="$1"
 
     case "$1" in
         -a) op="${arc}"           ;;
-        -l) op="--list-archives"  ;; 
-        -s) op="--print-stats"    ;; 
+        -l) op="--list-archives"  ;;
+        -s) op="--print-stats"    ;;
      -d|-e) check                 ;;
         -t) dryrun                ;;
-      -h|*) usage && exit         ;;  
+      -h|*) usage && exit         ;;
     esac
 
-# run the options    
+# run the options
 [ "$1" = "-t" ] && sudo tarsnap $op 2>tarsnapout.txt || sudo tarsnap $op
 
-   

Scripts/squeezebox.py

 #! /usr/bin/python2
-  
+
 from telnetlib import Telnet
 from urllib import unquote
 from time import sleep
-  
+
 def query(server, port, player, commands):
     tn = Telnet(server, port)
-  
+
     for command in commands:
         tn.write("%s %s ?\n" % (player, command))
-  
+
     sleep(0.2)
     feedback = tn.read_very_eager().split('\n')
     results = [(cmd,unquote(res)[len(player)+len(cmd)+2:]) \
                  for cmd,res in zip(commands, feedback)]
     return dict(results)
-  
+
 if __name__ == "__main__":
     server = "192.168.1.100" # according to your server
     port = 9090
     player = "00:04:20:12:9e:43" # according to your player
     commands = ("artist", "title")
-  
+
     res = query(server, port, player, commands)
     print "%(artist)s - %(title)s" % res
-  
 
+
     is-enabled |  check status
     status     |  current state
     disable    |  do not load at boot
-    
+
     list       |  list all running services
     read       |  read the relevant service file
     fail       |  list failed services
 }
 
 actions=("start" "restart" "stop" "enable" "disable")
- 
+
 for i in "${actions[@]}"; do
     [[ "$i" = "$arg1" ]] && super="yes"
 done
 
 
-if [[ ( $# -eq 2 && "$super" == "yes" ) ]]; then 
+if [[ ( $# -eq 2 && "$super" == "yes" ) ]]; then
     sudo systemctl "$1" "$2".service
 
 elif [[ ( $# -eq 2 && "$1" == "read" ) ]]; then
     less -FX /usr/lib/systemd/system/"$2".service
-    
+
 elif [[ $# -eq 2 ]]; then
     systemctl "$1" "$2".service
 fi
 
 if [[ $# -eq 1 ]]; then
-    
+
     case "$1" in
         list) systemctl list-units ;;
        fail*) systemctl --failed   ;;

Scripts/tmuxmail.sh

 maildirs="$HOME/Mail/*/INBOX/new/"
 
 find $maildirs -type f | wc -l
-                
-exit 0
+
 #!/bin/bash
-awk -F"[, ]" '{ 
+awk -F"[, ]" '{
     if (NF==17)
         print $4
     else
 # wrapper to prevent screen blanking
 
 usage() {
-    printf "%s\n" "Usage: ${0##*/} /path/to/file" 
+    printf "%s\n" "Usage: ${0##*/} /path/to/file"
     exit 1
 }
 
 
 dirs=($HOME/.$1* $HOME/.$1/ $XDG_CONFIG_HOME/$1/)
 
-IFS=$'\n' 
+IFS=$'\n'
 read -r -d '' -a files < \
     <(find "${dirs[@]}" -type f \( \
            -name "*.conf" \
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.