Add Desktop Files

master
DustyP 5 years ago
parent 6d93a8c225
commit 9060606810

3
.gitmodules vendored

@ -0,0 +1,3 @@
[submodule "config/zsh/plugins/zsh-autosuggestions"]
path = config/zsh/plugins/zsh-autosuggestions
url = https://github.com/zsh-users/zsh-autosuggestions

@ -0,0 +1,551 @@
# Configuration for Alacritty, the GPU enhanced terminal emulator.
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty itself.
env:
# TERM variable
#
# This value is used to set the `$TERM` environment variable for
# each instance of Alacritty. If it is not present, alacritty will
# check the local terminfo database and use `alacritty` if it is
# available, otherwise `xterm-256color` is used.
TERM: xterm-256color
window:
# Window dimensions (changes require restart)
#
# Specified in number of columns/lines, not pixels.
# If both are `0`, this setting is ignored.
#dimensions:
# columns: 0
# lines: 0
# Window position (changes require restart)
#
# Specified in number of pixels.
# If the position is not set, the window manager will handle the placement.
#position:
# x: 0
# y: 0
# Window padding (changes require restart)
#
# Blank space added around the window in pixels. This padding is scaled
# by DPI and the specified value is always added at both opposing sides.
padding:
x: 4
y: 4
# Spread additional padding evenly around the terminal content.
#dynamic_padding: false
# Window decorations
#
# Values for `decorations`:
# - full: Borders and title bar
# - none: Neither borders nor title bar
#
# Values for `decorations` (macOS only):
# - transparent: Title bar, transparent background and title bar buttons
# - buttonless: Title bar, transparent background, but no title bar buttons
decorations: full
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
#startup_mode: Windowed
# Window title
#title: Alacritty
# Window class (Linux/BSD only):
#class:
# Application instance name
#instance: Alacritty
# General application class
#general: Alacritty
# GTK theme variant (Linux/BSD only)
#
# Override the variant of the GTK theme. Commonly supported values are `dark` and `light`.
# Set this to `None` to use the default theme variant.
#gtk_theme_variant: None
#scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
#history: 10000
# Number of lines the viewport will move for every line scrolled when
# scrollback is enabled (history > 0).
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
normal:
# Font family
#
# Default:
# - (macOS) Menlo
# - (Linux/BSD) monospace
# - (Windows) Consolas
family: DejaVuSansMono Nerd Font
# The `style` can be specified to pick a specific face.
style: Regular
# Bold font face
bold:
# Font family
#
# If the bold family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold
# Italic font face
italic:
# Font family
#
# If the italic family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font
# The `style` can be specified to pick a specific face.
style: Italic
# Bold italic font face
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: DejaVuSansMono Nerd Font
# The `style` can be specified to pick a specific face.
style: Bold Italic
# Point size
size: 8
# Offset is the extra space around each character. `offset.y` can be thought of
# as modifying the line spacing, and `offset.x` as modifying the letter spacing.
#offset:
# x: 0
# y: 0
# Glyph offset determines the locations of the glyphs within their cells with
# the default being at the bottom. Increasing `x` moves the glyph to the right,
# increasing `y` moves the glyph upwards.
#glyph_offset:
# x: 0
# y: 0
# Thin stroke font rendering (macOS only)
#
# Thin strokes are suitable for retina displays, but for non-retina screens
# it is recommended to set `use_thin_strokes` to `false`
#
# macOS >= 10.14.x:
#
# If the font quality on non-retina display looks bad then set
# `use_thin_strokes` to `true` and enable font smoothing by running the
# following command:
# `defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO`
#
# This is a global setting and will require a log out or restart to take
# effect.
#use_thin_strokes: true
# If `true`, bold text is drawn using the bright color variants.
#draw_bold_text_with_bright_colors: false
# Colors (Dracula)
colors:
# Default colors
primary:
background: '#282a36'
foreground: '#f8f8f2'
# Bright and dim foreground colors
#
# The dimmed foreground color is calculated automatically if it is not present.
# If the bright foreground color is not set, or `draw_bold_text_with_bright_colors`
# is `false`, the normal foreground color will be used.
#dim_foreground: '0x9a9a9a'
bright_foreground: '#6e46a4'
# Cursor colors
#
# Colors which should be used to draw the terminal cursor. If these are unset,
# the cursor color will be the inverse of the cell color.
cursor:
text: '#44475a'
cursor: '#f8f8f2'
# Normal colors
normal:
black: '#262626'
red: '#e64747'
green: '#42e66c'
yellow: '#e4f34a'
blue: '#9b6bdf'
magenta: '#e356a7'
cyan: '#75d7ec'
white: '#efa554'
# Bright colors
bright:
black: '#7a7a7a'
red: '#ff5555'
green: '#50fa7b'
yellow: '#f1fa8c'
blue: '#bd93f9'
magenta: '#ff79c6'
cyan: '#8be9fd'
white: '#ffb86c'
# Dim colors
#
# If the dim colors are not set, they will be calculated automatically based
# on the `normal` colors.
#dim:
# black: '#14151b'
# red: '#ff2222'
# green: '#1ef956'
# yellow: '#ebf85b'
# blue: '#4d5b86'
# magenta: '#ff46b0'
# cyan: '#59dffc'
# white: '#e6e6d1'
# Indexed Colors
#
# The indexed colors include all colors from 16 to 256.
# When these are not set, they're filled with sensible defaults.
#
# Example:
# `- { index: 16, color: '0xff00ff' }`
#
indexed_colors: []
# Visual Bell
#
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
# rung, the terminal background will be set to white and transition back to the
# default background color. You can control the rate of this transition by
# setting the `duration` property (represented in milliseconds). You can also
# configure the transition function by setting the `animation` property.
#
# Values for `animation`:
# - Ease
# - EaseOut
# - EaseOutSine
# - EaseOutQuad
# - EaseOutCubic
# - EaseOutQuart
# - EaseOutQuint
# - EaseOutExpo
# - EaseOutCirc
# - Linear
#
# Specifying a `duration` of `0` will disable the visual bell.
#visual_bell:
# animation: EaseOutExpo
# duration: 0
# color: '#ffffff'
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
background_opacity: 0.9
#selection:
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
# When set to `true`, selected text will be copied to the primary clipboard.
#save_to_clipboard: false
# Allow terminal applications to change Alacritty's window title.
#dynamic_title: true
#cursor:
# Cursor style
#
# Values for `style`:
# - ▇ Block
# - _ Underline
# - | Beam
#style: Block
# If this is `true`, the cursor will be rendered as a hollow box when the
# window is not focused.
#unfocused_hollow: true
# Live config reload (changes require restart)
#live_config_reload: true
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
# Startup directory
#
# Directory the shell is started in. If this is unset, or `None`, the working
# directory of the parent process will be used.
#working_directory: None
# WinPTY backend (Windows only)
#
# Alacritty defaults to using the newer ConPTY backend if it is available,
# since it resolves a lot of bugs and is quite a bit faster. If it is not
# available, the the WinPTY backend will be used instead.
#
# Setting this option to `true` makes Alacritty use the legacy WinPTY backend,
# even if the ConPTY backend is available.
#winpty_backend: false
# Send ESC (\x1b) before characters when alt is pressed.
#alt_send_esc: true
#mouse:
# Click settings
#
# The `double_click` and `triple_click` settings control the time
# alacritty should wait for accepting multiple clicks as one double
# or triple click.
#double_click: { threshold: 300 }
#triple_click: { threshold: 300 }
# If this is `true`, the cursor is temporarily hidden when typing.
#hide_when_typing: false
#url:
# URL launcher
#
# This program is executed when clicking on a text which is recognized as a URL.
# The URL is always added to the command as the last parameter.
#
# When set to `None`, URL launching will be disabled completely.
#
# Default:
# - (macOS) open
# - (Linux/BSD) xdg-open
# - (Windows) explorer
#launcher:
# program: xdg-open
# args: []
# URL modifiers
#
# These are the modifiers that need to be held down for opening URLs when clicking
# on them. The available modifiers are documented in the key binding section.
#modifiers: None
# Mouse bindings
#
# Mouse bindings are specified as a list of objects, much like the key
# bindings further below.
#
# To trigger mouse bindings when an application running within Alacritty captures the mouse, the
# `Shift` modifier is automatically added as a requirement.
#
# Each mouse binding will specify a:
#
# - `mouse`:
#
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# - `action` (see key bindings)
#
# And optionally:
#
# - `mods` (see key bindings)
#mouse_bindings:
# - { mouse: Middle, action: PasteSelection }
# Key bindings
#
# Key bindings are specified as a list of objects. For example, this is the
# default paste binding:
#
# `- { key: V, mods: Control|Shift, action: Paste }`
#
# Each key binding will specify a:
#
# - `key`: Identifier of the key pressed
#
# - A-Z
# - F1-F24
# - Key0-Key9
#
# A full list with available key codes can be found here:
# https://docs.rs/glutin/*/glutin/event/enum.VirtualKeyCode.html#variants
#
# Instead of using the name of the keys, the `key` field also supports using
# the scancode of the desired key. Scancodes have to be specified as a
# decimal number. This command will allow you to display the hex scancodes
# for certain keys:
#
# `showkey --scancodes`.
#
# Then exactly one of:
#
# - `chars`: Send a byte sequence to the running application
#
# The `chars` field writes the specified string to the terminal. This makes
# it possible to pass escape sequences. To find escape codes for bindings
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
# of tmux. Note that applications use terminfo to map escape sequences back
# to keys. It is therefore required to update the terminfo when changing an
# escape sequence.
#
# - `action`: Execute a predefined action
#
# - Copy
# - Paste
# - PasteSelection
# - IncreaseFontSize
# - DecreaseFontSize
# - ResetFontSize
# - ScrollPageUp
# - ScrollPageDown
# - ScrollLineUp
# - ScrollLineDown
# - ScrollToTop
# - ScrollToBottom
# - ClearHistory
# - Hide
# - Minimize
# - Quit
# - ToggleFullscreen
# - SpawnNewInstance
# - ClearLogNotice
# - ReceiveChar
# - None
#
# (macOS only):
# - ToggleSimpleFullscreen: Enters fullscreen without occupying another space
#
# - `command`: Fork and execute a specified command plus arguments
#
# The `command` field must be a map containing a `program` string and an
# `args` array of command line parameter strings. For example:
# `{ program: "alacritty", args: ["-e", "vttest"] }`
#
# And optionally:
#
# - `mods`: Key modifiers to filter binding actions
#
# - Command
# - Control
# - Option
# - Super
# - Shift
# - Alt
#
# Multiple `mods` can be combined using `|` like this:
# `mods: Control|Shift`.
# Whitespace and capitalization are relevant and must match the example.
#
# - `mode`: Indicate a binding for only specific terminal reported modes
#
# This is mainly used to send applications the correct escape sequences
# when in different modes.
#
# - AppCursor
# - AppKeypad
# - Alt
#
# A `~` operator can be used before a mode to apply the binding whenever
# the mode is *not* active, e.g. `~Alt`.
#
# Bindings are always filled by default, but will be replaced when a new
# binding with the same triggers is defined. To unset a default binding, it can
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
# a no-op if you do not wish to receive input characters for that binding.
#
# If the same trigger is assigned to multiple actions, all of them are executed
# at once.
#key_bindings:
# (Windows, Linux, and BSD only)
#- { key: V, mods: Control|Shift, action: Paste }
#- { key: C, mods: Control|Shift, action: Copy }
#- { key: Insert, mods: Shift, action: PasteSelection }
#- { key: Key0, mods: Control, action: ResetFontSize }
#- { key: Equals, mods: Control, action: IncreaseFontSize }
#- { key: Add, mods: Control, action: IncreaseFontSize }
#- { key: Subtract, mods: Control, action: DecreaseFontSize }
#- { key: Minus, mods: Control, action: DecreaseFontSize }
# (Windows only)
#- { key: Return, mods: Alt, action: ToggleFullscreen }
# (macOS only)
#- { key: Key0, mods: Command, action: ResetFontSize }
#- { key: Equals, mods: Command, action: IncreaseFontSize }
#- { key: Add, mods: Command, action: IncreaseFontSize }
#- { key: Minus, mods: Command, action: DecreaseFontSize }
#- { key: K, mods: Command, action: ClearHistory }
#- { key: K, mods: Command, chars: "\x0c" }
#- { key: V, mods: Command, action: Paste }
#- { key: C, mods: Command, action: Copy }
#- { key: H, mods: Command, action: Hide }
#- { key: M, mods: Command, action: Minimize }
#- { key: Q, mods: Command, action: Quit }
#- { key: W, mods: Command, action: Quit }
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
#- { key: Paste, action: Paste }
#- { key: Copy, action: Copy }
#- { key: L, mods: Control, action: ClearLogNotice }
#- { key: L, mods: Control, chars: "\x0c" }
#- { key: PageUp, mods: Shift, action: ScrollPageUp, mode: ~Alt }
#- { key: PageDown, mods: Shift, action: ScrollPageDown, mode: ~Alt }
#- { key: Home, mods: Shift, action: ScrollToTop, mode: ~Alt }
#- { key: End, mods: Shift, action: ScrollToBottom, mode: ~Alt }
#debug:
# Display the time it takes to redraw each frame.
#render_timer: false
# Keep the log file after quitting Alacritty.
#persistent_logging: false
# Log level
#
# Values for `log_level`:
# - None
# - Error
# - Warn
# - Info
# - Debug
# - Trace
#log_level: Warn
# Print all received window events.
#print_events: false

@ -0,0 +1,40 @@
#! /usr/bin/bash
# Workaround for: https://github.com/baskerville/bspwm/issues/52
wmname LG3D
export _JAVA_AWT_WM_NONPARENTING=1
# Fix monitors
xrandr --output DisplayPort-0 --primary --auto --output DisplayPort-1 --auto --left-of DisplayPort-0 --output HDMI-A-0 --auto --right-of DisplayPort-0
sxhkd &
picom -b
copyq &
# https://wiki.archlinux.org/index.php/GNOME/Keyring
# eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
# export $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
# Wallpaper and finally the status bar
feh --bg-scale ~/Pictures/wallpaper.jpg
$HOME/.config/polybar/launchpolybar
# Swallow parent process with the child
pidof bspswallow || bspswallow &
bspc config border_width 1
bspc config window_gap 7
bspc config split_ratio 0.50
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focused_border_color \#444444
bspc config normal_border_color \#080808
bspc monitor DisplayPort-0 -d 4 5 6 7 8
bspc monitor DisplayPort-1 -d 1 2 3
bspc monitor HDMI-A-0 -d 9 0
bspc rule -a Zathura state=tiled

@ -0,0 +1,139 @@
set previewer pistol
set hidden true
set color256 true
set drawbox true
set icons true
set ignorecase true
cmd open ${{
case $(file --mime-type "$f" -bL) in
text/*|application/json) $EDITOR "$f";;
image/*) sxiv "$f";;
application/pdf) zathura "$f";;
video/*) mpv "$f";;
*) xdg-open "$f";;
esac
}}
cmd mkdir ${{
printf "Directory Name: "
read ans
mkdir $ans
}}
cmd mkfile ${{
printf "File Name: "
read ans
$EDITOR $ans
}}
cmd chmod ${{
printf "Bits: "
read ans
for file in "$fx"
do
chmod $ans $file
done
lf -remote "send reload"
}}
cmd sudochmod ${{
printf "(sudo) Bits: "
read ans
for file in "$fx"
do
sudo chmod $ans $file
done
lf -remote "send reload"
}}
cmd sudomkfile ${{
printf "(sudo) File Name: "
read ans
sudo $EDITOR $ans
}}
cmd setwallpaper %cp "$f" ~/.config/wall.png && feh --bg-scale "$f"
cmd fzfjump ${{
res="$(find . -maxdepth 3 | fzf --reverse --header='Jump to location')"
if [ -f "$res" ]; then
cmd="select"
elif [ -d "$res" ]; then
cmd="cd"
fi
lf -remote "send $id $cmd \"$res\""
}}
cmd unarchive ${{
case "$f" in
*.zip) unzip "$f" ;;
*.tar*) tar -xvf "$f";;
*) echo "Unsupported Format";;
esac
}}
# Key Bindings
# Remove some default bindings
map m
map o
map n
map "'"
map '"'
map d
map c
map e
map f
map v
map i
map i invert
map w
# File Openers
map ee $$EDITOR "$f"
map v $view "$f"
map u unarchive
# Finder
map f fzfjump
map . set hidden!
map dd delete
map p paste
map y copy
map x cut
map <enter> open
map mf mkfile
map md mkdir
map mr sudomkfile
map ch chmod
map cr sudochmod
map bg setwallpaper
map r rename
map H top
map L bottom
map R reload
map C clear
map U unselect
map gh cd ~
map gp cd ~/Pictures
map gw cd ~/Pictures/Wallpapers
map gd cd ~/Documents
map gD cd ~/Downloads
map gb cd ~/bin
map gc. cd ~/code
map gcg cd ~/code/Projects/Golang/src
map gcp cd ~/code/Projects/Python
map gcr cd ~/code/Projects/Rust
map giws cd ~/code/IWS
map gcfg cd ~/.config
map ge cd /etc
map g/ cd /

@ -0,0 +1,494 @@
" Fisa-nvim-config
" http://nvim.fisadev.com
" version: 11.1
" Vim-plug initialization {{{
" Avoid modifying this section, unless you are very sure of what you are doing
let vim_plug_just_installed = 0
let vim_plug_path = expand('~/.config/nvim/autoload/plug.vim')
if !filereadable(vim_plug_path)
echo "Installing Vim-plug..."
echo ""
silent !mkdir -p ~/.config/nvim/autoload
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
let vim_plug_just_installed = 1
endif
" manually load vim-plug the first time
if vim_plug_just_installed
:execute 'source '.fnameescape(vim_plug_path)
endif
" Obscure hacks done, you can now modify the rest of the .vimrc as you wish :)
" }}}
" Active plugins {{{
" You can disable or add new ones here:
" this needs to be here, so vim-plug knows we are declaring the plugins we
" want to use
call plug#begin('~/.config/nvim/plugged')
" Now the actual plugins:
" VimWiki
Plug 'vimwiki/vimwiki'
" Golang plugin
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" Markdown previewer
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
" Markdown Syntax
Plug 'godlygeek/tabular'
Plug 'elzr/vim-json'
Plug 'plasticboy/vim-markdown'
" Code commenter
Plug 'scrooloose/nerdcommenter'
" Better file browser
Plug 'scrooloose/nerdtree'
" Class/module browser
Plug 'majutsushi/tagbar'
" TODO known problems:
" * current block not refreshing
" Search results counter
Plug 'vim-scripts/IndexedSearch'
" Badwolf Colorscheme
Plug 'sjl/badwolf'
" Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Code and files fuzzy finder
" Plug 'ctrlpvim/ctrlp.vim'
" Extension to ctrlp, for fuzzy command finder
" Plug 'fisadev/vim-ctrlp-cmdpalette'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Async autocompletion
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
" Completion from other opened files
Plug 'Shougo/context_filetype.vim'
" Python autocompletion
Plug 'zchee/deoplete-jedi', { 'do': ':UpdateRemotePlugins' }
" Just to add the python go-to-definition and similar features, autocompletion
" from this plugin is disabled
Plug 'davidhalter/jedi-vim'
" Automatically close parenthesis, etc
Plug 'Townk/vim-autoclose'
" Surround
Plug 'tpope/vim-surround'
" Indent text object
Plug 'michaeljsmith/vim-indent-object'
" Indentation based movements
Plug 'jeetsukumaran/vim-indentwise'
" Better language packs
Plug 'sheerun/vim-polyglot'
" Paint css colors with the real color
Plug 'lilydjwg/colorizer'
" Window chooser
Plug 't9md/vim-choosewin'
" Automatically sort python imports
Plug 'fisadev/vim-isort'
" Highlight matching html tags
Plug 'valloric/MatchTagAlways'
" Generate html in a simple way
Plug 'mattn/emmet-vim'
" Git integration
Plug 'tpope/vim-fugitive'
" Git/mercurial/others diff icons on the side of the file lines
Plug 'mhinz/vim-signify'
" Yank history navigation
Plug 'vim-scripts/YankRing.vim'
" Black Linter integration
Plug 'psf/black', { 'branch': 'stable' }
" Nice icons
Plug 'ryanoasis/vim-devicons'
" Easier Terminal splits
Plug 'vimlab/split-term.vim'
" Dracula theme
Plug 'dracula/vim', {'as': 'dracula'}
" Tell vim-plug we finished declaring plugins, so it can load them
call plug#end()
" Install plugins the first time vim runs
if vim_plug_just_installed
echo "Installing Bundles, please ignore key map error messages"
:PlugInstall
endif
" }}}
" Vim settings and mappings {{{
" You can edit them as you wish
" tabs and spaces handling
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set smarttab
if has("autocmd")
au BufReadPost * if &modifiable | retab | endif
endif
" autoread and autowrite
augroup save
au!
au FocusLost * wall
augroup END
set nohidden
set nobackup
set noswapfile
set nowritebackup
set autoread
set autowrite
set autowriteall
" persistant undo
set undodir=~/.vim/undo
set undofile
set path+=**
"
" Reloads vimrc after saving but keeps cursor position
if !exists('*ReloadVimrc')
fun! ReloadVimrc()
let save_cursor = getcurpos()
source $MYVIMRC
call setpos('.', save_cursor)
endfun
endif
autocmd! BufWritePost $MYVIMRC call ReloadVimrc()
" Set 80 character column identifier
set colorcolumn=80,100,120
" show line numbers
set number relativenumber
" Toggle between number and relativenumber
function! ToggleNumber()
if(&relativenumber == 1)
set norelativenumber
set number
else
set number relativenumber
endif
endfunc
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
: autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
:augroup END
nnoremap <F2> :call ToggleNumber()<CR>
nnoremap <F5> :buffers<CR>:buffer<Space>
" Highlight current line
set cursorline
" Load filetype-specific indent files
filetype indent on
" Visual autocompletion for command window
set wildmenu
" Redraw only when needed
set lazyredraw
" Highlight matching brackets
set showmatch
" Transparent background
let g:dracula_colorterm = 0
" use 256 colors when possible
if (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256') || has('nvim')
let &t_Co = 256
colorscheme dracula
else
colorscheme delek
endif
" needed so deoplete can auto select the first suggestion
" set completeopt+=noinsert
" comment this line to enable autocompletion preview window
" (displays documentation related to the selected completion option)
" set completeopt-=preview
" autocompletion of files and commands behaves like shell
" (complete only the common part, list the options that match)
set wildmode=list:longest
" when scrolling, keep cursor 5 lines away from screen border
set scrolloff=5
" clear search results
nnoremap <silent> // :noh<CR>
" clear empty spaces at the end of lines on save of python files
autocmd BufWritePre *.py :%s/\s\+$//e
" Ability to add python breakpoints
" (I use ipdb, but you can change it to whatever tool you use for debugging)
au FileType python map <silent> <leader>b Oimport pudb; pudb.set_trace()<esc>
set incsearch " Search as characters are entered
set hlsearch " Highlight matches
" Turn off search highlight
nnoremap <leader>m :nohlsearch<CR>
" Enable folding
set foldenable
set foldlevelstart=10 " Open most folds when file opened
set foldnestmax=10 " Only nest folds 10 deep
" Use Space to open and close folds
nnoremap <space> za
set foldmethod=indent
" Movement remaps
" Visually move between lines
nnoremap j gj
nnoremap k gk
" Move to beginning/end of line with better keybindings
nnoremap B ^
nnoremap E $
" Highlight last inserted text
nnoremap gV `[v`]
" Leader Shortcuts
let mapleader=","
" Use jk as escape
inoremap jk <esc>
" Check final line for modeline
set modelines=1
" Set Python interpreters
let g:python3_host_prog = '/home/dustyp/.pyenv/versions/3.8.2/bin/python'
let g:python2_host_prog = '/home/dustyp/.pyenv/versions/2.7.16/bin/python'
" Remap Ctrl+hjkl to move between windows
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Enable Mouse support
set mouse=a
" }}}
" Plugins settings and mappings {{{
" Tagbar {{{
" toggle tagbar display
map <F4> :TagbarToggle<CR>
" autofocus on tagbar open
let g:tagbar_autofocus = 1
" }}}
" NERDTree {{{
" toggle nerdtree display
map <F3> :NERDTreeToggle<CR>
" open nerdtree with the current file selected
nmap <leader>t :NERDTreeFind<CR>
" don;t show these file types
let NERDTreeIgnore = ['\.pyc$', '\.pyo$']
" }}}
" Black {{{
" Execute Black on file save
autocmd BufWritePre *.py execute ':Black'
" Execute Black with keypress
nnoremap <F9> :Black<CR>
" }}}
" Fzf {{{
" file finder mapping
nmap <leader>e :Files<CR>
" tags (symbols) in current file finder mapping
nmap <leader>g :BTag<CR>
" tags (symbols) in all files finder mapping
nmap <leader>G :Tags<CR>
" general code finder in current file mapping
nmap <leader>f :BLines<CR>
" general code finder in all files mapping
nmap <leader>F :Lines<CR>
" commands finder mapping
nmap <leader>c :Commands<CR>
" search in path
nmap <leader>ag :Ag<CR>
" to be able to call CtrlP with default search text
function! CtrlPWithSearchText(search_text, ctrlp_command_end)
execute ':CtrlP' . a:ctrlp_command_end
call feedkeys(a:search_text)
endfunction
" same as previous mappings, but calling with current word as default text
nmap <leader>wg :call CtrlPWithSearchText(expand('<cword>'), 'BufTag')<CR>
nmap <leader>wG :call CtrlPWithSearchText(expand('<cword>'), 'BufTagAll')<CR>
nmap <leader>wf :call CtrlPWithSearchText(expand('<cword>'), 'Line')<CR>
nmap <leader>we :call CtrlPWithSearchText(expand('<cword>'), '')<CR>
nmap <leader>pe :call CtrlPWithSearchText(expand('<cfile>'), '')<CR>
nmap <leader>wm :call CtrlPWithSearchText(expand('<cword>'), 'MRUFiles')<CR>
nmap <leader>wc :call CtrlPWithSearchText(expand('<cword>'), 'CmdPalette')<CR>
" }}}
" Deoplete {{{
" Use deoplete.
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_ignore_case = 1
call deoplete#custom#option("enable_smart_case", 1)
" complete with words from any opened file
let g:context_filetype#same_filetypes = {}
let g:context_filetype#same_filetypes._ = '_'
" }}}
" Jedi-vim {{{
" Disable autocompletion (using deoplete instead)
let g:jedi#completions_enabled = 0
" All these mappings work only for python code:
" Go to definition
let g:jedi#goto_command = ',d'
" Find ocurrences
let g:jedi#usages_command = ',o'
" Find assignments
let g:jedi#goto_assignments_command = ',a'
" Go to definition in new tab
nmap ,D :tab split<CR>:call jedi#goto()<CR>
" }}}
" Window Chooser {{{
" mapping
nmap - <Plug>(choosewin)
" show big letters
let g:choosewin_overlay_enable = 1
" }}}
" Signify {{{
" this first setting decides in which order try to guess your current vcs
" UPDATE it to reflect your preferences, it will speed up opening files
let g:signify_vcs_list = [ 'git' ]
" mappings to jump to changed blocks
nmap <leader>sn <plug>(signify-next-hunk)
nmap <leader>sp <plug>(signify-prev-hunk)
" nicer colors
highlight DiffAdd cterm=bold ctermbg=none ctermfg=119
highlight DiffDelete cterm=bold ctermbg=none ctermfg=167
highlight DiffChange cterm=bold ctermbg=none ctermfg=227
highlight SignifySignAdd cterm=bold ctermbg=237 ctermfg=119
highlight SignifySignDelete cterm=bold ctermbg=237 ctermfg=167
highlight SignifySignChange cterm=bold ctermbg=237 ctermfg=227
" }}}
" Autoclose {{{
" Fix to let ESC work as espected with Autoclose plugin
" (without this, when showing an autocompletion window, ESC won't leave insert
" mode)
let g:AutoClosePumvisible = {"ENTER": "\<C-Y>", "ESC": "\<ESC>"}
" }}}
" Yankring {{{
" Fix for yankring and neovim problem when system has non-text things copied
" in clipboard
let g:yankring_clipboard_monitor = 0
let g:yankring_history_dir = '~/.config/nvim/'
" }}}
" Airline {{{
let g:airline_powerline_fonts = 1
let g:airline_theme = 'bubblegum'
let g:airline#extensions#whitespace#enabled = 0
let g:airline#extensions#tabline#enabled = 1
" to use fancy symbols for airline, uncomment the following lines and use a
" patched font (more info on docs/fancy_symbols.rst)
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
" }}}
" Isort {{{
nnoremap <leader>s :Isort<CR>
" }}}
" Split Term {{{
" Split terms to the right and below current buffer
set splitright
set splitbelow
" Set default shell to ZSH
let g:split_term_default_shell = "zsh"
" Shortcuts to open terminals
nnoremap <C-v> :VTerm<CR>
nnoremap <C-t> :10Term<CR>
nnoremap <C-y> :VTerm python<CR>
" }}}
" Vim-Markdown {{{
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_conceal = 0
let g:tex_conceal = ""
let g:vim_markdown_math = 1
let g:vim_markdown_frontmatter = 1 " for YAML format
let g:vim_markdown_toml_frontmatter = 1 " for TOML format
let g:vim_markdown_json_frontmatter = 1 " for JSON format
" }}}
" Markdown Preview {{{
nnoremap <M-m> :MarkdownPreview<CR>
let g:mkdp_auto_close = 0
" }}}
" vim-go {{{
let g:go_fmt_command = "goimports"
let g:go_auto_type_info = 1
" }}}
" vimwiki {{{
let g:vimwiki_list = [
\{'path': '~/Notes', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Programming', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Programming/Golang', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Programming/Python', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Programming/Rust', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Britecore', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Arch', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/AWS', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Bible Study', 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/Notes/Preparedness', 'syntax': 'markdown', 'ext': '.md'}]
" }}}
" }}}
" vim:foldmethod=marker:foldlevel=0

@ -0,0 +1,542 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
;background = ${xrdb:color0:#222}
background = #282a36
background-alt = #7a7a7a
;foreground = ${xrdb:color7:#222}
foreground = #ffb86c
foreground-alt = #7a7a7a
primary = #f8f8f2
secondary = #e64747
alert = #ff5555
[bar/topbar]
;monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 27
;offset-x = 1%
;offset-y = 1%
radius = 6.0
fixed-center = false
monitor = DisplayPort-0
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = DejaVuSansMono Nerd Font:style=Regular:size=8;4
font-1 = Font Awesome 5 Free:style=Solid:size=10;4
font-2 = Font Awesome 5 Free:style=Regular:size=10;4
font-3 = FontAwesome5Brands:style=Regular:size=10;4
modules-left = bspwm
modules-center = xwindow
modules-right = filesystem alsa memory cpu wlan eth temperature date powermenu
tray-position = right
tray-padding = 2
;tray-background = #0063ff
wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[bar/left]
;monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 27
;offset-x = 1%
;offset-y = 1%
radius = 6.0
fixed-center = false
monitor = DisplayPort-1
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = DejaVuSansMono Nerd Font:style=Regular:size=8;4
font-1 = Font Awesome 5 Free:style=Solid:size=10;4
font-2 = Font Awesome 5 Free:style=Regular:size=10;4
font-3 = FontAwesome5Brands:style=Regular:size=10;4
modules-left = bspwm
modules-center = xwindow
modules-right = filesystem alsa memory cpu wlan eth temperature date
tray-position = right
tray-padding = 2
;tray-background = #0063ff
wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[bar/right]
;monitor = ${env:MONITOR:HDMI-1}
width = 100%
height = 27
;offset-x = 1%
;offset-y = 1%
radius = 6.0
fixed-center = false
monitor = HDMI-A-0
background = ${colors.background}
foreground = ${colors.foreground}
line-size = 3
line-color = #f00
border-size = 4
border-color = #000
padding-left = 0
padding-right = 2
module-margin-left = 1
module-margin-right = 2
font-0 = DejaVuSansMono Nerd Font:style=Regular:size=8;4
font-1 = Font Awesome 5 Free:style=Solid:size=10;4
font-2 = Font Awesome 5 Free:style=Regular:size=10;4
font-3 = FontAwesome5Brands:style=Regular:size=10;4
modules-left = bspwm
modules-center = xwindow
modules-right = filesystem alsa memory cpu wlan eth temperature date
tray-position = right
tray-padding = 2
;tray-background = #0063ff
wm-restack = bspwm
;wm-restack = i3
;override-redirect = true
;scroll-up = bspwm-desknext
;scroll-down = bspwm-deskprev
;scroll-up = i3wm-wsnext
;scroll-down = i3wm-wsprev
cursor-click = pointer
cursor-scroll = ns-resize
[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-prefix-underline = ${colors.secondary}
label-layout = %layout%
label-layout-underline = ${colors.secondary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-background = ${colors.secondary}
label-indicator-underline = ${colors.secondary}
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
mount-1 = /home
label-mounted = %{F#75d7ec}%mountpoint%%{F-}: %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.foreground-alt}
[module/bspwm]
type = internal/bspwm
ws-icon-0 = "1;"
ws-icon-1 = "2;"
ws-icon-2 = "3;"
ws-icon-3 = "4;"
ws-icon-4 = "5;"
ws-icon-5 = "6;"
ws-icon-6 = "7;"
ws-icon-7 = "8;ﱮ"
ws-icon-8 = "9;ﭮ"
ws-icon-9 = "0;"
ws-icon-default = ""
label-focused = %name%:%icon%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 1
label-occupied = %name%:%icon%
label-occupied-padding = 1
label-urgent = %name%:%icon%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%:%icon%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 1
; Separator in between workspaces
; label-separator = |
[module/i3]
type = internal/i3
format = <label-state> <label-mode>
index-sort = true
wrapping-scroll = false
; Only show workspaces on the same output as the bar
;pin-workspaces = true
label-mode-padding = 2
label-mode-foreground = #000
label-mode-background = ${colors.primary}
; focused = Active workspace on focused monitor
label-focused = %index%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2
; unfocused = Inactive workspace on any monitor
label-unfocused = %index%
label-unfocused-padding = 2
; visible = Active workspace on unfocused monitor
label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
; urgent = Workspace with urgency hint set
label-urgent = %index%
label-urgent-background = ${colors.alert}
label-urgent-padding = 2
; Separator in between workspaces
; label-separator = |
[module/mpd]
type = internal/mpd
format-online = <label-song> <icon-prev> <icon-stop> <toggle> <icon-next>
icon-prev = ←
icon-stop = ■
icon-play = ▶
icon-pause = ❚❚
icon-next = →
label-song-maxlen = 25
label-song-ellipsis = true
[module/xbacklight]
type = internal/xbacklight
format = <label> <bar>
label = BL
bar-width = 10
bar-indicator = |
bar-indicator-foreground = #7a7a7a
bar-indicator-font = 2
bar-fill = ─
bar-fill-font = 2
bar-fill-foreground = #9b6bdf
bar-empty = ─
bar-empty-font = 2
bar-empty-foreground = ${colors.foreground-alt}
[module/backlight-acpi]
inherit = module/xbacklight
type = internal/backlight
card = intel_backlight
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #42e66c
label = %percentage:2%%
[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #75d7ec
label = %percentage_used%%
[module/wlan]
type = internal/network
interface = wlan0
interval = 3.0
format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9b6bdf
label-connected = %essid%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
ramp-signal-0 = 
ramp-signal-foreground = ${colors.foreground-alt}
[module/eth]
type = internal/network
interface = enp6s0
interval = 3.0
format-connected-underline = #e356a7
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%
format-disconnected =
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}
[module/date]
type = internal/date
interval = 5
date = " %Y-%m-%d"
date-alt =
time = %H:%M:%S
time-alt = %H:%M:%S
format-prefix = 
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #e4f34a
label = %date% %time%
[module/pulseaudio]
type = internal/pulseaudio
format-volume = <label-volume> <bar-volume>
label-volume =  %percentage%%
label-volume-foreground = ${root.foreground}
label-muted =  muted
label-muted-foreground = #666
bar-volume-width = 10
bar-volume-foreground-0 = #ff5555
bar-volume-foreground-1 = #ff5555
bar-volume-foreground-2 = #ffb86c
bar-volume-foreground-3 = #ffb86c
bar-volume-foreground-4 = #42e66c
bar-volume-foreground-5 = #42e66c
bar-volume-foreground-6 = #42e66c
bar-volume-gradient = false
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/alsa]
type = internal/alsa
master-soundcard = hw:3
master-mixer = "UMC202HD 192k Output"
format-volume = <label-volume> <bar-volume>
label-volume = 
label-volume-foreground = ${root.foreground}
format-muted-prefix = " "
format-muted-foreground = ${colors.foreground-alt}
label-muted = muted
bar-volume-width = 10
bar-volume-foreground-0 = #ff2222
bar-volume-foreground-1 = #ff5555
bar-volume-foreground-2 = #efa554
bar-volume-foreground-3 = #ffb86c
bar-volume-foreground-4 = #59dffc
bar-volume-foreground-5 = #8be9fd
bar-volume-foreground-6 = #1ef956
bar-volume-foreground-7 = #50fa7b
bar-volume-gradient = true
bar-volume-indicator = |
bar-volume-indicator-font = 2
bar-volume-fill = ─
bar-volume-fill-font = 2
bar-volume-empty = ─
bar-volume-empty-font = 2
bar-volume-empty-foreground = ${colors.foreground-alt}
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98
format-charging = <animation-charging> <label-charging>
format-charging-underline = #75d7ec
format-discharging = <animation-discharging> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}
format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground-alt}
format-full-underline = ${self.format-charging-underline}
ramp-capacity-0 = 
ramp-capacity-1 = 
ramp-capacity-2 = 
ramp-capacity-3 = 
ramp-capacity-4 = 
ramp-capacity-foreground = ${colors.foreground-alt}
animation-charging-0 = 
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750
animation-discharging-0 = 
animation-discharging-1 = 
animation-discharging-2 = 
animation-discharging-3 = 
animation-discharging-4 = 
animation-discharging-foreground = ${colors.foreground-alt}
animation-discharging-framerate = 750
[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60
format = <ramp> <label>
format-underline = #262626
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}
label = %temperature-c%
label-warn = %temperature-c%
label-warn-foreground = ${colors.secondary}
ramp-0 = 
ramp-foreground = ${colors.foreground-alt}
[module/powermenu]
type = custom/menu
expand-right = true
format-spacing = 1
label-open = 
label-open-foreground = ${colors.secondary}
label-close = cancel
label-close-foreground = ${colors.secondary}
label-separator = |
label-separator-foreground = ${colors.foreground-alt}
menu-0-0 = reboot
menu-0-0-exec = menu-open-1
menu-0-1 = power off
menu-0-1-exec = menu-open-2
menu-1-0 = cancel
menu-1-0-exec = menu-open-0
menu-1-1 = reboot
menu-1-1-exec = reboot
menu-2-0 = power off
menu-2-0-exec = poweroff
menu-2-1 = cancel
menu-2-1-exec = menu-open-0
[settings]
screenchange-reload = true
;compositing-background = xor
;compositing-background = screen
;compositing-foreground = source
;compositing-border = over
;pseudo-transparency = false
[global/wm]
margin-top = 5
margin-bottom = 5
; vim:ft=dosini

@ -0,0 +1,139 @@
#
# wm independent hotkeys
#
# terminal emulator
super + Return
alacritty
# program launcher
super + d
rofi -show run -font "Monospace Bold 12" -m -1 -fullscreen -padding 300 -hide-scrollbar
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
# close and kill
super + {_,shift + }w
bspc node -{c,k}
# alternate between the tiled and monocle layout
super + m
bspc desktop -l next
# send the newest marked node to the newest preselected node
super + y
bspc node newest.marked.local -n newest.!automatic.local
# swap the current node and the biggest window
super + g
bspc node -s biggest.window
#
# state/flags
#
# set the window state
super + {t,shift + t,s,f}
bspc node -t {tiled,pseudo_tiled,floating,fullscreen}
# set the node flags
super + ctrl + {m,x,y,z}
bspc node -g {marked,locked,sticky,private}
#
# focus/swap
#
# focus the node in the given direction
super + {_,shift + }{h,j,k,l}
bspc node -{f,s} {west,south,north,east}
# focus the node for the given path jump
super + {p,b,comma,period}
bspc node -f @{parent,brother,first,second}
# focus the next/previous window in the current desktop
super + {_,shift + }c
bspc node -f {next,prev}.local.!hidden.window
# focus the next/previous desktop in the current monitor
super + bracket{left,right}
bspc desktop -f {prev,next}.local
# focus the last node/desktop
super + {grave,Tab}
bspc {node,desktop} -f last
# focus the older or newer node in the focus history
super + {o,i}
bspc wm -h off; \
bspc node {older,newer} -f; \
bspc wm -h on
# focus or send to the given desktop
super + {_,shift + }{1-9,0}
bspc {desktop -f,node -d} '^{1-9,10}'
#
# preselect
#
# preselect the direction
super + ctrl + {h,j,k,l}
bspc node -p {west,south,north,east}
# preselect the ratio
super + ctrl + {1-9}
bspc node -o 0.{1-9}
# cancel the preselection for the focused node
super + ctrl + space
bspc node -p cancel
# cancel the preselection for the focused desktop
super + ctrl + shift + space
bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel
#
# move/resize
#
# expand a window by moving one of its side outward
super + alt + {h,j,k,l}
bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
# contract a window by moving one of its side inward
super + alt + shift + {h,j,k,l}
bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
# move a floating window
super + {Left,Down,Up,Right}
bspc node -v {-20 0,0 20,0 -20,20 0}
# Multimedia
XF86Audio{Raise,Lower}Volume
amixer sset Master {5%+,5%-}
XF86AudioMute
amixer sset Master toggle
# Tabbed
super + t; {h,j,k,l}
tabc add {west,south,north,east} $(bspc query -N -n focused)
super + t; r
tabbed=$(bspc query -N -n focused)
child=$(tabc list $tabbed | head -n1)
tabc remove $child
# xbacklight has to be installed
XF86MonBrightness{Up,Down}
adjust_brightness.py {10,-10}

@ -0,0 +1,12 @@
source $HOME/.config/zsh/plugins/catimg.plugin.zsh
source $HOME/.config/zsh/plugins/command-not-found.plugin.zsh
source $HOME/.config/zsh/plugins/extract.plugin.zsh
source $HOME/.config/zsh/plugins/git.plugin.zsh
source $HOME/.config/zsh/plugins/history.plugin.zsh
source $HOME/.config/zsh/plugins/pip.plugin.zsh
source $HOME/.config/zsh/plugins/python.plugin.zsh
source $HOME/.config/zsh/plugins/sudo.plugin.zsh
source $HOME/.config/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
source $HOME/.config/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
source $HOME/.config/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh

@ -0,0 +1,17 @@
################################################################################
# catimg script by Eduardo San Martin Morote aka Posva #
# https://posva.net #
# #
# Ouput the content of an image to the stdout using the 256 colors of the #
# terminal. #
# GitHub: https://github.com/posva/catimg #
################################################################################
function catimg() {
if [[ -x `which convert` ]]; then
zsh $ZSH/plugins/catimg/catimg.sh $@
else
echo "catimg need convert (ImageMagick) to work)"
fi
}

@ -0,0 +1,38 @@
# Uses the command-not-found package zsh support
# as seen in https://www.porcheron.info/command-not-found-for-zsh/
# this is installed in Ubuntu
[[ -e /etc/zsh_command_not_found ]] && source /etc/zsh_command_not_found
# Arch Linux command-not-found support, you must have package pkgfile installed
# https://wiki.archlinux.org/index.php/Pkgfile#.22Command_not_found.22_hook
[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && source /usr/share/doc/pkgfile/command-not-found.zsh
# Fedora command-not-found support
if [ -f /usr/libexec/pk-command-not-found ]; then
command_not_found_handler () {
runcnf=1
retval=127
[ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0
[ ! -x /usr/libexec/packagekitd ] && runcnf=0
if [ $runcnf -eq 1 ]
then
/usr/libexec/pk-command-not-found $@
retval=$?
fi
return $retval
}
fi
# OSX command-not-found support
# https://github.com/Homebrew/homebrew-command-not-found
if [[ -s '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh' ]]; then
source '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh'
fi
# NixOS command-not-found support
if [ -x /run/current-system/sw/bin/command-not-found ]; then
command_not_found_handler () {
/run/current-system/sw/bin/command-not-found $@
}
fi

@ -0,0 +1,82 @@
alias x=extract
extract() {
local remove_archive
local success
local extract_dir
if (( $# == 0 )); then
cat <<-'EOF' >&2
Usage: extract [-option] [file ...]
Options:
-r, --remove Remove archive after unpacking.
EOF
fi
remove_archive=1
if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then
remove_archive=0
shift
fi
while (( $# > 0 )); do
if [[ ! -f "$1" ]]; then
echo "extract: '$1' is not a valid file" >&2
shift
continue
fi
success=0
extract_dir="${1:t:r}"
case "${1:l}" in
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz)
tar --xz --help &> /dev/null \
&& tar --xz -xvf "$1" \
|| xzcat "$1" | tar xvf - ;;
(*.tar.zma|*.tlz)
tar --lzma --help &> /dev/null \
&& tar --lzma -xvf "$1" \
|| lzcat "$1" | tar xvf - ;;
(*.tar.zst|*.tzst)
tar --zstd --help &> /dev/null \
&& tar --zstd -xvf "$1" \
|| zstdcat "$1" | tar xvf - ;;
(*.tar) tar xvf "$1" ;;
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
(*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
(*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;;
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
(*.lz4) lz4 -d "$1" ;;
(*.lzma) unlzma "$1" ;;
(*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;;
(*.rpm) mkdir "$extract_dir" && cd "$extract_dir" && rpm2cpio "../$1" | cpio --quiet -id && cd .. ;;
(*.7z) 7za x "$1" ;;
(*.deb)
mkdir -p "$extract_dir/control"
mkdir -p "$extract_dir/data"
cd "$extract_dir"; ar vx "../${1}" > /dev/null
cd control; tar xzvf ../control.tar.gz
cd ../data; extract ../data.tar.*
cd ..; rm *.tar.* debian-binary
cd ..
;;
(*.zst) unzstd "$1" ;;
(*)
echo "extract: '$1' cannot be extracted" >&2
success=1
;;
esac
(( success = $success > 0 ? $success : $? ))
(( $success == 0 )) && (( $remove_archive == 0 )) && rm "$1"
shift
done
}

@ -0,0 +1,272 @@
#
# Functions
#
# The name of the current branch
# Back-compatibility wrapper for when this function was defined here in
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
# to fix the core -> git plugin dependency.
function current_branch() {
git_current_branch
}
# Pretty log messages
function _git_log_prettily(){
if ! [ -z $1 ]; then
git log --pretty=$1
fi
}
compdef _git _git_log_prettily=git-log
# Warn if the current branch is a WIP
function work_in_progress() {
if $(git log -n 1 2>/dev/null | grep -q -c "\-\-wip\-\-"); then
echo "WIP!!"
fi
}
#
# Aliases
# (sorted alphabetically)
#
alias g='git'
alias ga='git add'
alias gaa='git add --all'
alias gapa='git add --patch'
alias gau='git add --update'
alias gav='git add --verbose'
alias gap='git apply'
alias gb='git branch'
alias gba='git branch -a'
alias gbd='git branch -d'
alias gbda='git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d'
alias gbD='git branch -D'
alias gbl='git blame -b -w'
alias gbnm='git branch --no-merged'
alias gbr='git branch --remote'
alias gbs='git bisect'
alias gbsb='git bisect bad'
alias gbsg='git bisect good'
alias gbsr='git bisect reset'
alias gbss='git bisect start'
alias gc='git commit -v'
alias gc!='git commit -v --amend'
alias gcn!='git commit -v --no-edit --amend'
alias gca='git commit -v -a'
alias gca!='git commit -v -a --amend'
alias gcan!='git commit -v -a --no-edit --amend'
alias gcans!='git commit -v -a -s --no-edit --amend'
alias gcam='git commit -a -m'
alias gcsm='git commit -s -m'
alias gcb='git checkout -b'
alias gcf='git config --list'
alias gcl='git clone --recurse-submodules'
alias gclean='git clean -id'
alias gpristine='git reset --hard && git clean -dffx'
alias gcm='git checkout master'
alias gcd='git checkout develop'
alias gcmsg='git commit -m'
alias gco='git checkout'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gcpa='git cherry-pick --abort'
alias gcpc='git cherry-pick --continue'
alias gcs='git commit -S'
alias gd='git diff'
alias gdca='git diff --cached'
alias gdcw='git diff --cached --word-diff'
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
alias gds='git diff --staged'
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gdw='git diff --word-diff'
function gdv() { git diff -w "$@" | view - }
compdef _git gdv=git-diff
alias gf='git fetch'
alias gfa='git fetch --all --prune'
alias gfo='git fetch origin'
alias gfg='git ls-files | grep'
alias gg='git gui citool'
alias gga='git gui citool --amend'
function ggf() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force origin "${b:=$1}"
}
compdef _git ggf=git-checkout
function ggfl() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git push --force-with-lease origin "${b:=$1}"
}
compdef _git ggfl=git-checkout
function ggl() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git pull origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git pull origin "${b:=$1}"
fi
}
compdef _git ggl=git-checkout
function ggp() {
if [[ "$#" != 0 ]] && [[ "$#" != 1 ]]; then
git push origin "${*}"
else
[[ "$#" == 0 ]] && local b="$(git_current_branch)"
git push origin "${b:=$1}"
fi
}
compdef _git ggp=git-checkout
function ggpnp() {
if [[ "$#" == 0 ]]; then
ggl && ggp
else
ggl "${*}" && ggp "${*}"
fi
}
compdef _git ggpnp=git-checkout
function ggu() {
[[ "$#" != 1 ]] && local b="$(git_current_branch)"
git pull --rebase origin "${b:=$1}"
}
compdef _git ggu=git-checkout
alias ggpur='ggu'
alias ggpull='git pull origin "$(git_current_branch)"'
alias ggpush='git push origin "$(git_current_branch)"'
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
alias gpsup='git push --set-upstream origin $(git_current_branch)'
alias ghh='git help'
alias gignore='git update-index --assume-unchanged'
alias gignored='git ls-files -v | grep "^[[:lower:]]"'
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
alias gk='\gitk --all --branches'
alias gke='\gitk --all $(git log -g --pretty=%h)'
alias gl='git pull'
alias glg='git log --stat'
alias glgp='git log --stat -p'
alias glgg='git log --graph'
alias glgga='git log --graph --decorate --all'
alias glgm='git log --graph --max-count=10'
alias glo='git log --oneline --decorate'
alias glol="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"
alias glols="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat"
alias glod="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset'"
alias glods="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short"
alias glola="git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all"
alias glog='git log --oneline --decorate --graph'
alias gloga='git log --oneline --decorate --graph --all'
alias glp="_git_log_prettily"
alias gm='git merge'
alias gmom='git merge origin/master'
alias gmt='git mergetool --no-prompt'
alias gmtvim='git mergetool --no-prompt --tool=vimdiff'
alias gmum='git merge upstream/master'
alias gma='git merge --abort'
alias gp='git push'
alias gpd='git push --dry-run'
alias gpf='git push --force-with-lease'
alias gpf!='git push --force'
alias gpoat='git push origin --all && git push origin --tags'
alias gpu='git push upstream'
alias gpv='git push -v'
alias gr='git remote'
alias gra='git remote add'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbd='git rebase develop'
alias grbi='git rebase -i'
alias grbm='git rebase master'
alias grbs='git rebase --skip'
alias grev='git revert'
alias grh='git reset'
alias grhh='git reset --hard'
alias groh='git reset origin/$(git_current_branch) --hard'
alias grm='git rm'
alias grmc='git rm --cached'
alias grmv='git remote rename'
alias grrm='git remote remove'
alias grs='git restore'
alias grset='git remote set-url'
alias grss='git restore --source'
alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
alias gru='git reset --'
alias grup='git remote update'
alias grv='git remote -v'
alias gsb='git status -sb'
alias gsd='git svn dcommit'
alias gsh='git show'
alias gsi='git submodule init'
alias gsps='git show --pretty=short --show-signature'
alias gsr='git svn rebase'
alias gss='git status -s'
alias gst='git status'
# use the default stash push on git 2.13 and newer
autoload -Uz is-at-least
is-at-least 2.13 "$(git --version 2>/dev/null | awk '{print $3}')" \
&& alias gsta='git stash push' \
|| alias gsta='git stash save'
alias gstaa='git stash apply'
alias gstc='git stash clear'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop'
alias gsts='git stash show --text'
alias gstu='git stash --include-untracked'
alias gstall='git stash --all'
alias gsu='git submodule update'
alias gsw='git switch'
alias gswc='git switch -c'
alias gts='git tag -s'
alias gtv='git tag | sort -V'
alias gtl='gtl(){ git tag --sort=-v:refname -n -l "${1}*" }; noglob gtl'
alias gunignore='git update-index --no-assume-unchanged'
alias gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
alias gup='git pull --rebase'
alias gupv='git pull --rebase -v'
alias gupa='git pull --rebase --autostash'
alias gupav='git pull --rebase --autostash -v'
alias glum='git pull upstream master'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'
alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"'
function grename() {
if [[ -z "$1" || -z "$2" ]]; then
echo "Usage: $0 old_branch new_branch"
return 1
fi
# Rename branch locally
git branch -m "$1" "$2"
# Rename branch in origin remote
if git push origin :"$1"; then
git push --set-upstream origin "$2"
fi
}

@ -0,0 +1,3 @@
alias h='history'
alias hs='history | grep'
alias hsi='history | grep -i'

@ -0,0 +1,82 @@
# Usage:
# Just add pip to your installed plugins.
# If you would like to change the cheeseshops used for autocomplete set
# ZSH_PIP_INDEXES in your zshrc. If one of your indexes are bogus you won't get
# any kind of error message, pip will just not autocomplete from them. Double
# check!
#
# If you would like to clear your cache, go ahead and do a
# "zsh-pip-clear-cache".
ZSH_PIP_CACHE_FILE=~/.pip/zsh-cache
ZSH_PIP_INDEXES=(https://pypi.org/simple/)
zsh-pip-clear-cache() {
rm $ZSH_PIP_CACHE_FILE
unset piplist
}
zsh-pip-clean-packages() {
sed -n '/<a href/ s/.*>\([^<]\{1,\}\).*/\1/p'
}
zsh-pip-cache-packages() {
if [[ ! -d ${ZSH_PIP_CACHE_FILE:h} ]]; then
mkdir -p ${ZSH_PIP_CACHE_FILE:h}
fi
if [[ ! -f $ZSH_PIP_CACHE_FILE ]]; then
echo -n "(...caching package index...)"
tmp_cache=/tmp/zsh_tmp_cache
touch $tmp_cache
for index in $ZSH_PIP_INDEXES ; do
# well... I've already got two problems
curl -L $index 2>/dev/null | \
zsh-pip-clean-packages \
>> $tmp_cache
done
sort $tmp_cache | uniq | tr '\n' ' ' > $ZSH_PIP_CACHE_FILE
rm $tmp_cache
fi
}
# A test function that validates the regex against known forms of the simple
# index. If you modify the regex to make it work for you, you should add a test
# case in here and make sure that your changes don't break things for someone
# else.
zsh-pip-test-clean-packages() {
local expected
local actual
expected="0x10c-asm
1009558_nester"
actual=$(echo -n "<html><head><title>Simple Index</title><meta name=\"api-version\" value=\"2\" /></head><body>
<a href='0x10c-asm'>0x10c-asm</a><br/>
<a href='1009558_nester'>1009558_nester</a><br/>
</body></html>" | zsh-pip-clean-packages)
if [[ $actual != $expected ]] ; then
echo -e "python's simple index is broken:\n$actual\n !=\n$expected"
else
echo "python's simple index is fine"
fi
actual=$(echo -n '<html>
<head>
<title>Simple Package Index</title>
</head>
<body>
<a href="0x10c-asm">0x10c-asm</a><br/>
<a href="1009558_nester">1009558_nester</a><br/>
</body></html>' | zsh-pip-clean-packages)
if [[ $actual != $expected ]] ; then
echo -e "the djangopypi2 index is broken:\n$actual\n !=\n$expected"
else
echo "the djangopypi2 index is fine"
fi
}
alias pip="noglob pip" # allows square brackets for pip command invocation

@ -0,0 +1,42 @@
# This plugin loads pyenv into the current shell and provides prompt info via
# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
# Load pyenv only if command not already available
command -v pyenv &> /dev/null && FOUND_PYENV=1 || FOUND_PYENV=0
if [[ $FOUND_PYENV -ne 1 ]]; then
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
for dir in $pyenvdirs; do
if [[ -d $dir/bin ]]; then
export PATH="$PATH:$dir/bin"
FOUND_PYENV=1
break
fi
done
fi
if [[ $FOUND_PYENV -ne 1 ]]; then
if (( $+commands[brew] )) && dir=$(brew --prefix pyenv 2>/dev/null); then
if [[ -d $dir/bin ]]; then
export PATH="$PATH:$dir/bin"
FOUND_PYENV=1
fi
fi
fi
if [[ $FOUND_PYENV -eq 1 ]]; then
eval "$(pyenv init - zsh)"
if (( $+commands[pyenv-virtualenv-init] )); then
eval "$(pyenv virtualenv-init - zsh)"
fi
function pyenv_prompt_info() {
echo "$(pyenv version-name)"
}
else
# fallback to system python
function pyenv_prompt_info() {
echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
}
fi
unset FOUND_PYENV pyenvdirs dir

@ -0,0 +1,47 @@
# Find python file
alias pyfind='find . -name "*.py"'
# Remove python compiled byte-code and mypy/pytest cache in either the current
# directory or in a list of specified directories (including sub directories).
function pyclean() {
ZSH_PYCLEAN_PLACES=${*:-'.'}
find ${ZSH_PYCLEAN_PLACES} -type f -name "*.py[co]" -delete
find ${ZSH_PYCLEAN_PLACES} -type d -name "__pycache__" -delete
find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".mypy_cache" -exec rm -r "{}" +
find ${ZSH_PYCLEAN_PLACES} -depth -type d -name ".pytest_cache" -exec rm -r "{}" +
}
# Add the user installed site-packages paths to PYTHONPATH, only if the
# directory exists. Also preserve the current PYTHONPATH value.
# Feel free to autorun this when .zshrc loads.
function pyuserpaths() {
local targets=("python2" "python3") # bins
# Get existing interpreters.
local interps=()
for target in $targets; do
[ `command -v $target` ] && interps+=($target)
done
# Check for a non-standard install directory.
local user_base="${HOME}/.local"
[ $PYTHONUSERBASE ] && user_base=$PYTHONUSERBASE
# Add version specific paths, if:
# it exists in the filesystem;
# it isn't in PYTHONPATH already.
for interp in $interps; do
# Get minor release version.
local ver=`$interp -V 2>&1`
ver=`echo ${ver:7} | cut -d '.' -f 1,2` # The patch version is variable length, truncate it.
local site_pkgs="${user_base}/lib/python${ver}/site-packages"
[[ -d $site_pkgs && ! $PYTHONPATH =~ $site_pkgs ]] && export PYTHONPATH=${site_pkgs}:$PYTHONPATH
done
}
# Grep among .py files
alias pygrep='grep -r --include="*.py"'
# Run proper IPython regarding current virtualenv (if any)
alias ipython="python -c 'import IPython; IPython.terminal.ipapp.launch_new_instance()'"

@ -0,0 +1,33 @@
# ------------------------------------------------------------------------------
# Description
# -----------
#
# sudo or sudoedit will be inserted before the command
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Dongweiming <ciici123@gmail.com>
#
# ------------------------------------------------------------------------------
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
if [[ $BUFFER == sudo\ * ]]; then
LBUFFER="${LBUFFER#sudo }"
elif [[ $BUFFER == $EDITOR\ * ]]; then
LBUFFER="${LBUFFER#$EDITOR }"
LBUFFER="sudoedit $LBUFFER"
elif [[ $BUFFER == sudoedit\ * ]]; then
LBUFFER="${LBUFFER#sudoedit }"
LBUFFER="$EDITOR $LBUFFER"
else
LBUFFER="sudo $LBUFFER"
fi
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey -M emacs '\e\e' sudo-command-line
bindkey -M vicmd '\e\e' sudo-command-line
bindkey -M viins '\e\e' sudo-command-line

@ -0,0 +1 @@
Subproject commit ae315ded4dba10685dbbafbfa2ff3c1aefeb490d

@ -0,0 +1 @@
Subproject commit e7d3fbc50b0209cb9f9b0812fd40298be03c7808

@ -0,0 +1 @@
Subproject commit b4aec740f23d195116d1fddec91d67b5e9c2c5c7

@ -0,0 +1,30 @@
SPACESHIP_PROMPT_SEPARATE_LINE=false
SPACESHIP_DIR_TRUNK_PREFIX="…/"
SPACESHIP_PACKAGE_SHOW=false
SPACESHIP_NODE_SHOW=false
SPACESHIP_RUBY_SHOW=false
SPACESHIP_ELM_SHOW=false
SPACESHIP_ELIXIR_SHOW=false
SPACESHIP_XCODE_SHOW_LOCAL=false
SPACESHIP_XCODE_SHOW_GLOBAL=false
SPACESHIP_SWIFT_SHOW_LOCAL=false
SPACESHIP_SWIFT_SHOW_GLOBAL=false
SPACESHIP_GOLANG_SYMBOL="\UFCD1 "
SPACESHIP_GOLANG_SHOW=false
SPACESHIP_PYTHON_SHOW=false
SPACESHIP_PYENV_SHOW=false
SPACESHIP_PHP_SHOW=false
SPACESHIP_RUST_SYMBOL="\Ue7a8 "
SPACESHIP_JULIA_SHOW=false
SPACESHIP_DOCKER_SYMBOL="\UF308 "
SPACESHIP_AWS_SYMBOL="\UE7AD "
SPACESHIP_AWS_PREFIX=""
SPACESHIP_DOTNET_SHOW=false
SPACESHIP_EMBER_SHOW=false
SPACESHIP_KUBECTL_SHOW=false
SPACESHIP_KUBECTL_VERSION_SHOW=false
SPACESHIP_KUBECONTEXT_SHOW=false
SPACESHIP_TERRAFORM_SHOW=false
SPACESHIP_BATTERY_THRESHOLD=100
spaceship_vi_mode_enable

@ -0,0 +1 @@
source $HOME/.config/zsh/themes/spaceship-prompt/spaceship.zsh-theme

@ -0,0 +1 @@
Subproject commit 8275b72a5f50d7862c62ac9ab277b3f6aa63a5ce

@ -0,0 +1,81 @@
# Fix issue with git plugin
autoload -U +X compinit && compinit
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/code/Projects/Golang/bin:$HOME/go/go1.14.2/bin:$HOME/code/Bin:$HOME/.cargo/bin:$HOME/scripts:$HOME/.gem/ruby/2.7.0/gems:/usr/local/bin:$PATH
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
source $HOME/.config/zsh/aliases.zsh
source $HOME/.config/zsh/plugins.zsh
source $HOME/.config/zsh/themes.zsh
export VISUAL=vim
export EDITOR=$VISUAL
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
bindkey '^`' autosuggest-clear
bindkey -v
# ------ ZSH Settings -----
unsetopt NO_BEEP
unsetopt NO_MATCH
setopt AUTO_CD
setopt BEEP
setopt NOMATCH
setopt NOTIFY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_FIND_NO_DUPS
setopt HIST_SAVE_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY
setopt HIST_BEEP
setopt INTERACTIVE_COMMENTS
setopt MAGIC_EQUAL_SUBST
HISTFILE="$HOME/.zsh_history"
HIST_STAMPS=yyyy-mm-dd
HISTSIZE=5000
SAVEHIST=5000
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=#ccc'
ZLE_RPROMPT_INDENT=0
source $HOME/.config/zsh/spaceship.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export OPENCV_LOG_LEVEL=ERROR
# For BriteDevEnv...
function load_britedevenv() {
# Activate direnv, which will pick up the `.envrc`.
eval "$(direnv hook zsh)"
# Since 'docker-compose' will now be working across multiple repositories,
# we'll export a ENV variable that it can read to figure out where all our
# repos are checked out at.
export REPO_DIR="~/code/IWS"
export BRITEDEVENV_PATH="/home/dustyp/code/IWS/BriteDevEnv"
bde_zsh_extras="${BRITEDEVENV_PATH}/shells/zsh_extras.sh"
if [ -f ${bde_zsh_extras} ]
then
source ${bde_zsh_extras}
fi
}
load_britedevenv

@ -0,0 +1,53 @@
#!/bin/sh
# Get class of a wid
get_class() {
id=$1
if [ -z "$id" ]; then
echo ""
else
xprop -id "$id" | sed -n '/WM_CLASS\|WM_COMMAND/s/.*"\(.*\)".*/\1/p'
fi
}
swallow() {
addedtodesktop=$2
lasttermdesktop=$(bspc query -D -n last)
swallowerid=$1
swallowingid=$(bspc query -N -n last)
if [ "$addedtodesktop" = "$lasttermdesktop" ]; then
cat ~/.config/bspwm/noswallow ~/.config/bspwm/terminals | grep "^$(get_class "$swallowerid")$" && return
grep "^$(get_class "$swallowingid")$" ~/.config/bspwm/terminals || return
echo "$swallowerid $swallowingid" >> /tmp/swallowids
bspc node "$swallowingid" --flag hidden=on
fi
}
spit() {
spitterid=$1
spitterdesktop=$2
grep "^$spitterid" /tmp/swallowids || return
spittingid=$(grep "^$spitterid" /tmp/swallowids | head -n1 | awk '{print $2}')
bspc node "$spittingid" --flag hidden=off
termdesktop=$(bspc query -D -n "$spittingid")
[ "$termdesktop" = "$spitterdesktop" ] || bspc node "$spittingid" -d "$spitterdesktop"
bspc node "$spittingid" -f
sed -i "/^$spitterid/d" /tmp/swallowids
}
bspc subscribe node_add node_remove | while read -r event
do
case $(echo "$event" | awk '{ print $1 }') in
node_add)
swallow $(echo "$event" | awk '{print $5 " " $3}')
;;
node_remove)
spit $(echo "$event" | awk '{print $4 " " $3}')
;;
esac
done

@ -0,0 +1,14 @@
#!/bin/zsh
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch Polybar, using default config location ~/.config/polybar/config
polybar topbar &
polybar right &
polybar left &
echo "Polybar launched..."
Loading…
Cancel
Save