diff --git a/README.md b/README.md index 557db03..cf0b27e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/emacs/doom.d/config.el b/emacs/doom.d/config.el index abf6220..d8e0756 100644 --- a/emacs/doom.d/config.el +++ b/emacs/doom.d/config.el @@ -15,4 +15,7 @@ ;; Deft: Set path to Org-mope Directory (setq deft-directory "~/org/") +;; Have projectile automatically check code. +(setq projectile-project-search-path '("~/code/") + (setq doom-localleader-key ",") diff --git a/emacs/doom.d/init.el b/emacs/doom.d/init.el index 6992034..9aaf1fe 100644 --- a/emacs/doom.d/init.el +++ b/emacs/doom.d/init.el @@ -13,14 +13,14 @@ ;;japanese :completion - (company ; the ultimate code completion backend - +childframe - ) - helm ; the *other* search engine for love and life + (company ; the ultimate code completion backend. + +childframe ; Use company-box. + +tng) ; Compnay on tab. + (helm ; because sometimes I prefer what I know. + +fuzzy) ; woh typse aynthing write teh first time. ;;ido ; the other *other* search engine... ;;(ivy ; a search engine for love and life - ;; +fuzzy - ;;) + ;; +fuzzy) :ui deft ; notational velocity for Emacs @@ -35,8 +35,8 @@ ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on (popup ; tame sudden yet inevitable temporary windows - +all ; catch all popups that start with an asterix - +defaults) ; default popup rules + +all ; catch all popups that start with an asterix + +defaults) ; default popup rules (pretty-code ; replace bits of code with pretty symbols +fira) ; I use firaCode or FiraCode derivatives everywhere, all the time. ;;tabbar ; FIXME an (incomplete) tab bar for Emacs @@ -61,9 +61,8 @@ :emacs (dired ; making dired pretty [functional] - +ranger ; bringing the goodness of ranger to dired - +icons ; colorful icons for dired-mode - ) + +ranger ; bringing the goodness of ranger to dired + +icons) ; colorful icons for dired-mode electric ; smarter, keyword-based electric-indent vc ; version-control and Emacs, sitting in a tree @@ -71,29 +70,29 @@ ;;eshell ; a consistent, cross-platform shell (WIP) ;;shell ; a terminal REPL for Emacs ;;term ; terminals in Emacs - ;;vterm ; another terminals in Emacs - + vterm ; another terminals in Emacs + :tools ;;ansible ;;debugger ; FIXME stepping through code, to help you add bugs ;;direnv ;;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 eval ; run code, run (also, repls) flycheck ; tasing you for every semicolon you forget flyspell ; tasing you for misspelling mispelling ;;gist ; interacting with github gists (lookup ; helps you navigate your code and documentation - +docsets) ; ...or in Dash docsets locally - ;;lsp + +docsets) ; ...or in Dash docsets locally + lsp ;;macos ; MacOS-specific commands magit ; a git porcelain for Emacs - ;;make ; run make tasks from Emacs + make ; run make tasks from Emacs ;;pass ; password manager for nerds ;;pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders - ;;rgb ; creating color strings + ;rgb ; creating color strings ;;terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux ;;upload ; map local to remote projects via ssh/ftp @@ -131,10 +130,11 @@ ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org ; organize your plain life in plain text - +dragndrop ; file drag & drop support - +ipython ; ipython support for babel - +pandoc ; pandoc integration into org's exporter - +present) ; using Emacs for presentations + +dragndrop ; file drag & drop support + +ipython ; ipython support for babel + +gnuplot ; plot suff + +pandoc ; pandoc integration into org's exporter + +pomodoro) ; Because timers are helpful. ;;perl ; write code no one else can comprehend ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more @@ -146,11 +146,12 @@ ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;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. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - web ; the tubes + (web +lsp) ; the tubes ;;vala ; GObjective-C :email diff --git a/emacs/makefile b/emacs/makefile index 9671875..f2e4c32 100644 --- a/emacs/makefile +++ b/emacs/makefile @@ -51,8 +51,7 @@ update: ifeq ($(shell [ -e $(EMACSD) ] $(return_val_truthy) ), false) $(report) info "Emacs directory doesn't exist." else ifeq ($(FRAMEWORK), doom) - ~/.emacs.d/bin/doom --yes update - ~/.emacs.d/bin/doom --yes upgrade + ~/.emacs.d/bin/doom --yes refresh $(report) info "Doom updated" else cd $(EMACSD) \ diff --git a/lib/helper/mk_link b/lib/helper/mk_link index 50a3197..15ce8c6 100755 --- a/lib/helper/mk_link +++ b/lib/helper/mk_link @@ -1,4 +1,6 @@ #! env zsh +# -*- sh -*- + REPORT=`dirname $0`/report if [ -z "$1" ] || [ -z "$2" ] ; then @@ -12,3 +14,4 @@ if [[ -e $2 ]] ; then fi $REPORT info "Symlinked `ln -svf $1 $2`" + diff --git a/lib/helper/report b/lib/helper/report index 2ac3318..758c0b0 100755 --- a/lib/helper/report +++ b/lib/helper/report @@ -1,4 +1,5 @@ #! env zsh +# -*- sh -*- R='\033[0;31m' Y='\033[0;33m' G='\033[0;32m' @@ -21,3 +22,4 @@ if [[ -z $2 ]] ; then else format $1 $2 fi + diff --git a/lib/helper/rm_link b/lib/helper/rm_link index fa951d4..2aa1c6a 100755 --- a/lib/helper/rm_link +++ b/lib/helper/rm_link @@ -1,4 +1,5 @@ #! env zsh +# -*- sh -*- REPORT=`dirname $0`/report if [[ -z $1 ]] ; then @@ -18,3 +19,4 @@ fi $REPORT info "Deleting $1" rm $1 + diff --git a/lib/post-merge b/lib/post-merge index 075e5b4..7e248b5 100755 --- a/lib/post-merge +++ b/lib/post-merge @@ -1,4 +1,5 @@ #!/bin/sh +# -*- zsh -*- local_hook="$HOME"/.git_template.local/hooks/post-merge [ -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 & make update + diff --git a/lib/shared.mk b/lib/shared.mk index 1dcdb98..a2459de 100644 --- a/lib/shared.mk +++ b/lib/shared.mk @@ -15,7 +15,7 @@ return_val_truthy := && echo true || echo false cmd_exist = $(shell (($$+commands[$1])) $(return_val_truthy) ) # 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. # With this you can use `$(IS_MAC) && echo "I'm a Mac" || echo "I'm not a Mac"` diff --git a/rofi/scripts/btctl b/rofi/scripts/btctl index 2da5d6b..741605b 100755 --- a/rofi/scripts/btctl +++ b/rofi/scripts/btctl @@ -1,4 +1,5 @@ #!/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')) # unset "cmds[2]" diff --git a/rofi/scripts/media_controls b/rofi/scripts/media_controls index c0fc4c4..ba18b0e 100755 --- a/rofi/scripts/media_controls +++ b/rofi/scripts/media_controls @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# -*- sh -*- STATUS="$(playerctl status)" MSG="$(playerctl metadata --format '{{xesam:title}} - {{xesam:artist}}')" diff --git a/rofi/scripts/power_menu b/rofi/scripts/power_menu index c1c673d..5f66a9e 100755 --- a/rofi/scripts/power_menu +++ b/rofi/scripts/power_menu @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# -*- sh -*- OPTIONS=" Lock 鈴 Sleep diff --git a/ssh/makefile b/ssh/makefile index 0face91..f49e34e 100644 --- a/ssh/makefile +++ b/ssh/makefile @@ -1,6 +1,6 @@ SRC_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) -SOURCE := $(SRC_DIR)/config -TARGET := ~/.ssh/config +CONFIG_SRC := $(SRC_DIR)/config +CONFIG_TRGT := ~/.ssh/config JPATRICK_KEY := ~/.ssh/git.jpatrick.io include ../lib/shared.mk @@ -9,10 +9,16 @@ install: | init update init: $(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 update: + cd ~/.ssh \ + && mkdir -p public_keys/`hostname` \ + && for i in *.pub ; do ; \ + cp $$i public_keys/`hostname`/$$i ; \ + done remove: $(info => Remvoing ssh) diff --git a/ssh/public_keys/zuk/git.jpatrick.io.pub b/ssh/public_keys/zuk/git.jpatrick.io.pub new file mode 100644 index 0000000..79cbfaa --- /dev/null +++ b/ssh/public_keys/zuk/git.jpatrick.io.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHc429ju3N/DoIe7r4F35asaZeNv6/ZWPGXlQiEHUMtf zuk Tue Apr 16 21:54:38 EDT 2019 diff --git a/ssh/public_keys/zuk/id_ed25519.pub b/ssh/public_keys/zuk/id_ed25519.pub new file mode 100644 index 0000000..2924838 --- /dev/null +++ b/ssh/public_keys/zuk/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC9pheTZRF6Yo2Od0b8CyxLuazodEtB/5oAEDei8cBvi zuk: Sun 10 Nov 2019 11:50:45 AM EST diff --git a/ssh/public_keys/zuk/jpatrick.io.pub b/ssh/public_keys/zuk/jpatrick.io.pub new file mode 100644 index 0000000..ea0e8ff --- /dev/null +++ b/ssh/public_keys/zuk/jpatrick.io.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICmLHzD7WneJQEHCNgT5k/4wa8rM07yQVu8w7nH3dNU5 zuk: 20190430235108 diff --git a/sway/config b/sway/config index 111ad8b..ce012d8 100644 --- a/sway/config +++ b/sway/config @@ -2,6 +2,7 @@ # # Logo key. Use Mod1 for Alt. set $mod Mod4 +set $ctrl Control # Home row direction keys, like vim set $left h set $down j @@ -21,6 +22,7 @@ set $PIP floating enabled ; sticky enabled ; border pixel 0 for_window [class="mpv"] $PIP for_window [class="pip"] $PIP for_window [window_role="PictureInPicture"] $PIP +for_window [class="feh"] floating enabled ; border pixel 0 # Status Bar: bar { diff --git a/sway/config.d/keybinds b/sway/config.d/keybinds index cfb9207..a1b2837 100644 --- a/sway/config.d/keybinds +++ b/sway/config.d/keybinds @@ -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+0 move container to workspace 10 -#bindsym $mod+print exec file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').mp4 \ -## && wf-recorder -g "$(slurp)" $file \ -## && wl-copy $file \ -## && notify-send -i $file "File copied to clipboard" +# Printscreen functions bindsym print exec $printscreen +bindsym $ctrl+print exec farge ################################################################################ # Layout stuff: diff --git a/sway/scripts/import_gsetting b/sway/scripts/import_gsetting index 93fb35c..aa654b4 100755 --- a/sway/scripts/import_gsetting +++ b/sway/scripts/import_gsetting @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- # Lifted from https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland # usage: import-gsettings : : ... diff --git a/sway/scripts/menu b/sway/scripts/menu index aa6f65f..67f38a2 100755 --- a/sway/scripts/menu +++ b/sway/scripts/menu @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- rofi \ -show drun \ -p run \ diff --git a/sway/scripts/menu_clipman b/sway/scripts/menu_clipman index 2448948..37fd91c 100755 --- a/sway/scripts/menu_clipman +++ b/sway/scripts/menu_clipman @@ -1,2 +1,3 @@ #! /bin/sh +# -*- sh -*- clipman --selector="rofi" --select diff --git a/sway/scripts/menu_gopass b/sway/scripts/menu_gopass index 8abea02..352fe0c 100755 --- a/sway/scripts/menu_gopass +++ b/sway/scripts/menu_gopass @@ -1,4 +1,5 @@ #! /bin/sh +# -*- sh -*- gopass ls --flat \ | rofi -dmenu -p pass -i \ - | xargs --no-run-if-empty gopass show -c \ No newline at end of file + | xargs --no-run-if-empty gopass show -c diff --git a/sway/scripts/printscreen b/sway/scripts/printscreen index e75fec1..b01c230 100755 --- a/sway/scripts/printscreen +++ b/sway/scripts/printscreen @@ -1,6 +1,7 @@ #! /bin/sh +# -*- sh -*- file=~/Pictures/Screenshots/Screenshot-$(date '+%Y%m%d%H%M%S').png grim -g "$(slurp)" $file \ && wl-copy $file \ - && notify-send -i $file "File copied to clipboard" \ No newline at end of file + && notify-send -i $file "File copied to clipboard" diff --git a/sway/scripts/sanitize_wob b/sway/scripts/sanitize_wob index 8e257de..80b86b9 100755 --- a/sway/scripts/sanitize_wob +++ b/sway/scripts/sanitize_wob @@ -1,4 +1,6 @@ #!/bin/bash +# -*- sh -*- +# while read IN do [[ ! $IN =~ ^[+-]?[0-9]+$ ]] && IN=0 diff --git a/tridactyl/scripts/speak b/tridactyl/scripts/speak index c5e4aab..5e7f794 100755 --- a/tridactyl/scripts/speak +++ b/tridactyl/scripts/speak @@ -1,4 +1,5 @@ #!/bin/bash +# -*- sh -*- message="$@" case "$OSTYPE" in @@ -7,10 +8,10 @@ case "$OSTYPE" in ;; linux*) mimic \ - --setf duration_stretch=0.5 \ + --setf duration_stretch=0.65 \ -t "$message" \ - -voice 'slt_hts' - #-voice 'kal16' + -voice 'kal16' + #-voice 'slt' ;; *) echo "unsupported OS" diff --git a/tridactyl/themes/onedark.css b/tridactyl/themes/onedark.css index 3be25b0..be64698 100644 --- a/tridactyl/themes/onedark.css +++ b/tridactyl/themes/onedark.css @@ -130,7 +130,7 @@ .TridactylStatusIndicator { background: var(--tridactyl-bg) !important; border: 1px var(--base0B) solid !important; - color: var(--base0B) + color: var(--base0B); border: unset !important; bottom: 0 !important; font-size: 12pt !important; diff --git a/zsh/modules/bin/tellme b/zsh/modules/bin/tellme new file mode 100755 index 0000000..48fe3e2 --- /dev/null +++ b/zsh/modules/bin/tellme @@ -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 diff --git a/zsh/modules/tmux/init.zsh b/zsh/modules/tmux/init.zsh index 7aabe74..30f6d23 100644 --- a/zsh/modules/tmux/init.zsh +++ b/zsh/modules/tmux/init.zsh @@ -6,7 +6,7 @@ if (( ! $+commands[tmux] )); then fi # If running as root, stop and return. -if [ "$EUID" -ne 0 ] ; then +if [ "$EUID" -eq 0 ] ; then return 0 fi diff --git a/zsh/zplug b/zsh/zplug old mode 100644 new mode 100755 index 16eb68a..e096868 --- a/zsh/zplug +++ b/zsh/zplug @@ -2,6 +2,18 @@ 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", \ as:plugin, \ defer:2 @@ -14,7 +26,9 @@ zplug "zsh-users/zsh-history-substring-search", \ as:plugin, \ defer:2 -zplug "zpm-zsh/autoenv" +zplug "zpm-zsh/autoenv", \ + as:plugin, \ + defer:2 zplug "zsh-users/zsh-autosuggestions", \ as:plugin, \ @@ -34,6 +48,7 @@ zplug "zdharma/zsh-diff-so-fancy", \ use:"bin/{git-dsf,diff-so-fancy}" zplug "${ZDIR}/modules/bin/", \ + from:local, \ as:command, \ use:"*"