From 0c54457655c9febf8f8646bb4f2eb897eafb4103 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 8 Jun 2021 15:36:14 -0400 Subject: [PATCH] Replace ssh-a alias with ssh_a function ... Update default .xinitrc in provision_linux --- .config/fish/functions/define_aliases.fish | 1 - .config/fish/functions/ssh_a.fish | 11 +++++++ provision_linux | 36 +++++++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 .config/fish/functions/ssh_a.fish diff --git a/.config/fish/functions/define_aliases.fish b/.config/fish/functions/define_aliases.fish index ffc57d4..c400a5e 100644 --- a/.config/fish/functions/define_aliases.fish +++ b/.config/fish/functions/define_aliases.fish @@ -8,7 +8,6 @@ function define_aliases -a uname -d 'Defines aliases for commonly used commands' alias fromcb 'xclip -out -selection clipboard' alias ssh-rm 'ssh-keygen -f ~/.ssh/known_hosts -R' alias wiki 'nvim +VimwikiIndex' - alias ssh-a 'ssh-add ~/.secrets/id_ed25519' alias age-p 'age --armor --passphrase' alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519' alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)' diff --git a/.config/fish/functions/ssh_a.fish b/.config/fish/functions/ssh_a.fish new file mode 100644 index 0000000..1f8e281 --- /dev/null +++ b/.config/fish/functions/ssh_a.fish @@ -0,0 +1,11 @@ +function ssh_a -d 'Shortcut for adding keys to ssh agent' + argparse --max-args 1 's/seedly' 'r/rsa' -- $argv + + if test -n "$_flag_s" + ssh-add ~/.secrets/seedly_ed25519 + else if test -n "$_flag_r" + ssh-add ~/.secrets/id_rsa + else + ssh-add ~/.secrets/id_ed25519 + end +end diff --git a/provision_linux b/provision_linux index 7af2daa..eae87af 100755 --- a/provision_linux +++ b/provision_linux @@ -131,7 +131,41 @@ function provision_desktop_env -d 'Install base desktop utilities and configure or return $status log 'Setting xinitrc' - echo 'exec bspwm' >~/.xinitrc + echo '#!/bin/sh + +userresources=$HOME/.Xresources +usermodmap=$HOME/.Xmodmap +sysresources=/etc/X11/xinit/.Xresources +sysmodmap=/etc/X11/xinit/.Xmodmap + +# merge in defaults and keymaps + +if [ -f $sysresources ]; then + xrdb -merge $sysresources +fi + +if [ -f $sysmodmap ]; then + xmodmap $sysmodmap +fi + +if [ -f "$userresources" ]; then + xrdb -merge "$userresources" +fi + +if [ -f "$usermodmap" ]; then + xmodmap "$usermodmap" +fi + +# start some nice programs + +if [ -d /etc/X11/xinit/xinitrc.d ] ; then + for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +exec bspwm' >~/.xinitrc log 'Installing arc-gruvbox theme' mkdir -p ~/.themes