chore(global): update shellrcs and config

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.xyz>
This commit is contained in:
Andrei Jiroh Halili 2024-08-13 09:06:17 +08:00
parent 912ca16eec
commit 3d03a19d09
No known key found for this signature in database
GPG key ID: 67BFC91B3DA12BE8
6 changed files with 58 additions and 88 deletions

View file

@ -11,15 +11,7 @@ _load_env_keys() {
if [ -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" != "1" ]]; then if [ -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" != "1" ]]; then
echo "dotenv-keys: loading up dotenv keys from this directory" echo "dotenv-keys: loading up dotenv keys from this directory"
export "$(grep -v '^#' .env.keys | xargs)"
# TODO: Add source link since it is obviously copied from Stack Overflow.
unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then
export $(grep -v '^#' .env.keys | xargs -d '\n')
elif [ "$unamestr" = 'FreeBSD' ] || [ "$unamestr" = 'Darwin' ]; then
export $(grep -v '^#' .env.keys | xargs -0)
fi
export DOTENV_KEYS_LOADED=1 LAST_DOTENV_DIR=$PWD DOTENV_KEYS_LOADER=auto export DOTENV_KEYS_LOADED=1 LAST_DOTENV_DIR=$PWD DOTENV_KEYS_LOADER=auto
elif [ ! -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" == "1" ]]; then elif [ ! -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" == "1" ]]; then
echo "dotenv-keys: unloading dotenv keys" echo "dotenv-keys: unloading dotenv keys"
@ -45,13 +37,7 @@ dotenv-keys() {
fi fi
echo "dotenv-keys: loading up dotenv keys from this directory" echo "dotenv-keys: loading up dotenv keys from this directory"
# TODO: Add source link since it is obviously copied from Stack Overflow. export "$(grep -v '^#' .env.keys | xargs)"
unamestr=$(uname)
if [ "$unamestr" = 'Linux' ]; then
export $(grep -v '^#' .env.keys | xargs -d '\n')
elif [ "$unamestr" = 'FreeBSD' ] || [ "$unamestr" = 'Darwin' ]; then
export $(grep -v '^#' .env.keys | xargs -0)
fi
export LOADED_DOTENV_KEYS=$PWD DOTENV_KEYS_LOADER=manual DOTENV_KEYS_LOADED=1 export LOADED_DOTENV_KEYS=$PWD DOTENV_KEYS_LOADER=manual DOTENV_KEYS_LOADED=1
elif [[ $1 == "unload" ]]; then elif [[ $1 == "unload" ]]; then

View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
if [ -f "$HOME/.yadm-project/yadm" ]; then
export PATH="$HOME/.yadm-project:$PATH"
fi

54
.env
View file

@ -1,53 +1,9 @@
#!/usr/bin/env sh # TODO: Hook things up with dotenvx later.
# SPDX-License-Identifier: MIT AND MPL-2.0
#
# This is POSIX sh-compartible shell script to sourced for both shortcuts
# to daily commands I use and then some.
#
# PLEASE DO NOT LEAK ANY SECRETS, INCLUDING DOPPLER CLI TOKENS AND TAILSCALE_AUTHKEYS
# IN THIS BLOODY FILE!
#
# https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell # https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell
export DEBFULLNAME="Andrei Jiroh Halili" DEBFULLNAME="Andrei Jiroh Halili"
# Temporary Gmail address for devel stuff, even through my longer email one is, well, DEBEMAIL="releases@andreijiroh.xyz"
# on my public GPG key btw, so YOLO it.
export DEBEMAIL="releases@andreijiroh.eu.org"
# Customized PATH + Jetbrains Toolbox
export PATH="$HOME/go/bin:$HOME/.local/bin:$GOPATH/bin:$PATH:$HOME/.local/share/JetBrains/Toolbox/scripts"
# Hardcode timezone to PHT unless otherwise specified in ~/.env.local. # Hardcode timezone to PHT unless otherwise specified in ~/.env.local.
# You might need tzdata installed on Alpine per https://wiki.alpinelinux.org/wiki/Setting_the_timezone # You might need tzdata installed on Alpine per https://wiki.alpinelinux.org/wiki/Setting_the_timezone
export TZ=Asia/Manila TZ=Asia/Manila
########################################################################################## export DEBFULLNAME DEBMAIL
# Code snippets from https://git.sr.ht/~sircmpwn/dotfiles/tree/db5945a4/item/.env
##########################################################################################
if ls --version 2>&1 | grep -i gnu >/dev/null
then
alias ls='ls --color=auto '
elif ls --version 2>&1 | grep -i busybox >/dev/null
then
alias ls='ls --color=auto '
fi
alias recent='ls -ltch'
# Add optmizations for multicore builds
if [ $(uname) = "Linux" ]
then
nproc=$(grep '^processor' /proc/cpuinfo | wc -l)
if [ $nproc -gt 4 ]
then
# Reserve two cores
nproc=$((nproc - 2))
fi
export MAKEFLAGS="-j$nproc"
export SAMUFLAGS="-j$nproc"
fi
##########################################################################################
# import aliases to shell too
. "$HOME/.config/bash/aliases"

22
.nanorc
View file

@ -1,5 +1,7 @@
# User-wide nanorc based on my system-wide configs for stellapent-cier.tailnet # This is my user-wide settings for nano, similar to VS Code and friends.
# to make things portable as needed. # Feel free to use it on your own, as long as you keep the copyright information
# below intact.
# SPDX-License-Identifier: MIT AND MPL-2.0 (excluding third party code)
# Display line numbers to the left (and any anchors in the margin). # Display line numbers to the left (and any anchors in the margin).
set linenumbers set linenumbers
@ -19,7 +21,7 @@ set guidestripe 80
## mouse clicks can be used to place the cursor, set the mark (with a ## mouse clicks can be used to place the cursor, set the mark (with a
## double click), and execute shortcuts. The mouse will work in the ## double click), and execute shortcuts. The mouse will work in the
## X Window System, and on the console when gpm is running. ## X Window System, and on the console when gpm is running.
set mouse #set mouse
# Switch on multiple file buffers (inserting a file will put it into a # Switch on multiple file buffers (inserting a file will put it into a
# separate buffer). # separate buffer).
@ -38,12 +40,14 @@ set tabsize 4
set tabstospaces set tabstospaces
## Snip whitespace at the end of lines when justifying or hard-wrapping. ## Snip whitespace at the end of lines when justifying or hard-wrapping.
# set trimblanks set trimblanks
# import included syntax highlighting for nano # import included syntax highlighting for nano
# TODO: Load them via ~/.local/share/nano for portability
include "/usr/share/nano/*.nanorc" include "/usr/share/nano/*.nanorc"
# Make regularly-used features have more usual shortcuts # Make regularly-used features have more usual shortcuts
bind M-Z suspend main
bind ^X cut main bind ^X cut main
bind ^C copy main bind ^C copy main
bind ^V paste all bind ^V paste all
@ -52,14 +56,14 @@ bind ^S savefile main
#bind ^W writeout main #bind ^W writeout main
#bind ^O insert main #bind ^O insert main
#set multibuffer #set multibuffer
#bind ^H help all bind ^H help all
#bind ^H exit help bind ^H exit help
#bind ^F whereis all #bind ^F whereis all
#bind ^G findnext all #bind ^G findnext all
#bind ^B wherewas all #bind ^B wherewas all
#bind ^D findprevious all #bind ^D findprevious all
#bind ^R replace main #bind ^R replace main
#unbind ^U all unbind ^U all
#unbind ^N main #unbind ^N main
#unbind ^Y all #unbind ^Y all
#unbind M-J main #unbind M-J main
@ -67,10 +71,10 @@ bind ^S savefile main
bind ^A mark main bind ^A mark main
#bind ^P location main #bind ^P location main
bind ^T gotoline main bind ^T gotoline main
#bind ^T gotodir browser bind ^T gotodir browser
#bind ^T cutrestoffile execute #bind ^T cutrestoffile execute
#bind ^L linter execute #bind ^L linter execute
#bind ^E execute main bind ^E execute main
#bind ^K "{mark}{end}{zap}" main #bind ^K "{mark}{end}{zap}" main
#bind ^U "{mark}{home}{zap}" main #bind ^U "{mark}{home}{zap}" main
bind ^Z undo main bind ^Z undo main

View file

@ -9,14 +9,6 @@
# for ssh logins, install and configure the libpam-umask package. # for ssh logins, install and configure the libpam-umask package.
#umask 022 #umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists # set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH" PATH="$HOME/bin:$PATH"
@ -40,5 +32,32 @@ if [ -f "$HOME/.config/localconfig.env" ]; then
. "$HOME/.config/localconfig.env" . "$HOME/.config/localconfig.env"
fi fi
##########################################################################################
# Code snippets from https://git.sr.ht/~sircmpwn/dotfiles/tree/db5945a4/item/.env
##########################################################################################
if ls --version 2>&1 | grep -i gnu >/dev/null
then
alias ls='ls --color=auto '
elif ls --version 2>&1 | grep -i busybox >/dev/null
then
alias ls='ls --color=auto '
fi
alias recent='ls -ltch'
# Add optmizations for multicore builds
if [ $(uname) = "Linux" ]
then
nproc=$(grep '^processor' /proc/cpuinfo | wc -l)
if [ $nproc -gt 4 ]
then
# Reserve two cores
nproc=$((nproc - 2))
fi
export MAKEFLAGS="-j$nproc"
export SAMUFLAGS="-j$nproc"
fi
##########################################################################################
if [[ $FF_BYOBU_ON_LOGIN != "" ]]; then if [[ $FF_BYOBU_ON_LOGIN != "" ]]; then
fi fi

View file

@ -1,8 +1,8 @@
fullname = "Andrei Jiroh Halili" fullname = "Andrei Jiroh Halili"
gemini = "gemini.andreijiroh.eu.org" gemini = "gemini.andreijiroh.xyz"
website = "https://andreijiroh.eu.org" website = "https://andreijiroh.xyz"
description = "Open-source maintainer and web dev at Recap Time Squad, sometimes NixOS + Alpine Linux user, #ActuallyAutistic" description = "Open-source maintainer and web dev at Recap Time Squad, sometimes NixOS + Alpine Linux user, #ActuallyAutistic"
email = "ajhalili2006@andreijiroh.eu.org" email = "ajhalili2006@andreijiroh.xyz"
matrix = "@ajhalili2006:envs.net" matrix = "@ajhalili2006:envs.net"
fediverse = "tilde.zone/@ajhalili2006" fediverse = "tilde.zone/@ajhalili2006"
location = "Marilao, Bulacan, Philippines" location = "Marilao, Bulacan, Philippines"