From d9362f346f3609007060bdec8ab6691a5537b0ad Mon Sep 17 00:00:00 2001 From: ds6 Date: Thu, 30 Nov 2017 18:20:39 -0600 Subject: [PATCH] split files to base/ xdg/; fixed vol keys, install added XDG configs in `xdg/' and env exports in `.zshenv'. files are in `xdg/' for XDG-style configs (eg. files in `.config') and in `base/' for legacy dotfile-style configs (eg. `.zshrc'). install.sh was modified to support this. volume keys in i3 were fixed. vim tw removed by default. --- .gitignore | 5 + .Xmodmap => base/.Xmodmap | 0 .Xresources => base/.Xresources | 0 .dialogrc => base/.dialogrc | 0 .gitconfig => base/.gitconfig | 0 .gtkrc-2.0 => base/.gtkrc-2.0 | 0 .login_conf => base/.login_conf | 0 .pythonrc => base/.pythonrc | 0 {.vim => base/.vim}/autoload/todo/txt.vim | 0 {.vim => base/.vim}/doc/tags | 0 {.vim => base/.vim}/doc/todo.txt | 0 {.vim => base/.vim}/ftdetect/todo.vim | 0 {.vim => base/.vim}/ftplugin/todo.vim | 0 .../python/dateregex/dateregex/__init__.py | 0 .../python/dateregex/dateregex/after.py | 0 .../python/dateregex/dateregex/before.py | 0 {.vim => base/.vim}/syntax/python/todo.py | 0 {.vim => base/.vim}/syntax/todo.vim | 0 .vimrc => base/.vimrc | 9 +- .xinitrc => base/.xinitrc | 0 .zlogout => base/.zlogout | 0 .zshenv => base/.zshenv | 4 +- .zshrc => base/.zshrc | 16 +- install.sh | 13 +- xdg/compton.conf | 54 +++++ xdg/dunst/dunstrc | 46 ++++ xdg/gtk-3.0/settings.ini | 5 + i3-config => xdg/i3/config | 8 +- i3status-config => xdg/i3status/config | 0 xdg/luakit/rc.lua | 187 +++++++++++++++++ xdg/luakit/theme.lua | 106 ++++++++++ xdg/tint2/tint2rc | 198 ++++++++++++++++++ 32 files changed, 630 insertions(+), 21 deletions(-) create mode 100644 .gitignore rename .Xmodmap => base/.Xmodmap (100%) rename .Xresources => base/.Xresources (100%) rename .dialogrc => base/.dialogrc (100%) rename .gitconfig => base/.gitconfig (100%) rename .gtkrc-2.0 => base/.gtkrc-2.0 (100%) rename .login_conf => base/.login_conf (100%) rename .pythonrc => base/.pythonrc (100%) rename {.vim => base/.vim}/autoload/todo/txt.vim (100%) rename {.vim => base/.vim}/doc/tags (100%) rename {.vim => base/.vim}/doc/todo.txt (100%) rename {.vim => base/.vim}/ftdetect/todo.vim (100%) rename {.vim => base/.vim}/ftplugin/todo.vim (100%) rename {.vim => base/.vim}/syntax/python/dateregex/dateregex/__init__.py (100%) rename {.vim => base/.vim}/syntax/python/dateregex/dateregex/after.py (100%) rename {.vim => base/.vim}/syntax/python/dateregex/dateregex/before.py (100%) rename {.vim => base/.vim}/syntax/python/todo.py (100%) rename {.vim => base/.vim}/syntax/todo.vim (100%) rename .vimrc => base/.vimrc (92%) rename .xinitrc => base/.xinitrc (100%) rename .zlogout => base/.zlogout (100%) rename .zshenv => base/.zshenv (64%) rename .zshrc => base/.zshrc (84%) create mode 100644 xdg/compton.conf create mode 100644 xdg/dunst/dunstrc create mode 100644 xdg/gtk-3.0/settings.ini rename i3-config => xdg/i3/config (96%) rename i3status-config => xdg/i3status/config (100%) create mode 100644 xdg/luakit/rc.lua create mode 100644 xdg/luakit/theme.lua create mode 100644 xdg/tint2/tint2rc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7da8187 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +xdg/tint2/tint2rc.backup.* + +# vim +base/.vim/.netrwhist +*.swp diff --git a/.Xmodmap b/base/.Xmodmap similarity index 100% rename from .Xmodmap rename to base/.Xmodmap diff --git a/.Xresources b/base/.Xresources similarity index 100% rename from .Xresources rename to base/.Xresources diff --git a/.dialogrc b/base/.dialogrc similarity index 100% rename from .dialogrc rename to base/.dialogrc diff --git a/.gitconfig b/base/.gitconfig similarity index 100% rename from .gitconfig rename to base/.gitconfig diff --git a/.gtkrc-2.0 b/base/.gtkrc-2.0 similarity index 100% rename from .gtkrc-2.0 rename to base/.gtkrc-2.0 diff --git a/.login_conf b/base/.login_conf similarity index 100% rename from .login_conf rename to base/.login_conf diff --git a/.pythonrc b/base/.pythonrc similarity index 100% rename from .pythonrc rename to base/.pythonrc diff --git a/.vim/autoload/todo/txt.vim b/base/.vim/autoload/todo/txt.vim similarity index 100% rename from .vim/autoload/todo/txt.vim rename to base/.vim/autoload/todo/txt.vim diff --git a/.vim/doc/tags b/base/.vim/doc/tags similarity index 100% rename from .vim/doc/tags rename to base/.vim/doc/tags diff --git a/.vim/doc/todo.txt b/base/.vim/doc/todo.txt similarity index 100% rename from .vim/doc/todo.txt rename to base/.vim/doc/todo.txt diff --git a/.vim/ftdetect/todo.vim b/base/.vim/ftdetect/todo.vim similarity index 100% rename from .vim/ftdetect/todo.vim rename to base/.vim/ftdetect/todo.vim diff --git a/.vim/ftplugin/todo.vim b/base/.vim/ftplugin/todo.vim similarity index 100% rename from .vim/ftplugin/todo.vim rename to base/.vim/ftplugin/todo.vim diff --git a/.vim/syntax/python/dateregex/dateregex/__init__.py b/base/.vim/syntax/python/dateregex/dateregex/__init__.py similarity index 100% rename from .vim/syntax/python/dateregex/dateregex/__init__.py rename to base/.vim/syntax/python/dateregex/dateregex/__init__.py diff --git a/.vim/syntax/python/dateregex/dateregex/after.py b/base/.vim/syntax/python/dateregex/dateregex/after.py similarity index 100% rename from .vim/syntax/python/dateregex/dateregex/after.py rename to base/.vim/syntax/python/dateregex/dateregex/after.py diff --git a/.vim/syntax/python/dateregex/dateregex/before.py b/base/.vim/syntax/python/dateregex/dateregex/before.py similarity index 100% rename from .vim/syntax/python/dateregex/dateregex/before.py rename to base/.vim/syntax/python/dateregex/dateregex/before.py diff --git a/.vim/syntax/python/todo.py b/base/.vim/syntax/python/todo.py similarity index 100% rename from .vim/syntax/python/todo.py rename to base/.vim/syntax/python/todo.py diff --git a/.vim/syntax/todo.vim b/base/.vim/syntax/todo.vim similarity index 100% rename from .vim/syntax/todo.vim rename to base/.vim/syntax/todo.vim diff --git a/.vimrc b/base/.vimrc similarity index 92% rename from .vimrc rename to base/.vimrc index 24611ec..7e81fe3 100644 --- a/.vimrc +++ b/base/.vimrc @@ -6,12 +6,11 @@ source $VIMRUNTIME/defaults.vim packadd matchit set backup -set backupdir=$HOME/tmp// +set backupdir=$HOME/tmp/vim// set undofile -set undodir=$HOME/tmp// +set undodir=$HOME/tmp/vim// set autoindent -set textwidth=79 set colorcolumn=80 autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab autocmd FileType markdown setlocal tabstop=4 shiftwidth=4 expandtab @@ -26,7 +25,7 @@ set list set listchars=tab:├─,extends:»,precedes:«,space:·,trail:∙,nbsp:■ set number set relativenumber -autocmd FocusLost * :set norelativenumber -autocmd FocusGained * :set relativenumber autocmd InsertEnter * :set norelativenumber autocmd InsertLeave * :set relativenumber +autocmd FocusLost * :set norelativenumber +autocmd FocusGained * :set relativenumber diff --git a/.xinitrc b/base/.xinitrc similarity index 100% rename from .xinitrc rename to base/.xinitrc diff --git a/.zlogout b/base/.zlogout similarity index 100% rename from .zlogout rename to base/.zlogout diff --git a/.zshenv b/base/.zshenv similarity index 64% rename from .zshenv rename to base/.zshenv index 987ac8e..7ef4681 100644 --- a/.zshenv +++ b/base/.zshenv @@ -1,5 +1,7 @@ export EDITOR=vim -export XDG_CACHE_HOME="$HOME/tmp/" +export XDG_DATA_HOME="$HOME/share" +export XDG_DATA_DIRS="$HOME/.local/share:/usr/local/share/:/usr/share/" +export XDG_CACHE_HOME="$HOME/tmp" export CLICOLOR= export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=46;34:cd=43;34:su=41;30:sg=46;30:tw=42;30:ow=43;30' diff --git a/.zshrc b/base/.zshrc similarity index 84% rename from .zshrc rename to base/.zshrc index 7ad1611..5fdafa8 100644 --- a/.zshrc +++ b/base/.zshrc @@ -3,7 +3,14 @@ autoload -Uz vcs_info zstyle ':vcs_info:*' enable git zstyle ':vcs_info:*' get-revision true zstyle ':vcs_info:git*' formats "(%F{green}%r/%b%f) %m%u%c " -precmd() { vcs_info } + +function precmd { + vcs_info + print -Pn "\e]0;%#zsh%L %(1j,%jj ,)%~\a" +} +function preexec { + printf "\033]0;%s\a" "$1" +} # prompt setopt prompt_subst @@ -24,6 +31,7 @@ alias la="ls -aF" alias lf="ls -AF" alias ll="ls -lhAF" alias pa="sudo ps -Sudax" +function s { sysctl hw.snd.default_unit=$1 } # be paranoid alias cp='cp -ip' @@ -34,8 +42,8 @@ alias rm='rm -I' alias activate="source bin/activate" # ports -alias pkg-install-make-build-depends="sudo pkg install --automatic \`make build-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`" -alias pkg-install-make-run-depends="sudo pkg install --automatic \`make run-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`" +alias pbuild="sudo pkg install --automatic \`make build-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`" +alias prun="sudo pkg install --automatic \`make run-depends-list | sed 's/\/usr\/ports\// /' | tr -d '\n'\`" # keys bindkey "^[[7~" beginning-of-line #Home @@ -81,4 +89,4 @@ unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install -# vim: ts=8:sts=4:sw=4:et:tw=80 +# vim: ts=8:sts=4:sw=4:et:tw=79 diff --git a/install.sh b/install.sh index 5ac2fae..0befa7c 100755 --- a/install.sh +++ b/install.sh @@ -1,16 +1,17 @@ #!/bin/sh -for x in `find "$PWD" -mindepth 1 -maxdepth 1 \! \( -name '.git' -name 'install.sh' \) -name '.*'`; do + +#fix permissions from git (should probably move this to git hook) +chmod go= base/.zshenv base/.Xresources + +for x in `find "$PWD/base" -mindepth 1 -maxdepth 1`; do ln -vwis "$x" "$HOME/`basename $x`" done -ln -vwis "$PWD/i3-config" "$HOME/.config/i3/config" -ln -vwis "$PWD/i3status-config" "$HOME/.config/i3status/config" touch "$HOME/.hushlogin" -#fix permissions from git (should probably move this to git hook) -chmod go= .zshenv .Xresources -# #FreeBSD tries `_secure_path' on `.login_conf' before reaading the database, #so it needs to be compiled and unlinked for it to actually take effect. +cd "$HOME" rm .login_conf.db cap_mkdb .login_conf unlink .login_conf +cd - diff --git a/xdg/compton.conf b/xdg/compton.conf new file mode 100644 index 0000000..99228bc --- /dev/null +++ b/xdg/compton.conf @@ -0,0 +1,54 @@ +# Shadow +shadow = true; +no-dnd-shadow = true; +no-dock-shadow = true; +clear-shadow = true; +shadow-radius = 7; +shadow-offset-x = -7; +shadow-offset-y = -7; +shadow-opacity = 1; +shadow-exclude = [ + "_GTK_FRAME_EXTENTS@:c", + # fullscreen + "x = 0 && y = 0 && override_redirect = true" +]; +shadow-ignore-shaped = true; +xinerama-shadow-crop = true; + +# Opacity +menu-opacity = 0.9; +inactive-opacity = 0.875; +active-opacity = 1; +alpha-step = 0.01; +inactive-dim = 0.075; +blur-background = true; +blur-kern = "5,5,0.367879,0.535261,0.606531,0.535261,0.367879,0.535261,0.778801,0.882497,0.778801,0.535261,0.606531,0.882497,0.882497,0.606531,0.535261,0.778801,0.882497,0.778801,0.535261,0.367879,0.535261,0.606531,0.535261,0.367879," + +# Fading +fading = true; +fade-delta = 16; +fade-in-step = 0.05; +fade-out-step = 0.05; + +# Rendering +backend = "glx" +glx-no-stencil = true; +glx-no-rebind-pixmap = true; +paint-on-overlay = true; +refresh-rate = 0; +vsync = "opengl-swc"; + +# Other +mark-wmwin-focused = true; +mark-ovredir-focused = true; +use-ewmh-active-win = true; +detect-rounded-corners = true; +detect-client-opacity = true; +detect-transient = true; +detect-client-leader = true; + +# Window type settings +wintypes: +{ + tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true; }; +}; diff --git a/xdg/dunst/dunstrc b/xdg/dunst/dunstrc new file mode 100644 index 0000000..32891c8 --- /dev/null +++ b/xdg/dunst/dunstrc @@ -0,0 +1,46 @@ +[global] +geometry = "400x0-30-30" +follow = keyboard +sort = yes + +font = "Dina, DejaVu Sans Mono, monospace 9" +markup = no +format = "%s %p %a\n%b" +show_age_threshold = 5 + +frame_width = 1 +separator_height = 1 +separator_color = frame +padding = 4 +horizontal_padding = 4 +icon_position = left +icon_folders = "/home/ds6/.icons/Paper/16x16/status/:/home/ds6/.icons/Paper/16x16/devices/:/home/ds6/.icons/Paper/16x16/emblems/:/usr/local/share/icons/Adwaita/16x16/status/:/usr/local/share/icons/Adwaita/16x16/devices/:/usr/local/share/icons/Adwaita/16x16/emblems/" + +dmenu = "/home/ds6/bin/dmenu -p dunst:" +browser = /usr/local/bin/luakit + +[shortcuts] +#close = mod4+mod1+q +#close_all = mod4+mod1+shift+q +history = mod4+grave +context = mod4+shift+grave + +[urgency_low] +background = "#110800" +foreground = "#93a1a1" +frame_color = "#884400" +timeout = 5 + +[urgency_normal] +background = "#221100" +foreground = "#eee8d5" +frame_color = "#268bd2" +timeout = 10 + +[urgency_critical] +background = "#dc332f" +foreground = "#000000" +frame_color = "#ff4400" +timeout = 0 + +# vim: ft=cfg diff --git a/xdg/gtk-3.0/settings.ini b/xdg/gtk-3.0/settings.ini new file mode 100644 index 0000000..444e1c2 --- /dev/null +++ b/xdg/gtk-3.0/settings.ini @@ -0,0 +1,5 @@ +[Settings] +gtk-theme-name=Blackbird +gtk-icon-theme-name=Paper-Mono-Dark +gtk-font-name=Dina 10 +gtk-cursor-theme-name=Adwaita diff --git a/i3-config b/xdg/i3/config similarity index 96% rename from i3-config rename to xdg/i3/config index f87dc41..d37b5d7 100644 --- a/i3-config +++ b/xdg/i3/config @@ -136,9 +136,9 @@ bindcode 198 exec --no-startup-id rotate set normal bindcode 204 exec --no-startup-id rotate right # volume buttons -bindsym XF86AudioMute exec -no-startup-id mixer vol 0 -bindsym XF86AudioRaiseVolume exec -no-startup-id mixer vol +5 -bindsym XF86AudioLowerVolume exec -no-startup-id mixer vol -5 +bindsym XF86AudioMute exec --no-startup-id mixer vol 0 +bindsym XF86AudioLowerVolume exec --no-startup-id mixer vol -5 +bindsym XF86AudioRaiseVolume exec --no-startup-id mixer vol +5 # move and resize [floating] windows mode "translate" { @@ -204,8 +204,6 @@ hide_edge_borders smart new_window pixel 1 gaps inner 6 smart_gaps on -#for_window [class="^URxvt$"] border pixel 1 -#for_window [class="^links$"] border pixel 1 # misc workspace_auto_back_and_forth yes diff --git a/i3status-config b/xdg/i3status/config similarity index 100% rename from i3status-config rename to xdg/i3status/config diff --git a/xdg/luakit/rc.lua b/xdg/luakit/rc.lua new file mode 100644 index 0000000..e784406 --- /dev/null +++ b/xdg/luakit/rc.lua @@ -0,0 +1,187 @@ +------------------------------------------------------------------------------ +-- luakit configuration file, more information at https://luakit.github.io/ -- +------------------------------------------------------------------------------ + +require "lfs" + +require "unique_instance" + +-- Set the number of web processes to use. A value of 0 means 'no limit'. +luakit.process_limit = 4 +-- Set the cookie storage location +soup.cookies_storage = luakit.data_dir .. "/cookies.db" + +-- Load library of useful functions for luakit +local lousy = require "lousy" + +-- Load users theme +-- ("$XDG_CONFIG_HOME/luakit/theme.lua" or "/etc/xdg/luakit/theme.lua") +lousy.theme.init(lousy.util.find_config("theme.lua")) +assert(lousy.theme.get(), "failed to load theme") + +-- Load users window class +-- ("$XDG_CONFIG_HOME/luakit/window.lua" or "/etc/xdg/luakit/window.lua") +local window = require "window" + +-- Load users webview class +-- ("$XDG_CONFIG_HOME/luakit/webview.lua" or "/etc/xdg/luakit/webview.lua") +local webview = require "webview" + +-- Add luakit;//log/ chrome page +local log_chrome = require "log_chrome" + +window.add_signal("build", function (w) + local widgets, l, r = require "lousy.widget", w.sbar.l, w.sbar.r + + -- Left-aligned status bar widgets + l.layout:pack(widgets.uri()) + l.layout:pack(widgets.hist()) + l.layout:pack(widgets.progress()) + + -- Right-aligned status bar widgets + r.layout:pack(widgets.buf()) + r.layout:pack(log_chrome.widget()) + r.layout:pack(widgets.ssl()) + r.layout:pack(widgets.tabi()) + r.layout:pack(widgets.scroll()) +end) + +-- Load luakit binds and modes +local modes = require "modes" +local binds = require "binds" + +local settings = require "settings" +require "settings_chrome" + +---------------------------------- +-- Optional user script loading -- +---------------------------------- + +-- Add adblock +local adblock = require "adblock" +local adblock_chrome = require "adblock_chrome" + +local webinspector = require "webinspector" + +-- Add uzbl-like form filling +local formfiller = require "formfiller" + +-- Add proxy support & manager +local proxy = require "proxy" + +-- Add quickmarks support & manager +local quickmarks = require "quickmarks" + +-- Add session saving/loading support +local session = require "session" + +-- Add command to list closed tabs & bind to open closed tabs +local undoclose = require "undoclose" + +-- Add command to list tab history items +local tabhistory = require "tabhistory" + +-- Add greasemonkey-like javascript userscript support +local userscripts = require "userscripts" + +-- Add bookmarks support +local bookmarks = require "bookmarks" +local bookmarks_chrome = require "bookmarks_chrome" + +-- Add download support +local downloads = require "downloads" +local downloads_chrome = require "downloads_chrome" + +-- Add automatic PDF downloading and opening +local viewpdf = require "viewpdf" + +-- Example using xdg-open for opening downloads / showing download folders +downloads.add_signal("open-file", function (file) + luakit.spawn(string.format("xdg-open %q", file)) + return true +end) + +-- Add vimperator-like link hinting & following +local follow = require "follow" + +-- Add command history +local cmdhist = require "cmdhist" + +-- Add search mode & binds +local search = require "search" + +-- Add ordering of new tabs +local taborder = require "taborder" + +-- Save web history +local history = require "history" +local history_chrome = require "history_chrome" + +local help_chrome = require "help_chrome" +local binds_chrome = require "binds_chrome" + +-- Add command completion +local completion = require "completion" + +-- Press Control-E while in insert mode to edit the contents of the currently +-- focused