1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-27 21:19:51 -05:00

Update configs and move to methods

This commit is contained in:
Jack 2017-12-06 15:38:22 -05:00
parent 7889ce26d6
commit c33d08a6be
Signed by: foltik
GPG Key ID: 303F88F996E95541
6 changed files with 253 additions and 122 deletions

View File

@ -1,4 +1,11 @@
#!/bin/bash
idx=$(( (RANDOM % 3) + 1))
feh --bg-scale /home/lain/Pictures/wallpaper$idx.jpg
killall -q xwinwrap
idx=$(( (RANDOM % 5) + 1))
if [[ $idx -eq 5 ]];
then
xwinwrap -ov -fs -- gifview -w WID -a /home/lain/Pictures/wallpaper.gif 2>/dev/null
else
feh --bg-scale /home/lain/Pictures/wallpaper$idx.jpg
fi

View File

@ -18,7 +18,7 @@
## MPD clients (eg. ncmpc) also use that location.
##
#
#lyrics_directory = ~/.lyrics
lyrics_directory = ~/.lyrics
#
##### connection settings #####
#
@ -30,7 +30,7 @@
#
## Needed for tag editor and file operations to work.
##
#mpd_music_dir = ~/music
mpd_music_dir = ~/Music/beets
#
#mpd_crossfade_time = 5
#
@ -192,17 +192,17 @@ visualizer_color = 34, 64, 57, 94, 164, 198
#
#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
#
current_item_prefix = $(magenta)$r
current_item_prefix = $(magenta)$b
#
#current_item_suffix = $/r$(end)
current_item_suffix = $/b$(end)
#
#current_item_inactive_column_prefix = $(white)$r
#
#current_item_inactive_column_suffix = $/r$(end)
#
#now_playing_prefix = $b
now_playing_prefix = $r
#
#now_playing_suffix = $/b
now_playing_suffix = $/r
#
#browser_playlist_prefix = "$2playlist$9 "
#
@ -431,14 +431,14 @@ progressbar_look = ─╼─
## Note: if below is enabled, ncmpcpp will ignore leading "The" word while
## sorting items in browser, tags in media library, etc.
##
ignore_leading_the = yes
#ignore_leading_the = no
#
##
## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and
## filtering lists. This takes an effect only if boost was compiled with ICU
## support.
##
ignore_diacritics = no
#ignore_diacritics = no
#
#block_search_constraints_change_if_items_found = yes
#

120
cfg/nvim/init.vim Normal file
View File

@ -0,0 +1,120 @@
runtime! archlinux.vim
let g:python_host_prog = '/usr/bin/python2.7'
let g:python3_host_prog = '/usr/bin/python3'
call plug#begin('~/.local/share/nvim/plugged')
Plug 'xolox/vim-misc'
Plug 'xolox/vim-easytags'
Plug 'jiangmiao/auto-pairs'
Plug 'scrooloose/nerdtree'
Plug 'fidian/hexmode'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'majutsushi/tagbar'
Plug 'neomake/neomake'
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
call plug#end()
filetype plugin indent on
syntax enable
" disable beeping
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif
set laststatus=2
set showtabline=1
set noshowmode
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
set selectmode=mouse
set mouse=a
set nobackup
set nowritebackup
set history=50
set ruler
set backspace=indent,eol,start
set autoread
set wildmenu
set number
set encoding=utf-8
set incsearch " CTRL-G and CTRL-T keys to move to the next and previous match
" Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>
endif
colorscheme SerialExperimentsLain
" Plugin configs
" Tagbar
nmap <F8> :TagbarToggle<CR>
" Airline
let g:airline_theme='simple'
let g:airline_powerline_fonts=1
" Easytags
let g:easytags_async = 1 " Might not work lmao
set tags=./tags;
let g:easytags_dynamic_files = 1 " Per-project tags files
:let g:easytags_resolve_links = 1 " Resolve hard/soft links in UNIX
" Hex editor mode
map <C-h> :Hexmode<CR> " ctrl + h
let g:hexmode_patterns = '*.bin,*.exe,*.dat,*.o,*.out'
let g:hexmode_autodetect = 1
" Nerd Tree
map <C-n> :NERDTreeToggle<CR>
" syntastic (unused)
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
"
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" Neovim specific stuff below
" Neomake
function! MyOnBattery()
if filereadable('/sys/class/power_supply/AC/online')
return readfile('/sys/class/power_supply/AC/online') == ['0']
endif
return 0
endfunction
if MyOnBattery()
call neomake#configure#automake('w')
else
call neomake#configure#automake('nw', 1000)
endif
" deoplete
call deoplete#enable()

View File

@ -33,7 +33,7 @@ HIST_STAMPS="yyyy-mm-dd"
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
plugins=(git archlinux autojump command-not-found)
### User configuration
@ -43,7 +43,7 @@ export MANPATH="/usr/local/man:$MANPATH"
export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
export EDITOR='vim'
export EDITOR='nvim'
# Compilation flags
export ARCHFLAGS="-arch x86_64"
@ -66,3 +66,33 @@ if [[ ! -d $ZSH_CACHE_DIR ]]; then
fi
source $ZSH/oh-my-zsh.sh
export PATH="$HOME/opt/i686-elf/bin:$PATH"
alias vpnon="sudo systemctl start openvpn-client@BoltWolf"
alias vpnoff="sudo systemctl stop openvpn-client@BoltWolf"
alias vim=nvim
function masm() (
set -e
export WINEPREFIX=~/.wine-masm
FILENAME="$(basename "$1")"
EXT="${FILENAME##*.}"
if [[ "$EXT" = "asm" ]]; then
FILENAME="${FILENAME%.*}"
fi
UNIX_PATH="$(dirname "$1")/$FILENAME"
WINDOWS_PATH=$(echo "$UNIX_PATH" | tr '/' '\\')
wine ml -nologo -c -coff -Zi "$WINDOWS_PATH.asm"
wine link /NOLOGO /SUBSYSTEM:CONSOLE /ENTRY:main \
/LIBPATH:'C:\Irvine' \
irvine32.lib kernel32.lib user32.lib "$WINDOWS_PATH.obj"
rm $UNIX_PATH.obj
wine "$WINDOWS_PATH.exe"
)

View File

@ -1,97 +1,78 @@
#!/bin/zsh
# Print Header
lnh() {
print -Pn '%B%F{green}### '
print -n $1
print -P ' ###%f%b'
}
lnf() {
print -Pn '%B%F{yellow}>>>%f%b '
}
lnfb() {
print -P '%B%F{yellow}[[[%f%b'
}
lnfbe() {
print -P '%B%F{yellow}]]]'
}
# Print subheader
ln() {
Print -Pn '%B%F{yellow}>>> '
Print -n $1
Print -P '%f%b'
print -Pn '%B%F{yellow}>>> '
print -n $1
print -P '%f%b'
}
pac_install() {
if ! (pacman -Q $1 >/dev/null 2>&1);
then
ln "Installing $1 from Official Repos..."
sudo pacman -S $1 --noconfirm
fi;
}
aur_install() {
if ! (pacman -Q $1 >/dev/null 2>&1);
then
ln "Installing $1 from AUR..."
yaourt -S $1 --noconfirm
fi;
}
svc_install() {
sudo cp -v "$1" '/etc/systemd/system'
}
svc_install_user() {
sudo cp -v "$1" '/etc/systemd/user'
}
svc_enable() {
sudo systemctl enable $1
}
svc_enable_user() {
systemctl --user enable $1
}
install_i3() {
# Install Packages
if ! (pacman -Q i3-gaps >/dev/null 2>&1);
then
lnh "Installing i3-gaps from AUR..."
yaourt -S i3-gaps --noconfirm
fi;
lnh "Installing i3"
if ! (pacman -Q i3blocks-gaps-git >/dev/null 2>&1);
then
lnh "Installing i3blocks-gaps-git from AUR..."
yaourt -S i3blocks-gaps-git --noconfirm
fi;
ln "Installing Packages"
aur_install i3-gaps
aur_install i3blocks-gaps-git
aur_install i3lock
aur_install i3lock-fancy-dualmonitors-git
pac_install compton
if ! (pacman -Q i3lock >/dev/null 2>&1);
then
lnh "Installing i3lock"
pacman -S i3lock --noconfirm
fi;
ln "Installing Services"
svc_install cfg/systemd/system/suspend@.service # suspend locker
svc_install_user cfg/systemd/user/locker.service # xautolock
if ! (pacman -Q i3lock-fancy-dualmonitors-git >/dev/null 2>&1);
then
lnh "Installing i3lock-fancy"
yaourt -S i3lock-fancy-dualmonitors-git --noconfirm
fi;
if ! (pacman -Q compton >/dev/null 2>&1);
then
lnh "Installing Compton..."
pacman -S compton --noconfirm
fi;
### Install Service Files
lnh "Installing Services"
# Suspend locker
lnf
sudo cp -v cfg/systemd/system/suspend@.service /etc/systemd/system/
# Auto locker
lnf
sudo cp -v cfg/systemd/user/locker.service /etc/systemd/user
ln "Enabling Services"
sudo systemctl daemon-reload
lnh "Enabling Services"
lnf
sudo systemctl enable suspend@$USER.service
lnf
systemctl --user enable locker.service
svc_enable suspend@$USER.service
svc_enable_user locker.service
### Install Configuration Files
lnh "Installing General Configuration Files"
# Compton
lnf
ln "Installing Configuration Files"
cp -v cfg/compton/config ~/.config/compton/config
# NCMPCPP ws10 config
lnf
cp -v cfg/termite/ncmpcpp_config ~/.config/termite/ncmpcpp_config
### Install Tools
lnh "Installing General Tools"
lnf
ln "Installing Tools"
mkdir -pv ~/Documents/tools
# Wallpaper Tool
lnf
cp -v cfg/i3/tools/wallpaper.sh ~/Documents/tools/
lnfb
cp -v cfg/wallpapers/wallpaper* ~/Pictures/
lnfbe
lnh "Select a Platform"
platform_opt=("Desktop" "Laptop")
@ -99,10 +80,11 @@ install_i3() {
do
case $opt in
"Desktop")
lnh "Platform Not Supported with i3"
exit
break
;;
"Laptop")
lnh "Installing i3"
install_i3_laptop
break
;;
@ -112,58 +94,47 @@ install_i3() {
}
install_i3_laptop() {
lnh "Installing Laptop Configuration Files"
# i3blocks
lnf
ln "Installing Laptop Configuration Files"
cp -v cfg/i3blocks/laptop/config ~/.config/i3blocks/config
lnfb
cp -rv cfg/i3blocks/laptop/blocks ~/.config/i3blocks/blocks
lnfbe
}
configure_common() {
### Install Config Files
lnh "Installing Common Configuration Files"
ln "Installing Common Configuration Files"
# powerlevel9k
sudo git clone https://github.com/bhilburn/powerlevel9k.git /usr/share/oh-my-zsh/themes/powerlevel9k
# ZSH
lnf
cp -v cfg/zshrc ~/.zshrc
# VIM
lnf
cp -v cfg/vimrc ~/.vimrc
vim +PlugInstall +qall
# MPD
awk '{gsub(/lain/,"'$USER'")}1' cfg/mpd/mpd.conf > mpd.conf.temp && mv mpd.conf.temp cfg/mpd/mpd.conf
lnfb
cp -rv cfg/mpd ~/.mpd
lnfbe
lnf
mkdir -pv ~/Music/beets
# NCMPCPP
lnf
cp -v cfg/ncmpcpp ~/.ncmpcpp
# Beets
lnfb
# zsh
cp -v cfg/zshrc ~/.zshrc
# neovim
cp -v cfg/nvim/init.vim ~/.config/nvim
nvim +PlugInstall +qall
# mpd
awk '{gsub(/lain/,"'$USER'")}1' cfg/mpd/mpd.conf > mpd.conf.temp && mv mpd.conf.temp cfg/mpd/mpd.conf
cp -rv cfg/mpd ~/.config/mpd
# beets
mkdir -pv ~/Music/beets
cp -rv cfg/beets ~/.config/beets
lnfbe
### Install Services
# MPD
systemctl --user enable mpd.service
systemctl --user start mpd.service
# NetworkManager
sudo systemctl enable NetworkManager.service
sudo systemctl start NetworkManager.service
# ncmpcpp
cp -v cfg/ncmpcpp/config ~/.ncmpcpp/
ln "Installing Common Services"
svc_enable_user mpd
svc_enable NetworkManager
}
echo "Select a Window Manager"
lnh "Select a Window Manager"
wm_opt=("Gnome" "i3")
select opt in "${wm_opt[@]}"
do
case $opt in
"Gnome")
echo "gnome"
lnh "Window Manager Not Supported"
exit
break
;;
"i3")
@ -173,3 +144,5 @@ do
*) echo "Invalid Option";;
esac
done
configure_common

View File

@ -2,8 +2,9 @@ ttf-vlgothic AUR
nerd-fonts-complete AUR
termite
vim
vim-plug
nvim
ctags
# vim-plug --- clone from github
mpd
mpc