From 6635267a287202fef04704559775909dc869bc84 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Eugenio Halili Date: Wed, 6 Jul 2022 22:09:53 +0800 Subject: [PATCH] Update bashrc and nanorc config fir termux Also in this commit, I also changed gpg.program to use okc-gpg for commit and tag signing. Signed-off-by: Andrei Jiroh Eugenio Halili --- config/bashrc/termux | 41 ++++++++----------------------------- config/gitconfig/termux | 3 +++ config/nanorc/config/termux | 3 ++- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/config/bashrc/termux b/config/bashrc/termux index 9ae0c9f..ffae71b 100755 --- a/config/bashrc/termux +++ b/config/bashrc/termux @@ -2,20 +2,14 @@ # Start GPG and SSH agents export GPG_TTY=$(tty) -eval $(gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info") -if [ -f "${HOME}/.gpg-agent-info" ]; then - # gpg-agent[****]: WARNING: "--write-env-file" is an obsolete - # option - it has no effect - . "${HOME}/.gpg-agent-info" - export GPG_AGENT_INFO - export SSH_AUTH_SOCK - export SSH_AGENT_PID -else - echo "Howdy, user ID ${EUID}. Shenanigans beget shenanigans." - # not needed this because we have .ssh/config - # but keep this uncommented because Git is being - # an dougebag in every single shell sessiob. - source ~/.dotfiles/bin/source-ssh-agent +# Use OkcAgent's SSH agent client to use my GPG key for SSH sessions. +if ! pgrep okc-ssh-agent > /dev/null; then + okc-ssh-agent > "$PREFIX/tmp/okc-ssh-agent.env" +fi +source "$PREFIX/tmp/okc-ssh-agent.env" + +if ! pgrep sshd > /dev/null; then + sshd fi # Then add my scripts @@ -27,22 +21,5 @@ export DOTFILES_HOME=$HOME/.dotfiles #rm -rf ~/.bash_history>>/dev/null && history -c && echo "history-cleanup: Shell history cleaned for past session" || echo "history-cleanup: No bash_history file found for past session." # then do chain sourcing -source ~/.dotfiles/bashrc/chain-source +source ~/.dotfiles/config/bashrc/chain-source -# check if thefuck Python3 package is there in case I really -# fricked the commands. -TF_PYTHON_PATH=$(command -v thefuck) -if [[ $TF_PYTHON_PATH != "" ]];then - eval $(thefuck --alias fuckwit) - eval $(thefuck --alias what-the-fuck) - eval $(thefuck --alias holy-shit) - eval $(thefuck --alias stfu) - eval $(thefuck --alias fuck) - eval $(thefuck --alias bullshit) -fi - -# Export my Cloudflare API keys -#source ~/.dotfiles/secrets/cloudflare.api-keys - -# do console cleanup -#clear diff --git a/config/gitconfig/termux b/config/gitconfig/termux index 5d0bb86..6e053f9 100644 --- a/config/gitconfig/termux +++ b/config/gitconfig/termux @@ -17,6 +17,9 @@ ## This way, we don't need to install VS Code again ## if we want to edit files. editor = nano +[gpg] + # use OkcAgent's GPG client to sign using my key in OpenKeychain + program = okc-gpg # Enforce SSH [url "git@github.com:"] diff --git a/config/nanorc/config/termux b/config/nanorc/config/termux index 2a1dbfe..db6c596 100644 --- a/config/nanorc/config/termux +++ b/config/nanorc/config/termux @@ -1,5 +1,6 @@ # import package defaults first -include /data/data/com.termux/files/usr/share/nano/* +include /data/data/com.termux/files/usr/share/nano/*.nanorc +include /data/data/com.termux/files/usr/share/nano/extra/*.nanorc # then import ours include /data/data/com.termux/files/home/.dotfiles/nanorc/highlighting/*.nanorc