diff --git a/.aliasrc b/.aliasrc new file mode 100644 index 00000000..1fb1c8d1 --- /dev/null +++ b/.aliasrc @@ -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 % ;} diff --git a/.bashrc b/.bashrc index 366bc56e..85698659 100644 --- a/.bashrc +++ b/.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" diff --git a/.bmfiles b/.bmfiles index e794fa4d..d657c833 100644 --- a/.bmfiles +++ b/.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 diff --git a/.config/getkeys/i3keysguide b/.config/getkeys/i3keysguide deleted file mode 100644 index 40f4e0bd..00000000 --- a/.config/getkeys/i3keysguide +++ /dev/null @@ -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 diff --git a/.config/i3/config b/.config/i3/config index fc5c724c..d9bcefc8 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -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 @@ -412,5 +412,3 @@ bindsym XF86Documents exec $term -e $FILE ~/Documents ##bindsym XF86Battery exec ##bindsym XF86Bluetooth exec bindsym XF86WLAN exec $netrefresh - -exec --no-startup-id lukescripts diff --git a/.config/ncmpcpp/config b/.config/ncmpcpp/config index 999c6bc0..6f87aaba 100644 --- a/.config/ncmpcpp/config +++ b/.config/ncmpcpp/config @@ -11,7 +11,7 @@ ## ncmpcpp. ## # -#ncmpcpp_directory = ~/.ncmpcpp +ncmpcpp_directory = ~/.config/ncmpcpp # ## ## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 63e31c41..28339844 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -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 f :Goyo \| set linebreak + map f :Goyo \| set bg=light \| set linebreak " Spell-check set to o, 'o' for 'orthography': map o :setlocal spell! spelllang=en_us @@ -40,6 +40,13 @@ set clipboard=unnamedplus map :NERDTreeToggle autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +" vimling: + nm d :call ToggleDeadKeys() + imap d :call ToggleDeadKeys()a + nm i :call ToggleIPA() + imap i :call ToggleIPA()a + nm q :call ToggleProse() + " Shortcutting split navigation, saving a keypress: map h map 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 o :w !detex \| wc -w + autocmd FileType tex map w :w !detex \| wc -w " Code snippets autocmd FileType tex inoremap ,fr \begin{frame}\frametitle{}<++>\end{frame}<++>6kf}i autocmd FileType tex inoremap ,fi \begin{fitch}\end{fitch}<++>3kA diff --git a/.inputrc b/.inputrc index 862d3478..f9b94dd3 100644 --- a/.inputrc +++ b/.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 diff --git a/.readme.mom b/.readme.mom index 84616175..7844860b 100644 --- a/.readme.mom +++ b/.readme.mom @@ -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 diff --git a/.scripts/i3cmds/dmenuumount b/.scripts/i3cmds/dmenuumount index 3191ec5c..e4ec064e 100755 --- a/.scripts/i3cmds/dmenuumount +++ b/.scripts/i3cmds/dmenuumount @@ -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() { \ diff --git a/.scripts/i3cmds/dropdowncalc b/.scripts/i3cmds/dropdowncalc index fee8f07f..4d41f88b 100755 --- a/.scripts/i3cmds/dropdowncalc +++ b/.scripts/i3cmds/dropdowncalc @@ -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 diff --git a/.scripts/i3cmds/maimpick b/.scripts/i3cmds/maimpick index f3f72fe7..07d032f9 100755 --- a/.scripts/i3cmds/maimpick +++ b/.scripts/i3cmds/maimpick @@ -1,9 +1,9 @@ #!/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" ;; "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" ;; "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 ;; esac diff --git a/.scripts/i3cmds/xcqr b/.scripts/i3cmds/xcqr index 5e7b5f05..23525997 100755 --- a/.scripts/i3cmds/xcqr +++ b/.scripts/i3cmds/xcqr @@ -1,6 +1,6 @@ #!/bin/sh # Credit to Maddison Hellstrom (@b0o on Github) -qrencode -o - -s 1 \ +ifinstalled feh && qrencode -o - -s 1 \ "$(xclip -out -selection clipboard)" | feh --zoom max \ -F \ diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate index 84c7ab1e..9a57ca42 100755 --- a/.scripts/statusbar/mpdupdate +++ b/.scripts/statusbar/mpdupdate @@ -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 ; diff --git a/.scripts/tools/linkhandler b/.scripts/tools/linkhandler index 07196605..c616d047 100755 --- a/.scripts/tools/linkhandler +++ b/.scripts/tools/linkhandler @@ -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 ;;