From 59c6e400c56e29e95fd3f2bb2a625c3c8f298f68 Mon Sep 17 00:00:00 2001 From: Kevin Mok Date: Mon, 15 Apr 2019 02:25:07 -0400 Subject: [PATCH] chezmoi: ignore (root), convert some paths Aliases for chezmoi. --- .chezmoiignore | 17 ++++++++++++++ dot_config/private_fish/config.fish | 12 ++++------ key_aliases | 10 ++++---- txt/key_dirs.txt => key_dirs | 9 +++----- txt/key_files.txt => key_files | 10 ++++---- scripts/executable_sync-aliases | 36 ----------------------------- scripts/executable_sync-shortcuts | 6 ++--- txt/ideas.md | 7 ++++++ 8 files changed, 46 insertions(+), 61 deletions(-) create mode 100644 .chezmoiignore rename txt/key_dirs.txt => key_dirs (91%) rename txt/key_files.txt => key_files (87%) delete mode 100644 scripts/executable_sync-aliases diff --git a/.chezmoiignore b/.chezmoiignore new file mode 100644 index 0000000..7d33349 --- /dev/null +++ b/.chezmoiignore @@ -0,0 +1,17 @@ +README.md + +{{ if eq .chezmoi.username "root" }} +.config/i3/ +.config/i3blocks/ +.config/mpv/ +.config/neofetch/ +.config/zathura/ +scripts/ +txt/ +.bashrc +.gitconfig +.imwheelrc +.xinitrc +.Xresources +.zshrc +{{ end }} diff --git a/dot_config/private_fish/config.fish b/dot_config/private_fish/config.fish index e478b80..9d66de4 100644 --- a/dot_config/private_fish/config.fish +++ b/dot_config/private_fish/config.fish @@ -20,9 +20,11 @@ builtin cd $last_dir bind \ce edit_command_buffer bind \cr forward-word -/home/kevin/linux-config/scripts/sync-shortcuts +chezmoi apply +/home/kevin/scripts/sync-shortcuts source /home/kevin/.config/fish/key_abbr.fish -set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions" +# set -U fish_fxn_dir "/home/kevin/linux-config/fish/.config/fish/functions" +set -U fish_fxn_dir "/home/kevin/.config/fish/functions" abbr ff "cd $fish_fxn_dir" for fxn in (find $fish_fxn_dir -name '*.fish') source $fxn @@ -42,11 +44,7 @@ abbr mt "math" set -U spv_dir "/home/kevin/coding/spotify-lib-vis" set -U mfs_dir "/home/kevin/coding/mf-site" -# set -U PATH /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/site_perl -# /usr/bin/vendor_perl /usr/bin/core_perl /home/kevin/linux-config/scripts -# /home/kevin/linux-config/scripts/colors -# (ruby -e 'print Gem.user_dir')/bin -set -x PATH $PATH /home/kevin/linux-config/scripts /home/kevin/linux-config/scripts/colors /home/kevin/go/bin +set -x PATH $PATH /home/kevin/scripts /home/kevin/scripts/colors /home/kevin/go/bin set -x PASSWORD_STORE_CLIP_TIME 120 set -xU XSET_RATE 90 set -xU XSET_DELAY 200 diff --git a/key_aliases b/key_aliases index 2eecf1f..809c232 100644 --- a/key_aliases +++ b/key_aliases @@ -174,7 +174,7 @@ sxt "sxiv -t *" vmd "vimdiff" wg "wego" wp "grep wallpaper ~/.cache/wal/colors.sh" -z "zathura --fork" +zt "zathura --fork" lz "unzip -l" @@ -325,9 +325,11 @@ gunc "git update-index --assume-unchanged" # coding projs {{{ # # coding_dir="~/coding" -cz "chezmoi" -cza "chezmoi add" -cze "chezmoi edit" +zm "chezmoi" +za "chezmoi add" +zar "chezmoi add -r" +ze "chezmoi edit" +zp "chezmoi -v apply" rgt "rg TODO" diff --git a/txt/key_dirs.txt b/key_dirs similarity index 91% rename from txt/key_dirs.txt rename to key_dirs index 031b84f..640a936 100644 --- a/txt/key_dirs.txt +++ b/key_dirs @@ -3,21 +3,19 @@ bg /home/kevin/Pictures/Backgrounds cf /home/kevin/.config -lc /home/kevin/linux-config/ -lf /mnt/linux-files d /home/kevin/Downloads D /home/kevin/Documents fo /home/kevin/.config/fish -fs /home/kevin/linux-config/fish/.config/fish k /home/kevin/ -lc /home/kevin/linux-config/ +lf /mnt/linux-files +lfv /mnt/linux-files/Videos me /run/media/kevin o / p /home/kevin/.password-store P /home/kevin/Pictures sw ~/.local/share/nvim/swap/ tm /tmp -lfv /mnt/linux-files/Videos +z /home/kevin/linux-config # }}} sys * @@ -39,7 +37,6 @@ swa /home/kevin/.local/share/nvim/swap tx /home/kevin/linux-config/txt wd /home/kevin/.config/watson wo /home/kevin/Documents/workout-logs/11 -zd /home/kevin/chezmoi # }}} cdn * diff --git a/txt/key_files.txt b/key_files similarity index 87% rename from txt/key_files.txt rename to key_files index a34b5d8..fba948c 100644 --- a/txt/key_files.txt +++ b/key_files @@ -1,9 +1,9 @@ # sys {{{ * -3 /home/kevin/.config/i3/config -a /home/kevin/linux-config/aliases/key_aliases -d /home/kevin/linux-config/txt/key_dirs.txt -f /home/kevin/linux-config/txt/key_files.txt +3 ~/linux-config/dot_config/i3/config +a ~/linux-config/key_aliases +d ~/linux-config/key_dirs +f ~/linux-config/key_files i /home/kevin/.config/i3blocks/i3blocks.conf p /home/kevin/linux-config/txt/pacman-pkgs/pacman-pkgs.txt r /home/kevin/.config/ranger/rc.conf @@ -11,7 +11,7 @@ sr /home/kevin/linux-config/configs/ranger/shortcuts.conf ss /home/kevin/.shortcuts u /home/kevin/.Xresources v /home/kevin/.vimrc -x /home/kevin/.config/fish/config.fish +x ~/linux-config/dot_config/private_fish/config.fish y /home/kevin/.zshrc z /home/kevin/linux-config/aliases/zsh_aliases diff --git a/scripts/executable_sync-aliases b/scripts/executable_sync-aliases deleted file mode 100644 index c451da7..0000000 --- a/scripts/executable_sync-aliases +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -key_aliases="$HOME/linux-config/aliases/key_aliases" - -# Ensure text of argument 1 exists in the file argument 2 -ensure() {{{ - if [[ ! -e "$2" ]]; then - touch "$2" - fi - (grep "$1" "$2")>/dev/null 2>&1 || echo "$1" >> "$2" -}}} - -# fish -fish_config="$HOME/.config/fish/config.fish" -fish_abbr="$HOME/.config/fish/key_aliases.fish" -ensure "source $fish_abbr" "$fish_config" - -# bash/zsh -bashrc="$HOME/.bashrc" -zshrc="$HOME/.zshrc" -aliases="$HOME/.aliases" -ensure "source $aliases" "$bashrc" -ensure "source $aliases" "$zshrc" - -# Remove, prepare files -printf "# vim: filetype=sh\\n" > "$fish_abbr" -printf "# vim: filetype=sh\\n" > "$aliases" - -sed -e '/^$/d' -e '/^[ \t#].*/d' "$key_aliases" | sort | tee \ - >(awk '{printf "abbr " $1; $1 = ""; print $0; }' >> "$fish_abbr") \ - | awk '{ - printf "alias " $1; - $1 = ""; - printf "="; - print gensub(" ", "", 1, $0); - }' >> "$aliases" diff --git a/scripts/executable_sync-shortcuts b/scripts/executable_sync-shortcuts index d8f1934..af82697 100644 --- a/scripts/executable_sync-shortcuts +++ b/scripts/executable_sync-shortcuts @@ -30,9 +30,9 @@ ensure "source $fish_abbr" "$fish_config" ensure "source $ranger_mappings" "$ranger_config" # key files -key_dirs="$HOME/linux-config/txt/key_dirs.txt" -key_files="$HOME/linux-config/txt/key_files.txt" -key_aliases="$HOME/linux-config/aliases/key_aliases" +key_dirs="$HOME/key_dirs" +key_files="$HOME/key_files" +key_aliases="$HOME/key_aliases" # Remove, prepare files rm -f "$ranger_mappings" 2>/dev/null diff --git a/txt/ideas.md b/txt/ideas.md index 18ffdb9..01d1c9d 100644 --- a/txt/ideas.md +++ b/txt/ideas.md @@ -1,2 +1,9 @@ +# chezmoi +- edit chez dir files? +- nvim setup +- fish config +- home dir var +- merge laptop + - nnn - spotify blocklet - escape chars.