mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
commit
4a084542e4
31
.aliasrc
Normal file
31
.aliasrc
Normal 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
40
.bashrc
@ -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)\]"
|
||||
|
||||
[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases
|
||||
|
||||
# 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 % ;}
|
||||
[ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc"
|
||||
|
||||
9
.bmfiles
9
.bmfiles
@ -1,22 +1,17 @@
|
||||
bf ~/.bmfiles
|
||||
bd ~/.bmdirs
|
||||
cfb ~/.bashrc
|
||||
cfa ~/.aliasrc
|
||||
cfz ~/.zshrc
|
||||
cfv ~/.vimrc
|
||||
cfv ~/.config/nvim/init.vim
|
||||
cfr ~/.config/ranger/rc.conf
|
||||
cfi ~/.config/i3/config
|
||||
cfq ~/.config/qutebrowser/config.py
|
||||
cfm ~/.config/mutt/muttrc
|
||||
cft ~/.config/termite/config
|
||||
eb ~/Documents/LaTeX/uni.bib
|
||||
cv ~/Documents/LaTeX/cv.tex
|
||||
cfp ~/.config/polybar/config
|
||||
cfd ~/.Xdefaults
|
||||
cfu ~/.config/newsboat/urls
|
||||
cfn ~/.config/newsboat/config
|
||||
cfA ~/.asoundrc
|
||||
cfmb ~/.config/ncmpcpp/bindings
|
||||
cfmc ~/.config/ncmpcpp/config
|
||||
cfmpd ~/.config/mpd/mpd.conf
|
||||
cfM ~/.config/mpd/mpd.conf
|
||||
er ~/.referbib
|
||||
|
||||
@ -44,6 +44,8 @@ for_window [instance="dropdown_dropdowncalc"] border pixel 2
|
||||
for_window [instance="dropdown_*"] move position center
|
||||
|
||||
# #---Starting External Scripts---# #
|
||||
# mpd startup
|
||||
exec --no-startup-id mpd
|
||||
# Setting the background:
|
||||
exec --no-startup-id setbg
|
||||
# Starts dunst for notifications:
|
||||
@ -56,8 +58,6 @@ exec --no-startup-id remaps
|
||||
exec --no-startup-id unclutter
|
||||
# Run the script to update the mpd i3block on change.
|
||||
exec_always --no-startup-id mpdupdate
|
||||
# mpd startup
|
||||
exec --no-startup-id mpd
|
||||
# Podboat automatic queue and download
|
||||
exec_always --no-startup-id podentr
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ set clipboard=unnamedplus
|
||||
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
|
||||
" 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':
|
||||
map <leader>o :setlocal spell! spelllang=en_us<CR>
|
||||
@ -40,6 +40,13 @@ set clipboard=unnamedplus
|
||||
map <C-n> :NERDTreeToggle<CR>
|
||||
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:
|
||||
map <C-h> <C-w>h
|
||||
map <C-j> <C-w>j
|
||||
@ -79,7 +86,7 @@ set clipboard=unnamedplus
|
||||
" Enable Goyo by default for mutt writting
|
||||
" 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* :Goyo
|
||||
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo \| set bg=light
|
||||
|
||||
" Automatically deletes all trailing whitespace on save.
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
@ -97,7 +104,7 @@ set clipboard=unnamedplus
|
||||
|
||||
"""LATEX
|
||||
" 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
|
||||
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
|
||||
|
||||
4
.inputrc
4
.inputrc
@ -2,6 +2,10 @@ $include /etc/inputrc
|
||||
set editing-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
|
||||
# these are for vi-command mode
|
||||
Control-l: clear-screen
|
||||
|
||||
@ -172,7 +172,7 @@ Naturally, you can use \f(CWyay\fP to look for and install any you want to add.
|
||||
.ITEM
|
||||
\f(CWMod+w\fP \(en nmtui (for connecting to wireless internet)
|
||||
.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
|
||||
\f(CWMod+i\fP \(en htop (system info)
|
||||
.ITEM
|
||||
@ -258,7 +258,7 @@ I use ncmpcpp as a music player, which is a front end for mpd.
|
||||
.ITEM
|
||||
\f(CWMod+]\fP \(en Forward 10 seconds (holding shift increases amount)
|
||||
.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
|
||||
.HEADING 2 "Workspaces"
|
||||
.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.
|
||||
.LI
|
||||
.ITEM
|
||||
\f(CWPrintScreen\fP \(en Take a scrot screenshot
|
||||
\f(CWPrintScreen\fP \(en Take a screenshot
|
||||
.ITEM
|
||||
\f(CWShift+PrintScreen\fP \(en Take a scrot screenshot of only selected window
|
||||
\f(CWShift+PrintScreen\fP \(en Select area to screenshot
|
||||
.ITEM
|
||||
\f(CWMod+PrintScreen\fP \(en Opens dmenu menu to select kind of audio/video recording
|
||||
.ITEM
|
||||
|
||||
@ -34,8 +34,13 @@ twoscreen() { # If multi-monitor is selected and there are two screens.
|
||||
|
||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
||||
secondary=$(echo "$screens" | grep -v "$primary")
|
||||
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
|
||||
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
|
||||
direction=$(printf "left\\nright\\nabove\\nbelow" | dmenu -i -p "What side of $primary should $secondary be on?")
|
||||
|
||||
# xrandr uses -of as ending for left and right
|
||||
if [ "$direction" = "left" ] || [ "$direction" = "right" ]; then
|
||||
direction=$(printf "%s-of" "$direction")
|
||||
fi
|
||||
xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction" "$primary" --auto --scale 1.0x1.0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ unmountusb() {
|
||||
unmountandroid() { \
|
||||
chosen=$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")
|
||||
[ -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() { \
|
||||
|
||||
@ -1,5 +1,2 @@
|
||||
#!/bin/sh
|
||||
# This script ensures that i3 will spawn a calculator.
|
||||
# If R is installed, it will run R, otherwise it will run
|
||||
# Python.
|
||||
([ -e /usr/bin/R ] && R -q --no-save) || python -q
|
||||
ifinstalled bc && echo "Welcome to the Calculator." && bc -lq
|
||||
|
||||
@ -3,6 +3,16 @@
|
||||
mpc pause >/dev/null 2>&1
|
||||
pauseallmpv >/dev/null 2>&1
|
||||
|
||||
|
||||
|
||||
# If `imagemagick` is not installed, use a colored screen.
|
||||
[ -f /usr/bin/convert ] &&
|
||||
rm -f /tmp/locked.png && # remove old lock img
|
||||
scrot -m -z /tmp/base.png && # Take a screen shot
|
||||
pgrep -x dunst && notify-send -i ~/.scripts/pix/lock.png "Locking computer..." &&
|
||||
convert /tmp/base.png -blur 0x8 /tmp/locked.png &&
|
||||
i3lock -e -f -c 000000 -i /tmp/locked.png
|
||||
|
||||
i3lock -e -f -c 1d2021
|
||||
|
||||
# In five seconds, turn off display unless key press in last 4 seconds.
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
|
||||
|
||||
while : ; do
|
||||
sleep 5 && while : ; do
|
||||
pgrep -x mpd || exit
|
||||
mpc idle > /dev/null
|
||||
pkill -RTMIN+11 i3blocks ;
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# 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 music file or pdf, it will download,
|
||||
# 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.
|
||||
[ -z "$1" ] && { "$BROWSER"; exit; }
|
||||
|
||||
@ -16,11 +13,9 @@ case "$1" in
|
||||
*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 & ;;
|
||||
*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*)
|
||||
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"
|
||||
else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user