mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
commit
5a8369755f
31
.bashrc
31
.bashrc
@ -1,42 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# _ _
|
|
||||||
# | |__ __ _ ___| |__ _ __ ___
|
|
||||||
# | '_ \ / _` / __| '_ \| '__/ __|
|
|
||||||
# | |_) | (_| \__ \ | | | | | (__
|
|
||||||
# |_.__/ \__,_|___/_| |_|_| \___|
|
|
||||||
|
|
||||||
stty -ixon # Disable ctrl-s and ctrl-q.
|
stty -ixon # Disable ctrl-s and ctrl-q.
|
||||||
shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
|
shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
|
||||||
HISTSIZE= HISTFILESIZE= # Infinite history.
|
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)\]"
|
||||||
|
|
||||||
# Setting Bash prompt. Capitalizes username and host if root user (my root user uses this same config file).
|
[ -f "$HOME/.shortcuts" ] && source "$HOME/.shortcuts" # Load shortcut aliases
|
||||||
if [ "$EUID" -ne 0 ]
|
|
||||||
then 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)\]"
|
|
||||||
else export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]ROOT\[$(tput setaf 2)\]@\[$(tput setaf 4)\]$(hostname | awk '{print toupper($0)}') \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
|
|
||||||
fi
|
|
||||||
|
|
||||||
export GPG_TTY=$(tty)
|
|
||||||
|
|
||||||
# System Maintainence
|
# System Maintainence
|
||||||
alias mw="~/.config/mutt/mutt-wizard.sh"
|
alias mw="~/.config/mutt/mutt-wizard.sh"
|
||||||
alias muttwizard="~/.config/mutt/mutt-wizard.sh"
|
|
||||||
alias sdn="sudo shutdown now"
|
alias sdn="sudo shutdown now"
|
||||||
alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg
|
alias psref="gpg-connect-agent RELOADAGENT /bye" # Refresh gpg
|
||||||
|
alias gua="git remote | xargs -L1 git push --all"
|
||||||
|
|
||||||
# Some aliases
|
# Some aliases
|
||||||
alias e="$EDITOR"
|
alias e="$EDITOR"
|
||||||
alias p="sudo pacman"
|
alias p="sudo pacman"
|
||||||
alias SS="sudo systemctl"
|
alias SS="sudo systemctl"
|
||||||
alias v="vim"
|
alias v="vim"
|
||||||
alias sv="sudo vim"
|
alias f="vifm"
|
||||||
alias r="ranger"
|
alias r="ranger"
|
||||||
alias sr="sudo ranger"
|
alias sr="sudo ranger"
|
||||||
alias ka="killall"
|
alias ka="killall"
|
||||||
alias g="git"
|
alias g="git"
|
||||||
alias trem="transmission-remote"
|
alias trem="transmission-remote"
|
||||||
alias mkd="mkdir -pv"
|
alias mkd="mkdir -pv"
|
||||||
alias ref="shortcuts && source ~/.bashrc" # Refresh shortcuts manually and reload bashrc
|
alias ref="shortcuts >/dev/null ; source ~/.bashrc" # Refresh shortcuts manually and reload bashrc
|
||||||
alias bw="wal -i ~/.config/wall.png" # Rerun pywal
|
alias mpv="mpv --input-ipc-server=/tmp/mpvsoc$(date +%s)"
|
||||||
|
alias x="sxiv -ft *"
|
||||||
|
alias lp="pacman -Qett --color=always | less"
|
||||||
|
|
||||||
# Adding color
|
# Adding color
|
||||||
alias ls='ls -hN --color=auto --group-directories-first'
|
alias ls='ls -hN --color=auto --group-directories-first'
|
||||||
@ -45,9 +36,11 @@ alias diff="diff --color=auto"
|
|||||||
alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting.
|
alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting.
|
||||||
|
|
||||||
# Internet
|
# Internet
|
||||||
alias yt="youtube-dl --add-metadata -ic" # Download video link
|
alias yt="youtube-dl --add-metadata -i" # Download video link
|
||||||
alias yta="yt -x -f bestaudio/best" # Download only audio
|
alias yta="yt -x -f bestaudio/best" # Download only audio
|
||||||
alias YT="youtube-viewer"
|
alias YT="youtube-viewer"
|
||||||
|
|
||||||
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
|
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
|
||||||
vf() { $EDITOR $(fzf) ;}
|
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 % ;}
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
# This config file will use environmental variables such as $BROWSER and $TERMINAL.
|
# This config file will use environmental variables such as $BROWSER and $TERMINAL.
|
||||||
# You can set these variables in ~/.profile or ~/.bash_profile if you have it as below:
|
# You can set these variables in ~/.profile or ~/.bash_profile if you have it as below:
|
||||||
#
|
#
|
||||||
# export BROWSER="firefox"
|
# export FILE="ranger"
|
||||||
# export TERMINAL="st"
|
# export TERMINAL="st"
|
||||||
|
|
||||||
# #---Basic Definitions---# #
|
# #---Basic Definitions---# #
|
||||||
@ -32,21 +32,16 @@ set $hibernate sudo -A systemctl suspend
|
|||||||
|
|
||||||
# #---Dropdown Windows---# #
|
# #---Dropdown Windows---# #
|
||||||
|
|
||||||
# First I have a tmux window used for background scripts.
|
# General dropdown window traits. The order can matter.
|
||||||
# I'll later bind this to mod+u.
|
for_window [instance="dropdown_*"] floating enable
|
||||||
for_window [instance="tmuxdd"] floating enable
|
for_window [instance="dropdown_*"] move scratchpad
|
||||||
for_window [instance="tmuxdd"] resize set 625 450
|
for_window [instance="dropdown_*"] sticky enable
|
||||||
for_window [instance="tmuxdd"] move scratchpad
|
for_window [instance="dropdown_*"] scratchpad show
|
||||||
for_window [instance="tmuxdd"] border pixel 3
|
for_window [instance="dropdown_tmuxdd"] resize set 625 450
|
||||||
for_window [instance="tmuxdd"] sticky enable
|
for_window [instance="dropdown_dropdowncalc"] resize set 800 300
|
||||||
|
for_window [instance="dropdown_tmuxdd"] border pixel 3
|
||||||
# Then I have a window running R I use for basic arithmetic
|
for_window [instance="dropdown_dropdowncalc"] border pixel 2
|
||||||
# I'll later bind this to mod+a.
|
for_window [instance="dropdown_*"] move position center
|
||||||
for_window [instance="dropdowncalc"] floating enable
|
|
||||||
for_window [instance="dropdowncalc"] resize set 800 300
|
|
||||||
for_window [instance="dropdowncalc"] move scratchpad
|
|
||||||
for_window [instance="dropdowncalc"] border pixel 2
|
|
||||||
for_window [instance="dropdowncalc"] sticky enable
|
|
||||||
|
|
||||||
# #---Starting External Scripts---# #
|
# #---Starting External Scripts---# #
|
||||||
# Setting the background:
|
# Setting the background:
|
||||||
@ -126,15 +121,15 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode
|
|||||||
##bindsym $mod+asciitilde
|
##bindsym $mod+asciitilde
|
||||||
|
|
||||||
#STOP/HIDE EVERYTHING:
|
#STOP/HIDE EVERYTHING:
|
||||||
bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger
|
bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec --no-startup-id lmc pause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e $FILE
|
||||||
|
|
||||||
# Show selection:
|
# Show selection:
|
||||||
bindsym $mod+Insert exec --no-startup-id showclip
|
bindsym $mod+Insert exec --no-startup-id showclip
|
||||||
bindsym $mod+Pause exec --no-startup-id xcqr
|
bindsym $mod+Pause exec --no-startup-id xcqr
|
||||||
|
|
||||||
# #---Letter Key Bindings---# #
|
# #---Letter Key Bindings---# #
|
||||||
bindsym $mod+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill
|
bindsym $mod+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill
|
||||||
bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill
|
bindsym $mod+Shift+q [con_id="__focused__" instance="^(?!dropdown_).*$"] kill
|
||||||
|
|
||||||
bindsym $mod+w exec $term -e nmtui
|
bindsym $mod+w exec $term -e nmtui
|
||||||
bindsym $mod+Shift+w exec --no-startup-id $BROWSER
|
bindsym $mod+Shift+w exec --no-startup-id $BROWSER
|
||||||
@ -328,8 +323,8 @@ bindsym $mod+bracketright exec --no-startup-id lmc forward 10
|
|||||||
bindsym $mod+Shift+bracketright exec --no-startup-id lmc forward 120
|
bindsym $mod+Shift+bracketright exec --no-startup-id lmc forward 120
|
||||||
|
|
||||||
# For screenshots and recording
|
# For screenshots and recording
|
||||||
bindsym Print exec --no-startup-id scrot
|
bindsym Print exec --no-startup-id maim pic-full-"$(date '+%y%m%d-%H%M-%S').png"
|
||||||
bindsym Shift+Print exec --no-startup-id scrot -u
|
bindsym Shift+Print exec --no-startup-id maimpick
|
||||||
bindsym $mod+Print exec --no-startup-id dmenurecord
|
bindsym $mod+Print exec --no-startup-id dmenurecord
|
||||||
bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey"
|
bindsym $mod+Scroll_Lock exec --no-startup-id "killall screenkey || screenkey"
|
||||||
bindsym $mod+Delete exec $stoprec
|
bindsym $mod+Delete exec $stoprec
|
||||||
@ -353,7 +348,7 @@ bindsym XF86PowerOff exec --no-startup-id prompt "Shutdown computer?" "$shutdow
|
|||||||
bindsym XF86Calculator exec $term -e R -q --no-save
|
bindsym XF86Calculator exec $term -e R -q --no-save
|
||||||
##bindsym XF86Sleep This binding is typically mapped by systemd automatically.
|
##bindsym XF86Sleep This binding is typically mapped by systemd automatically.
|
||||||
##bindsym XF86WakeUp exec
|
##bindsym XF86WakeUp exec
|
||||||
bindsym XF86Explorer exec $term -e ranger
|
bindsym XF86Explorer exec $term -e $FILE
|
||||||
##bindsym XF86Send exec
|
##bindsym XF86Send exec
|
||||||
##bindsym XF86Xfer exec
|
##bindsym XF86Xfer exec
|
||||||
bindsym XF86WWW exec --no-startup-id $BROWSER
|
bindsym XF86WWW exec --no-startup-id $BROWSER
|
||||||
@ -362,7 +357,7 @@ bindsym XF86ScreenSaver exec exec --no-startup-id lockscreen
|
|||||||
##bindsym XF86RotateWindows exec
|
##bindsym XF86RotateWindows exec
|
||||||
##bindsym XF86TaskPane exec
|
##bindsym XF86TaskPane exec
|
||||||
##bindsym XF86Favorites exec
|
##bindsym XF86Favorites exec
|
||||||
bindsym XF86MyComputer exec $term -e ranger
|
bindsym XF86MyComputer exec $term -e $FILE
|
||||||
##bindsym XF86Back exec
|
##bindsym XF86Back exec
|
||||||
##bindsym XF86Forward exec
|
##bindsym XF86Forward exec
|
||||||
bindsym XF86Eject exec --no-startup-id dmenuumount
|
bindsym XF86Eject exec --no-startup-id dmenuumount
|
||||||
@ -407,14 +402,16 @@ bindsym XF86Shop exec $BROWSER https://ebay.com
|
|||||||
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15
|
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 15
|
||||||
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15
|
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 15
|
||||||
bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp
|
bindsym XF86AudioMedia exec --no-startup-id $term -e ncmpcpp
|
||||||
bindsym XF86Display exec --no-startup-id arandr
|
bindsym XF86Display exec --no-startup-id displayselect
|
||||||
#bindsym XF86KbdLightOnOff exec
|
#bindsym XF86KbdLightOnOff exec
|
||||||
#bindsym XF86KbdBrightnessDown exec
|
#bindsym XF86KbdBrightnessDown exec
|
||||||
#bindsym XF86KbdBrightnessUp exec
|
#bindsym XF86KbdBrightnessUp exec
|
||||||
##bindsym XF86Reply exec
|
##bindsym XF86Reply exec
|
||||||
##bindsym XF86MailForward exec
|
##bindsym XF86MailForward exec
|
||||||
##bindsym XF86Save exec
|
##bindsym XF86Save exec
|
||||||
bindsym XF86Documents exec $term -e ranger ~/Documents
|
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
|
||||||
|
|||||||
@ -3,7 +3,7 @@ separator_block_width=15
|
|||||||
markup=pango
|
markup=pango
|
||||||
|
|
||||||
[record]
|
[record]
|
||||||
command=cat ~/.recordingicon
|
command=cat /tmp/recordingicon
|
||||||
interval=once
|
interval=once
|
||||||
signal=9
|
signal=9
|
||||||
|
|
||||||
@ -28,6 +28,7 @@ signal=7
|
|||||||
|
|
||||||
[weather]
|
[weather]
|
||||||
interval=3600
|
interval=3600
|
||||||
|
signal=5
|
||||||
|
|
||||||
[mailbox]
|
[mailbox]
|
||||||
label=📬
|
label=📬
|
||||||
|
|||||||
@ -3,6 +3,6 @@ x-scheme-handler/magnet=transmission-remote.desktop;
|
|||||||
x-scheme-handler/mailto=mutt.desktop;
|
x-scheme-handler/mailto=mutt.desktop;
|
||||||
text/plain=vim.desktop;
|
text/plain=vim.desktop;
|
||||||
application/pdf=zathura.desktop;
|
application/pdf=zathura.desktop;
|
||||||
image/png=feh.desktop;
|
image/png=sxiv.desktop;
|
||||||
image/jpeg=feh.desktop;
|
image/jpeg=sxiv.desktop;
|
||||||
image/gif=gif.desktop;
|
image/gif=sxiv.desktop;
|
||||||
|
|||||||
216
.config/nvim/init.vim
Normal file
216
.config/nvim/init.vim
Normal file
@ -0,0 +1,216 @@
|
|||||||
|
" _
|
||||||
|
" __ _(_)_ __ ___ _ __ ___
|
||||||
|
" \ \ / / | '_ ` _ \| '__/ __|
|
||||||
|
" \ V /| | | | | | | | | (__
|
||||||
|
" \_/ |_|_| |_| |_|_| \___|
|
||||||
|
|
||||||
|
let mapleader =" "
|
||||||
|
|
||||||
|
call plug#begin('~/.vim/plugged')
|
||||||
|
Plug 'junegunn/goyo.vim'
|
||||||
|
Plug 'PotatoesMaster/i3-vim-syntax'
|
||||||
|
Plug 'jreybert/vimagit'
|
||||||
|
Plug 'LukeSmithxyz/vimling'
|
||||||
|
Plug 'vimwiki/vimwiki'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
" Some basics:
|
||||||
|
set nocompatible
|
||||||
|
filetype plugin on
|
||||||
|
syntax on
|
||||||
|
set encoding=utf-8
|
||||||
|
set number relativenumber
|
||||||
|
" Enable autocompletion:
|
||||||
|
set wildmode=longest,list,full
|
||||||
|
" Disables automatic commenting on newline:
|
||||||
|
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>
|
||||||
|
|
||||||
|
" Spell-check set to <leader>o, 'o' for 'orthography':
|
||||||
|
map <leader>o :setlocal spell! spelllang=en_us<CR>
|
||||||
|
|
||||||
|
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
||||||
|
set splitbelow splitright
|
||||||
|
|
||||||
|
" Shortcutting split navigation, saving a keypress:
|
||||||
|
map <C-h> <C-w>h
|
||||||
|
map <C-j> <C-w>j
|
||||||
|
map <C-k> <C-w>k
|
||||||
|
map <C-l> <C-w>l
|
||||||
|
|
||||||
|
" Check file in shellcheck:
|
||||||
|
map <leader>s :!clear && shellcheck %<CR>
|
||||||
|
|
||||||
|
" Open my bibliography file in split
|
||||||
|
map <leader>b :vsp<space>$BIB<CR>
|
||||||
|
map <leader>r :vsp<space>$REFER<CR>
|
||||||
|
|
||||||
|
" Replace all is aliased to S.
|
||||||
|
nnoremap S :%s//g<Left><Left>
|
||||||
|
|
||||||
|
" Compile document, be it groff/LaTeX/markdown/etc.
|
||||||
|
map <leader>c :w! \| !compiler <c-r>%<CR><CR>
|
||||||
|
|
||||||
|
" Open corresponding .pdf/.html or preview
|
||||||
|
map <leader>p :!opout <c-r>%<CR><CR>
|
||||||
|
|
||||||
|
" Runs a script that cleans out tex build files whenever I close out of a .tex file.
|
||||||
|
autocmd VimLeave *.tex !texclear %
|
||||||
|
|
||||||
|
" Ensure files are read as what I want:
|
||||||
|
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
||||||
|
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
||||||
|
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
|
||||||
|
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
||||||
|
|
||||||
|
" Readmes autowrap text:
|
||||||
|
autocmd BufRead,BufNewFile *.md set tw=79
|
||||||
|
|
||||||
|
" Use urlscan to choose and open a url:
|
||||||
|
:noremap <leader>u :w<Home> !urlscan -r 'linkhandler {}'<CR>
|
||||||
|
:noremap ,, !urlscan -r 'linkhandler {}'<CR>
|
||||||
|
|
||||||
|
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
|
||||||
|
vnoremap <C-c> "+y
|
||||||
|
map <C-p> "+P
|
||||||
|
|
||||||
|
" 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
|
||||||
|
|
||||||
|
" Automatically deletes all trailing whitespace on save.
|
||||||
|
autocmd BufWritePre * %s/\s\+$//e
|
||||||
|
|
||||||
|
" When shortcut files are updated, renew bash and ranger configs with new material:
|
||||||
|
autocmd BufWritePost ~/.bm* !shortcuts
|
||||||
|
|
||||||
|
" Run xrdb whenever Xdefaults or Xresources are updated.
|
||||||
|
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
|
||||||
|
|
||||||
|
" Navigating with guides
|
||||||
|
inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
|
||||||
|
vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
|
||||||
|
map <Space><Tab> <Esc>/<++><Enter>"_c4l
|
||||||
|
|
||||||
|
"____ _ _
|
||||||
|
"/ ___| _ __ (_)_ __ _ __ ___| |_ ___
|
||||||
|
"\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __|
|
||||||
|
"___) | | | | | |_) | |_) | __/ |_\__ \
|
||||||
|
"|____/|_| |_|_| .__/| .__/ \___|\__|___/
|
||||||
|
"|_| |_|
|
||||||
|
|
||||||
|
"""LATEX
|
||||||
|
" Word count:
|
||||||
|
autocmd FileType tex map <leader><leader>o :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
|
||||||
|
autocmd FileType tex inoremap ,exe \begin{exe}<Enter>\ex<Space><Enter>\end{exe}<Enter><Enter><++><Esc>3kA
|
||||||
|
autocmd FileType tex inoremap ,em \emph{}<++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,bf \textbf{}<++><Esc>T{i
|
||||||
|
autocmd FileType tex vnoremap , <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a
|
||||||
|
autocmd FileType tex inoremap ,it \textit{}<++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,ct \textcite{}<++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,cp \parencite{}<++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,glos {\gll<Space><++><Space>\\<Enter><++><Space>\\<Enter>\trans{``<++>''}}<Esc>2k2bcw
|
||||||
|
autocmd FileType tex inoremap ,x \begin{xlist}<Enter>\ex<Space><Enter>\end{xlist}<Esc>kA<Space>
|
||||||
|
autocmd FileType tex inoremap ,ol \begin{enumerate}<Enter><Enter>\end{enumerate}<Enter><Enter><++><Esc>3kA\item<Space>
|
||||||
|
autocmd FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space>
|
||||||
|
autocmd FileType tex inoremap ,li <Enter>\item<Space>
|
||||||
|
autocmd FileType tex inoremap ,ref \ref{}<Space><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,tab \begin{tabular}<Enter><++><Enter>\end{tabular}<Enter><Enter><++><Esc>4kA{}<Esc>i
|
||||||
|
autocmd FileType tex inoremap ,ot \begin{tableau}<Enter>\inp{<++>}<Tab>\const{<++>}<Tab><++><Enter><++><Enter>\end{tableau}<Enter><Enter><++><Esc>5kA{}<Esc>i
|
||||||
|
autocmd FileType tex inoremap ,can \cand{}<Tab><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,con \const{}<Tab><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,v \vio{}<Tab><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,a \href{}{<++>}<Space><++><Esc>2T{i
|
||||||
|
autocmd FileType tex inoremap ,sc \textsc{}<Space><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,chap \chapter{}<Enter><Enter><++><Esc>2kf}i
|
||||||
|
autocmd FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i
|
||||||
|
autocmd FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i
|
||||||
|
autocmd FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i
|
||||||
|
autocmd FileType tex inoremap ,st <Esc>F{i*<Esc>f}i
|
||||||
|
autocmd FileType tex inoremap ,beg \begin{DELRN}<Enter><++><Enter>\end{DELRN}<Enter><Enter><++><Esc>4k0fR:MultipleCursorsFind<Space>DELRN<Enter>c
|
||||||
|
autocmd FileType tex inoremap ,up <Esc>/usepackage<Enter>o\usepackage{}<Esc>i
|
||||||
|
autocmd FileType tex nnoremap ,up /usepackage<Enter>o\usepackage{}<Esc>i
|
||||||
|
autocmd FileType tex inoremap ,tt \texttt{}<Space><++><Esc>T{i
|
||||||
|
autocmd FileType tex inoremap ,bt {\blindtext}
|
||||||
|
autocmd FileType tex inoremap ,nu $\varnothing$
|
||||||
|
autocmd FileType tex inoremap ,col \begin{columns}[T]<Enter>\begin{column}{.5\textwidth}<Enter><Enter>\end{column}<Enter>\begin{column}{.5\textwidth}<Enter><++><Enter>\end{column}<Enter>\end{columns}<Esc>5kA
|
||||||
|
autocmd FileType tex inoremap ,rn (\ref{})<++><Esc>F}i
|
||||||
|
|
||||||
|
"""HTML
|
||||||
|
autocmd FileType html inoremap ,b <b></b><Space><++><Esc>FbT>i
|
||||||
|
autocmd FileType html inoremap ,it <em></em><Space><++><Esc>FeT>i
|
||||||
|
autocmd FileType html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
|
||||||
|
autocmd FileType html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
|
||||||
|
autocmd FileType html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
|
||||||
|
autocmd FileType html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
|
||||||
|
autocmd FileType html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
|
||||||
|
autocmd FileType html inoremap ,e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
|
||||||
|
autocmd FileType html inoremap ,ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
|
||||||
|
autocmd FileType html inoremap ,li <Esc>o<li></li><Esc>F>a
|
||||||
|
autocmd FileType html inoremap ,ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
|
||||||
|
autocmd FileType html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
|
||||||
|
autocmd FileType html inoremap ,td <td></td><++><Esc>Fdcit
|
||||||
|
autocmd FileType html inoremap ,tr <tr></tr><Enter><++><Esc>kf<i
|
||||||
|
autocmd FileType html inoremap ,th <th></th><++><Esc>Fhcit
|
||||||
|
autocmd FileType html inoremap ,tab <table><Enter></table><Esc>O
|
||||||
|
autocmd FileType html inoremap ,gr <font color="green"></font><Esc>F>a
|
||||||
|
autocmd FileType html inoremap ,rd <font color="red"></font><Esc>F>a
|
||||||
|
autocmd FileType html inoremap ,yl <font color="yellow"></font><Esc>F>a
|
||||||
|
autocmd FileType html inoremap ,dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
|
||||||
|
autocmd FileType html inoremap ,dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
|
||||||
|
autocmd FileType html inoremap &<space> &<space>
|
||||||
|
autocmd FileType html inoremap á á
|
||||||
|
autocmd FileType html inoremap é é
|
||||||
|
autocmd FileType html inoremap í í
|
||||||
|
autocmd FileType html inoremap ó ó
|
||||||
|
autocmd FileType html inoremap ú ú
|
||||||
|
autocmd FileType html inoremap ä ä
|
||||||
|
autocmd FileType html inoremap ë ë
|
||||||
|
autocmd FileType html inoremap ï ï
|
||||||
|
autocmd FileType html inoremap ö ö
|
||||||
|
autocmd FileType html inoremap ü ü
|
||||||
|
autocmd FileType html inoremap ã ã
|
||||||
|
autocmd FileType html inoremap ẽ &etilde;
|
||||||
|
autocmd FileType html inoremap ĩ ĩ
|
||||||
|
autocmd FileType html inoremap õ õ
|
||||||
|
autocmd FileType html inoremap ũ ũ
|
||||||
|
autocmd FileType html inoremap ñ ñ
|
||||||
|
autocmd FileType html inoremap à à
|
||||||
|
autocmd FileType html inoremap è è
|
||||||
|
autocmd FileType html inoremap ì ì
|
||||||
|
autocmd FileType html inoremap ò ò
|
||||||
|
autocmd FileType html inoremap ù ù
|
||||||
|
|
||||||
|
|
||||||
|
""".bib
|
||||||
|
autocmd FileType bib inoremap ,a @article{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>journal<Space>=<Space>{<++>},<Enter>volume<Space>=<Space>{<++>},<Enter>pages<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i
|
||||||
|
autocmd FileType bib inoremap ,b @book{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>6kA,<Esc>i
|
||||||
|
autocmd FileType bib inoremap ,c @incollection{<Enter>author<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>booktitle<Space>=<Space>{<++>},<Enter>editor<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i
|
||||||
|
|
||||||
|
"MARKDOWN
|
||||||
|
autocmd Filetype markdown,rmd map <leader>w yiWi[<esc>Ea](<esc>pa)
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,n ---<Enter><Enter>
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,b ****<++><Esc>F*hi
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,s ~~~~<++><Esc>F~hi
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,e **<++><Esc>F*i
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,h ====<Space><++><Esc>F=hi
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,i <++><Esc>F[a
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++><Esc>F[a
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,1 #<Space><Enter><++><Esc>kA
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,2 ##<Space><Enter><++><Esc>kA
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,3 ###<Space><Enter><++><Esc>kA
|
||||||
|
autocmd Filetype markdown,rmd inoremap ,l --------<Enter>
|
||||||
|
autocmd Filetype rmd inoremap ,r ```{r}<CR>```<CR><CR><esc>2kO
|
||||||
|
autocmd Filetype rmd inoremap ,p ```{python}<CR>```<CR><CR><esc>2kO
|
||||||
|
autocmd Filetype rmd inoremap ,c ```<cr>```<cr><cr><esc>2kO
|
||||||
|
|
||||||
|
""".xml
|
||||||
|
autocmd FileType xml inoremap ,e <item><Enter><title><++></title><Enter><guid<space>isPermaLink="false"><++></guid><Enter><pubDate><Esc>:put<Space>=strftime('%a, %d %b %Y %H:%M:%S %z')<Enter>kJA</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>?<title><enter>cit
|
||||||
|
autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci"
|
||||||
|
|
||||||
@ -515,3 +515,6 @@ map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, po
|
|||||||
#Downloading
|
#Downloading
|
||||||
map ytv console shell youtube-dl -ic%space
|
map ytv console shell youtube-dl -ic%space
|
||||||
map yta console shell youtube-dl -xic%space
|
map yta console shell youtube-dl -xic%space
|
||||||
|
|
||||||
|
# Source shortcuts
|
||||||
|
source ~/.config/ranger/shortcuts.conf
|
||||||
|
|||||||
@ -101,6 +101,7 @@ ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
|
|||||||
ext nes, has fceux, X = fceux "$1"
|
ext nes, has fceux, X = fceux "$1"
|
||||||
ext exe = wine "$1"
|
ext exe = wine "$1"
|
||||||
name ^[mM]akefile$ = make
|
name ^[mM]akefile$ = make
|
||||||
|
ext asf, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@"
|
||||||
|
|
||||||
#--------------------------------------------
|
#--------------------------------------------
|
||||||
# Code
|
# Code
|
||||||
@ -117,9 +118,11 @@ ext php = php -- "$1"
|
|||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
|
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
|
||||||
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
|
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
|
||||||
mime ^video, has mpv, X, flag f = mpv -- "$@"
|
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@"
|
||||||
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
|
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-video -- "$@"
|
||||||
mime ^video, has mpv, X, flag f = mpv --loop -- "$@"
|
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --fs -- "$@"
|
||||||
|
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --loop -- "$@"
|
||||||
|
mime ^video, has mpv, X, flag f = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --title="obs" --autofit=1050x700 -- "$@"
|
||||||
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
|
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
|
||||||
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
|
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
|
||||||
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
|
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
|
||||||
@ -132,16 +135,16 @@ mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
|
|||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
|
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
|
||||||
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
|
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
|
||||||
mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@"
|
mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --no-audio-display -- "$@"
|
||||||
mime ^audio|ogg$ = tag "$@"
|
mime ^audio|ogg$ = tag "$@"
|
||||||
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
|
mime ^audio|ogg$, terminal, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@"
|
||||||
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
|
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------
|
#--------------------------------------------
|
||||||
# Video without X:
|
# Video without X:
|
||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
mime ^video, terminal, !X, has mpv = mpv -- "$@"
|
mime ^video, terminal, !X, has mpv = mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -- "$@"
|
||||||
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
|
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
|
||||||
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
|
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
|
||||||
|
|
||||||
@ -164,6 +167,7 @@ ext pdf, has qpdfview, X, flag f = qpdfview "$@"
|
|||||||
ext epub, has zathura, X, flag f = zathura -- "$@"
|
ext epub, has zathura, X, flag f = zathura -- "$@"
|
||||||
ext epub, has mupdf, X, flag f = mupdf "$@"
|
ext epub, has mupdf, X, flag f = mupdf "$@"
|
||||||
|
|
||||||
|
ext ps, has zathura, X, flag f = zathura -- "$@"
|
||||||
|
|
||||||
ext docx, has abiword, X, flag f = abiword "$@"
|
ext docx, has abiword, X, flag f = abiword "$@"
|
||||||
|
|
||||||
@ -184,14 +188,13 @@ ext djvu, has atril, X, flag f = atril -- "$@"
|
|||||||
#-------------------------------------------
|
#-------------------------------------------
|
||||||
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
||||||
mime ^image/svg, has display, X, flag f = display -- "$@"
|
mime ^image/svg, has display, X, flag f = display -- "$@"
|
||||||
mime ^image/gif, has mpv, X, flag f = mpv --loop -- "$@"
|
|
||||||
mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@"
|
mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@"
|
||||||
mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
|
mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
|
||||||
|
|
||||||
ext xcf, X, flag f = gimp -- "$@"
|
ext xcf, X, flag f = gimp -- "$@"
|
||||||
|
mime ^image, has sxiv, X, flag f = sxiv -a -- "$@"
|
||||||
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@"
|
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@"
|
||||||
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@"
|
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@"
|
||||||
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
|
|
||||||
mime ^image, has mirage, X, flag f = mirage -- "$@"
|
mime ^image, has mirage, X, flag f = mirage -- "$@"
|
||||||
mime ^image, has ristretto, X, flag f = ristretto "$@"
|
mime ^image, has ristretto, X, flag f = ristretto "$@"
|
||||||
mime ^image, has eog, X, flag f = eog -- "$@"
|
mime ^image, has eog, X, flag f = eog -- "$@"
|
||||||
@ -225,8 +228,9 @@ label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
|
|||||||
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
|
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
|
||||||
|
|
||||||
# Define the editor for non-text files + pager as last action
|
# Define the editor for non-text files + pager as last action
|
||||||
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
|
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = ask
|
||||||
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
|
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = $EDITOR -- "$@"
|
||||||
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
|
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|ms = "$PAGER" -- "$@"
|
||||||
|
|
||||||
ext blend, has blender, X, flag f = blender -- "$@"
|
ext blend, has blender, X, flag f = blender -- "$@"
|
||||||
|
ext ms = $EDITOR -- "$@"
|
||||||
|
|||||||
0
.config/ranger/shortcuts.conf
Normal file
0
.config/ranger/shortcuts.conf
Normal file
37
.config/sxiv/exec/key-handler
Executable file
37
.config/sxiv/exec/key-handler
Executable file
@ -0,0 +1,37 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
while read file
|
||||||
|
do
|
||||||
|
fullpath="$(pwd)/$file"
|
||||||
|
case "$1" in
|
||||||
|
"w")
|
||||||
|
cp "$file" ~/.config/wall.png &&
|
||||||
|
feh --bg-scale "$HOME/.config/wall.png"
|
||||||
|
notify-send -i "$HOME/.config/wall.png" "Wallpaper changed." ;;
|
||||||
|
"c")
|
||||||
|
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
|
[ -z "$destdir" ] && exit
|
||||||
|
cp "$file" "$destdir" && notify-send -i "$fullpath" "$file copied to $destdir." &
|
||||||
|
;;
|
||||||
|
"m")
|
||||||
|
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ~/.bmdirs | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
|
[ -z "$destdir" ] && exit
|
||||||
|
cp "$file" "$destdir" && notify-send -i "$fullpath" "$file moved to $destdir." &
|
||||||
|
;;
|
||||||
|
"r")
|
||||||
|
convert -rotate 90 "$file" "$file" ;;
|
||||||
|
"R")
|
||||||
|
convert -rotate -90 "$file" "$file" ;;
|
||||||
|
"f")
|
||||||
|
convert -flop "$file" "$file" ;;
|
||||||
|
"y")
|
||||||
|
echo -n "$file" | xclip -selection clipboard &&
|
||||||
|
notify-send "$file copied to clipboard" & ;;
|
||||||
|
"Y")
|
||||||
|
echo -n "$fullpath" | xclip -selection clipboard &&
|
||||||
|
notify-send "$fullpath copied to clipboard" & ;;
|
||||||
|
"d")
|
||||||
|
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
||||||
|
"G")
|
||||||
|
gimp "$file" & ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
4
.local/share/applications/sxiv.desktop
Normal file
4
.local/share/applications/sxiv.desktop
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Type=Application
|
||||||
|
Name=feh image viewer
|
||||||
|
Exec=/usr/bin/sxiv -a %u
|
||||||
10
.profile
10
.profile
@ -2,16 +2,16 @@
|
|||||||
# Profile file. Runs on login.
|
# Profile file. Runs on login.
|
||||||
|
|
||||||
# Adds `~/.scripts` and all subdirectories to $PATH
|
# Adds `~/.scripts` and all subdirectories to $PATH
|
||||||
export PATH="$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')$PATH"
|
export PATH="$PATH:$(du "$HOME/.scripts/" | cut -f2 | tr '\n' ':')"
|
||||||
export EDITOR="vim"
|
export EDITOR="vim"
|
||||||
export TERMINAL="st"
|
export TERMINAL="st"
|
||||||
export BROWSER="firefox"
|
export BROWSER="firefox"
|
||||||
export READER="zathura"
|
export READER="zathura"
|
||||||
|
export FILE="ranger"
|
||||||
export BIB="$HOME/Documents/LaTeX/uni.bib"
|
export BIB="$HOME/Documents/LaTeX/uni.bib"
|
||||||
export REFER="$HOME/.referbib"
|
export REFER="$HOME/.referbib"
|
||||||
# PIX is here I have LARBS keep icons. Subject to change, hence a variable.
|
|
||||||
export PIX="$HOME/.scripts/pix"
|
|
||||||
export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass"
|
export SUDO_ASKPASS="$HOME/.scripts/tools/dmenupass"
|
||||||
|
export PIX="$HOME/.pix/"
|
||||||
|
|
||||||
# less/man colors
|
# less/man colors
|
||||||
export LESS=-R
|
export LESS=-R
|
||||||
@ -25,10 +25,10 @@ export LESS_TERMCAP_ue=$'\E[0m' # reset underline
|
|||||||
|
|
||||||
[ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1
|
[ ! -f ~/.shortcuts ] && shortcuts >/dev/null 2>&1
|
||||||
|
|
||||||
[ -f ~/.bashrc ] && source "$HOME/.bashrc"
|
echo "$0" | grep "bash$" >/dev/null && [ -f ~/.bashrc ] && source "$HOME/.bashrc"
|
||||||
|
|
||||||
# Start graphical server if i3 not already running.
|
# Start graphical server if i3 not already running.
|
||||||
[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && exec startx
|
[ "$(tty)" = "/dev/tty1" ] && ! pgrep -x i3 >/dev/null && exec startx
|
||||||
|
|
||||||
# Switch escape and caps and use wal colors if tty:
|
# Switch escape and caps if tty:
|
||||||
sudo -n loadkeys ~/.scripts/ttymaps.kmap 2>/dev/null
|
sudo -n loadkeys ~/.scripts/ttymaps.kmap 2>/dev/null
|
||||||
|
|||||||
@ -12,292 +12,76 @@ export PATH="$(du $HOME/.scripts/ | cut -f2 | tr '\n' ':')$PATH"
|
|||||||
|
|
||||||
For modules used in i3blocks.
|
For modules used in i3blocks.
|
||||||
|
|
||||||
### `i3battery`
|
- `battery` -- i3blocks module. Shows available power remaining with icon indicating battery status. Colors indicate different levels of charge.
|
||||||
|
- `clock` -- Shows time and date. If clicked, brings up calender or coming calcuse events.
|
||||||
i3blocks module. Shows available power remaining with icon indicating battery
|
- `cpu` -- Shows CPU temperature. If clicked, shows most processor-intensive processes.
|
||||||
status. Colors indicate different levels of charge.
|
- `help` -- Module which appears as a question mark. Brings up readme if clicked.
|
||||||
|
- `internet` -- Shows whether machine is connected to wifi and ethernet. If clicked, brings up `nmtui`.
|
||||||
### `i3mail`
|
- `mailbox` -- i3blocks module for use with mutt-wizard. Shows unread mail and if `mailsync.sh` is running.
|
||||||
|
- `mem` -- Shows memory usage. If clicked, shows most memory-intensive processes.
|
||||||
i3blocks module for use with mutt-wizard. Shows unread mail and if
|
- `music` -- i3blocks module. Shows current song; if paused, name will be grayed and italic.
|
||||||
`mailsync.sh` is running.
|
- `mpdupdate` -- A daemon running by default that will update the i3mpd block on mpd change.
|
||||||
|
- `news` -- Shows unread newsboat articles. Brings up newsboat or refreshes RSS feeds.
|
||||||
### `i3mpd`
|
- `pacpackages` -- i3blocks module. Detects new installable upgrades. Only works if you use cronjobs to automatically sync repositories.
|
||||||
|
- `popupgrade` -- Called by clicking on the update icon if there are new packages. Spawns a `yay` upgrade of the main Arch repos and AUR packages, updates the i3blocks module once complete.
|
||||||
i3blocks module. Shows current song; if paused, name will be grayed and italic.
|
- `torrent` -- i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or finished (🌱).
|
||||||
|
- `volume` -- i3blocks module. Shows volume percentage or mute notification.
|
||||||
### `i3mpdupdate`
|
- `weather` -- i3blocks module. Gets weather forcast from wttr.in and returns today's precipitation chance (☔), daily low (❄️) and daily high (☀️).
|
||||||
|
|
||||||
A daemon running by default that will update the i3mpd block on mpd change.
|
|
||||||
|
|
||||||
### `i3pacman`
|
|
||||||
|
|
||||||
i3blocks module. Detects new installable upgrades. Only works if you use
|
|
||||||
cronjobs to automatically sync repositories.
|
|
||||||
|
|
||||||
### `i3torrent`
|
|
||||||
|
|
||||||
i3blocks module. Shows torrents idle (⌛️), downloading (⬇️) or
|
|
||||||
finished (🌱).
|
|
||||||
|
|
||||||
### `i3volume`
|
|
||||||
|
|
||||||
i3blocks module. Shows volume percentage or mute notification.
|
|
||||||
|
|
||||||
### `i3weather`
|
|
||||||
|
|
||||||
i3blocks module. Gets weather forcast from wttr.in and returns today's
|
|
||||||
precipitation chance (☔), daily low (❄️) and daily high (☀️).
|
|
||||||
|
|
||||||
### `i3wifi`
|
|
||||||
|
|
||||||
A modified version of the i3blocks wifi module. Clicked, it brings up wifi-menu
|
|
||||||
and also appears when there is no wifi connection.
|
|
||||||
|
|
||||||
### `popupdate`
|
|
||||||
|
|
||||||
Called by clicking on the update icon if there are new packages. Spawns a `yay`
|
|
||||||
upgrade of the main Arch repos and AUR packages, updates the i3blocks module
|
|
||||||
once complete.
|
|
||||||
|
|
||||||
### `popweather`
|
|
||||||
|
|
||||||
The script called by clicking on the i3 weather module. Brings up the forecast
|
|
||||||
from `http://wttr.in` and will close on <Enter>.
|
|
||||||
|
|
||||||
|
|
||||||
## `cron/`
|
## `cron/`
|
||||||
|
|
||||||
For scripts meant to be cronjobs. None are active by default on LARBS.
|
For scripts meant to be cronjobs. None are active by default on LARBS.
|
||||||
|
|
||||||
### `checkup`
|
- `checkup` -- If connected to internet, syncs package repositories and downloads (but does not install) any potential updates. Gives `notify-send` notifications of when it is active since other `pacman` install commands cannot be run simultaneously. You may need to grant your user the ability to run `pacman -Syyuw --noconfirm` without a password (done in `/etc/sudoers`).
|
||||||
|
- `cronbat` -- Gives a dunst notification if the battery is less than 25%.
|
||||||
If connected to internet, syncs package repositories and downloads (but does
|
- `crontog` -- Not actually a cronjob, but just turns off/on all user cronjobs.
|
||||||
not install) any potential updates. Gives `notify-send` notifications of when
|
- `getforecast` -- Updates the weather forecast. This is automatically run by `weather` if there hasn't been a new forecast today.
|
||||||
it is active since other `pacman` install commands cannot be run
|
- `newsup` -- Updates newsboat RSS feeds if connected to internet. Will also display a newspaper update icon on i3blocks if it has not be user disabled.
|
||||||
simultaneously.
|
|
||||||
|
|
||||||
You may need to grant your user the ability to run `pacman -Syyuw --noconfirm`
|
|
||||||
without a password (done in `/etc/sudoers`).
|
|
||||||
|
|
||||||
### `cronbat`
|
|
||||||
|
|
||||||
Gives a dunst notification if the battery is less than 25%.
|
|
||||||
|
|
||||||
### `crontog`
|
|
||||||
|
|
||||||
Not actually a cronjob, but just turns off/on all user cronjobs.
|
|
||||||
|
|
||||||
### `newsup`
|
|
||||||
|
|
||||||
Updates newsboat RSS feeds if connected to internet. Will also display a
|
|
||||||
newspaper update icon on i3blocks if it has not be user disabled.
|
|
||||||
|
|
||||||
## `tools/`
|
## `tools/`
|
||||||
|
|
||||||
Scripts intended to be run either manually by the user or linked to a shortcut
|
Scripts intended to be run either manually by the user or linked to a shortcut
|
||||||
in vim or another program.
|
in vim or another program.
|
||||||
|
|
||||||
### `compiler`
|
- `compiler` -- Compiles a markdown, R markdown or LaTeX document with the approriate command. Will also run `make && sudo make install` if in a `config.h` file. Otherwise it will create a sent presentation. This can be thought of a general output handler. I have it bound to `<leader>c` in vim.
|
||||||
|
- `dmenuhandler` -- Give this script a url and it will offer dmenu options for opening it. Used by `newsboat` and some other programs as a link handler.
|
||||||
Compiles a markdown, R markdown or LaTeX document with the approriate command.
|
- `extract` -- Will detect file type of archive and run appropriate extraction command.
|
||||||
Will also run `make && sudo make install` if in a `config.h` file. Otherwise
|
- `getbib` -- Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to search for the .pdf's DOI. Returns nothing if none detected.
|
||||||
it will create a sent presentation. This can be thought of a general output
|
- `getkeys` -- Get the LARBS documentation on what bindings exist for main programs.
|
||||||
handler. I have it bound to `<leader>c` in vim.
|
- `linkhandler` -- The automatic link handler used by `newsboat` and other programs. Urls of video sites or of video files are opened in `mpv`, images are downloaded/opened in `feh`, music files are downloaded with `wget` and all other urls are opened in the default browser.
|
||||||
|
- `lmc` -- A music controller that simplifies music/audio management and improves the interface with i3blocks. Check inside to see what it does. This is what i3 audio/music commands run by default. If you use a difference music system or ALSA, you can change this script rather than changing all the shortcuts in different places.
|
||||||
### `dmenuhandler`
|
- `note` -- Give this script some text/a message as an argument. It will print it to the terminal, and if `dunst` is running, display a notification.
|
||||||
|
- `opout` -- "Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or `.rmd` file, or if given an `.html` file, will open it in the browser. Bound to `<leader>p` in my vim config to reveal typical output.
|
||||||
Give this script a url and it will offer dmenu options for opening it. Used by
|
- `pauseallmpv` -- Pauses all mpv instances by sending the `,` key to each. Used by several scripts, but can be used alone as well. It will not pause an audio only mpv instance. If you know how to add a hack to do this, feel free to PR it or email me an addition.
|
||||||
`newsboat` and some other programs as a link handler.
|
- `remaps` -- Remaps capslock to escape when pressed and super/mod when held. Maps the menu key to super as well. Runs the US international keyboard setup. If you want another keyboard setup, edit this fine.
|
||||||
|
- `shortcuts` -- For updating bash and ranger shortcuts. Reads `~/.key_directories` and `~/.key_files` for pairs of keypresses and directories and files, then autoproduces bash aliases and ranger shortcuts for them which output to `~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are read automatically by my bash and ranger configs. You don't have to run this script manually though, as it's run by vim whenever you edit one of the `~/.key_*` files.
|
||||||
### `extract`
|
- `speedvid` -- Speed up a given video file (`$1`) by a given ammount (`$2`).
|
||||||
|
- `tpb` -- Search Pirate Bay for the certain search terms given as arguments.
|
||||||
Will detect file type of archive and run appropriate extraction command.
|
- `texclear` -- Remove all `.tex` related build files. This is run by my vim when I stop editing any `.tex` file.
|
||||||
|
- `transadd` -- The mimeapp default script for handling torrent magnet links. Starts `transmission-daemon` if not running and adds the link.
|
||||||
### `getbib`
|
|
||||||
|
|
||||||
Use crossref.org to automatically detect bibtex entry of a .pdf. Attempts to
|
|
||||||
search for the .pdf's DOI. Returns nothing if none detected.
|
|
||||||
|
|
||||||
### `getkeys`
|
|
||||||
|
|
||||||
Get the LARBS documentation on what bindings exist for main programs.
|
|
||||||
|
|
||||||
### `linkhandler`
|
|
||||||
|
|
||||||
The automatic link handler used by `newsboat` and other programs. Urls of video
|
|
||||||
sites or of video files are opened in `mpv`, images are downloaded/opened in
|
|
||||||
`feh`, music files are downloaded with `wget` and all other urls are opened in
|
|
||||||
the default browser.
|
|
||||||
|
|
||||||
### `lmc`
|
|
||||||
|
|
||||||
A music controller that simplifies music/audio management and improves the
|
|
||||||
interface with i3blocks. Check inside to see what it does. This is what i3
|
|
||||||
audio/music commands run by default. If you use a difference music system or
|
|
||||||
ALSA, you can change this script rather than changing all the shortcuts in
|
|
||||||
different places.
|
|
||||||
|
|
||||||
### `note`
|
|
||||||
|
|
||||||
Give this script some text/a message as an argument. It will print it to the
|
|
||||||
terminal, and if `dunst` is running, display a notification.
|
|
||||||
|
|
||||||
### `opout`
|
|
||||||
|
|
||||||
"Open output", opens the corresponding `.pdf` file if run on a `.md`, `.tex` or
|
|
||||||
`.rmd` file, or if given an `.html` file, will open it in the browser. Bound
|
|
||||||
to `<leader>p` in my vim config to reveal typical output.
|
|
||||||
|
|
||||||
### `pauseallmpv`
|
|
||||||
|
|
||||||
Pauses all mpv instances by sending the `,` key to each. Used by several
|
|
||||||
scripts, but can be used alone as well. It will not pause an audio only mpv
|
|
||||||
instance. If you know how to add a hack to do this, feel free to PR it or email
|
|
||||||
me an addition.
|
|
||||||
|
|
||||||
### `remaps`
|
|
||||||
|
|
||||||
Remaps capslock to escape when pressed and super/mod when held. Maps the menu
|
|
||||||
key to super as well. Runs the US international keyboard setup. If you want
|
|
||||||
another keyboard setup, edit this fine.
|
|
||||||
|
|
||||||
### `shortcuts`
|
|
||||||
|
|
||||||
For updating bash and ranger shortcuts. Reads `~/.key_directories` and
|
|
||||||
`~/.key_files` for pairs of keypresses and directories and files, then
|
|
||||||
autoproduces bash aliases and ranger shortcuts for them which output to
|
|
||||||
`~/.shortcuts` and `~/.config/ranger/shortcuts.conf` respectively. These are
|
|
||||||
read automatically by my bash and ranger configs. You don't have to run this
|
|
||||||
script manually though, as it's run by vim whenever you edit one of the
|
|
||||||
`~/.key_*` files.
|
|
||||||
|
|
||||||
### `speedvid`
|
|
||||||
|
|
||||||
Speed up a given video file (`$1`) by a given ammount (`$2`).
|
|
||||||
|
|
||||||
### `tpb`
|
|
||||||
|
|
||||||
Search Pirate Bay for the certain search terms given as arguments.
|
|
||||||
|
|
||||||
### `texclear`
|
|
||||||
|
|
||||||
Remove all `.tex` related build files. This is run by my vim when I stop
|
|
||||||
editing any `.tex` file.
|
|
||||||
|
|
||||||
### `transadd`
|
|
||||||
|
|
||||||
The mimeapp default script for handling torrent magnet links. Starts
|
|
||||||
`transmission-daemon` if not running and adds the link.
|
|
||||||
|
|
||||||
## `i3cmds`
|
## `i3cmds`
|
||||||
|
|
||||||
These are scripts linked to bindings in i3. They typically perform
|
These are scripts linked to bindings in i3. They typically perform
|
||||||
user-interface actions or involve dmenu.
|
user-interface actions or involve dmenu.
|
||||||
|
|
||||||
### `bottomleft` and `bottomright`
|
- `bottomleft` and `bottomright` -- Makes the currently selected window float in one of the bottom corners of the screen. `bottomleft` is bound to `mod+B` by default.
|
||||||
|
- `camtoggle` -- Starts/kills /dev/video0 webcam. Placed in bottom right by default.
|
||||||
Makes the currently selected window float in one of the bottom corners of the
|
- `ddspawn` -- This is the script called to create, show and hide the dropdown tmux terminal mapped to `mod+u`, but also the dropdown calculator mapped to `mod+a`. Give the script an argument that is a script the window will run. If a window does not already exist, `ddspawn` creates it, if it does, `ddspawn` will toggle its visibility. The the script itself for usage.
|
||||||
screen. `bottomleft` is bound to `mod+B` by default.
|
- `displayselect` -- Select which displays to use. Bound to `mod+F3`.
|
||||||
|
- `dmenumount` -- Gives a dmenu prompt for mounting USB drives or Android devices. Bound to `mod+F9`. Will do nothing if none are available.
|
||||||
### `camtoggle`
|
- `dmenurecord` -- Gives a list of recording commands: `audio`, `video` and `screencast` (both) in dmenu for selection. Bound to `mod+PrintScreen` by default. Should be killed by `killrecording`.
|
||||||
|
- `dmenuumount` -- Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing if none are mounted. It will not try to unmount essential system partitions.
|
||||||
Starts/kills /dev/video0 webcam. Placed in bottom right by default.
|
- `dmenuunicode` -- Shows a searchable dmenu prompt of emoji characters. The selected emoji is copied to the system clipboard, while its character code is copied to primary selection (middle mouse button).
|
||||||
|
- `dropdowncalc` -- The dropdown calculator script called by `ddspawn` and bound to `mod+a` by default. Will run an R calculator if installed, otherwise python.
|
||||||
### `ddspawn`
|
- `ducksearch` -- Show a dmenu prompt and search for the inputed text in DuckDuckGo. Can take bangtags as expected, i.e. typing in `!aw Arch Linux` will search the Arch Wiki for "Arch Linux" or `!yt Luke Smith` will search YouTube for "Luke Smith", etc.
|
||||||
|
- `i3resize` -- A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`.
|
||||||
This is the script called to create, show and hide the dropdown tmux terminal
|
- `killrecording` -- End a recording started by `dmenurecord` the proper way without file trucation or lingering background processes, mapped to `mod+Delete` by default.
|
||||||
mapped to `mod+u`, but also the dropdown calculator mapped to `mod+a`. Give the
|
- `lockscreen` -- The screen locker. Gives a confirm prompt and if user says yes, all audio will be paused and the screen will be distorted and locked and screen will soon time out. User must insert password to unlock. Mapped to `mod+x` by default.
|
||||||
script an argument that is a script the window will run. If a window does not
|
- `newspod` -- A silly line that has a script all to itself due to i3's idiosyncracies. Starts `newsboat`, if `newsboat` cannot open because of another instance being open, opens `podboat`.
|
||||||
already exist, `ddspawn` creates it, if it does, `ddspawn` will toggle its
|
- `prompt` -- Gives a Yes/No prompt to a question given as an argument. Used by numerous bindings like `mod+shift+x`, `mod+shift+backspace` and `mod+shift+escape`.
|
||||||
visibility. The the script itself for usage.
|
- `samedir` -- Opens a terminal window in the same directory as the window currently selection. Bound to `mod+shift+enter`.
|
||||||
|
- `td-toggle` -- Gives a dmenu prompt to start `transmission-daemon` if not running, or the kill it if it is. Obviously you need `transmission-cli` installed for this to work. Mapped to `mod+F7` by default.
|
||||||
### `displayselect`
|
- `tmuxdd` -- The startup script for the dropdown terminal (toggleable with `mod+u`). Either attaches to an existing tmux session or begins a new one.
|
||||||
|
- `toggletouchpad` -- As the name suggests, turns off TouchPad if on, and turns it on if off. Requires `xf86-input-synaptics`. If your laptop has a special button for this, it will be mapped by default.
|
||||||
Select which displays to use. Bound to `mod+F3`.
|
- `tutorialvids` -- A dmenu prompt that gives some options of tutorial videos to watch. Bound to `mod+shift+e`.
|
||||||
|
|
||||||
### `dmenumount`
|
|
||||||
|
|
||||||
Gives a dmenu prompt for mounting USB drives or Android devices. Bound to
|
|
||||||
`mod+F9`. Will do nothing if none are available.
|
|
||||||
|
|
||||||
### `dmenurecord`
|
|
||||||
|
|
||||||
Gives a list of recording commands: `audio`, `video` and `screencast` (both) in
|
|
||||||
dmenu for selection. Bound to `mod+Print Screen` by default. Should be kill by
|
|
||||||
`killrecording`.
|
|
||||||
|
|
||||||
### `dmenuumount`
|
|
||||||
|
|
||||||
Unmount a mounted non-essential partition. Bound to `mod+F10`. Will do nothing
|
|
||||||
if none are mounted. It will not try to unmount essential system partitions.
|
|
||||||
|
|
||||||
### `dmenuunicode`
|
|
||||||
|
|
||||||
Shows a searchable dmenu prompt of emoji characters. The selected emoji is
|
|
||||||
copied to the system clipboard, while its character code is copied to primary
|
|
||||||
selection (middle mouse button).
|
|
||||||
|
|
||||||
### `dropdowncalc`
|
|
||||||
|
|
||||||
The dropdown calculator script called by `ddspawn` and bound to `mod+a` by
|
|
||||||
default. Will run an R calculator if installed, otherwise python.
|
|
||||||
|
|
||||||
### `ducksearch`
|
|
||||||
|
|
||||||
Show a dmenu prompt and search for the inputed text in DuckDuckGo. Can take
|
|
||||||
bangtags as expected, i.e. typing in `!aw Arch Linux` will search the Arch Wiki
|
|
||||||
for "Arch Linux" or `!yt Luke Smith` will search YouTube for "Luke Smith", etc.
|
|
||||||
|
|
||||||
### `i3resize`
|
|
||||||
|
|
||||||
A script that allows intuitive resizing of windows. Mapped to `mod+Y/U/I/O`.
|
|
||||||
|
|
||||||
### `killrecording`
|
|
||||||
|
|
||||||
End a recording started by `dmenurecord` the proper way without file trucation
|
|
||||||
or lingering background processes, mapped to `mod+Delete` by default.
|
|
||||||
|
|
||||||
### `lockscreen`
|
|
||||||
|
|
||||||
The screen locker. Gives a confirm prompt and if user says yes, all audio will
|
|
||||||
be paused and the screen will be distorted and locked and screen will soon time
|
|
||||||
out. User must insert password to unlock. Mapped to `mod+x` by default.
|
|
||||||
|
|
||||||
### `newspod`
|
|
||||||
|
|
||||||
A silly line that has a script all to itself due to i3's idiosyncracies. Starts
|
|
||||||
`newsboat`, if `newsboat` cannot open because of another instance being open,
|
|
||||||
opens `podboat`.
|
|
||||||
|
|
||||||
### `prompt`
|
|
||||||
|
|
||||||
Gives a Yes/No prompt to a question given as an argument. Used by numerous
|
|
||||||
bindings like `mod+shift+x`, `mod+shift+backspace` and `mod+shift+escape`.
|
|
||||||
|
|
||||||
### `samedir`
|
|
||||||
|
|
||||||
Opens a terminal window in the same directory as the window currently
|
|
||||||
selection. Bound to `mod+shift+enter`.
|
|
||||||
|
|
||||||
### `td-toggle`
|
|
||||||
|
|
||||||
Gives a dmenu prompt to start `transmission-daemon` if not running, or the kill
|
|
||||||
it if it is. Obviously you need `transmission-cli` installed for this to work.
|
|
||||||
Mapped to `mod+F7` by default.
|
|
||||||
|
|
||||||
### `tmuxdd`
|
|
||||||
|
|
||||||
The startup script for the dropdown terminal (toggleable with `mod+u`). Either
|
|
||||||
attaches to an existing tmux session or begins a new one.
|
|
||||||
|
|
||||||
### `toggletouchpad`
|
|
||||||
|
|
||||||
As the name suggests, turns off TouchPad if on, and turns it on if off.
|
|
||||||
Requires `xf86-input-synaptics`. If your laptop has a special button for this,
|
|
||||||
it will be mapped by default.
|
|
||||||
|
|
||||||
### `tutorialvids`
|
|
||||||
|
|
||||||
A dmenu prompt that gives some options of tutorial videos to watch. Bound to
|
|
||||||
`mod+shift+e`.
|
|
||||||
|
|||||||
@ -3,16 +3,16 @@
|
|||||||
|
|
||||||
ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
|
ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
|
||||||
|
|
||||||
note "Checking for pacakge updates..." "$PIX/larbs.gif"
|
notify-send -i "$PIX/larbs.gif" "Checking for pacakge updates..."
|
||||||
|
|
||||||
sudo pacman -Syyuw --noconfirm || note "Error downloading updates.
|
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
|
||||||
|
|
||||||
Check your internet connection, if pacman is already running, or run update manually to see errors."
|
Check your internet connection, if pacman is already running, or run update manually to see errors."
|
||||||
pkill -RTMIN+8 i3blocks
|
pkill -RTMIN+8 i3blocks
|
||||||
|
|
||||||
if pacman -Qul
|
if pacman -Qu | grep -v "\[ignored\]"
|
||||||
then
|
then
|
||||||
note "Package updates available. Click statusbar icon for update." "$PIX/larbs.gif"
|
notify-send -i "$PIX/larbs.gif" "Package updates available. Click statusbar icon (📦) for update."
|
||||||
else
|
else
|
||||||
note "Repository sync complete. No new packages for update." "$PIX/larbs.gif"
|
notify-send -i "$PIX/larbs.gif" "Repository sync complete. No new packages for update."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -2,5 +2,5 @@
|
|||||||
# Updates weather forecast
|
# Updates weather forecast
|
||||||
ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit
|
ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit
|
||||||
location="$1"; [ -z "$location" ] || location="$location+"
|
location="$1"; [ -z "$location" ] || location="$location+"
|
||||||
curl -s "wttr.in/$location" > ~/.weatherreport
|
curl -s "wttr.in/$location" > /tmp/weatherreport
|
||||||
pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated."
|
pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated."
|
||||||
|
|||||||
@ -8,9 +8,9 @@ current=$(xdotool getwindowfocus)
|
|||||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
||||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
||||||
|
|
||||||
xdotool windowsize "$(xdotool getwindowfocus)" $newheight $newwidth
|
xdotool windowsize "$current" $newheight $newwidth
|
||||||
|
|
||||||
newsize=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
||||||
|
|
||||||
height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
||||||
xdotool windowmove "$current" 0 $height
|
xdotool windowmove "$current" 0 $height
|
||||||
|
|||||||
@ -8,10 +8,10 @@ current=$(xdotool getwindowfocus)
|
|||||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
||||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
||||||
|
|
||||||
xdotool windowsize "$(xdotool getwindowfocus)" $newheight $newwidth
|
xdotool windowsize "$current" $newheight $newwidth
|
||||||
|
|
||||||
newsize=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
||||||
newwidth=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | grep -o " [0-9]*")
|
newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*")
|
||||||
|
|
||||||
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
||||||
horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth))
|
horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth))
|
||||||
|
|||||||
@ -1,25 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# This script simplifies dropdown windows in i3.
|
# Toggle floating dropdown terminal in i3, or start if non-existing.
|
||||||
# Shows/hides a scratchpad of a given name, if it doesn't exist, creates it.
|
# $1 is the script run in the terminal.
|
||||||
# Usage:
|
# All other args are terminal settings.
|
||||||
# argument 1: script to run in dropdown window
|
# Terminal names are in dropdown_* to allow easily setting i3 settings.
|
||||||
# all other args are interpreted as options for your terminal
|
|
||||||
# My usage:
|
|
||||||
# ddpawn
|
|
||||||
# bindsym $mod+u exec --no-startup-id ddspawn tmuxdd
|
|
||||||
# Will hide/show window running the `tmuxdd` script when I press mod+u in i3
|
|
||||||
# bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
|
|
||||||
# Similar to above but with `dropdowncalc` and the other args are interpretated as for my terminal emulator (to increase font)
|
|
||||||
|
|
||||||
[ -z "$1" ] && exit
|
[ -z "$1" ] && exit
|
||||||
|
|
||||||
if xwininfo -tree -root | grep "(\"$1\" ";
|
if xwininfo -tree -root | grep "(\"dropdown_$1\" ";
|
||||||
then
|
then
|
||||||
echo "Window detected."
|
echo "Window detected."
|
||||||
|
i3 "[instance=\"dropdown_$1\"] scratchpad show; [instance=\"dropdown_$1\"] move position center"
|
||||||
else
|
else
|
||||||
echo "Window not detected... spawning."
|
echo "Window not detected... spawning."
|
||||||
i3 "exec --no-startup-id $TERMINAL -n $1 $(echo "$@" | cut -d ' ' -f2-) -e $1" && i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center"
|
i3 "exec --no-startup-id $TERMINAL -n dropdown_$1 $(echo "$@" | cut -d ' ' -f2-) -e $1"
|
||||||
sleep .25 # This sleep is my laziness, will fix later (needed for immediate appearance after spawn).
|
|
||||||
fi
|
fi
|
||||||
i3 "[instance=\"$1\"] scratchpad show; [instance=\"$1\"] move position center"
|
|
||||||
|
|||||||
@ -6,11 +6,38 @@
|
|||||||
# I plan on adding a routine from multi-monitor setups later.
|
# I plan on adding a routine from multi-monitor setups later.
|
||||||
|
|
||||||
twoscreen() { # If multi-monitor is selected and there are two screens.
|
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")
|
mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
|
||||||
direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
|
# Mirror displays using native resolution of external display and a scaled
|
||||||
xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto
|
# version for the internal display
|
||||||
}
|
if [ "$mirror" = "yes" ]; then
|
||||||
|
external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:")
|
||||||
|
internal=$(echo "$screens" | grep -v "$external")
|
||||||
|
|
||||||
|
res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
|
||||||
|
tail -n 1 | awk '{print $1}')
|
||||||
|
res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
|
||||||
|
tail -n 1 | awk '{print $1}')
|
||||||
|
|
||||||
|
res_ext_x=$(echo $res_external | sed 's/x.*//')
|
||||||
|
res_ext_y=$(echo $res_external | sed 's/.*x//')
|
||||||
|
res_int_x=$(echo $res_internal | sed 's/x.*//')
|
||||||
|
res_int_y=$(echo $res_internal | sed 's/.*x//')
|
||||||
|
|
||||||
|
scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
|
||||||
|
scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
|
||||||
|
|
||||||
|
xrandr --output "$external" --auto --scale 1.0x1.0 \
|
||||||
|
--output "$internal" --auto --same-as "$external" \
|
||||||
|
--scale "$scale_x"x"$scale_y"
|
||||||
|
else
|
||||||
|
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
morescreen() { # If multi-monitor is selected and there are more than two screens.
|
morescreen() { # If multi-monitor is selected and there are more than two screens.
|
||||||
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
|
||||||
@ -38,7 +65,7 @@ chosen=$(printf "%s\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p
|
|||||||
case "$chosen" in
|
case "$chosen" in
|
||||||
"manual selection") arandr ; exit ;;
|
"manual selection") arandr ; exit ;;
|
||||||
"multi-monitor") multimon ;;
|
"multi-monitor") multimon ;;
|
||||||
*) xrandr --output "$chosen" --auto $(echo "$screens" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;
|
*) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$screens" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fix feh background if screen size/arangement has changed.
|
# Fix feh background if screen size/arangement has changed.
|
||||||
|
|||||||
@ -19,7 +19,12 @@ mountusb() { \
|
|||||||
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
|
chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?" | awk '{print $1}')"
|
||||||
sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0
|
sudo -A mount "$chosen" && notify-send "$chosen mounted." && exit 0
|
||||||
getmount "/mnt /media /mount /home -maxdepth 5 -type d"
|
getmount "/mnt /media /mount /home -maxdepth 5 -type d"
|
||||||
sudo -A mount "$chosen" "$mp" && notify-send "$chosen mounted to $mp."
|
partitiontype="$(lsblk -no "fstype" "$chosen")"
|
||||||
|
case "$partitiontype" in
|
||||||
|
"vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;;
|
||||||
|
*) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" 741 "$mp";;
|
||||||
|
esac
|
||||||
|
notify-send "$chosen mounted to $mp."
|
||||||
}
|
}
|
||||||
|
|
||||||
mountandroid() { \
|
mountandroid() { \
|
||||||
|
|||||||
@ -10,15 +10,15 @@
|
|||||||
# If there is already a running instance, user will be prompted to end it.
|
# If there is already a running instance, user will be prompted to end it.
|
||||||
|
|
||||||
updateicon() { \
|
updateicon() { \
|
||||||
echo "$1" > ~/.recordingicon
|
echo "$1" > /tmp/recordingicon
|
||||||
pkill -RTMIN+9 i3blocks
|
pkill -RTMIN+9 i3blocks
|
||||||
}
|
}
|
||||||
|
|
||||||
killrecording() {
|
killrecording() {
|
||||||
recpid="$(cat ~/.recordingpid)"
|
recpid="$(cat /tmp/recordingpid)"
|
||||||
# kill with SIGTERM, allowing finishing touches.
|
# kill with SIGTERM, allowing finishing touches.
|
||||||
kill -15 "$recpid"
|
kill -15 "$recpid"
|
||||||
rm -f ~/.recordingpid
|
rm -f /tmp/recordingpid
|
||||||
updateicon ""
|
updateicon ""
|
||||||
pkill -RTMIN+9 i3blocks
|
pkill -RTMIN+9 i3blocks
|
||||||
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
# even after SIGTERM, ffmpeg may still run, so SIGKILL it.
|
||||||
@ -37,7 +37,7 @@ screencast() { \
|
|||||||
-r 30 \
|
-r 30 \
|
||||||
-c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \
|
-c:v libx264rgb -crf 0 -preset ultrafast -c:a flac \
|
||||||
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/screencast-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! > ~/.recordingpid
|
echo $! > /tmp/recordingpid
|
||||||
updateicon "⏺️🎙️"
|
updateicon "⏺️🎙️"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,25 +47,25 @@ video() { ffmpeg \
|
|||||||
-i :0.0 \
|
-i :0.0 \
|
||||||
-c:v libx264 -qp 0 -r 30 \
|
-c:v libx264 -qp 0 -r 30 \
|
||||||
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/video-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! > ~/.recordingpid
|
echo $! > /tmp/recordingpid
|
||||||
updateicon "⏺️"
|
updateicon "⏺️"
|
||||||
}
|
}
|
||||||
|
|
||||||
webcamhidef() { ffmpeg \
|
webcamhidef() { ffmpeg \
|
||||||
-f v412 \
|
-f v4l2 \
|
||||||
-i /dev/video0 \
|
-i /dev/video0 \
|
||||||
-video_size 1920x1080 \
|
-video_size 1920x1080 \
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! > ~/.recordingpid
|
echo $! > /tmp/recordingpid
|
||||||
updateicon "🎥"
|
updateicon "🎥"
|
||||||
}
|
}
|
||||||
|
|
||||||
webcam() { ffmpeg \
|
webcam() { ffmpeg \
|
||||||
-f v412 \
|
-f v4l2 \
|
||||||
-i /dev/video0 \
|
-i /dev/video0 \
|
||||||
-video_size 640x480 \
|
-video_size 640x480 \
|
||||||
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
"$HOME/webcam-$(date '+%y%m%d-%H%M-%S').mkv" &
|
||||||
echo $! > ~/.recordingpid
|
echo $! > /tmp/recordingpid
|
||||||
updateicon "🎥"
|
updateicon "🎥"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ audio() { \
|
|||||||
-f alsa -i default \
|
-f alsa -i default \
|
||||||
-c:a flac \
|
-c:a flac \
|
||||||
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
"$HOME/audio-$(date '+%y%m%d-%H%M-%S').flac" &
|
||||||
echo $! > ~/.recordingpid
|
echo $! > /tmp/recordingpid
|
||||||
updateicon "🎙️"
|
updateicon "🎙️"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,8 +85,8 @@ askrecording() { \
|
|||||||
screencast) screencast;;
|
screencast) screencast;;
|
||||||
audio) audio;;
|
audio) audio;;
|
||||||
video) video;;
|
video) video;;
|
||||||
webcam) webcamrecord;;
|
webcam) webcam;;
|
||||||
"webcam (hi-def)") webcamrecord;;
|
"webcam (hi-def)") webcamhidef;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,5 +101,5 @@ case "$1" in
|
|||||||
audio) audio;;
|
audio) audio;;
|
||||||
video) video;;
|
video) video;;
|
||||||
kill) killrecording;;
|
kill) killrecording;;
|
||||||
*) ([ -f ~/.recordingpid ] && asktoend && exit) || askrecording;;
|
*) ([ -f /tmp/recordingpid ] && asktoend && exit) || askrecording;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
9
.scripts/i3cmds/maimpick
Executable file
9
.scripts/i3cmds/maimpick
Executable file
@ -0,0 +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
|
||||||
|
"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 ;;
|
||||||
|
"full screen (copy)") maim | xclip -selection clipboard -t image/png ;;
|
||||||
|
esac
|
||||||
@ -9,7 +9,7 @@ clip=$(xclip -o -selection clipboard)
|
|||||||
|
|
||||||
prim=$(xclip -o -selection primary)
|
prim=$(xclip -o -selection primary)
|
||||||
|
|
||||||
[ "$prim" != "" ] && notify-send "<b>Clipboard:</b>
|
[ "$clip" != "" ] && notify-send "<b>Clipboard:</b>
|
||||||
$clip"
|
$clip"
|
||||||
[ "$clip" != "" ] && notify-send "<b>Primary:</b>
|
[ "$prim" != "" ] && notify-send "<b>Primary:</b>
|
||||||
$prim"
|
$prim"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
vidlist="
|
vidlist="
|
||||||
status bar https://www.youtube.com/watch?v=gKumet6b-WY
|
status bar https://www.youtube.com/watch?v=gKumet6b-WY
|
||||||
feh
|
sxiv (image viewer) https://www.youtube.com/watch?v=GYW9i_u5PYs
|
||||||
st (terminal) https://www.youtube.com/watch?v=9H75enWM22k
|
st (terminal) https://www.youtube.com/watch?v=9H75enWM22k
|
||||||
i3 (window manager) https://www.youtube.com/watch?v=GKviflL9XeI
|
i3 (window manager) https://www.youtube.com/watch?v=GKviflL9XeI
|
||||||
mutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A
|
mutt (email) https://www.youtube.com/watch?v=2U3vRbF7v5A
|
||||||
@ -15,4 +15,4 @@ urlview https://www.youtube.com/watch?v=IgzpAjFgbCw
|
|||||||
colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE
|
colorschemes with pywal https://www.youtube.com/watch?v=Es79N_9BblE
|
||||||
vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E
|
vi mode in shell https://www.youtube.com/watch?v=GqoJQft5R2E
|
||||||
"
|
"
|
||||||
mpv "$(echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 5 | awk '{print $1}')\s" | sed 's/.*\t//')"
|
echo "$vidlist" | grep -P "^$(echo "$vidlist" | grep "https:" | sed 's/\t.*//g' | dmenu -i -p "Learn about what? (ESC to cancel)" -l 20 | awk '{print $1}')\s" | sed 's/.*\t//' | xargs -r mpv
|
||||||
|
|||||||
@ -16,4 +16,4 @@ case $BLOCK_BUTTON in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
pacman -Qu | wc -l | sed -e "s/^0$//g"
|
pacman -Qu | grep -v "\[ignored\]" | wc -l | sed -e "s/^0$//g"
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[ "$(stat -c %y .weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast
|
[ "$(stat -c %y /tmp/weatherreport | awk '{print $1}')" != "$(date '+%Y-%m-%d')" ] && getforecast
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) $TERMINAL -e less -S ~/.weatherreport ;;
|
1) $TERMINAL -e less -S /tmp/weatherreport ;;
|
||||||
3) pgrep -x dunst >/dev/null && notify-send "<b>🌈 Weather module:</b>
|
3) pgrep -x dunst >/dev/null && notify-send "<b>🌈 Weather module:</b>
|
||||||
- Click for wttr.in forecast.
|
- Click for wttr.in forecast.
|
||||||
☔: Chance of rain/snow
|
☔: Chance of rain/snow
|
||||||
@ -10,6 +10,6 @@ case $BLOCK_BUTTON in
|
|||||||
🌞: Daily high" ;;
|
🌞: Daily high" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
printf "%s" "$(sed '16q;d' ~/.weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
|
printf "%s" "$(sed '16q;d' /tmp/weatherreport | grep -wo "[0-9]*%" | sort -n | sed -e '$!d' | sed -e "s/^/☔ /g" | tr -d '\n')"
|
||||||
|
|
||||||
sed '13q;d' ~/.weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}'
|
sed '13q;d' /tmp/weatherreport | grep -o "m\\(-\\)*[0-9]\\+" | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | awk '{print " ❄️",$1 "°","🌞",$2 "°"}'
|
||||||
|
|||||||
@ -5,11 +5,11 @@
|
|||||||
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in
|
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in
|
||||||
"copy url") echo "$1" | xclip -selection clipboard ;;
|
"copy url") echo "$1" | xclip -selection clipboard ;;
|
||||||
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
|
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
|
||||||
"mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;;
|
"mpv (loop)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet --loop "$1" >/dev/null 2>&1 & ;;
|
||||||
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
||||||
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
|
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
|
||||||
browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;;
|
browser) setsid "$BROWSER" "$1" >/dev/null 2>&1 & ;;
|
||||||
feh) setsid feh "$1" >/dev/null 2>&1 & ;;
|
feh) setsid feh "$1" >/dev/null 2>&1 & ;;
|
||||||
w3m) w3m "$1" >/dev/null 2>&1 ;;
|
w3m) w3m "$1" >/dev/null 2>&1 ;;
|
||||||
"mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;
|
"mpv (float)") setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -10,18 +10,18 @@
|
|||||||
scihub="http://sci-hub.tw/"
|
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" ] && { "$TRUEBROWSER"; exit; }
|
[ -z "$1" ] && { "$BROWSER"; exit; }
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*)
|
*mkv|*webm|*mp4|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*)
|
||||||
setsid mpv -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)
|
*png|*jpg|*jpe|*jpeg|*gif)
|
||||||
setsid feh "$1" >/dev/null 2>&1 & ;;
|
setsid sxiv -a "$1" >/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*)
|
*springer.com*)
|
||||||
setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;;
|
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 "$TRUEBROWSER" "$1" >/dev/null 2>&1 & fi ;;
|
else setsid "$BROWSER" "$1" >/dev/null 2>&1 & fi ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Sends a , key to all mpv instances, pausing them at the last frame.
|
for i in $(ls /tmp/mpvsoc*); do
|
||||||
|
echo '{ "command": ["set_property", "pause", true] }' | socat - $i;
|
||||||
xdotool search --class mpv | xargs -I % xdotool key --window % comma
|
done
|
||||||
|
|||||||
@ -1,12 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Shell rc file (i.e. bash vs. zsh, etc.)
|
|
||||||
shellrc="$HOME/.bashrc"
|
|
||||||
|
|
||||||
# Bookmark file locations
|
|
||||||
bmdirs="$HOME/.bmdirs"
|
|
||||||
bmfiles="$HOME/.bmfiles"
|
|
||||||
|
|
||||||
# Output locations. Unactivated progs should go to /dev/null.
|
# Output locations. Unactivated progs should go to /dev/null.
|
||||||
shell_shortcuts="$HOME/.shortcuts"
|
shell_shortcuts="$HOME/.shortcuts"
|
||||||
ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf"
|
ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf"
|
||||||
@ -15,24 +7,16 @@ fish_shortcuts="/dev/null"
|
|||||||
|
|
||||||
# Remove, prepare files
|
# Remove, prepare files
|
||||||
rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null
|
rm -f "$ranger_shortcuts" "$qute_shortcuts" 2>/dev/null
|
||||||
#echo "abbr \\" > "$fish_shortcuts"
|
echo "abbr \\" > "$fish_shortcuts"
|
||||||
echo "alias \\" > "$shell_shortcuts"
|
echo "alias \\" > "$shell_shortcuts"
|
||||||
|
|
||||||
# Ensure text of argument 1 exists in the file argument 2
|
|
||||||
ensure() { (grep "$1" "$2")>/dev/null 2>&1 || echo "$1" >> "$2" ;}
|
|
||||||
|
|
||||||
ensure "source $shell_shortcuts" "$shellrc"
|
|
||||||
ensure "source $HOME/.config/ranger/shortcuts.conf" "$HOME/.config/ranger/rc.conf"
|
|
||||||
#ensure "config.source('shortcuts.py')" "$HOME/.config/qutebrowser/config.py"
|
|
||||||
#ensure "source $HOME/.config/fish/shortcuts.fish" "$HOME/.config/fish/config.fish"
|
|
||||||
|
|
||||||
# Format the `bmdirs` file in the correct syntax and sent it to all three configs.
|
# Format the `bmdirs` file in the correct syntax and sent it to all three configs.
|
||||||
sed "s/#.*$//;/^$/d" "$bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \
|
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmdirs" | tee >(awk '{print $1"=\"cd "$2" && ls -a\" \\"}' >> "$shell_shortcuts") \
|
||||||
>(awk '{print $1, "\"cd " $2 "; and ls -a\" \\"}' >> "$fish_shortcuts") \
|
>(awk '{print $1, "\"cd " $2 "; and ls -a\" \\"}' >> "$fish_shortcuts") \
|
||||||
>(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \
|
>(awk '{print "config.bind(\";"$1"\", \"set downloads.location.directory "$2" ;; hint links download\")"}' >> "$qute_shortcuts") \
|
||||||
| awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts"
|
| awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts"
|
||||||
|
|
||||||
# Format the `configs` file in the correct syntax and sent it to both configs.
|
# Format the `configs` file in the correct syntax and sent it to both configs.
|
||||||
sed "s/#.*$//;/^$/d" "$bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \
|
sed "s/\s*#.*$//;/^\s*$/d" "$HOME/.bmfiles" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \
|
||||||
>(awk '{print $1, "\"$EDITOR "$2"\" \\"}' >> "$fish_shortcuts") \
|
>(awk '{print $1, "\"$EDITOR "$2"\" \\"}' >> "$fish_shortcuts") \
|
||||||
| awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"
|
| awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"
|
||||||
|
|||||||
@ -1,66 +1,5 @@
|
|||||||
" vim-plug: Vim plugin manager
|
|
||||||
" ============================
|
|
||||||
"
|
|
||||||
" Download plug.vim and put it in ~/.vim/autoload
|
|
||||||
"
|
|
||||||
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
|
||||||
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
"
|
|
||||||
" Edit your .vimrc
|
|
||||||
"
|
|
||||||
" call plug#begin('~/.vim/plugged')
|
|
||||||
"
|
|
||||||
" " Make sure you use single quotes
|
|
||||||
"
|
|
||||||
" " Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
|
|
||||||
" Plug 'junegunn/vim-easy-align'
|
|
||||||
"
|
|
||||||
" " Any valid git URL is allowed
|
|
||||||
" Plug 'https://github.com/junegunn/vim-github-dashboard.git'
|
|
||||||
"
|
|
||||||
" " Multiple Plug commands can be written in a single line using | separators
|
|
||||||
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
|
|
||||||
"
|
|
||||||
" " On-demand loading
|
|
||||||
" Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
|
||||||
" Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
|
|
||||||
"
|
|
||||||
" " Using a non-master branch
|
|
||||||
" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
|
|
||||||
"
|
|
||||||
" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
|
|
||||||
" Plug 'fatih/vim-go', { 'tag': '*' }
|
|
||||||
"
|
|
||||||
" " Plugin options
|
|
||||||
" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
|
|
||||||
"
|
|
||||||
" " Plugin outside ~/.vim/plugged with post-update hook
|
|
||||||
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
|
||||||
"
|
|
||||||
" " Unmanaged plugin (manually installed and updated)
|
|
||||||
" Plug '~/my-prototype-plugin'
|
|
||||||
"
|
|
||||||
" " Initialize plugin system
|
|
||||||
" call plug#end()
|
|
||||||
"
|
|
||||||
" Then reload .vimrc and :PlugInstall to install plugins.
|
|
||||||
"
|
|
||||||
" Plug options:
|
|
||||||
"
|
|
||||||
"| Option | Description |
|
|
||||||
"| ----------------------- | ------------------------------------------------ |
|
|
||||||
"| `branch`/`tag`/`commit` | Branch/tag/commit of the repository to use |
|
|
||||||
"| `rtp` | Subdirectory that contains Vim plugin |
|
|
||||||
"| `dir` | Custom directory for the plugin |
|
|
||||||
"| `as` | Use different name for the plugin |
|
|
||||||
"| `do` | Post-update hook (string or funcref) |
|
|
||||||
"| `on` | On-demand loading: Commands or `<Plug>`-mappings |
|
|
||||||
"| `for` | On-demand loading: File types |
|
|
||||||
"| `frozen` | Do not update unless explicitly specified |
|
|
||||||
"
|
|
||||||
" More information: https://github.com/junegunn/vim-plug
|
" More information: https://github.com/junegunn/vim-plug
|
||||||
"
|
"
|
||||||
"
|
|
||||||
" Copyright (c) 2017 Junegunn Choi
|
" Copyright (c) 2017 Junegunn Choi
|
||||||
"
|
"
|
||||||
" MIT License
|
" MIT License
|
||||||
|
|||||||
216
.vimrc
216
.vimrc
@ -1,216 +0,0 @@
|
|||||||
" _
|
|
||||||
" __ _(_)_ __ ___ _ __ ___
|
|
||||||
" \ \ / / | '_ ` _ \| '__/ __|
|
|
||||||
" \ V /| | | | | | | | | (__
|
|
||||||
" \_/ |_|_| |_| |_|_| \___|
|
|
||||||
|
|
||||||
let mapleader =" "
|
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
|
||||||
Plug 'junegunn/goyo.vim'
|
|
||||||
Plug 'PotatoesMaster/i3-vim-syntax'
|
|
||||||
Plug 'jreybert/vimagit'
|
|
||||||
Plug 'LukeSmithxyz/vimling'
|
|
||||||
Plug 'vimwiki/vimwiki'
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
" Some basics:
|
|
||||||
set nocompatible
|
|
||||||
filetype plugin on
|
|
||||||
syntax on
|
|
||||||
set encoding=utf-8
|
|
||||||
set number relativenumber
|
|
||||||
" Enable autocompletion:
|
|
||||||
set wildmode=longest,list,full
|
|
||||||
" Disables automatic commenting on newline:
|
|
||||||
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>
|
|
||||||
|
|
||||||
" Spell-check set to <leader>o, 'o' for 'orthography':
|
|
||||||
map <leader>o :setlocal spell! spelllang=en_us<CR>
|
|
||||||
|
|
||||||
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
|
|
||||||
set splitbelow splitright
|
|
||||||
|
|
||||||
" Shortcutting split navigation, saving a keypress:
|
|
||||||
map <C-h> <C-w>h
|
|
||||||
map <C-j> <C-w>j
|
|
||||||
map <C-k> <C-w>k
|
|
||||||
map <C-l> <C-w>l
|
|
||||||
|
|
||||||
" Check file in shellcheck:
|
|
||||||
map <leader>s :!clear && shellcheck %<CR>
|
|
||||||
|
|
||||||
" Open my bibliography file in split
|
|
||||||
map <leader>b :vsp<space>$BIB<CR>
|
|
||||||
map <leader>r :vsp<space>$REFER<CR>
|
|
||||||
|
|
||||||
" Replace all is aliased to S.
|
|
||||||
nnoremap S :%s//g<Left><Left>
|
|
||||||
|
|
||||||
" Compile document, be it groff/LaTeX/markdown/etc.
|
|
||||||
map <leader>c :w! \| !compiler <c-r>%<CR><CR>
|
|
||||||
|
|
||||||
" Open corresponding .pdf/.html or preview
|
|
||||||
map <leader>p :!opout <c-r>%<CR><CR>
|
|
||||||
|
|
||||||
" Runs a script that cleans out tex build files whenever I close out of a .tex file.
|
|
||||||
autocmd VimLeave *.tex !texclear %
|
|
||||||
|
|
||||||
" Ensure files are read as what I want:
|
|
||||||
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'}
|
|
||||||
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
|
|
||||||
autocmd BufRead,BufNewFile *.ms,*.me,*.mom,*.man set filetype=groff
|
|
||||||
autocmd BufRead,BufNewFile *.tex set filetype=tex
|
|
||||||
|
|
||||||
" Readmes autowrap text:
|
|
||||||
autocmd BufRead,BufNewFile *.md set tw=79
|
|
||||||
|
|
||||||
" Use urlscan to choose and open a url:
|
|
||||||
:noremap <leader>u :w<Home> !urlscan -r 'linkhandler {}'<CR>
|
|
||||||
:noremap ,, !urlscan -r 'linkhandler {}'<CR>
|
|
||||||
|
|
||||||
" Copy selected text to system clipboard (requires gvim/nvim/vim-x11 installed):
|
|
||||||
vnoremap <C-c> "+y
|
|
||||||
map <C-p> "+P
|
|
||||||
|
|
||||||
" 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
|
|
||||||
|
|
||||||
" Automatically deletes all trailing whitespace on save.
|
|
||||||
autocmd BufWritePre * %s/\s\+$//e
|
|
||||||
|
|
||||||
" When shortcut files are updated, renew bash and ranger configs with new material:
|
|
||||||
autocmd BufWritePost ~/.bm* !shortcuts
|
|
||||||
|
|
||||||
" Run xrdb whenever Xdefaults or Xresources are updated.
|
|
||||||
autocmd BufWritePost ~/.Xresources,~/.Xdefaults !xrdb %
|
|
||||||
|
|
||||||
" Navigating with guides
|
|
||||||
inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
|
|
||||||
vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
|
|
||||||
map <Space><Tab> <Esc>/<++><Enter>"_c4l
|
|
||||||
|
|
||||||
"____ _ _
|
|
||||||
"/ ___| _ __ (_)_ __ _ __ ___| |_ ___
|
|
||||||
"\___ \| '_ \| | '_ \| '_ \ / _ \ __/ __|
|
|
||||||
"___) | | | | | |_) | |_) | __/ |_\__ \
|
|
||||||
"|____/|_| |_|_| .__/| .__/ \___|\__|___/
|
|
||||||
"|_| |_|
|
|
||||||
|
|
||||||
"""LATEX
|
|
||||||
" Word count:
|
|
||||||
autocmd FileType tex map <leader><leader>o :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
|
|
||||||
autocmd FileType tex inoremap ,exe \begin{exe}<Enter>\ex<Space><Enter>\end{exe}<Enter><Enter><++><Esc>3kA
|
|
||||||
autocmd FileType tex inoremap ,em \emph{}<++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,bf \textbf{}<++><Esc>T{i
|
|
||||||
autocmd FileType tex vnoremap , <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a
|
|
||||||
autocmd FileType tex inoremap ,it \textit{}<++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,ct \textcite{}<++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,cp \parencite{}<++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,glos {\gll<Space><++><Space>\\<Enter><++><Space>\\<Enter>\trans{``<++>''}}<Esc>2k2bcw
|
|
||||||
autocmd FileType tex inoremap ,x \begin{xlist}<Enter>\ex<Space><Enter>\end{xlist}<Esc>kA<Space>
|
|
||||||
autocmd FileType tex inoremap ,ol \begin{enumerate}<Enter><Enter>\end{enumerate}<Enter><Enter><++><Esc>3kA\item<Space>
|
|
||||||
autocmd FileType tex inoremap ,ul \begin{itemize}<Enter><Enter>\end{itemize}<Enter><Enter><++><Esc>3kA\item<Space>
|
|
||||||
autocmd FileType tex inoremap ,li <Enter>\item<Space>
|
|
||||||
autocmd FileType tex inoremap ,ref \ref{}<Space><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,tab \begin{tabular}<Enter><++><Enter>\end{tabular}<Enter><Enter><++><Esc>4kA{}<Esc>i
|
|
||||||
autocmd FileType tex inoremap ,ot \begin{tableau}<Enter>\inp{<++>}<Tab>\const{<++>}<Tab><++><Enter><++><Enter>\end{tableau}<Enter><Enter><++><Esc>5kA{}<Esc>i
|
|
||||||
autocmd FileType tex inoremap ,can \cand{}<Tab><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,con \const{}<Tab><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,v \vio{}<Tab><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,a \href{}{<++>}<Space><++><Esc>2T{i
|
|
||||||
autocmd FileType tex inoremap ,sc \textsc{}<Space><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,chap \chapter{}<Enter><Enter><++><Esc>2kf}i
|
|
||||||
autocmd FileType tex inoremap ,sec \section{}<Enter><Enter><++><Esc>2kf}i
|
|
||||||
autocmd FileType tex inoremap ,ssec \subsection{}<Enter><Enter><++><Esc>2kf}i
|
|
||||||
autocmd FileType tex inoremap ,sssec \subsubsection{}<Enter><Enter><++><Esc>2kf}i
|
|
||||||
autocmd FileType tex inoremap ,st <Esc>F{i*<Esc>f}i
|
|
||||||
autocmd FileType tex inoremap ,beg \begin{DELRN}<Enter><++><Enter>\end{DELRN}<Enter><Enter><++><Esc>4k0fR:MultipleCursorsFind<Space>DELRN<Enter>c
|
|
||||||
autocmd FileType tex inoremap ,up <Esc>/usepackage<Enter>o\usepackage{}<Esc>i
|
|
||||||
autocmd FileType tex nnoremap ,up /usepackage<Enter>o\usepackage{}<Esc>i
|
|
||||||
autocmd FileType tex inoremap ,tt \texttt{}<Space><++><Esc>T{i
|
|
||||||
autocmd FileType tex inoremap ,bt {\blindtext}
|
|
||||||
autocmd FileType tex inoremap ,nu $\varnothing$
|
|
||||||
autocmd FileType tex inoremap ,col \begin{columns}[T]<Enter>\begin{column}{.5\textwidth}<Enter><Enter>\end{column}<Enter>\begin{column}{.5\textwidth}<Enter><++><Enter>\end{column}<Enter>\end{columns}<Esc>5kA
|
|
||||||
autocmd FileType tex inoremap ,rn (\ref{})<++><Esc>F}i
|
|
||||||
|
|
||||||
"""HTML
|
|
||||||
autocmd FileType html inoremap ,b <b></b><Space><++><Esc>FbT>i
|
|
||||||
autocmd FileType html inoremap ,it <em></em><Space><++><Esc>FeT>i
|
|
||||||
autocmd FileType html inoremap ,1 <h1></h1><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,2 <h2></h2><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,3 <h3></h3><Enter><Enter><++><Esc>2kf<i
|
|
||||||
autocmd FileType html inoremap ,p <p></p><Enter><Enter><++><Esc>02kf>a
|
|
||||||
autocmd FileType html inoremap ,a <a<Space>href=""><++></a><Space><++><Esc>14hi
|
|
||||||
autocmd FileType html inoremap ,e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
|
|
||||||
autocmd FileType html inoremap ,ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
|
|
||||||
autocmd FileType html inoremap ,li <Esc>o<li></li><Esc>F>a
|
|
||||||
autocmd FileType html inoremap ,ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
|
|
||||||
autocmd FileType html inoremap ,im <img src="" alt="<++>"><++><esc>Fcf"a
|
|
||||||
autocmd FileType html inoremap ,td <td></td><++><Esc>Fdcit
|
|
||||||
autocmd FileType html inoremap ,tr <tr></tr><Enter><++><Esc>kf<i
|
|
||||||
autocmd FileType html inoremap ,th <th></th><++><Esc>Fhcit
|
|
||||||
autocmd FileType html inoremap ,tab <table><Enter></table><Esc>O
|
|
||||||
autocmd FileType html inoremap ,gr <font color="green"></font><Esc>F>a
|
|
||||||
autocmd FileType html inoremap ,rd <font color="red"></font><Esc>F>a
|
|
||||||
autocmd FileType html inoremap ,yl <font color="yellow"></font><Esc>F>a
|
|
||||||
autocmd FileType html inoremap ,dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
|
|
||||||
autocmd FileType html inoremap ,dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
|
|
||||||
autocmd FileType html inoremap &<space> &<space>
|
|
||||||
autocmd FileType html inoremap á á
|
|
||||||
autocmd FileType html inoremap é é
|
|
||||||
autocmd FileType html inoremap í í
|
|
||||||
autocmd FileType html inoremap ó ó
|
|
||||||
autocmd FileType html inoremap ú ú
|
|
||||||
autocmd FileType html inoremap ä ä
|
|
||||||
autocmd FileType html inoremap ë ë
|
|
||||||
autocmd FileType html inoremap ï ï
|
|
||||||
autocmd FileType html inoremap ö ö
|
|
||||||
autocmd FileType html inoremap ü ü
|
|
||||||
autocmd FileType html inoremap ã ã
|
|
||||||
autocmd FileType html inoremap ẽ &etilde;
|
|
||||||
autocmd FileType html inoremap ĩ ĩ
|
|
||||||
autocmd FileType html inoremap õ õ
|
|
||||||
autocmd FileType html inoremap ũ ũ
|
|
||||||
autocmd FileType html inoremap ñ ñ
|
|
||||||
autocmd FileType html inoremap à à
|
|
||||||
autocmd FileType html inoremap è è
|
|
||||||
autocmd FileType html inoremap ì ì
|
|
||||||
autocmd FileType html inoremap ò ò
|
|
||||||
autocmd FileType html inoremap ù ù
|
|
||||||
|
|
||||||
|
|
||||||
""".bib
|
|
||||||
autocmd FileType bib inoremap ,a @article{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>journal<Space>=<Space>{<++>},<Enter>volume<Space>=<Space>{<++>},<Enter>pages<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i
|
|
||||||
autocmd FileType bib inoremap ,b @book{<Enter>author<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>6kA,<Esc>i
|
|
||||||
autocmd FileType bib inoremap ,c @incollection{<Enter>author<Space>=<Space>{<++>},<Enter>title<Space>=<Space>{<++>},<Enter>booktitle<Space>=<Space>{<++>},<Enter>editor<Space>=<Space>{<++>},<Enter>year<Space>=<Space>{<++>},<Enter>publisher<Space>=<Space>{<++>},<Enter>}<Enter><++><Esc>8kA,<Esc>i
|
|
||||||
|
|
||||||
"MARKDOWN
|
|
||||||
autocmd Filetype markdown,rmd map <leader>w yiWi[<esc>Ea](<esc>pa)
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,n ---<Enter><Enter>
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,b ****<++><Esc>F*hi
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,s ~~~~<++><Esc>F~hi
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,e **<++><Esc>F*i
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,h ====<Space><++><Esc>F=hi
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,i <++><Esc>F[a
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,a [](<++>)<++><Esc>F[a
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,1 #<Space><Enter><++><Esc>kA
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,2 ##<Space><Enter><++><Esc>kA
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,3 ###<Space><Enter><++><Esc>kA
|
|
||||||
autocmd Filetype markdown,rmd inoremap ,l --------<Enter>
|
|
||||||
autocmd Filetype rmd inoremap ,r ```{r}<CR>```<CR><CR><esc>2kO
|
|
||||||
autocmd Filetype rmd inoremap ,p ```{python}<CR>```<CR><CR><esc>2kO
|
|
||||||
autocmd Filetype rmd inoremap ,c ```<cr>```<cr><cr><esc>2kO
|
|
||||||
|
|
||||||
""".xml
|
|
||||||
autocmd FileType xml inoremap ,e <item><Enter><title><++></title><Enter><guid<space>isPermaLink="false"><++></guid><Enter><pubDate><Esc>:put<Space>=strftime('%a, %d %b %Y %H:%M:%S %z')<Enter>kJA</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>?<title><enter>cit
|
|
||||||
autocmd FileType xml inoremap ,a <a href="<++>"><++></a><++><Esc>F"ci"
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user