This commit is contained in:
Darren 'Tadgy' Austin 2020-12-02 20:12:06 +00:00
commit e106e8eb5d
12 changed files with 59 additions and 327 deletions

View file

@ -7,7 +7,6 @@ export LANG="en_GB.UTF-8"
export LC_COLLATE="POSIX" # 'C' causes issues with some applications
# export LC_CTYPE="POSIX" # Not sure why I set this in the first place...
export LESS="-RMi -PM?f%F:stdin. -- Page %dt of %D -- %lt/%L (%Pt\%)$"
export MANPAGER="less -Mis -PM'Page %dt$'"
export PAGER="less"
export PATH="/usr/local/sbin:/usr/sbin:/opt/sbin:/sbin:$PATH"
export VISUAL="$EDITOR"
@ -19,10 +18,12 @@ if [[ "$_PLATFORM" = "Linux" ]]; then
export I_WANT_A_BROKEN_PS=1
export LYNX_CFG="$HOME/.lynx.cfg"
export LYNX_LSS="$HOME/.lynx.lss"
export MANPAGER="most"
export MANPATH="$HOME/.local/share/man:$MANPATH"
hash dircolors >/dev/null 2>&1 && eval "$(dircolors -b ~/.dir_colors)"
elif [[ "$_PLATFORM" = "Darwin" ]]; then
export LSCOLORS="ExGxdxdxCxDxDxbcacbeae"
export MANPAGER="less -Mis -PM'Page %dt$'"
export MANPATH="/opt/local/share/man:$MANPATH"
export PATH="/opt/local/sbin:/opt/local/bin:$PATH"
else
@ -116,6 +117,10 @@ unset _OUTPUT _PLATFORM
# Screen.
hash screen >/dev/null 2>&1 && {
# Reattach existing screens.
screen_attach
# Output some screen info.
export SCREENDIR="$HOME/.screen-$(hostname --short)"
if [[ ! -e ~/.hushlogin ]]; then
if [[ ! -z "$STY" ]]; then

27
.bashrc
View file

@ -153,6 +153,30 @@ _unlock_agents_file() {
fi
}
screen_attach() {
local TTY SCREENS
# Only continue if it's not a remote connection, and not inside screen already.
[[ -z "$SSH_TTY" ]] && [[ -z "$STY" ]] && {
TTY="$(tty | cut -d/ -f3-)"
SCREENS="$(screen -list | fgrep -v "Dead" | fgrep "$HOSTNAME" | fgrep "${TTY//\//-}")"
case "$(echo "${SCREENS:--n}" | wc -l)" in
0)
# No screens found - start a new instance.
screen
;;
1)
# Just one screen - reconnect.
screen -dr "${TTY//\//-}.$HOSTNAME"
;;
*)
# Multiple screens - output a list
echo "Multiple screens found for $TTY:"
echo "$SCREENS" | sed -e 's/^/ /g'
;;
esac
}
}
# Make bash a little more pleasent - these are valid for all versions.
shopt -s cdspell checkhash checkwinsize cmdhist histappend no_empty_cmd_completion
@ -205,7 +229,8 @@ unset _COLOUR
# Set the debugger prompt.
# PS4="+(\\\$? = \$?) \${BASH_SOURCE##*/}\${FUNCNAME:+(\$FUNCNAME)}:\$LINENO: "
PS4="+(\[\e[33m\]\\\$? = \$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${BASH_SOURCE##*/}\[$(tput sgr0)\]\${FUNCNAME:+(\[$(tput bold)$(tput setaf 2)\]\$FUNCNAME\[$(tput sgr0)\])}:\[$(tput bold)$(tput setaf 1)\]\$LINENO\[$(tput sgr0)\]: "
# PS4="+(\[\e[33m\]\\\$? = \$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${BASH_SOURCE##*/}\[$(tput sgr0)\]\${FUNCNAME:+(\[$(tput bold)$(tput setaf 2)\]\$FUNCNAME\[$(tput sgr0)\])}:\[$(tput bold)$(tput setaf 1)\]\$LINENO\[$(tput sgr0)\]: "
export PS4="+(\[\e[33m\]\$?\[$(tput sgr0)\]) \[$(tput bold)$(tput setaf 4)\]\${BASH_SOURCE##*/}\[$(tput sgr0)\]\${FUNCNAME:+(\[$(tput bold)$(tput setaf 2)\]\$FUNCNAME\[$(tput sgr0)\])}:\[$(tput bold)$(tput setaf 1)\]\$LINENO\[$(tput sgr0)\]: "
# The commands to execute before the prompt is displayed.
PROMPT_COMMAND="_agent_prompt_command"

View file

@ -1,6 +1,6 @@
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
@ -20,7 +20,7 @@ update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
delay=15
left_meters=AllCPUs CPU
left_meter_modes=1 1
right_meters=Uptime LoadAverage Tasks Memory Swap
right_meter_modes=2 2 2 1 1
left_meters=AllCPUs CPU
left_meter_modes=1 1
right_meters=Uptime LoadAverage Tasks Memory Swap
right_meter_modes=2 2 2 1 1

View file

@ -2,8 +2,8 @@
bm_open_method=0
[volume]
mount_on_startup=1
mount_removable=1
mount_on_startup=0
mount_removable=0
autorun=1
[autorun]

2
.dmrc
View file

@ -1,2 +1,2 @@
[Desktop]
Session=LXDE
Session=lightdm-xsession

2
.gitignore vendored
View file

@ -6,10 +6,12 @@
.*.swp
.ICEauthority
.Xauthority
.Xauthority.orig
.ab*
.alpine-smime/
.aspell.*
.bash_history
.bash_history-*
.cache/
.gnupg
.lesshst

View file

@ -16,7 +16,7 @@
## ", ', ), >, ], and }.
## Use auto-indentation.
set autoindent
# set autoindent
## Do case-sensitive searches by default.
# set casesensitive
@ -33,6 +33,9 @@ set justifytrim
## Enable vim-style lock-files.
set locking
## Use the blank line below the titlebar as extra editing space.
set morespace
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
@ -55,7 +58,7 @@ set quickblank
set smarthome
## Use smooth scrolling as the default.
# set smooth
set smooth
## Enable soft line wrapping (AKA full-line display).
# set softwrap

View file

@ -1,100 +0,0 @@
## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure an option is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
##
## Quotes inside string parameters don't have to be escaped with
## backslashes. The last double quote in the string will be treated as
## its end. For example, for the "brackets" option, ""')>]}" will match
## ", ', ), >, ], and }.
## Use auto-indentation.
set autoindent
## Do case-sensitive searches by default.
# set casesensitive
## Set the line length for wrapping text and justifying paragraphs.
set fill -2
## Remember the used search/replace strings for the next session.
set historylog
## When justifying text, trailing whitespace will automatically be removed.
set justifytrim
## Display line numbers to the left of the text area.
set linenumbers
## Enable vim-style lock-files.
set locking
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
## Don't add newlines to the ends of files.
# set nonewlines
## Don't wrap text at all.
set nowrap
## Save the cursor position of files between editing sessions.
# set positionlog
## Do quick statusbar blanking.
set quickblank
## Do extended regular expression searches by default.
# set regexp
## Make the Home key smarter.
set smarthome
## Use smooth scrolling as the default.
# set smooth
## Enable soft line wrapping (AKA full-line display).
# set softwrap
## Use this spelling checker instead of the internal one.
set speller "aspell -x -c"
## Allow nano to be suspended.
set suspend
## The two characters used to indicate the presence of tabs and spaces.
# set whitespace >.
## Detect word boundaries more accurately by treating punctuation characters as parts of words.
set wordbounds
## Interface colours.
set functioncolor magenta
set keycolor brightwhite
set numbercolor magenta
set statuscolor magenta
set titlecolor magenta
## Include all existing syntax highlight definitions.
include "/usr/share/nano/*.nanorc"
## Key bindings.
## The following five functions are not bound to any key by default.
## You may wish to choose different keys than the ones suggested here.
# bind ^S savefile main
# bind M-Q findprevious main
# bind M-W findnext main
# bind M-B cutwordleft main
# bind M-N cutwordright main
## Set this if your Backspace key sends Del most of the time.
# bind Del backspace all

View file

@ -1,101 +0,0 @@
## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure an option is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
##
## Quotes inside string parameters don't have to be escaped with
## backslashes. The last double quote in the string will be treated as
## its end. For example, for the "brackets" option, ""')>]}" will match
## ", ', ), >, ], and }.
## Use auto-indentation.
set autoindent
## Do case-sensitive searches by default.
# set casesensitive
## Set the line length for wrapping text and justifying paragraphs.
set fill -2
## Remember the used search/replace strings for the next session.
set historylog
## Display line numbers to the left of the text area.
set linenumbers
## Enable vim-style lock-files.
set locking
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
## Don't add newlines to the ends of files.
# set nonewlines
## Don't wrap text at all.
set nowrap
## Save the cursor position of files between editing sessions.
# set positionlog
## Do quick statusbar blanking.
set quickblank
## Do extended regular expression searches by default.
# set regexp
## Make the Home key smarter.
set smarthome
## Use smooth scrolling as the default.
# set smooth
## Enable soft line wrapping (AKA full-line display).
# set softwrap
## Use this spelling checker instead of the internal one.
set speller "aspell -x -c"
## Allow nano to be suspended.
set suspend
## When justifying text, trailing whitespace will automatically be removed.
set trimblanks
## The two characters used to indicate the presence of tabs and spaces.
# set whitespace >.
## Detect word boundaries more accurately by treating punctuation characters as parts of words.
set wordbounds
## Interface colours.
set functioncolor magenta
set keycolor brightwhite
set numbercolor magenta
set selectedcolor brightwhite,blue
set statuscolor magenta
set titlecolor magenta
## Include all existing syntax highlight definitions.
include "/usr/share/nano/*.nanorc"
## Key bindings.
## The following five functions are not bound to any key by default.
## You may wish to choose different keys than the ones suggested here.
# bind ^S savefile main
# bind M-Q findprevious main
# bind M-W findnext main
# bind M-B cutwordleft main
# bind M-N cutwordright main
## Set this if your Backspace key sends Del most of the time.
# bind Del backspace all

View file

@ -1,106 +0,0 @@
## Sample initialization file for GNU nano.
##
## Please note that you must have configured nano with --enable-nanorc
## for this file to be read! Also note that this file should not be in
## DOS or Mac format, and that characters specially interpreted by the
## shell should not be escaped here.
##
## To make sure an option is disabled, use "unset <option>".
##
## For the options that take parameters, the default value is given.
## Other options are unset by default.
##
## Quotes inside string parameters don't have to be escaped with
## backslashes. The last double quote in the string will be treated as
## its end. For example, for the "brackets" option, ""')>]}" will match
## ", ', ), >, ], and }.
## When soft line wrapping is enabled, make it wrap lines at blank characters.
set atblanks
## Use auto-indentation.
set autoindent
## Do case-sensitive searches by default.
# set casesensitive
## Set the line length for wrapping text and justifying paragraphs.
set fill -2
## Remember the used search/replace strings for the next session.
set historylog
## Display line numbers to the left of the text area.
set linenumbers
## Enable vim-style lock-files.
set locking
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
## Don't add newlines to the ends of files.
# set nonewlines
## Don't wrap text at all.
set nowrap
## Save the cursor position of files between editing sessions.
# set positionlog
## Do quick statusbar blanking.
set quickblank
## Do extended regular expression searches by default.
# set regexp
## Make the Home key smarter.
set smarthome
## Use smooth scrolling as the default.
# set smooth
## Enable soft line wrapping (AKA full-line display).
# set softwrap
## Use this spelling checker instead of the internal one.
# set speller "aspell -x -c"
## Allow nano to be suspended.
set suspend
## When justifying text, trailing whitespace will automatically be removed.
set trimblanks
## Detect word boundaries more accurately by treating punctuation characters as parts of words.
# set wordbounds
## Let an unmodified Backspace or Delete erase the marked region, without affecting the cut-buffer.
# set zap
## Paint the interface elements of nano.
## This is an example; by default there are no colors.
set errorcolor brightwhite,red
set functioncolor magenta
set keycolor brightwhite
set numbercolor magenta
set selectedcolor brightwhite,blue
set statuscolor magenta
set titlecolor magenta
## Include all existing syntax highlight definitions.
include "/usr/share/nano/*.nanorc"
## Key bindings.
## The following five functions are not bound to any key by default.
## You may wish to choose different keys than the ones suggested here.
# bind ^S savefile main
# bind M-Q findprevious main
# bind M-W findnext main
# bind M-B cutwordleft main
# bind M-N cutwordright main
## Set this if your Backspace key sends Del most of the time.
# bind Del backspace all

View file

@ -19,7 +19,7 @@
set atblanks
## Use auto-indentation.
set autoindent
# set autoindent
## Automatically hard-wrap the current line when it becomes overlong.
# set breaklonglines
@ -40,7 +40,7 @@ set fill -2
set historylog
## Scroll the buffer contents per half-screen instead of per line.
set jumpyscrolling
# set jumpyscrolling
## Display line numbers to the left of the text area.
set linenumbers
@ -67,7 +67,7 @@ set smarthome
# set softwrap
## Use this spelling checker instead of the internal one.
# set speller "aspell -x -c"
set speller "aspell -x -c"
## Allow nano to be suspended.
set suspend

View file

@ -19,7 +19,7 @@
set atblanks
## Use auto-indentation.
set autoindent
# set autoindent
## Automatically hard-wrap the current line when it becomes overlong.
# set breaklonglines
@ -28,7 +28,7 @@ set autoindent
# set casesensitive
## Do not use the line below the title bar.
set emptyline
# set emptyline
## Set the line length for wrapping text and justifying paragraphs.
set fill -2
@ -39,8 +39,11 @@ set fill -2
## Remember the used search/replace strings for the next session.
set historylog
## Display a "scrollbar" on the righthand side of the edit window.
# set indicator
## Scroll the buffer contents per half-screen instead of per line.
set jumpyscrolling
# set jumpyscrolling
## Display line numbers to the left of the text area.
set linenumbers
@ -67,7 +70,7 @@ set smarthome
# set softwrap
## Use this spelling checker instead of the internal one.
# set speller "aspell -x -c"
set speller "aspell -x -c"
## Allow nano to be suspended.
set suspendable
@ -94,7 +97,8 @@ set keycolor brightwhite
set numbercolor magenta
set selectedcolor brightwhite,blue
set statuscolor magenta
set stripecolor brightblue
# set stripecolor brightblue
set stripecolor magenta
set titlecolor magenta