Merge branch 'master' of github.com:Jab2870/dotfiles

master
Jonathan Hodgson 6 years ago
commit 3621801d3f
  1. 0
      bin/conversion/code-to-pdf
  2. 0
      bin/conversion/csvtomd
  3. 0
      bin/conversion/iso-to-game-cube
  4. 0
      bin/conversion/iso-to-wii
  5. 0
      bin/conversion/otf2ttf
  6. 5
      bin/dmenu/README.md
  7. 1
      bin/dmenu/dmenu
  8. 0
      bin/dmenu/http-status-codes
  9. 0
      bin/dmenu/ports-common.csv
  10. 0
      bin/dmenu/ports-uncommon.csv
  11. 21
      bin/dmenu/rofi-reverse-shells
  12. 0
      bin/dmenu/rofi-shutdown
  13. 52
      bin/dmenu/unicode-character-select
  14. 0
      bin/dmenu/unicode.txt
  15. 0
      bin/fonts/changeFontFamily
  16. 0
      bin/fonts/fontFamily
  17. 0
      bin/fonts/fontWeight
  18. 0
      bin/git/git-cleaner
  19. 0
      bin/git/git-delete-submodule
  20. 0
      bin/git/git-initial-commit
  21. 0
      bin/git/git-jump
  22. 0
      bin/git/git-nuke
  23. 0
      bin/git/git-open
  24. 0
      bin/git/git-recall
  25. 0
      bin/git/git-wtf
  26. 0
      bin/i3exit
  27. 3
      bin/notifications/datetime
  28. 29
      bin/search/searchcss
  29. 29
      bin/search/searchhtml
  30. 29
      bin/search/searchjs
  31. 29
      bin/search/searchphp
  32. 0
      bin/search/where
  33. 3
      bin/whoami
  34. 0
      bin/wordpress/aquarius-htaccess
  35. 0
      bin/wordpress/aquarius-plugin
  36. 0
      bin/wordpress/aquarius-redirects
  37. 0
      bin/wordpress/aquarius-wpconfig
  38. 52
      bin/wordpress/getthemepath
  39. 0
      bin/wordpress/update3rdPartyPlugins
  40. 0
      bin/wordpress/updatePlugin
  41. 0
      bin/wordpress/wpLookup
  42. 0
      bin/wordpress/wp_urls
  43. 2
      dwm
  44. 106
      rofi/scripts/rofi-emoji
  45. 127
      shells/functions
  46. 5
      shells/profile
  47. 2
      vim
  48. 9
      x/xinitrc

@ -0,0 +1,5 @@
# Dmenu Scripts
Most of these scripts should work with dmenu although I have a dmenu symlinked to [rofi](https://github.com/davatorium/rofi) because I haven't yet got around to switching and testing these scripts with proper dmenu.

@ -0,0 +1 @@
/usr/bin/rofi

@ -1,12 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# Use rofi to pick a reverse shell # Use dmenu to pick a reverse shell
# #
# Requirements: # Requirements:
# rofi, xsel, rsg (git@github.com:mthbernardes/rsg.git) # dmenu, xsel
# #
SHELLS='/home/jonathan/GitRepos/rsg/shells.txt' SHELLS="$(dirname $0)/shells.txt"
function notify() { function notify() {
if [ "$(command -v notify-send)" ]; then if [ "$(command -v notify-send)" ]; then
@ -41,22 +41,7 @@ function display() {
port=$(getPort) port=$(getPort)
reverseShell=$(getReverseShell $ip $port) reverseShell=$(getReverseShell $ip $port)
#reverseShell=$( echo "$reverseShell" | sed "s/\[IPADDR\]/$ip/g" | sed "s/\[PORT\]/$port/g" )
echo -n "$reverseShell" | /usr/bin/xclip -i -selection clipboard echo -n "$reverseShell" | /usr/bin/xclip -i -selection clipboard
#emoji=$(cat "$UNICODE_FILE" | grep -v '^[[:space:]]*$')
#line=$(echo "$emoji" | rofi -dmenu -i -p Unicode -kb-custom-1 Ctrl+c $@)
#exit_code=$?
#line=($line)
#if [ $exit_code == 0 ]; then
# xdotool type --clearmodifiers "${line[0]}"
#elif [ $exit_code == 10 ]; then
# echo -n "${line[0]}" | /usr/bin/xclip -i -selection clipboard
#fi
} }

@ -0,0 +1,52 @@
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, xdotool, curl, xmllint
#
# Usage:
# 1. Download all emoji
# $ rofi-emoji --download
#
# 2. Run it!
# $ rofi-emoji
#
# Notes:
# * You'll need a emoji font like "Noto Emoji" or "EmojiOne".
# * Confirming an item will automatically paste it WITHOUT
# writing it to your clipboard.
# * Ctrl+C will copy it to your clipboard WITHOUT pasting it.
#
# Where to save the emojis file.
UNICODE_FILE="$(dirname "$0")/unicode.txt"
function notify() {
if [ "$(command -v notify-send)" ]; then
notify-send "$1" "$2"
fi
}
function display() {
emoji=$(cat "$UNICODE_FILE" | grep -v '^[[:space:]]*$')
line=$(echo "$emoji" | dmenu -i -p Unicode -kb-custom-1 Ctrl+c $@)
exit_code=$?
line=($line)
if [ $exit_code == 0 ]; then
xdotool type --clearmodifiers "${line[0]}"
elif [ $exit_code == 10 ]; then
echo -n "${line[0]}" | /usr/bin/xclip -i -selection clipboard
fi
}
# display displays :)
display

@ -0,0 +1,3 @@
#!/usr/bin/env bash
notify-send "$(date '+%T')" "$(date '+%A %d %Y')"

@ -0,0 +1,29 @@
#!/usr/bin/env bash
after=0
before=0
search=''
if [ $# == 0 ]; then
echo "Usage: $0 [-A <after>] [-B <before>] query"
exit 1
fi
while [ $# != 0 ]; do
case "$1" in
-A)
after="$2"
shift
shift
;;
-B)
before="$2"
shift
shift
;;
*)
search="$search $1"
shift
;;
esac
done
grep -r -i -n --color="always" --include=\*.{css,less,scss,sass} --exclude=\*.min.css -A "$after" -B "$before" "$search" .

@ -0,0 +1,29 @@
#!/usr/bin/env bash
after=0
before=0
search=''
if [ $# == 0 ]; then
echo "Usage: $0 [-A <after>] [-B <before>] query"
exit 1
fi
while [ $# != 0 ]; do
case "$1" in
-A)
after="$2"
shift
shift
;;
-B)
before="$2"
shift
shift
;;
*)
search="$search $1"
shift
;;
esac
done
grep -r -i -n --color="always" --include=\*.{html,htm} -A "$after" -B "$before" "$search" .

@ -0,0 +1,29 @@
#!/usr/bin/env bash
after=0
before=0
search=''
if [ $# == 0 ]; then
echo "Usage: $0 [-A <after>] [-B <before>] query"
exit 1
fi
while [ $# != 0 ]; do
case "$1" in
-A)
after="$2"
shift
shift
;;
-B)
before="$2"
shift
shift
;;
*)
search="$search $1"
shift
;;
esac
done
grep -r -i -n --color="always" --include=\*.{js,es6} --exclude=\*.min.js -A "$after" -B "$before" "$search" .

@ -0,0 +1,29 @@
#!/usr/bin/env bash
after=0
before=0
search=''
if [ $# == 0 ]; then
echo "Usage: $0 [-A <after>] [-B <before>] query"
exit 1
fi
while [ $# != 0 ]; do
case "$1" in
-A)
after="$2"
shift
shift
;;
-B)
before="$2"
shift
shift
;;
*)
search="$search $1"
shift
;;
esac
done
grep -r -i -n --color="always" --include=\*.{php,phtml} -A "$after" -B "$before" "$search" .

@ -0,0 +1,3 @@
#!/usr/bin/env bash
/usr/bin/whoami > /tmp/testing

@ -0,0 +1,52 @@
#!/usr/bin/env zsh
# Small script that echos the path of a wordpress theme
#
# By default it will echo the path of the active theme. If an argument is given, it will grep the list of themes with the argment and return the path for the first
#
# It assumes that the wordpress is in a folder called public_html or public_html/wp. It should be run from inside this directory
#
# It can also be run inside a wiki directory if public_html is a sibling of wiki
#
# @author jab2870
# @requires wp
# Gets the public html folder from any sub folder or the wiki folder
public_html="${${PWD%/public_html*}%/wiki*}/public_html"
# Checks the public_html directory exists
if [ -d $public_html ]; then
# Checks to see if wp is in a subdirectory called wp
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
else
wpPath=$public_html;
fi
# This assumes the domain for the site. It should be changed according to your setup
# It assumes here that the domain is the same as public_html folder with .local.jh appended
# This is needed if using a multisite setup
domain="$(basename $(dirname $public_html ) ).local.jh"
# If we have an argument
if [ ! -z "$1" ]; then
# Try and find the theme containing the argument and return it's path
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "$1" | head -n 1 | awk '{print $1}') 2> /dev/null ))
else
# Otherwise, get the active plugin
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "active" | grep -v "inactive" | awk '{print $1}') 2> /dev/null ))
fi
# If we have an answer
if [ -d $theme ]; then
# Echo it
echo $theme
else
# Otherwise we can fail
>&2 echo "cannot find theme"
exit 2
fi
else
>&2 echo "Cannot find public_html"
exit 1
fi

2
dwm

@ -1 +1 @@
Subproject commit bdc4d25b7af384533e17fb47c2acceb7126dfd34 Subproject commit e3594813917e8b8a162c701162432c9ee24a3551

@ -1,106 +0,0 @@
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, xdotool, curl, xmllint
#
# Usage:
# 1. Download all emoji
# $ rofi-emoji --download
#
# 2. Run it!
# $ rofi-emoji
#
# Notes:
# * You'll need a emoji font like "Noto Emoji" or "EmojiOne".
# * Confirming an item will automatically paste it WITHOUT
# writing it to your clipboard.
# * Ctrl+C will copy it to your clipboard WITHOUT pasting it.
#
# Where to save the emojis file.
UNICODE_FILE="$HOME/.dotfiles/rofi/scripts/unicode.txt"
# Urls of emoji to download.
# You can remove what you don't need.
URLS=(
'https://emojipedia.org/people/'
'https://emojipedia.org/nature/'
'https://emojipedia.org/food-drink/'
'https://emojipedia.org/activity/'
'https://emojipedia.org/travel-places/'
'https://emojipedia.org/objects/'
'https://emojipedia.org/symbols/'
'https://emojipedia.org/flags/'
)
function notify() {
if [ "$(command -v notify-send)" ]; then
notify-send "$1" "$2"
fi
}
function download() {
echo "Disabled the download"
#notify `basename "$0"` 'Downloading all emoji for your pleasure'
#echo "" > "$UNICODE_FILE"
#for url in "${URLS[@]}"; do
# echo "Downloading: $url"
# # Download the list of emoji and remove all the junk around it
# emojis=$(curl -s "$url" | \
# xmllint --html \
# --xpath '//ul[@class="emoji-list"]' - 2>/dev/null)
# # Get rid of starting/closing ul tags
# emojis=$(echo "$emojis" | head -n -1 | tail -n +1)
# # Extract the emoji and its description
# emojis=$(echo "$emojis" | \
# sed -rn 's/.*<span class="emoji">(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p')
# echo "$emojis" >> "$UNICODE_FILE"
#done
#notify `basename "$0"` "We're all set!"
}
function display() {
emoji=$(cat "$UNICODE_FILE" | grep -v '^[[:space:]]*$')
line=$(echo "$emoji" | rofi -dmenu -i -p Unicode -kb-custom-1 Ctrl+c $@)
exit_code=$?
line=($line)
if [ $exit_code == 0 ]; then
xdotool type --clearmodifiers "${line[0]}"
elif [ $exit_code == 10 ]; then
echo -n "${line[0]}" | /usr/bin/xclip -i -selection clipboard
fi
}
# Some simple argparsing
if [[ "$1" =~ -D|--download ]]; then
download
exit 0
elif [[ "$1" =~ -h|--help ]]; then
echo "usage: $0 [-D|--download]"
exit 0
fi
# Download all emoji if they don't exist yet
if [ ! -f "$UNICODE_FILE" ]; then
download
fi
# display displays :)
display

@ -7,7 +7,7 @@ function big-new-chromium () {
} }
# make xclip work as I would expect. Copy to clipboard if piped data. Paste from otherwise # make xclip work as I would expect. Copy to clipboard if piped data. Paste from otherwise
function xclip(){ function clip(){
if command -v /usr/bin/xclip 1>/dev/null; then if command -v /usr/bin/xclip 1>/dev/null; then
if [[ -p /dev/stdin ]] ; then if [[ -p /dev/stdin ]] ; then
# stdin is a pipe # stdin is a pipe
@ -113,36 +113,13 @@ function ptheme() {
fi fi
} }
function get_theme() {
public_html="${${PWD%/public_html*}%/wiki*}/public_html"
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
else
wpPath=$public_html;
fi
domain="$(basename $(dirname $public_html ) ).local.jh"
if [ ! -z "$1" ]; then
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "$1" | head -n 1 | awk '{print $1}') 2> /dev/null ))
else
theme=$(dirname $(wp --path="$wpPath" --url="$domain" theme path $(wp --path="$wpPath" --url="$domain" theme list 2> /dev/null | grep "active" | grep -v "inactive" | awk '{print $1}') 2> /dev/null ))
fi
if [ -d $theme ]; then
echo $theme
else
echo ""
fi
else
echo ""
fi
}
#Takes you to the child theme #Takes you to the child theme
function theme() { function theme() {
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
ctheme=$(get_theme "$1") ctheme=$(getthemepath "$1" 2> /dev/null)
else else
ctheme=$(get_theme) ctheme=$(getthemepath 2> /dev/null)
fi fi
if [ ! -z "$ctheme" ]; then if [ ! -z "$ctheme" ]; then
cd $ctheme cd $ctheme
@ -151,7 +128,7 @@ function theme() {
#Takes you to the js folder child theme #Takes you to the js folder child theme
function js() { function js() {
ctheme=$(get_theme) ctheme=$(getthemepath)
if [ ! -z "$ctheme" ]; then if [ ! -z "$ctheme" ]; then
cd $ctheme/js cd $ctheme/js
fi fi
@ -159,7 +136,7 @@ function js() {
#Takes you to the css folder child theme #Takes you to the css folder child theme
function css() { function css() {
ctheme=$(get_theme) ctheme=$(getthemepath)
if [ ! -z "$ctheme" ]; then if [ ! -z "$ctheme" ]; then
cd $ctheme/css cd $ctheme/css
fi fi
@ -210,40 +187,6 @@ function wooTemplates() {
fi fi
} }
#Copies a woo tepmplate file to the theme
function woocp() {
public_html=${PWD%/public_html*}/public_html
if [ -d $public_html ]; then
if [ -d $public_html/wp ]; then
wpPath=$public_html/wp;
else
wpPath=$public_html;
fi
woocommerce=$(dirname $(wp --path="$wpPath" plugin path woocommerce))
themes=$(dirname $(wp --path="$wpPath" theme path ))
if [ -d "$woocommerce" ]; then
#If we are here, we know what the woocommerce path is.
# If in WOO directory, we want to copy to the theme directory. If we are not in Woo directory, copy to the current directory
case $PWD/ in
$woocommerce/*)
theme=$(get_theme)
#if [[ $PWD = $woocommerce/templates
;;
$themes/*)
echo "in themes dir"
;;
*)
echo "soewhere else"
;;
esac
else
echo "Can't find woocommerce"
fi;
else
echo " Can't find public_html folder."
fi
}
#Takes you to the theme directory #Takes you to the theme directory
function themes() { function themes() {
public_html=${${PWD%/public_html*}%/wiki*}/public_html public_html=${${PWD%/public_html*}%/wiki*}/public_html
@ -277,58 +220,12 @@ function debugToggle(){
fi fi
} }
######################################## # Adds sub folders in by .bin directory to the PATH if they are not already in it
## ## function updatePath(){
## Search Functions ## for d in ~/.bin/*/; do
## ## if [[ :$PATH: != *:"$d":* ]] ; then
######################################## PATH+=":$d"
fi
#These search functions use grep to search all sub-folders of the current working directory done
searchjs() {
# This will search through .js and .es6 files but won't search minified files
grep -r -i -n --color="always" --include=\*.{js,es6} --exclude=\*.min.js "$1" . | tee /tmp/lastSearch
}
searchcss() {
# This will search through .css and .less files but won't search minified files
grep -r -i -n --color="always" --include=\*.{css,less,scss,sass} --exclude=\*.min.css "$1" . | tee /tmp/lastSearch
}
searchphp() {
grep -r -i -n --color="always" --include=\*.{php,phtml} "$1" . | tee /tmp/lastSearch
}
searchhtml() {
grep -r -i -n --color="always" --include=\*.{html,htm} "$1" . | tee /tmp/lastSearch
}
ops() {
responce=$(cat /tmp/lastSearch | slmenu -b -l $(tput lines) | sed 's/\x1B\[[0-9;]\+[A-Za-z]//g')
echo "responce"
file=$(echo "$responce" | awk -F ':' '{print $1}')
line=$(echo "$responce" | awk -F ':' '{print $2}')
vim +${line} ${file}
} }
png() {
pngcrush -brute "$1"{,.} && du -b "$1"{,.}
}
gif() {
gifsicle -O "$1" -o "$1." && du -b "$1"{,.}
}
jpeg() {
jpegtran "$1" > "$1." && du -b "$1"{,.}
}
# Just for easy access in history
mpng() {
mv "$1"{.,}
}
mgif() {
newsize=$(wc -c <"$1.")
oldsize=$(wc -c <"$1")
if [ $oldsize -gt $newsize ] ; then
mv "$1"{.,}
else
rm "$1."
fi
}
mjpeg() {
mv "$1"{.,}
}

@ -12,4 +12,9 @@ GEM_PATH=$GEM_HOME
export PATH=$PATH:$GEM_HOME/bin export PATH=$PATH:$GEM_HOME/bin
export GEM_HOME=$(ruby -e 'print Gem.user_dir') export GEM_HOME=$(ruby -e 'print Gem.user_dir')
# Adds sub folders in by .bin directory to the PATH
for d in ~/.bin/*/; do
PATH+=":$d"
done
#echo -e "Please don't sabotage my computer while I'm away \n\nTo turn on the print server, run the command 'cups'" | /usr/bin/cowsay -f tux -W 80 #echo -e "Please don't sabotage my computer while I'm away \n\nTo turn on the print server, run the command 'cups'" | /usr/bin/cowsay -f tux -W 80

2
vim

@ -1 +1 @@
Subproject commit 6fc7e108bfbb023fa028db299ec8e4b28e2fbcab Subproject commit 16d377b884fc88a352d7ed04be36c4a000f4e8f0

@ -5,6 +5,7 @@ xset r rate 200 70
# Need this for making qt applications use gtk theme ( I think ) # Need this for making qt applications use gtk theme ( I think )
export QT_QPA_PLATFORMTHEME=qt5ct export QT_QPA_PLATFORMTHEME=qt5ct
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel' export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export _JAVA_AWT_WM_NONREPARENTING=1
# Use gnome keyring # Use gnome keyring
killall gnome-keyring-d 2> /dev/null killall gnome-keyring-d 2> /dev/null
export `gnome-keyring-daemon -d` export `gnome-keyring-daemon -d`
@ -13,9 +14,9 @@ export $(gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg)
dbus-update-activation-environment --systemd DISPLAY dbus-update-activation-environment --systemd DISPLAY
#exec xrdb .Xresources #exec xrdb .Xresources
#xbindkeys #xbindkeys
exec i3 -V >> ~/i3log-$(date + '%F-%k-%M-%S') 2>&1 #exec i3 -V >> ~/i3log-$(date + '%F-%k-%M-%S') 2>&1
#while :; do while :; do
# dwm dwm
#done; done;
#exec sh /home/jonathan/.conky/conky-startup.sh #exec sh /home/jonathan/.conky/conky-startup.sh
#xcape #xcape

Loading…
Cancel
Save