This commit is contained in:
James Patrick 2019-12-11 20:31:17 +00:00
commit 19ef1433b2
29 changed files with 153 additions and 43 deletions

View File

@ -1 +1,18 @@
Hello World Hi. This is James Patrick's current collection of dotfiles. If you found this
feel free to steal what ever you want, if you have any questions feel free to
contact me.
# Tenants
1. The time invested in configuring tools will probably never be recouped by
increased productivity. That isn't a reason not to it.
2. Don't write what already exist.
3. Config to have easy setup and tear down, without destroying anything important.
4. Try to stay lean. More tools begets more maintenance.
1. The best code is no code.
2. Its better to have a imperfect tool than to have envs diverge.
3. Allow for variation between envs.
5. Any rule can be ignored if it has a non-stupid reason.
6. Take lots of screenshots.
7. Don't be a idiot and store large files
8. Do not tightly couple components.

View File

@ -15,4 +15,7 @@
;; Deft: Set path to Org-mope Directory ;; Deft: Set path to Org-mope Directory
(setq deft-directory "~/org/") (setq deft-directory "~/org/")
;; Have projectile automatically check code.
(setq projectile-project-search-path '("~/code/")
(setq doom-localleader-key ",") (setq doom-localleader-key ",")

View File

@ -13,14 +13,14 @@
;;japanese ;;japanese
:completion :completion
(company ; the ultimate code completion backend (company ; the ultimate code completion backend.
+childframe +childframe ; Use company-box.
) +tng) ; Compnay on tab.
helm ; the *other* search engine for love and life (helm ; because sometimes I prefer what I know.
+fuzzy) ; woh typse aynthing write teh first time.
;;ido ; the other *other* search engine... ;;ido ; the other *other* search engine...
;;(ivy ; a search engine for love and life ;;(ivy ; a search engine for love and life
;; +fuzzy ;; +fuzzy)
;;)
:ui :ui
deft ; notational velocity for Emacs deft ; notational velocity for Emacs
@ -35,8 +35,8 @@
;;neotree ; a project drawer, like NERDTree for vim ;;neotree ; a project drawer, like NERDTree for vim
ophints ; highlight the region an operation acts on ophints ; highlight the region an operation acts on
(popup ; tame sudden yet inevitable temporary windows (popup ; tame sudden yet inevitable temporary windows
+all ; catch all popups that start with an asterix +all ; catch all popups that start with an asterix
+defaults) ; default popup rules +defaults) ; default popup rules
(pretty-code ; replace bits of code with pretty symbols (pretty-code ; replace bits of code with pretty symbols
+fira) ; I use firaCode or FiraCode derivatives everywhere, all the time. +fira) ; I use firaCode or FiraCode derivatives everywhere, all the time.
;;tabbar ; FIXME an (incomplete) tab bar for Emacs ;;tabbar ; FIXME an (incomplete) tab bar for Emacs
@ -61,9 +61,8 @@
:emacs :emacs
(dired ; making dired pretty [functional] (dired ; making dired pretty [functional]
+ranger ; bringing the goodness of ranger to dired +ranger ; bringing the goodness of ranger to dired
+icons ; colorful icons for dired-mode +icons) ; colorful icons for dired-mode
)
electric ; smarter, keyword-based electric-indent electric ; smarter, keyword-based electric-indent
vc ; version-control and Emacs, sitting in a tree vc ; version-control and Emacs, sitting in a tree
@ -71,29 +70,29 @@
;;eshell ; a consistent, cross-platform shell (WIP) ;;eshell ; a consistent, cross-platform shell (WIP)
;;shell ; a terminal REPL for Emacs ;;shell ; a terminal REPL for Emacs
;;term ; terminals in Emacs ;;term ; terminals in Emacs
;;vterm ; another terminals in Emacs vterm ; another terminals in Emacs
:tools :tools
;;ansible ;;ansible
;;debugger ; FIXME stepping through code, to help you add bugs ;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv ;;direnv
;;docker ;;docker
;;editorconfig ; let someone else argue about tabs vs spaces editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs ;;ein ; tame Jupyter notebooks with emacs
eval ; run code, run (also, repls) eval ; run code, run (also, repls)
flycheck ; tasing you for every semicolon you forget flycheck ; tasing you for every semicolon you forget
flyspell ; tasing you for misspelling mispelling flyspell ; tasing you for misspelling mispelling
;;gist ; interacting with github gists ;;gist ; interacting with github gists
(lookup ; helps you navigate your code and documentation (lookup ; helps you navigate your code and documentation
+docsets) ; ...or in Dash docsets locally +docsets) ; ...or in Dash docsets locally
;;lsp lsp
;;macos ; MacOS-specific commands ;;macos ; MacOS-specific commands
magit ; a git porcelain for Emacs magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs make ; run make tasks from Emacs
;;pass ; password manager for nerds ;;pass ; password manager for nerds
;;pdf ; pdf enhancements ;;pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders ;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings ;rgb ; creating color strings
;;terraform ; infrastructure as code ;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux ;;tmux ; an API for interacting with tmux
;;upload ; map local to remote projects via ssh/ftp ;;upload ; map local to remote projects via ssh/ftp
@ -131,10 +130,11 @@
;;nix ; I hereby declare "nix geht mehr!" ;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel ;;ocaml ; an objective camel
(org ; organize your plain life in plain text (org ; organize your plain life in plain text
+dragndrop ; file drag & drop support +dragndrop ; file drag & drop support
+ipython ; ipython support for babel +ipython ; ipython support for babel
+pandoc ; pandoc integration into org's exporter +gnuplot ; plot suff
+present) ; using Emacs for presentations +pandoc ; pandoc integration into org's exporter
+pomodoro) ; Because timers are helpful.
;;perl ; write code no one else can comprehend ;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother ;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more ;;plantuml ; diagrams for confusing people more
@ -146,11 +146,12 @@
ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
;;scala ; java, but good ;;scala ; java, but good
sh ; she sells {ba,z,fi}sh shells on the C xor (sh ; she sells {ba,z,fi}sh shells on the C xor
+lsp) ; this is somehow a thing?
;;solidity ; do you need a blockchain? No. ;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables? ;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance. ;;terra ; Earth and Moon in alignment for performance.
web ; the tubes (web +lsp) ; the tubes
;;vala ; GObjective-C ;;vala ; GObjective-C
:email :email

View File

@ -51,8 +51,7 @@ update:
ifeq ($(shell [ -e $(EMACSD) ] $(return_val_truthy) ), false) ifeq ($(shell [ -e $(EMACSD) ] $(return_val_truthy) ), false)
$(report) info "Emacs directory doesn't exist." $(report) info "Emacs directory doesn't exist."
else ifeq ($(FRAMEWORK), doom) else ifeq ($(FRAMEWORK), doom)
~/.emacs.d/bin/doom --yes update ~/.emacs.d/bin/doom --yes refresh
~/.emacs.d/bin/doom --yes upgrade
$(report) info "Doom updated" $(report) info "Doom updated"
else else
cd $(EMACSD) \ cd $(EMACSD) \

View File

@ -1,4 +1,6 @@
#! env zsh #! env zsh
# -*- sh -*-
REPORT=`dirname $0`/report REPORT=`dirname $0`/report
if [ -z "$1" ] || [ -z "$2" ] ; then if [ -z "$1" ] || [ -z "$2" ] ; then
@ -12,3 +14,4 @@ if [[ -e $2 ]] ; then
fi fi
$REPORT info "Symlinked `ln -svf $1 $2`" $REPORT info "Symlinked `ln -svf $1 $2`"

View File

@ -1,4 +1,5 @@
#! env zsh #! env zsh
# -*- sh -*-
R='\033[0;31m' R='\033[0;31m'
Y='\033[0;33m' Y='\033[0;33m'
G='\033[0;32m' G='\033[0;32m'
@ -21,3 +22,4 @@ if [[ -z $2 ]] ; then
else else
format $1 $2 format $1 $2
fi fi

View File

@ -1,4 +1,5 @@
#! env zsh #! env zsh
# -*- sh -*-
REPORT=`dirname $0`/report REPORT=`dirname $0`/report
if [[ -z $1 ]] ; then if [[ -z $1 ]] ; then
@ -18,3 +19,4 @@ fi
$REPORT info "Deleting $1" $REPORT info "Deleting $1"
rm $1 rm $1

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
# -*- zsh -*-
local_hook="$HOME"/.git_template.local/hooks/post-merge local_hook="$HOME"/.git_template.local/hooks/post-merge
[ -f "$local_hook" ] && . "$local_hook" [ -f "$local_hook" ] && . "$local_hook"
@ -6,3 +7,4 @@ local_hook="$HOME"/.git_template.local/hooks/post-merge
.git/hooks/ctags >/dev/null 2>&1 & .git/hooks/ctags >/dev/null 2>&1 &
make update make update

View File

@ -15,7 +15,7 @@ return_val_truthy := && echo true || echo false
cmd_exist = $(shell (($$+commands[$1])) $(return_val_truthy) ) cmd_exist = $(shell (($$+commands[$1])) $(return_val_truthy) )
# Shortcut for the XDG dir if it exist. default to ~/.confg # Shortcut for the XDG dir if it exist. default to ~/.confg
XDG_DIR := $${XDG_CONFIG_DIR:-~/.config} XDG_DIR := $${XDG_CONFIG_HOME:-~/.config}
# Some things will OS specific. # Some things will OS specific.
# With this you can use `$(IS_MAC) && echo "I'm a Mac" || echo "I'm not a Mac"` # With this you can use `$(IS_MAC) && echo "I'm a Mac" || echo "I'm not a Mac"`

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# -*- sh -*-
# cmds=($(bluetoothctl help | cut -d' ' -f1 | sed 's/[\x01-\x1F\x7F]//g' | sed 's/\[[0-9];[0-9]\+m//g')) # cmds=($(bluetoothctl help | cut -d' ' -f1 | sed 's/[\x01-\x1F\x7F]//g' | sed 's/\[[0-9];[0-9]\+m//g'))
# unset "cmds[2]" # unset "cmds[2]"

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# -*- sh -*-
STATUS="$(playerctl status)" STATUS="$(playerctl status)"
MSG="$(playerctl metadata --format '{{xesam:title}} - {{xesam:artist}}')" MSG="$(playerctl metadata --format '{{xesam:title}} - {{xesam:artist}}')"

View File

@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# -*- sh -*-
OPTIONS=" Lock OPTIONS=" Lock
鈴 Sleep 鈴 Sleep

View File

@ -1,6 +1,6 @@
SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SOURCE := $(SRC_DIR)/config CONFIG_SRC := $(SRC_DIR)/config
TARGET := ~/.ssh/config CONFIG_TRGT := ~/.ssh/config
JPATRICK_KEY := ~/.ssh/git.jpatrick.io JPATRICK_KEY := ~/.ssh/git.jpatrick.io
include ../lib/shared.mk include ../lib/shared.mk
@ -9,10 +9,16 @@ install: | init update
init: init:
$(info => Setting up ssh) $(info => Setting up ssh)
$(mk_link) $(SOURCE) $(TARGET) $(mk_link) $(CONFIG_SRC) $(CONFIG_TRGT)
$(mk_link) $(SRC_DIR)/public_keys ~/.ssh/public_keys
$(MAKE) -C $(SRC_DIR) init_jpatrick_key $(MAKE) -C $(SRC_DIR) init_jpatrick_key
update: update:
cd ~/.ssh \
&& mkdir -p public_keys/`hostname` \
&& for i in *.pub ; do ; \
cp $$i public_keys/`hostname`/$$i ; \
done
remove: remove:
$(info => Remvoing ssh) $(info => Remvoing ssh)

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHc429ju3N/DoIe7r4F35asaZeNv6/ZWPGXlQiEHUMtf zuk Tue Apr 16 21:54:38 EDT 2019

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC9pheTZRF6Yo2Od0b8CyxLuazodEtB/5oAEDei8cBvi zuk: Sun 10 Nov 2019 11:50:45 AM EST

View File

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICmLHzD7WneJQEHCNgT5k/4wa8rM07yQVu8w7nH3dNU5 zuk: 20190430235108

View File

@ -2,6 +2,7 @@
# #
# Logo key. Use Mod1 for Alt. # Logo key. Use Mod1 for Alt.
set $mod Mod4 set $mod Mod4
set $ctrl Control
# Home row direction keys, like vim # Home row direction keys, like vim
set $left h set $left h
set $down j set $down j
@ -21,6 +22,7 @@ set $PIP floating enabled ; sticky enabled ; border pixel 0
for_window [class="mpv"] $PIP for_window [class="mpv"] $PIP
for_window [class="pip"] $PIP for_window [class="pip"] $PIP
for_window [window_role="PictureInPicture"] $PIP for_window [window_role="PictureInPicture"] $PIP
for_window [class="feh"] floating enabled ; border pixel 0
# Status Bar: # Status Bar:
bar { bar {

View File

@ -67,11 +67,9 @@ bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9 bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10 bindsym $mod+Shift+0 move container to workspace 10
#bindsym $mod+print exec file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').mp4 \ # Printscreen functions
## && wf-recorder -g "$(slurp)" $file \
## && wl-copy $file \
## && notify-send -i $file "File copied to clipboard"
bindsym print exec $printscreen bindsym print exec $printscreen
bindsym $ctrl+print exec farge
################################################################################ ################################################################################
# Layout stuff: # Layout stuff:

View File

@ -1,4 +1,5 @@
#! /bin/sh #! /bin/sh
# -*- sh -*-
# Lifted from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # Lifted from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ... # usage: import-gsettings <gsettings key>:<settings.ini key> <gsettings key>:<settings.ini key> ...

View File

@ -1,4 +1,5 @@
#! /bin/sh #! /bin/sh
# -*- sh -*-
rofi \ rofi \
-show drun \ -show drun \
-p run \ -p run \

View File

@ -1,2 +1,3 @@
#! /bin/sh #! /bin/sh
# -*- sh -*-
clipman --selector="rofi" --select clipman --selector="rofi" --select

View File

@ -1,4 +1,5 @@
#! /bin/sh #! /bin/sh
# -*- sh -*-
gopass ls --flat \ gopass ls --flat \
| rofi -dmenu -p pass -i \ | rofi -dmenu -p pass -i \
| xargs --no-run-if-empty gopass show -c | xargs --no-run-if-empty gopass show -c

View File

@ -1,4 +1,5 @@
#! /bin/sh #! /bin/sh
# -*- sh -*-
file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').png file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').png
grim -g "$(slurp)" $file \ grim -g "$(slurp)" $file \

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/bin/bash
# -*- sh -*-
#
while read IN while read IN
do do
[[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0 [[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# -*- sh -*-
message="$@" message="$@"
case "$OSTYPE" in case "$OSTYPE" in
@ -7,10 +8,10 @@ case "$OSTYPE" in
;; ;;
linux*) linux*)
mimic \ mimic \
--setf duration_stretch=0.5 \ --setf duration_stretch=0.65 \
-t "$message" \ -t "$message" \
-voice 'slt_hts' -voice 'kal16'
#-voice 'kal16' #-voice 'slt'
;; ;;
*) *)
echo "unsupported OS" echo "unsupported OS"

View File

@ -130,7 +130,7 @@
.TridactylStatusIndicator { .TridactylStatusIndicator {
background: var(--tridactyl-bg) !important; background: var(--tridactyl-bg) !important;
border: 1px var(--base0B) solid !important; border: 1px var(--base0B) solid !important;
color: var(--base0B) color: var(--base0B);
border: unset !important; border: unset !important;
bottom: 0 !important; bottom: 0 !important;
font-size: 12pt !important; font-size: 12pt !important;

46
zsh/modules/bin/tellme Executable file
View File

@ -0,0 +1,46 @@
#! /bin/bash
export CONFIG=${XDG_CONFIG_HOME:-~/.config}/tellme/creds
# Load config file if it exist.
[ -f $CONFIG ] && export $(grep -v '^#' $CONFIG | xargs)
usage(){
echo "You have to tell me something"
exit -1
}
setup(){
echo "It doesn't look like I've been setup yet. I will need the Application & User tokens."
read -r -p " Application Token: " APPLICATION_TOKEN
read -r -p " User Token: " USER_TOKEN
mkdir -p $(dirname $CONFIG)
cat <<-EOF > $CONFIG
application_token=$APPLICATION_TOKEN
user_token=$USER_TOKEN
EOF
chmod 600 $CONFIG
echo "Config setup at $CONFIG"
echo
}
if [[ -z $application_token || -z $user_token ]] ; then
setup
export $(grep -v '^#' $CONFIG | xargs)
fi
if [[ $# -eq 0 ]] ; then
usage
fi
message=$@
curl -s \
--form-string "token=$application_token" \
--form-string "user=$user_token" \
--form-string "message=$message" \
https://api.pushover.net/1/messages.json \
| grep "\"status\":1," 1>/dev/null
[[ $? -eq 0 ]] && echo "message sent" || echo "ERROR SENDING NOTIFICATION"
printf '\a' #Rings bell

View File

@ -6,7 +6,7 @@ if (( ! $+commands[tmux] )); then
fi fi
# If running as root, stop and return. # If running as root, stop and return.
if [ "$EUID" -ne 0 ] ; then if [ "$EUID" -eq 0 ] ; then
return 0 return 0
fi fi

17
zsh/zplug Normal file → Executable file
View File

@ -2,6 +2,18 @@
source ${ZPLUG_HOME}/init.zsh source ${ZPLUG_HOME}/init.zsh
zplug "junegunn/fzf-bin", \
from:gh-r, \
as:command, \
rename-to:fzf
zplug "zdharma/zsh-diff-so-fancy", \
as:command, \
use:"bin/{git-dsf,diff-so-fancy}"
zplug "${ZDIR}/modules/bin/", \
as:command, \
use:"*"
zplug "zdharma/fast-syntax-highlighting", \ zplug "zdharma/fast-syntax-highlighting", \
as:plugin, \ as:plugin, \
defer:2 defer:2
@ -14,7 +26,9 @@ zplug "zsh-users/zsh-history-substring-search", \
as:plugin, \ as:plugin, \
defer:2 defer:2
zplug "zpm-zsh/autoenv" zplug "zpm-zsh/autoenv", \
as:plugin, \
defer:2
zplug "zsh-users/zsh-autosuggestions", \ zplug "zsh-users/zsh-autosuggestions", \
as:plugin, \ as:plugin, \
@ -34,6 +48,7 @@ zplug "zdharma/zsh-diff-so-fancy", \
use:"bin/{git-dsf,diff-so-fancy}" use:"bin/{git-dsf,diff-so-fancy}"
zplug "${ZDIR}/modules/bin/", \ zplug "${ZDIR}/modules/bin/", \
from:local, \
as:command, \ as:command, \
use:"*" use:"*"