Merge pull request #1 from LukeSmithxyz/master

merge upstream
This commit is contained in:
richard134 2019-02-03 12:46:22 +01:00 committed by GitHub
commit 6fcbdfbb28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 63 additions and 118 deletions

31
.aliasrc Normal file
View File

@ -0,0 +1,31 @@
#!/bin/sh
alias ka="killall" \
mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)" \
magit="nvim -c Magit" \
p="sudo pacman" \
SS="sudo systemctl" \
f="vifm" \
g="git" \
trem="transmission-remote" \
e="$EDITOR" \
v="$EDITOR" \
x="sxiv -ft *" \
sdn="sudo shutdown -h now" \
gua="git remote | xargs -L1 git push --all" \
ls="ls -hN --color=auto --group-directories-first" \
grep="grep --color=auto" \
diff="diff --color=auto" \
ccat="highlight --out-format=ansi" \
yt="youtube-dl --add-metadata -i -o '%(upload_date)s-%(title)s.%(ext)s'" \
yta="yt -x -f bestaudio/best" \
YT="youtube-viewer" \
ref="shortcuts >/dev/null; source ~/.shortcuts" \
upc="sudo pacman -Syu; pkill -RTMIN+8 i3blocks" \
lsp="pacman -Qett --color=always | less"
command -v nvim >/dev/null && alias vimdiff="nvim -d" # Use neovim for vimdiff if present.
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;}
sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;}
vf() { fzf | xargs -r -I % $EDITOR % ;}

40
.bashrc
View File

@ -5,42 +5,4 @@ HISTSIZE= HISTFILESIZE= # Infinite history.
export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases [ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases
[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc"
# System Maintainence
alias mw="~/.config/mutt/mutt-wizard.sh"
alias sdn="sudo shutdown now"
alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg
alias gua="git remote | xargs -L1 git push --all"
# Some aliases
alias e="$EDITOR"
alias p="sudo pacman"
alias SS="sudo systemctl"
alias v="$EDITOR"
alias f="vifm"
alias r="ranger"
alias sr="sudo ranger"
alias ka="killall"
alias g="git"
alias trem="transmission-remote"
alias mkd="mkdir -pv"
alias ref="shortcuts >/dev/null ; source ~/.bashrc" # Refresh shortcuts manually and reload bashrc
alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)"
alias x="sxiv -ft *"
alias lsp="pacman -Qett --color=always | less"
# Adding color
alias ls='ls -hN --color=auto --group-directories-first'
alias grep="grep --color=auto"
alias diff="diff --color=auto"
alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting.
# Internet
alias yt="youtube-dl --add-metadata -i" # Download video link
alias yta="yt -x -f bestaudio/best" # Download only audio
alias YT="youtube-viewer"
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
se() { du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf | xargs -r $EDITOR ;}
sv() { vcopy "$(du -a ~/.scripts/* ~/.config/* | awk '{print $2}' | fzf)" ;}
vf() { fzf | xargs -r -I % $EDITOR % ;}

View File

@ -1,22 +1,17 @@
bf ~/.bmfiles bf ~/.bmfiles
bd ~/.bmdirs bd ~/.bmdirs
cfb ~/.bashrc cfb ~/.bashrc
cfa ~/.aliasrc
cfz ~/.zshrc cfz ~/.zshrc
cfv ~/.vimrc cfv ~/.config/nvim/init.vim
cfr ~/.config/ranger/rc.conf cfr ~/.config/ranger/rc.conf
cfi ~/.config/i3/config cfi ~/.config/i3/config
cfq ~/.config/qutebrowser/config.py
cfm ~/.config/mutt/muttrc cfm ~/.config/mutt/muttrc
cft ~/.config/termite/config
eb ~/Documents/LaTeX/uni.bib eb ~/Documents/LaTeX/uni.bib
cv ~/Documents/LaTeX/cv.tex cv ~/Documents/LaTeX/cv.tex
cfp ~/.config/polybar/config
cfd ~/.Xdefaults cfd ~/.Xdefaults
cfu ~/.config/newsboat/urls cfu ~/.config/newsboat/urls
cfn ~/.config/newsboat/config cfn ~/.config/newsboat/config
cfA ~/.asoundrc
cfmb ~/.config/ncmpcpp/bindings cfmb ~/.config/ncmpcpp/bindings
cfmc ~/.config/ncmpcpp/config cfmc ~/.config/ncmpcpp/config
cfmpd ~/.config/mpd/mpd.conf
cfM ~/.config/mpd/mpd.conf
er ~/.referbib er ~/.referbib

View File

@ -1,43 +0,0 @@
esc left workspace exit i3
tab last workspace
- - vol -- vol
_ - vol -- vol
= + vol ++ vol
+ + vol ++ vol
q kill win kill win
w browser browser
e neomutt tutorials
r ranger winresize
t toggle hor/vert gaps=15px
y calcurse resize left
u dropdown term resize down
i htop resize up
o sticky win resize right
p pause music
[ back 10 secs back 2 min
] forward 10 secs forward 2 min
\ last workspace
a calculator audio control
s + inner gaps - inner gaps
d dmenu remove gaps
f fullscreen freeze mode
g left workspace GIMP
h focus left move win left
j focus down move win down
k focus up move win up
l focus right move win right
; right workspace
' fast right win
z + outer gaps - outer gaps
x lock screen shutdown
c webcam
v visualizer projectm
b bar on/off stick/float win
n newsboat
m ncmpcpp mute audio
, previous song restart song
< previous song restart song
. next song
> next song
/ fast win below kill win
? fast win below kill win

View File

@ -44,6 +44,8 @@ for_window [instance="dropdown_dropdowncalc"] border pixel 2
for_window [instance="dropdown_*"] move position center for_window [instance="dropdown_*"] move position center
# #---Starting External Scripts---# # # #---Starting External Scripts---# #
# mpd startup
exec --no-startup-id mpd
# Setting the background: # Setting the background:
exec --no-startup-id setbg exec --no-startup-id setbg
# Starts dunst for notifications: # Starts dunst for notifications:
@ -56,8 +58,6 @@ exec --no-startup-id remaps
exec --no-startup-id unclutter exec --no-startup-id unclutter
# Run the script to update the mpd i3block on change. # Run the script to update the mpd i3block on change.
exec_always --no-startup-id mpdupdate exec_always --no-startup-id mpdupdate
# mpd startup
exec --no-startup-id mpd
# Podboat automatic queue and download # Podboat automatic queue and download
exec_always --no-startup-id podentr exec_always --no-startup-id podentr
@ -412,5 +412,3 @@ bindsym XF86Documents exec $term -e $FILE ~/Documents
##bindsym XF86Battery exec ##bindsym XF86Battery exec
##bindsym XF86Bluetooth exec ##bindsym XF86Bluetooth exec
bindsym XF86WLAN exec $netrefresh bindsym XF86WLAN exec $netrefresh
exec --no-startup-id lukescripts

View File

@ -11,7 +11,7 @@
## ncmpcpp. ## ncmpcpp.
## ##
# #
#ncmpcpp_directory = ~/.ncmpcpp ncmpcpp_directory = ~/.config/ncmpcpp
# #
## ##
## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other ## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other

View File

@ -28,7 +28,7 @@ set clipboard=unnamedplus
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Goyo plugin makes text more readable when writing prose: " Goyo plugin makes text more readable when writing prose:
map <leader>f :Goyo \| set linebreak<CR> map <leader>f :Goyo \| set bg=light \| set linebreak<CR>
" Spell-check set to <leader>o, 'o' for 'orthography': " Spell-check set to <leader>o, 'o' for 'orthography':
map <leader>o :setlocal spell! spelllang=en_us<CR> map <leader>o :setlocal spell! spelllang=en_us<CR>
@ -40,6 +40,13 @@ set clipboard=unnamedplus
map <C-n> :NERDTreeToggle<CR> map <C-n> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" vimling:
nm <leader>d :call ToggleDeadKeys()<CR>
imap <leader>d <esc>:call ToggleDeadKeys()<CR>a
nm <leader>i :call ToggleIPA()<CR>
imap <leader>i <esc>:call ToggleIPA()<CR>a
nm <leader>q :call ToggleProse()<CR>
" Shortcutting split navigation, saving a keypress: " Shortcutting split navigation, saving a keypress:
map <C-h> <C-w>h map <C-h> <C-w>h
map <C-j> <C-w>j map <C-j> <C-w>j
@ -79,7 +86,7 @@ set clipboard=unnamedplus
" Enable Goyo by default for mutt writting " Enable Goyo by default for mutt writting
" Goyo's width will be the line limit in mutt. " Goyo's width will be the line limit in mutt.
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80 autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo \| set bg=light
" Automatically deletes all trailing whitespace on save. " Automatically deletes all trailing whitespace on save.
autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\s\+$//e
@ -97,7 +104,7 @@ set clipboard=unnamedplus
"""LATEX """LATEX
" Word count: " Word count:
autocmd FileType tex map <leader><leader>o :w !detex \| wc -w<CR> autocmd FileType tex map <leader>w :w !detex \| wc -w<CR>
" Code snippets " Code snippets
autocmd FileType tex inoremap ,fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i autocmd FileType tex inoremap ,fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i
autocmd FileType tex inoremap ,fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA autocmd FileType tex inoremap ,fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA

View File

@ -2,6 +2,10 @@ $include /etc/inputrc
set editing-mode vi set editing-mode vi
$if mode=vi $if mode=vi
set show-mode-in-prompt on
set vi-ins-mode-string \1\e[6 q\2
set vi-cmd-mode-string \1\e[2 q\2
set keymap vi-command set keymap vi-command
# these are for vi-command mode # these are for vi-command mode
Control-l: clear-screen Control-l: clear-screen

View File

@ -172,7 +172,7 @@ Naturally, you can use \f(CWyay\fP to look for and install any you want to add.
.ITEM .ITEM
\f(CWMod+w\fP \(en nmtui (for connecting to wireless internet) \f(CWMod+w\fP \(en nmtui (for connecting to wireless internet)
.ITEM .ITEM
\f(CWMod+a\fP \(en R/Python calculator (hide with \f(CWmod+a\fP) \f(CWMod+a\fP \(en Dropdown calculator (hide with \f(CWmod+a\fP)
.ITEM .ITEM
\f(CWMod+i\fP \(en htop (system info) \f(CWMod+i\fP \(en htop (system info)
.ITEM .ITEM
@ -258,7 +258,7 @@ I use ncmpcpp as a music player, which is a front end for mpd.
.ITEM .ITEM
\f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount) \f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount)
.ITEM .ITEM
\f(CWMod+A\fP \(en ncpamixer (general volume sink/source control) \f(CWMod+A\fP \(en pulsemixer (general volume sink/source control)
.LIST OFF .LIST OFF
.HEADING 2 "Workspaces" .HEADING 2 "Workspaces"
.PP .PP
@ -287,9 +287,9 @@ All of these recording shortcuts will output into \f(CW~\fP, and will not overwr
previous recordings as their names are based on their exact times. previous recordings as their names are based on their exact times.
.LI .LI
.ITEM .ITEM
\f(CWPrintScreen\fP \(en Take a scrot screenshot \f(CWPrintScreen\fP \(en Take a screenshot
.ITEM .ITEM
\f(CWShift+PrintScreen\fP \(en Take a scrot screenshot of only selected window \f(CWShift+PrintScreen\fP \(en Select area to screenshot
.ITEM .ITEM
\f(CWMod+PrintScreen\fP \(en Opens dmenu menu to select kind of audio/video recording \f(CWMod+PrintScreen\fP \(en Opens dmenu menu to select kind of audio/video recording
.ITEM .ITEM

View File

@ -13,7 +13,7 @@ unmountusb() {
unmountandroid() { \ unmountandroid() { \
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?") chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
[ -z "$chosen" ] && exit [ -z "$chosen" ] && exit
fusermount -u "$chosen" && pgrep -x dunst && notify-send -i "$PIX/android.svg" "$chosen unmounted." sudo -A umount -l "$chosen" && pgrep -x dunst && notify-send -i "$PIX/android.svg" "$chosen unmounted."
} }
asktype() { \ asktype() { \

View File

@ -1,5 +1,2 @@
#!/bin/sh #!/bin/sh
# This script ensures that i3 will spawn a calculator. ifinstalled bc && echo "Welcome to the Calculator." && bc -lq
# If R is installed, it will run R, otherwise it will run
# Python.
([ -e /usr/bin/R ] && R -q --no-save) || python -q

View File

@ -1,9 +1,9 @@
#!/bin/sh #!/bin/sh
case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfullscreen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in case "$(printf "a selected area\\ncurrent window\\nfull screen\\na selected area (copy)\\ncurrent window (copy)\\nfull screen (copy)" | dmenu -l 6 -i -p "Screenshot which area?")" in
"a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;; "a selected area") maim -s pic-selected-"$(date '+%y%m%d-%H%M-%S').png" ;;
"current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;; "current window") maim -i "$(xdotool getactivewindow)" pic-window-"$(date '+%y%m%d-%H%M-%S').png" ;;
"full screen") maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;; "full screen") maim pic-full-"$(date '+%y%m%d-%H%M-%S').png" ;;
"a selected area (copy)") maim -s | xclip -selection clipboard -t image/png ;; "a selected area (copy)") maim -s | xclip -selection clipboard -t image/png ;;
"current window (copy)") maim -i | xclip -selection clipboard -t image/png ;; "current window (copy)") maim -i "$(xdotool getactivewindow)" | xclip -selection clipboard -t image/png ;;
"full screen (copy)") maim | xclip -selection clipboard -t image/png ;; "full screen (copy)") maim | xclip -selection clipboard -t image/png ;;
esac esac

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Credit to Maddison Hellstrom (@b0o on Github) # Credit to Maddison Hellstrom (@b0o on Github)
qrencode -o - -s 1 \ ifinstalled feh && qrencode -o - -s 1 \
"$(xclip -out -selection clipboard)" | "$(xclip -out -selection clipboard)" |
feh --zoom max \ feh --zoom max \
-F \ -F \

View File

@ -1,8 +1,7 @@
#!/bin/sh #!/bin/sh
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit [ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
while : ; do sleep 5 && while : ; do
pgrep -x mpd || exit pgrep -x mpd || exit
mpc idle > /dev/null mpc idle > /dev/null
pkill -RTMIN+11 i3blocks ; pkill -RTMIN+11 i3blocks ;

View File

@ -1,14 +1,11 @@
#!/bin/sh #!/bin/sh
# Feed script a url or file location. # Feed script a url or file location.
# If an image, it will view in feh, # If an image, it will view in sxiv,
# if a video or gif, it will view in mpv # if a video or gif, it will view in mpv
# if a music file or pdf, it will download, # if a music file or pdf, it will download,
# otherwise it opens link in browser. # otherwise it opens link in browser.
# Sci-Hub's domain occasionally changes due to shutdowns:
scihub="http://sci-hub.tw/"
# If no url given. Opens browser. For using script as $BROWSER. # If no url given. Opens browser. For using script as $BROWSER.
[ -z "$1" ] && { "$BROWSER"; exit; } [ -z "$1" ] && { "$BROWSER"; exit; }
@ -16,11 +13,9 @@ case "$1" in
*mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) *mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*)
setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;; setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;;
*png|*jpg|*jpe|*jpeg|*gif) *png|*jpg|*jpe|*jpeg|*gif)
setsid sxiv -a "$1" >/dev/null 2>&1 & ;; curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
*mp3|*flac|*opus|*mp3?source*) *mp3|*flac|*opus|*mp3?source*)
setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;;
*springer.com*)
setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;;
*) *)
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1"
else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;; else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;;