Compare commits

...

2 Commits

Author SHA1 Message Date
David Thurstenson 0540dc0927 docs: update misc/links-of-infamy 2024-03-09 03:26:07 +00:00
David Thurstenson f3397396ce docs: update dotfiles/bashrc 2024-03-09 03:22:54 +00:00
2 changed files with 14 additions and 13 deletions

View File

@ -2,7 +2,7 @@
title: Bashrc title: Bashrc
description: Details about how I configure my shell description: Details about how I configure my shell
published: true published: true
date: 2024-03-08T00:01:02.134Z date: 2024-03-09T03:22:52.743Z
tags: tags:
editor: markdown editor: markdown
dateCreated: 2024-03-07T23:21:44.989Z dateCreated: 2024-03-07T23:21:44.989Z
@ -16,13 +16,13 @@ https://git.thurstylark.com/dotfiles/bashrc/src/branch/master/.bash_profile
Bash chooses which dotfile to source based on how it gets run. If starting from a login shell, `~/.bash_profile` will get sourced, but if there's not a command in there to source your `~/.bashrc`, you may find yourself having to `exec bash` after starting bash. This can be fixed by adding the following line to your `~/.bash_profile`: Bash chooses which dotfile to source based on how it gets run. If starting from a login shell, `~/.bash_profile` will get sourced, but if there's not a command in there to source your `~/.bashrc`, you may find yourself having to `exec bash` after starting bash. This can be fixed by adding the following line to your `~/.bash_profile`:
``` ```bash
[ -f ~/.bashrc ]( -f ~/.bashrc .md) && . ~/.bashrc [ -f ~/.bashrc ]( -f ~/.bashrc .md) && . ~/.bashrc
``` ```
I also use `~/.bash_profile` for setting numlock while in a tty: I also use `~/.bash_profile` for setting numlock while in a tty:
``` ```bash
case $(tty) in /dev/tty[0-9]*) case $(tty) in /dev/tty[0-9]*)
setleds -D +num * (numlock for X is set in ~/.xinitrc) setleds -D +num * (numlock for X is set in ~/.xinitrc)
;; ;;
@ -43,21 +43,21 @@ I'm not going in to detail about every line, but I'll hilight the important part
First off, if we're not running bash interactively, there's no use for any of the rest of this, so just skip it. First off, if we're not running bash interactively, there's no use for any of the rest of this, so just skip it.
``` ```bash
# If not running interactively, don't do anything # If not running interactively, don't do anything
[ $- != *i* ]( $- != *i* .md) && return [ $- != *i* ]( $- != *i* .md) && return
``` ```
Another cool option is actually built in to bash: If you call for a directory without any command before it, just `cd` into that directory. Another cool option is actually built in to bash: If you call for a directory without any command before it, just `cd` into that directory.
``` ```bash
# If a directory is given without any command, CD into it. # If a directory is given without any command, CD into it.
shopt -s autocd shopt -s autocd
``` ```
This is where all the other utilities, aliases, and functions get pulled in. Anything in `~/.bashrc.d/` ending in `.bash` will get pulled in. This is where all the other utilities, aliases, and functions get pulled in. Anything in `~/.bashrc.d/` ending in `.bash` will get pulled in.
``` ```bash
for f in ~/.bashrc.d/*.bash; do source "$f"; done for f in ~/.bashrc.d/*.bash; do source "$f"; done
``` ```

View File

@ -1,12 +1,13 @@
--- ---
title: "Links of Infamy" title: Links of Infamy
description: "A link dump of things I find truly amazing" description: A link dump of things I find truly amazing
author: "Thurstylark" published: true
date: 2021-9-25 date: 2024-03-09T03:26:06.165Z
draft: false tags:
editor: markdown
dateCreated: 2024-03-07T23:22:12.102Z
--- ---
- [How to properly run a community.](https://wiki.archlinux.org/index.php/Code_of_conduct) - [How to properly run a community.](https://wiki.archlinux.org/index.php/Code_of_conduct)
- [How to properly automate yourself out of a job.](https://github.com/NARKOZ/hacker-scripts) - [How to properly automate yourself out of a job.](https://github.com/NARKOZ/hacker-scripts)
- [How to properly file a bug report.](https://github.com/chrislgarry/Apollo-11/issues/3) - [How to properly file a bug report.](https://github.com/chrislgarry/Apollo-11/issues/3)
@ -16,5 +17,5 @@ draft: false
- [How to properly install Gentoo](http://www.bash.org/?464385) - [How to properly install Gentoo](http://www.bash.org/?464385)
- [How to properly answer useless questions that get asked repeatedly.](http://stackoverflow.com/a/1732454) - [How to properly answer useless questions that get asked repeatedly.](http://stackoverflow.com/a/1732454)
- [How to properly appreciate the number five.](https://github.com/jackdcrawford/five) - [How to properly appreciate the number five.](https://github.com/jackdcrawford/five)
{.links-list}