diff --git a/.config/bash/functions b/.config/bash/functions index b58fbd7..6069766 100644 --- a/.config/bash/functions +++ b/.config/bash/functions @@ -11,15 +11,7 @@ _load_env_keys() { if [ -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" != "1" ]]; then echo "dotenv-keys: loading up dotenv keys from this directory" - - # 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 "$(grep -v '^#' .env.keys | xargs)" export DOTENV_KEYS_LOADED=1 LAST_DOTENV_DIR=$PWD DOTENV_KEYS_LOADER=auto elif [ ! -f "$PWD/.env.keys" ] && [[ "$LOADED_DOTENV_KEYS" == "1" ]]; then echo "dotenv-keys: unloading dotenv keys" @@ -45,13 +37,7 @@ dotenv-keys() { fi echo "dotenv-keys: loading up dotenv keys from this directory" - # 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 "$(grep -v '^#' .env.keys | xargs)" export LOADED_DOTENV_KEYS=$PWD DOTENV_KEYS_LOADER=manual DOTENV_KEYS_LOADED=1 elif [[ $1 == "unload" ]]; then @@ -64,4 +50,4 @@ dotenv-keys() { echo " load - load keys from .env.keys in current directory into shell session" echo " unload - unload keys from shell session" fi -} \ No newline at end of file +} diff --git a/.config/bash/tools/yadm.bashrc b/.config/bash/tools/yadm.bashrc new file mode 100644 index 0000000..3e77466 --- /dev/null +++ b/.config/bash/tools/yadm.bashrc @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +if [ -f "$HOME/.yadm-project/yadm" ]; then + export PATH="$HOME/.yadm-project:$PATH" +fi \ No newline at end of file diff --git a/.env b/.env index 17a37f2..1d0ead4 100644 --- a/.env +++ b/.env @@ -1,53 +1,9 @@ -#!/usr/bin/env sh - -# 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! -# - +# TODO: Hook things up with dotenvx later. # https://packaging.ubuntu.com/html/getting-set-up.html#configure-your-shell -export DEBFULLNAME="Andrei Jiroh Halili" -# Temporary Gmail address for devel stuff, even through my longer email one is, well, -# 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" - +DEBFULLNAME="Andrei Jiroh Halili" +DEBEMAIL="releases@andreijiroh.xyz" # 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 -export TZ=Asia/Manila +TZ=Asia/Manila -########################################################################################## -# 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" +export DEBFULLNAME DEBMAIL diff --git a/.nanorc b/.nanorc index d258115..3c280a4 100644 --- a/.nanorc +++ b/.nanorc @@ -1,5 +1,7 @@ -# User-wide nanorc based on my system-wide configs for stellapent-cier.tailnet -# to make things portable as needed. +# This is my user-wide settings for nano, similar to VS Code and friends. +# 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). set linenumbers @@ -19,7 +21,7 @@ set guidestripe 80 ## 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 ## 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 # separate buffer). @@ -38,12 +40,14 @@ set tabsize 4 set tabstospaces ## Snip whitespace at the end of lines when justifying or hard-wrapping. -# set trimblanks +set trimblanks # import included syntax highlighting for nano +# TODO: Load them via ~/.local/share/nano for portability include "/usr/share/nano/*.nanorc" # Make regularly-used features have more usual shortcuts +bind M-Z suspend main bind ^X cut main bind ^C copy main bind ^V paste all @@ -52,14 +56,14 @@ bind ^S savefile main #bind ^W writeout main #bind ^O insert main #set multibuffer -#bind ^H help all -#bind ^H exit help +bind ^H help all +bind ^H exit help #bind ^F whereis all #bind ^G findnext all #bind ^B wherewas all #bind ^D findprevious all #bind ^R replace main -#unbind ^U all +unbind ^U all #unbind ^N main #unbind ^Y all #unbind M-J main @@ -67,11 +71,11 @@ bind ^S savefile main bind ^A mark main #bind ^P location main bind ^T gotoline main -#bind ^T gotodir browser +bind ^T gotodir browser #bind ^T cutrestoffile execute #bind ^L linter execute -#bind ^E execute main +bind ^E execute main #bind ^K "{mark}{end}{zap}" main #bind ^U "{mark}{home}{zap}" main bind ^Z undo main -bind ^Y redo main \ No newline at end of file +bind ^Y redo main diff --git a/.profile b/.profile index 8132640..09c6c6e 100644 --- a/.profile +++ b/.profile @@ -9,14 +9,6 @@ # for ssh logins, install and configure the libpam-umask package. #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 if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" @@ -40,5 +32,32 @@ if [ -f "$HOME/.config/localconfig.env" ]; then . "$HOME/.config/localconfig.env" 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 -fi \ No newline at end of file +fi diff --git a/meta-info.toml b/meta-info.toml index dd47755..aec962d 100644 --- a/meta-info.toml +++ b/meta-info.toml @@ -1,8 +1,8 @@ fullname = "Andrei Jiroh Halili" -gemini = "gemini.andreijiroh.eu.org" -website = "https://andreijiroh.eu.org" +gemini = "gemini.andreijiroh.xyz" +website = "https://andreijiroh.xyz" 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" fediverse = "tilde.zone/@ajhalili2006" location = "Marilao, Bulacan, Philippines"