Initial commit and creation of setup script
This commit is contained in:
commit
cd67a505db
10 changed files with 2041 additions and 0 deletions
174
.config/i3/config
Normal file
174
.config/i3/config
Normal file
|
@ -0,0 +1,174 @@
|
||||||
|
# Global font config
|
||||||
|
font pango:DejaVu Sans Mono 9
|
||||||
|
|
||||||
|
# color scheme
|
||||||
|
client.focused #664477 #664477 #CCCCCC #E7D8B1 #664477
|
||||||
|
client.focused_inactive #222133 #222133 #AAAAAA #A074C4 #5F676A
|
||||||
|
client.unfocused #000000 #000000 #AAAAAA #A074C4 #222222
|
||||||
|
client.urgent #2F343A #900000 #FFFFFF #900000 #900000
|
||||||
|
client.placeholder #000000 #0C0C0C #FFFFFF #000000 #0C0C0C
|
||||||
|
client.background #000000
|
||||||
|
|
||||||
|
# Set mod key to Win key
|
||||||
|
set $mod Mod4
|
||||||
|
|
||||||
|
# i3status bar declarations
|
||||||
|
bar {
|
||||||
|
status_command "python3 -u ~/bin/statusbar"
|
||||||
|
position bottom
|
||||||
|
|
||||||
|
font pango:Terminus, Font Awesome 5 Free Regular 10
|
||||||
|
|
||||||
|
colors {
|
||||||
|
background #000000
|
||||||
|
statusline #CCCCCC
|
||||||
|
separator #000000
|
||||||
|
|
||||||
|
focused_workspace #664477 #664477 #CCCCCC
|
||||||
|
active_workspace #222133 #222133 #AAAAAA
|
||||||
|
inactive_workspace #000000 #000000 #AAAAAA
|
||||||
|
urgent_workspace #2F343A #900000 #FFFFFF
|
||||||
|
binding_mode #2F343A #900000 #FFFFFF
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec x-terminal-emulator
|
||||||
|
|
||||||
|
# screenshot on win+shift+s
|
||||||
|
bindsym $mod+Shift+s exec "~/bin/screenshot"
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
|
# kill on titlebar midclick
|
||||||
|
bindsym button3 kill
|
||||||
|
|
||||||
|
# rofi window switcher
|
||||||
|
bindsym $mod+Tab exec "rofi -show window"
|
||||||
|
|
||||||
|
# rofi launcher
|
||||||
|
bindsym $mod+space exec "rofi -show run"
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# split in horizontal orientation
|
||||||
|
bindsym $mod+h split h
|
||||||
|
|
||||||
|
# split in vertical orientation
|
||||||
|
bindsym $mod+v split v
|
||||||
|
|
||||||
|
# enter fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# focus the child container
|
||||||
|
bindsym $mod+d focus child
|
||||||
|
|
||||||
|
# Define names for default workspaces for which we configure key bindings later on.
|
||||||
|
# We use variables to avoid repeating the names in multiple places.
|
||||||
|
set $ws1 "1"
|
||||||
|
set $ws2 "2"
|
||||||
|
set $ws3 "3"
|
||||||
|
set $ws4 "4"
|
||||||
|
set $ws5 "5"
|
||||||
|
set $ws6 "6"
|
||||||
|
set $ws7 "7"
|
||||||
|
set $ws8 "8"
|
||||||
|
set $ws9 "9"
|
||||||
|
set $ws10 "10"
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace $ws1
|
||||||
|
bindsym $mod+2 workspace $ws2
|
||||||
|
bindsym $mod+3 workspace $ws3
|
||||||
|
bindsym $mod+4 workspace $ws4
|
||||||
|
bindsym $mod+5 workspace $ws5
|
||||||
|
bindsym $mod+6 workspace $ws6
|
||||||
|
bindsym $mod+7 workspace $ws7
|
||||||
|
bindsym $mod+8 workspace $ws8
|
||||||
|
bindsym $mod+9 workspace $ws9
|
||||||
|
bindsym $mod+0 workspace $ws10
|
||||||
|
|
||||||
|
# tilda replacement: workspace 10 is a full screen terminal
|
||||||
|
# menu key (old tilda hotkey) just swaps to it
|
||||||
|
bindsym Menu workspace $ws10
|
||||||
|
|
||||||
|
# move focused container to workspace
|
||||||
|
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||||
|
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||||
|
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
# exit i3 (logs you out of your X session)
|
||||||
|
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
||||||
|
|
||||||
|
# resize window (you can also use the mouse for that)
|
||||||
|
mode "resize" {
|
||||||
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
|
||||||
|
# Pressing left will shrink the window’s width.
|
||||||
|
# Pressing right will grow the window’s width.
|
||||||
|
# Pressing up will shrink the window’s height.
|
||||||
|
# Pressing down will grow the window’s height.
|
||||||
|
bindsym j resize shrink width 10 px or 10 ppt
|
||||||
|
bindsym k resize grow height 10 px or 10 ppt
|
||||||
|
bindsym l resize shrink height 10 px or 10 ppt
|
||||||
|
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||||
|
|
||||||
|
# same bindings, but for the arrow keys
|
||||||
|
bindsym Left resize shrink width 1 px or 1 ppt
|
||||||
|
bindsym Down resize grow height 1 px or 1 ppt
|
||||||
|
bindsym Up resize shrink height 1 px or 1 ppt
|
||||||
|
bindsym Right resize grow width 1 px or 1 ppt
|
||||||
|
|
||||||
|
# back to normal: Enter or Escape or $mod+r
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
bindsym $mod+r mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
|
# remove extraneous borders
|
||||||
|
hide_edge_borders both
|
||||||
|
|
||||||
|
# allow workspace swap keys to toggle back and forth with prior workspace
|
||||||
|
workspace_auto_back_and_forth yes
|
||||||
|
|
||||||
|
# Startup stuff
|
||||||
|
exec --no-startup-id "xsetroot -solid black"
|
||||||
|
exec --no-startup-id nextcloud
|
51
.config/kitty/kitty.conf
Normal file
51
.config/kitty/kitty.conf
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
cursor_blink_interval 0
|
||||||
|
scrollback_lines 2000
|
||||||
|
|
||||||
|
url_color #0087BD
|
||||||
|
url_style curly
|
||||||
|
|
||||||
|
sync_to_monitor yes
|
||||||
|
|
||||||
|
enable_audio_bell no
|
||||||
|
window_alert_on_bell yes
|
||||||
|
|
||||||
|
foreground #cccccc
|
||||||
|
background #000000
|
||||||
|
|
||||||
|
map kitty_mod+enter new_window_with_cwd
|
||||||
|
map kitty_mod+j previous_window
|
||||||
|
map kitty_mod+k next_window
|
||||||
|
map kitty_mod+up move_window_forward
|
||||||
|
map kitty_mod+down move_window_backward
|
||||||
|
|
||||||
|
map kitty_mod+] next_tab
|
||||||
|
map kitty_mod+[ previous_tab
|
||||||
|
map kitty_mod+right move_tab_forward
|
||||||
|
map kitty_mod+left move_tab_backward
|
||||||
|
map kitty_mod+t new_tab_with_cwd
|
||||||
|
|
||||||
|
map kitty_mod+equal change_font_size all +2.0
|
||||||
|
map kitty_mod+minus change_font_size all -2.0
|
||||||
|
map kitty_mod+backspace change_font_size all 0
|
||||||
|
|
||||||
|
map kitty_mod+u input_unicode_character
|
||||||
|
map kitty_mod+f2 edit_config_file
|
||||||
|
|
||||||
|
color0 #444444
|
||||||
|
color1 #FF0054
|
||||||
|
color2 #B1D630
|
||||||
|
color3 #9D895E
|
||||||
|
color4 #67BEE3
|
||||||
|
color5 #B576BC
|
||||||
|
color6 #569A9F
|
||||||
|
color7 #EDEDED
|
||||||
|
color8 #777777
|
||||||
|
color9 #D65E75
|
||||||
|
color10 #BAFFAA
|
||||||
|
color11 #ECE1C8
|
||||||
|
color12 #9FD3E5
|
||||||
|
color13 #DEB3DF
|
||||||
|
color14 #B6E0E5
|
||||||
|
color15 #FFFFFF
|
||||||
|
background #000000
|
||||||
|
selection #ffffff
|
1
.config/rofi/config
Normal file
1
.config/rofi/config
Normal file
|
@ -0,0 +1 @@
|
||||||
|
rofi.theme: /usr/share/rofi/themes/purple.rasi
|
5
.gitconfig
Normal file
5
.gitconfig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
[user]
|
||||||
|
email = trysdyn@voidfox.com
|
||||||
|
name = Trysdyn Black
|
||||||
|
[push]
|
||||||
|
default = simple
|
21
.taskrc
Normal file
21
.taskrc
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
include /usr/share/taskwarrior/dark-green-256.theme
|
||||||
|
|
||||||
|
data.location=~/Nextcloud/My Library/taskwarrior
|
||||||
|
|
||||||
|
# Quick "What I did yesterday/today" standup report
|
||||||
|
report.standup.labels=Status,Modified,Description
|
||||||
|
report.standup.columns=status,modified.relative,description.count
|
||||||
|
report.standup.sort=modified+
|
||||||
|
report.standup.filter=modified.after:yesterday or +next
|
||||||
|
|
||||||
|
# Same as above but weekly report
|
||||||
|
report.weekly.labels=Status,Modified,Description
|
||||||
|
report.weekly.columns=status,modified.relative,description.count
|
||||||
|
report.weekly.sort=modified+
|
||||||
|
report.weekly.filter=modified.after:today-7d or +next
|
||||||
|
|
||||||
|
# Remove annotations from default (next) report; just count them instead
|
||||||
|
report.next.columns=id,start.age,entry.age,depends,priority,project,tags,recur,scheduled.countdown,due.relative,until.remaining,description.count,urgency
|
||||||
|
|
||||||
|
# Remove blank lines and useless things like task totals in searches
|
||||||
|
verbose=label,footnote,new-id,special,edit,project
|
83
.vimrc
Normal file
83
.vimrc
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
" Ensure certain plugins work by removing vi compatable modes
|
||||||
|
set nocompatible
|
||||||
|
|
||||||
|
" Start Vundle, temporarily set some values
|
||||||
|
set rtp+=~/.vim/bundle/Vundle.vim
|
||||||
|
filetype off
|
||||||
|
call vundle#begin()
|
||||||
|
|
||||||
|
" Plugin execution
|
||||||
|
Plugin 'VundleVim/Vundle.vim'
|
||||||
|
Plugin 'vim-pandoc/vim-pandoc'
|
||||||
|
Plugin 'vim-pandoc/vim-pandoc-syntax'
|
||||||
|
Plugin 'tpope/vim-surround'
|
||||||
|
Plugin 'mhinz/vim-startify'
|
||||||
|
Plugin 'vim-airline/vim-airline'
|
||||||
|
Plugin 'dense-analysis/ale'
|
||||||
|
Plugin 'noahfrederick/vim-hemisu'
|
||||||
|
|
||||||
|
" End Vundle startup, reset changed values as desired
|
||||||
|
call vundle#end()
|
||||||
|
filetype plugin indent on
|
||||||
|
|
||||||
|
" Visual themeing
|
||||||
|
set termguicolors "Enable 256 colors
|
||||||
|
set scrolloff=5 "Always display 5 lines below cursor when scrolling
|
||||||
|
colorscheme hemisu
|
||||||
|
set background=dark
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
|
||||||
|
" Set UTF-8 default
|
||||||
|
set encoding=utf-8
|
||||||
|
|
||||||
|
" Searching Modifications
|
||||||
|
set hlsearch "highlight search matches
|
||||||
|
set incsearch
|
||||||
|
set ignorecase
|
||||||
|
set smartcase
|
||||||
|
|
||||||
|
" Tabs and Whitespace
|
||||||
|
set breakindent
|
||||||
|
set autoindent
|
||||||
|
set smartindent
|
||||||
|
set nowrap
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
set softtabstop=4
|
||||||
|
set expandtab
|
||||||
|
set list listchars=tab:\ \ ,trail:.
|
||||||
|
|
||||||
|
" Command completion
|
||||||
|
set wildmenu
|
||||||
|
set wildignorecase
|
||||||
|
|
||||||
|
" Syntax Highlighting
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
" Directories for backup files
|
||||||
|
set backupdir=~/.vim/backup
|
||||||
|
set directory=~/.vim/backup
|
||||||
|
|
||||||
|
" Disable markdown spelling by default
|
||||||
|
let g:pandoc#modules#disabled = ["spell"]
|
||||||
|
|
||||||
|
" Fixes to pandoc's rules to make markdown less ugly
|
||||||
|
let g:pandoc#syntax#codeblocks#embeds#langs = ["python", "bash=sh", "sh"]
|
||||||
|
let g:pandoc#syntax#conceal#blacklist = ["ellipses", "quotes"]
|
||||||
|
let g:pandoc#syntax#conceal#urls = 1
|
||||||
|
|
||||||
|
" Unfold everything by default
|
||||||
|
set foldlevel=99
|
||||||
|
|
||||||
|
" Bracketed Paste
|
||||||
|
let &t_ti = &t_ti . "\e[?2004h"
|
||||||
|
let &t_te = "\e[?2004l" . &t_te
|
||||||
|
function XTermPasteBegin(ret)
|
||||||
|
set pastetoggle=<Esc>[201~
|
||||||
|
set paste
|
||||||
|
return a:ret
|
||||||
|
endfunction
|
||||||
|
map <expr> <Esc>[200~ XTermPasteBegin("i")
|
||||||
|
imap <expr> <Esc>[200~ XTermPasteBegin("")
|
||||||
|
cmap <Esc>[200~ <nop>
|
||||||
|
cmap <Esc>[201~ <nop>
|
29
.zshrc
Normal file
29
.zshrc
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||||
|
# Initialization code that may require console input (password prompts, [y/n]
|
||||||
|
# confirmations, etc.) must go above this block; everything else may go below.
|
||||||
|
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||||
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
source ~/.p10k/powerlevel10k.zsh-theme
|
||||||
|
|
||||||
|
export EDITOR=vim
|
||||||
|
export PAGER=most
|
||||||
|
|
||||||
|
HISTFILE=~/.zsh_history
|
||||||
|
HISTSIZE=10000
|
||||||
|
SAVEHIST=10000
|
||||||
|
setopt appendhistory
|
||||||
|
|
||||||
|
alias ct="clear && task"
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
alias fgrep='fgrep --color=auto'
|
||||||
|
alias egrep='egrep --color=auto'
|
||||||
|
alias diff='diff --color=auto'
|
||||||
|
|
||||||
|
# Case-insensetive tab completion
|
||||||
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||||
|
|
||||||
|
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||||
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
1
README.md
Normal file
1
README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Personal dotfiles
|
86
setup_dotfiles.py
Executable file
86
setup_dotfiles.py
Executable file
|
@ -0,0 +1,86 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Syncronizes dotfiles from a source dir that mimics a homedir tree to a homedir,
|
||||||
|
removing old symlinks as necessary as well as optionally files.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
FORCE = False
|
||||||
|
HOMEDIR = os.path.expanduser("~")
|
||||||
|
SOURCEDIR = os.path.dirname(os.path.join(os.path.realpath(__file__)))
|
||||||
|
|
||||||
|
EXCLUSIONS = [
|
||||||
|
".git",
|
||||||
|
"setup_dotfiles.py",
|
||||||
|
"README.md"
|
||||||
|
]
|
||||||
|
|
||||||
|
def check_and_remove(source, destination, force=False):
|
||||||
|
"""
|
||||||
|
Checks if a file exists and removes it if appropriate.
|
||||||
|
|
||||||
|
If it's a symlink we check it points the right place and remove it if not.
|
||||||
|
|
||||||
|
If it's a file, we remove it if --force is provided, or error if not.
|
||||||
|
|
||||||
|
If we need to re-deply the symlink, return True, else return False.
|
||||||
|
"""
|
||||||
|
pathlib.Path(os.path.dirname(destination)).mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
# Destination exists as a symlink
|
||||||
|
if os.path.islink(destination):
|
||||||
|
# Symlink is correct, return
|
||||||
|
if os.readlink(destination) == source:
|
||||||
|
return False
|
||||||
|
# Symlink is incorrect, remove it
|
||||||
|
os.unlink(destination)
|
||||||
|
# Destination exists as a file
|
||||||
|
elif os.path.exists(destination):
|
||||||
|
# Force mode enabled, remove it (Data loss risk!!)
|
||||||
|
if force:
|
||||||
|
os.remove(destination)
|
||||||
|
# Force mode diseabled, error out
|
||||||
|
else:
|
||||||
|
raise OSError(f"{destination} exists as a file and --force not provided")
|
||||||
|
|
||||||
|
# File doesn't exists or undefined "thing" happened, return True to try to
|
||||||
|
# write, and if something goes wrong, we'll see the OSError
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def install_dotfiles(source_dir, dest_dir, exclusions, force=False):
|
||||||
|
"""
|
||||||
|
Iterates the files present in source_dir, excluding EXCLUSIONS, and syncs
|
||||||
|
them to dest_dir, overwriting files that exist if force is true.
|
||||||
|
"""
|
||||||
|
# source_dir needs to end in an / to make replacements work
|
||||||
|
if not source_dir.endswith("/"):
|
||||||
|
source_dir = source_dir + "/"
|
||||||
|
|
||||||
|
for root, dir_names, file_names in os.walk(source_dir):
|
||||||
|
# Remove exclusions from the walk list so we don't touch them
|
||||||
|
for exclusion in exclusions:
|
||||||
|
if exclusion in dir_names:
|
||||||
|
dir_names.remove(exclusion)
|
||||||
|
if exclusion in file_names:
|
||||||
|
file_names.remove(exclusion)
|
||||||
|
|
||||||
|
for file_name in file_names:
|
||||||
|
# Get the full path for the source file
|
||||||
|
source = os.path.join(root, file_name)
|
||||||
|
|
||||||
|
# Get the full path for where the symlink should go
|
||||||
|
# We remove the source_dir to get a dotfile dir relative path
|
||||||
|
destination = os.path.join(dest_dir, source.replace(source_dir, ''))
|
||||||
|
|
||||||
|
# Check for and remove the destination file if it exists
|
||||||
|
# If a removal occurs, catch True and deploy the symlink
|
||||||
|
if check_and_remove(source, destination, force):
|
||||||
|
print(f"Symlinking {source} => {destination}")
|
||||||
|
os.symlink(source, destination)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
install_dotfiles(SOURCEDIR, HOMEDIR, EXCLUSIONS, False)
|
Loading…
Add table
Reference in a new issue