This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='$(if [ $? -eq 0 ]; then echo "\[\033[32m\]:)"; else echo "\[\033[31m\]:("; fi) ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u : \[\033[01;34m\]$(echo $(pwd) | grep -o "/" | wc -l)/$(basename $(pwd))\[\033[00m\] - ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo blkid | grep sda | while read -r line | |
do | |
USB=$(echo $line | perl -pe 's/\:(.*)//') | |
TYPE=$(echo $line | perl -pe 's/(.*)TYPE=// and s/"//g') | |
DIR=$(echo $line | perl -pe 's/(.*)\/// and s/\:(.*)//') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ranger() { | |
tempfile='/tmp/chosendir' | |
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" | |
test -f "$tempfile" && | |
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then | |
cd -- "$(cat "$tempfile")" | |
fi | |
rm -f -- "$tempfile" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i="0" | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
while [ -f $FILE ]; | |
do | |
i=$[$i+1] | |
FILE="/home/andrew/Pictures/screenshots/screenshot($i).png" | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# the current version of chrome in linux requires focus on the window for xdotool | |
#this is a workaround to focus back to the editor after reloading the page | |
editor=`xdotool getwindowfocus` | |
xdotool search --onlyvisible --class "Chrome" windowfocus key 'ctrl+r' | |
xdotool windowfocus $editor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xdotool search --name firefox key --window %@ F5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written at $(date +'%r')") | |
"$@" | |
while inotifywait -qre close_write --format "$FORMAT" . | |
do | |
"$@" | |
done |
NewerOlder