From: Daniel Liu Date: Tue, 15 Jun 2021 02:45:18 +0000 (-0400) Subject: new scripts X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=b156356b96d0bd00229a145be24c6825ec309a2c;p=dotfiles.git new scripts --- diff --git a/.config/shell/commonrc b/.config/shell/commonrc index dbea038..e9a7df0 100644 --- a/.config/shell/commonrc +++ b/.config/shell/commonrc @@ -13,6 +13,9 @@ alias refreshusb='udevadm control --reload-rules' alias vpnup='nmcli connection up pinovpn' alias drill-srs='drill-srs 2>/dev/null' alias scrkey='screenkey -t 2.5 --mods-mode emacs -s small -p fixed -g $(slop -n -f '%g')' +alias mdp='export TERM=st; mdp' +alias R='R --vanilla' +alias fzf="fzf --color=16 --header=peee --info=inline --preview='echo {}; file -b {}; echo =-=-=-=-=-=-=-=-=-=-=-=-=-=; head -$LINES {}'" alias v="$EDITOR" alias z="$READER" diff --git a/.vim/mysnippets/tex.snippets b/.vim/mysnippets/tex.snippets index 292727a..040304f 100644 --- a/.vim/mysnippets/tex.snippets +++ b/.vim/mysnippets/tex.snippets @@ -303,3 +303,32 @@ snippet graph "Graph" w \end{axis} \end{tikzpicture} endsnippet + +snippet ffig "Figure" w +\begin{figure}[H] + \centering + \includegraphics[scale=1]{$1} + \caption{$2} +\end{figure} +endsnippet + +snippet ftab "Table" w +\begin{table}[H] +\centering +\caption{$1} +\begin{tabular}{$2} + \hline + $3 + \hline + \hline +\end{tabular} +\end{table} +endsnippet + +snippet b "bold" w +\textbf{$1}$0 +endsnippet + +snippet i "italics" w +\emph{$1}$0 +endsnippet diff --git a/.vim/templates/skeleton.tex b/.vim/templates/skeleton.tex index ed1ec59..45658f6 100644 --- a/.vim/templates/skeleton.tex +++ b/.vim/templates/skeleton.tex @@ -22,6 +22,7 @@ \import{./resources/}{#2.pdf_tex} } +% formatting \titleformat{\section} {\large\bfseries}{}{0em}{}[\titlerule] \titlespacing{\section} @@ -39,6 +40,10 @@ \thedate \end{center} } + +% commands +\newcommand{\euler}{e} + \begin{document} \parindent=0pt diff --git a/.vimrc b/.vimrc index 29ceed1..56cc40c 100644 --- a/.vimrc +++ b/.vimrc @@ -10,11 +10,12 @@ syntax on set number set relativenumber set incsearch -set smartcase set encoding=utf-8 set tabstop=4 set shiftwidth=4 set expandtab +set ignorecase +set smartcase set nrformats+=alpha "inc/dec alpha set hidden @@ -110,6 +111,11 @@ set statusline+=\ %r\[%{v:register}\] set statusline+=\ %l/%L:%c\ | set statusline+=%1*\ | +" Tab line +hi TabLineSel cterm=Bold ctermfg=Yellow +hi TabLine cterm=None ctermfg=Grey ctermbg=Black +hi TabLineFill cterm=None ctermbg=Black + " Templates augroup templates autocmd BufNewFile *.tex 0r ~/.vim/templates/skeleton.tex @@ -132,10 +138,10 @@ call plug#begin('~/.vim/plugged') Plug 'sirver/ultisnips' Plug 'lervag/vimtex' Plug 'PietroPate/vim-tex-conceal' -Plug 'jiangmiao/auto-pairs' +" Plug 'jiangmiao/auto-pairs' Plug 'tpope/vim-commentary' Plug 'rlue/vim-barbaric' -Plug 'ap/vim-css-color' +Plug 'ap/vim-buftabline' call plug#end() @@ -163,16 +169,13 @@ let g:vimtex_compiler_latexmk = { " \ '-shell-escape', " \], -" Ctrlp -" let g:ctrlp_cmd='CtrlPTag' - -" Lf -" let g:lf_replace_netrw = 1 " weird behavior rn - " vim-barbaric let g:barbaric_ime = 'ibus' set ttimeoutlen=0 +" buftabline +let g:buftabline_show = 1 + " Run after plugins autocmd FileType * set formatoptions-=o @@ -196,9 +199,6 @@ hi SpellRare ctermbg=13 ctermbg=0 cterm=underline hi SpellLocal ctermfg=14 ctermbg=0 cterm=underline hi PmenuSbar ctermbg=8 hi PmenuThumb ctermbg=0 -hi TabLine cterm=underline ctermfg=0 ctermbg=7 -hi TabLineSel cterm=bold -hi TabLineFill cterm=reverse hi CursorColumn ctermbg=7 hi CursorLine cterm=underline hi MatchParen cterm=NONE ctermfg=0 ctermbg=14 @@ -212,7 +212,7 @@ hi Underlined cterm=underline ctermfg=5 hi Ignore ctermfg=15 hi Error ctermfg=15 ctermbg=9 hi Todo ctermfg=0 ctermbg=11 -hi Comment ctermfg=7 +hi Comment ctermfg=DarkGrey hi lineNr ctermfg=DarkGrey hi Folded ctermfg=0 diff --git a/.xinitrc b/.xinitrc index 593d27d..e6fde30 100644 --- a/.xinitrc +++ b/.xinitrc @@ -26,13 +26,13 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then fi # bg -feh --bg-center "$(ls -d $HOME/Downloads/wallpapers/active/* | sort -R | tail -n1)" - +setwallpaper # start some daemons dwmblocks & tiramisu -j | notify & acpi_listen & -redshift -l 55.7:12.6 -t 3000:3000 -g 0.85 -m randr -v & +redshift -m randr:crtc=0 -O 3000 +# redshift -l 55.7:12.6 -t 3000:3000 -g 1 -m randr -v & sxhkd & mpd & mpd-change & diff --git a/Scripts/monitor-attach b/Scripts/monitor-attach new file mode 100755 index 0000000..05eac0a --- /dev/null +++ b/Scripts/monitor-attach @@ -0,0 +1,13 @@ +#!/bin/sh + +xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync +xrandr --addmode VGA1 "1920x1080_60.00" +xrandr --auto --output VGA1 --mode 1920x1080_60.00 --right-of LVDS1 + +# redshift +redshift -x +redshift -m randr:crtc=0 -O 3000 +redshift -m randr:crtc=1 -O 5000 + +# need to reset wallpaper too +setwallpaper diff --git a/Scripts/monitor-detach b/Scripts/monitor-detach new file mode 100755 index 0000000..661da5c --- /dev/null +++ b/Scripts/monitor-detach @@ -0,0 +1,3 @@ +#!/bin/sh + +xrandr --output VGA1 --off diff --git a/Scripts/setwallpaper b/Scripts/setwallpaper new file mode 100755 index 0000000..a4ed037 --- /dev/null +++ b/Scripts/setwallpaper @@ -0,0 +1,3 @@ +#!/bin/sh + +feh --bg-fill "$(ls -d $HOME/Downloads/wallpapers/active/* | sort -R | tail -n1)"