Commit 58a092be authored by Daniel Wayne Armstrong's avatar Daniel Wayne Armstrong
Browse files

first commit

parents
!
!> Daniel Wayne Armstrong
!> https://github.com/dwarmstrong/dotfiles
!> https://www.dwarmstrong.org
! acer swift 3 key mappings
! modify capsLk into repeating backspace
keycode 66 = BackSpace
clear Lock
!
!> Daniel Wayne Armstrong
!> https://github.com/vonbrownie/dotfiles
!> https://www.dwarmstrong.org
! thinkpad x230 key mappings
! modify capsLk into repeating backspace
keycode 66 = BackSpace
clear Lock
keycode 108 = Alt_R
! ~/.Xresources
!
! Refresh config by running `xrdb -merge ~/.Xresources`.
! == Colours ==
!
! Inspired by Nord Termite
! https://github.com/arcticicestudio/nord-termite
*.foreground: #d8dee9
*.background: #000000
*.cursorColor: #bf616a
! black
*.color0: #000000
*.color8: #4c566a
! red
*.color1: #bf616a
*.color9: #bf616a
! green
*.color2: #a3be8c
*.color10: #a3be8c
! yellow
*.color3: #ebcb8b
*.color11: #ebcb8b
! blue
*.color4: #81a1c1
*.color12: #81a1c1
! magenta
*.color5: #b48ead
*.color13: #b48ead
! cyan
*.color6: #88c0d0
*.color14: #88c0d0
! white
*.color7: #e5e9f0
*.color15: #eceff4
! == Urxvt ==
URxvt.scrollBar: false
URxvt.saveLines: 10000
! Test out fonts in a live terminal before committing to the config by
! printing escape codes in the terminal.
! Example: `printf '\e]710;%s\007' "xft:DejaVu Sans Mono:pixelsize=12"`
!URxvt.font: xft:DejaVu Sans Mono:pixelsize=16
URxvt.font: xft:Fira Code:pixelsize=16
!URxvt*letterSpace: -1
! Extensions
Urxvt*perl-lib: /usr/lib/urxvt/perl/
URxvt.perl-ext-common: default,matcher,url-select,keyboard-select
URxvt.colorUL: #87afd7
! matcher
URxvt.url-launcher: /usr/bin/xdg-open
URxvt.matcher.button: 1
! url-select
URxvt.keysym.M-u: perl:url-select:select_next
URxvt.url-select.launcher: /usr/bin/xdg-open
URxvt.url-select.underline: true
! keyboard-select
URxvt.keysym.M-Escape: perl:keyboard-select:activate
! == Rofi ==
! "Hide scroll-bar"
rofi.hide-scrollbar: true
! "Separator style (none, dash, solid)"
rofi.separator-style: solid
rofi.color-enabled: true
! "Color scheme window"
rofi.color-window: #000000, #2a373e, #000000
! "Color scheme for normal row"
rofi.color-normal: #000000, #fafbfc, #000000, #c14e4e, #000000
! "Color scheme for active row"
rofi.color-active: #000000, #c14e4e, #000000, #009688, #000000
! "Color scheme for urgent row"
rofi.color-urgent: #000000, #ff0000, #000000, #ff0000, #000000
#
# if not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# == Greeting ==
${HOME}/.local/bin/fortune ${HOME}/.fortunes
# == Prompt ==
# Colour codes
RED="\\[\\e[1;31m\\]"
GREEN="\\[\\e[1;32m\\]"
YELLOW="\\[\\e[1;33m\\]"
BLUE="\\[\\e[1;34m\\]"
MAGENTA="\\[\\e[1;35m\\]"
CYAN="\\[\\e[1;36m\\]"
WHITE="\\[\\e[1;37m\\]"
RESET="\\[\\e[0m\\]"
# Set a two-line prompt; if accessing via ssh include 'ssh-session' message
if [[ -n "$SSH_CLIENT" ]]; then
ssh_message="-ssh_session"
fi
PS1="${GREEN}\\u ${WHITE}at ${YELLOW}\h${RED}${ssh_message} ${WHITE}in ${BLUE}\\w \\n$WHITE\$${RESET} "
# == Functions ==
# Backup and timestamp files
bak() { for f in "$@" ; do cp -- "$f" "$f.$(date +%FT%H%M%S).bak" ; done ; }
# change directories and list contents
c() { cd -- "$@" && ls -aFlhNv --color=always ; }
# Top 10 most used commands
mostUsedCommands() { history | awk '{print $3}' | sort | uniq -c | sort -rn | head ; }
# Make directory and change to it immediately
md() { mkdir -p -- "$@" && cd -- "$@" || return ; }
# Replace spaces and non-ascii characters in a filename with underscore
mtg() { for f in "$@" ; do mv -- "$f" "${f//[^a-zA-Z0-9\.\-]/_}" ; done ; }
# == Aliases ==
alias aaa="sudo apt update && apt list --upgradable && sudo apt full-upgrade && sudo apt autoremove"
alias arst="setxkbmap us"
alias asdf="setxkbmap us -variant colemak"
alias bye="sudo systemctl poweroff"
alias dff="df -hT --total"
alias dpkgg="dpkg -l | grep -i"
alias e="nvim"
alias earthview="streamlink http://www.ustream.tv/channel/iss-hdev-payload best &"
alias gpush="git push -u origin master"
alias gsave="git commit -m 'save'"
alias gs="git status"
alias l="ls -aFlhNv --color=always"
alias max-bright="echo 255 | sudo tee /sys/class/backlight/amdgpu_bl0/brightness"
alias myip="ip -f inet address | grep inet | grep -v 'lo$' | cut -d ' ' -f 6,13 && curl ifconfig.me && echo ' external ip'"
alias p="less"
alias ppp="pacpkglst && sudo pacman -Syu"
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
alias reboot="sudo systemctl reboot"
alias t="c ~/tmp"
alias tmuxd="tmux -f ~/.tmux.default attach"
alias virtualboxFusion="VirtualBox -style Fusion %U"
alias x="exit"
alias yta="youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 --restrict-filenames"
alias zzz="systemctl suspend"
if [[ -f ~/.bash_aliases ]]; then
# shellcheck source=/dev/null
. ~/.bash_aliases
fi
# == History ==
# Unlimited history
HISTSIZE=
HISTFILESIZE=
# Change the history file location because certain bash sessions truncate
# ~/.bash_history upon close
HISTFILE=~/.bash_unlimited_history
# Default is to write history at the end of each session, overwriting the
# existing file with an updated version. If logged in with multiple sessions,
# only the last session to exit will have its history saved.
#
# Require prompt write to history after every command and append to the
# history file, don't overwrite it.
shopt -s histappend
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
# Now you can see the commands from all shells in near real-time in
# ~/.bash_unlimited history. Starting a new shell displays the
# combined history from all terminals.
# Add a timestamp per entry. Useful for context when viewing logfiles
HISTTIMEFORMAT="%FT%T "
# Save all lines of a multiple-line command in the same history entry
shopt -s cmdhist
# Re-edit a history substitution line if it failed
shopt -s histreedit
# Edit a recalled history line before executing
shopt -s histverify
# Do not put lines starting with space in the history
HISTCONTROL=ignorespace
# Toggle history off/on for a current shell
alias stophistory="set +o history"
alias starthistory="set -o history"
# Helpful!
# https://superuser.com/q/575479
# https://unix.stackexchange.com/q/1288
# == Misc ==
# When resizing a terminal emulator, check the window size after each command
# and, if necessary, update the values of LINES and COLUMNS.
shopt -s checkwinsize
# Set colours
#eval dircolors ${HOME}/.dir_colors/dircolors
eval `dircolors`
# Use `keychain` for ssh-agent management
if [[ -x /usr/bin/keychain ]]; then
keychain ~/.ssh/id_ed25519
. "${HOME}/.keychain/${HOSTNAME}-sh"
fi
# Disable XON/XOFF flow control. Enables use of C-S in other commands.
# Examples: forward search in history; disable screen freeze in vim.
stty -ixon
# Bash completion
if [[ -f /etc/profile.d/bash_completion.sh ]]; then
# shellcheck source=/dev/null
. /etc/profile.d/bash_completion.sh
fi
# Automatically search the official repositories when entering an unrecognized
# command.
if [[ -f /usr/share/doc/pkgfile/command-not-found.bash ]]; then
# shellcheck source=/dev/null
. /usr/share/doc/pkgfile/command-not-found.bash
fi
[Desktop Entry]
Name=terminalmax
Exec=/home/dwa/bin/terminalmax
Icon=utilities-terminal
Type=Application
StartupNotify=false
#
#> Daniel Wayne Armstrong
#> https://github.com/vonbrownie/dotfiles
#> https://www.dwarmstrong.org
#
[global]
font = Liberation Mono 10
# Allow a small subset of html markup:
# <b>bold</b>
# <i>italic</i>
# <s>strikethrough</s>
# <u>underline</u>
#
# For a complete reference see
# <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
# If markup is not allowed, those tags will be stripped out of the
# message.
allow_markup = yes
# The format of the message. Possible variables are:
# %a appname
# %s summary
# %b body
# %i iconname (including its path)
# %I iconname (without its path)
# %p progress value if set ([ 0%] to [100%]) or nothing
# Markup is allowed
format = "<b>%s</b>\n%b"
# Sort messages by urgency.
sort = yes
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Alignment of message text.
# Possible values are "left", "center" and "right".
alignment = left
# The frequency with wich text that is longer than the notification
# window allows bounces back and forth.
# This option conflicts with "word_wrap".
# Set to 0 to disable.
bounce_freq = 0
# Show age of message if message is older than show_age_threshold
# seconds.
# Set to -1 to disable.
show_age_threshold = 60
# Split notifications into multiple lines if they don't fit into
# geometry.
word_wrap = yes
# Ignore newlines '\n' in notifications.
ignore_newline = no
# The geometry of the window:
# [{width}]x{height}[+/-{x}+/-{y}]
# The geometry of the message window.
# The height is measured in number of notifications everything else
# in pixels. If the width is omitted but the height is given
# ("-geometry x2"), the message window expands over the whole screen
# (dmenu-like). If width is 0, the window expands to the longest
# message displayed. A positive x is measured from the left, a
# negative from the right side of the screen. Y is measured from
# the top and down respectevly.
# The width can be negative. In this case the actual width is the
# screen width minus the width defined in within the geometry option.
geometry = "300x5-30+20"
# Shrink window if it's smaller than the width. Will be ignored if
# width is 0.
shrink = no
# The transparency of the window. Range: [0; 100].
# This option will only work if a compositing windowmanager is
# present (e.g. xcompmgr, compiz, etc.).
transparency = 0
# Don't remove messages, if the user is idle (no mouse or keyboard input)
# for longer than idle_threshold seconds.
# Set to 0 to disable.
idle_threshold = 120
# Which monitor should the notifications be displayed on.
monitor = 0
# Display notification on focused monitor. Possible modes are:
# mouse: follow mouse pointer
# keyboard: follow window with keyboard focus
# none: don't follow anything
#
# "keyboard" needs a windowmanager that exports the
# _NET_ACTIVE_WINDOW property.
# This should be the case for almost all modern windowmanagers.
#
# If this option is set to mouse or keyboard, the monitor option
# will be ignored.
follow = keyboard
# Should a notification popped up from history be sticky or timeout
# as if it would normally do.
sticky_history = yes
# Maximum amount of notifications kept in history
history_length = 20
# Display indicators for URLs (U) and actions (A).
show_indicators = yes
# The height of a single line. If the height is smaller than the
# font height, it will get raised to the font height.
# This adds empty space above and under the text.
line_height = 0
# Draw a line of "separatpr_height" pixel height between two
# notifications.
# Set to 0 to disable.
separator_height = 2
# Padding between text and separator.
padding = 8
# Horizontal padding.
horizontal_padding = 8
# Define a color for the separator.
# possible values are:
# * auto: dunst tries to find a color fitting to the background;
# * foreground: use the same color as the foreground;
# * frame: use the same color as the frame;
# * anything else will be interpreted as a X color.
separator_color = frame
# Print a notification on startup.
# This is mainly for error detection, since dbus (re-)starts dunst
# automatically after a crash.
startup_notification = false
# dmenu path.
dmenu = /usr/bin/dmenu -p dunst:
# Browser for opening urls in context menu.
browser = /usr/bin/firefox -new-tab
# Align icons left/right/off
icon_position = off
# Paths to default icons.
icon_folders = /usr/share/icons/Papirus-Dark/16x16/status/:/usr/share/icons/Papirus-Dark/16x16/devices/
[frame]
width = 2
color = "#bf616a"
[shortcuts]
# Shortcuts are specified as [modifier+][modifier+]...key
# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
# "mod3" and "mod4" (windows-key).
# Xev might be helpful to find names for keys.
# Close notification.
close = ctrl+space
# Close all notifications.
close_all = ctrl+shift+space
# Redisplay last message(s).
# On the US keyboard layout "grave" is normally above TAB and left
# of "1".
history = ctrl+grave
# Context menu.
context = ctrl+shift+period
[urgency_low]
# IMPORTANT: colors have to be defined in quotation marks.
# Otherwise the "#" and following would be interpreted as a comment.
background = "#000000"
foreground = "#ffffff"
timeout = 4
[urgency_normal]
background = "#000000"
foreground = "#ffffff"
timeout = 4
[urgency_critical]
background = "#ff0000"
foreground = "#ffffff"
timeout = 0
# Every section that isn't one of the above is interpreted as a rules to
# override settings for certain messages.
# Messages can be matched by "appname", "summary", "body", "icon", "category",
# "msg_urgency" and you can override the "timeout", "urgency", "foreground",
# "background", "new_icon" and "format".
# Shell-like globbing will get expanded.
#
# SCRIPTING
# You can specify a script that gets run when the rule matches by
# setting the "script" option.
# The script will be called as follows:
# script appname summary body icon urgency
# where urgency can be "LOW", "NORMAL" or "CRITICAL".
#
# NOTE: if you don't want a notification to be displayed, set the format
# to "".
# NOTE: It might be helpful to run dunst -print in a terminal in order
# to find fitting options for rules.
#[espeak]
# summary = "*"
# script = dunst_espeak.sh
#[script-test]
# summary = "*script*"
# script = dunst_test.sh
#[ignore]
# # This notification will not be displayed
# summary = "foobar"
# format = ""
#[signed_on]
# appname = Pidgin
# summary = "*signed on*"
# urgency = low
#
#[signed_off]
# appname = Pidgin
# summary = *signed off*
# urgency = low
#
#[says]
# appname = Pidgin
# summary = *says*
# urgency = critical
#
#[twitter]
# appname = Pidgin
# summary = *twitter.com*
# urgency = normal
#
# vim: ft=cfg
" ~/.config/nvim/init.vim
" == General configuration ==
set nocompatible " disable compatibility to old-time vi
set background=dark " adjust default colours for better contrast
set showmatch " show matching brackets.
set ignorecase " case insensitive matching
set mouse=v " middle-click paste with mouse
set hlsearch " highlight search results
set autoindent " indent a new line the same amount as the line just typed
set number " add line numbers
set wildmode=longest,list " get bash-like tab completions
set cc=80 " set colour columns for good coding style
" python programming
syntax on " syntax highlighting
filetype plugin indent on " allow auto-indenting depending on file type
set tabstop=4 " number of columns occupied by a tab character
set expandtab " convert tabs to white space
set shiftwidth=4 " width for autoindents
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
" == Colors ==
" built-in schemes installed in `/usr/share/nvim/runtime/colors`; extra schemes in `~/.config/nvim/colors`
colorscheme default " `default` picks up colors defined in `~/.Xresources`
" == Mode mappings ==
" normal mode map -- `:nnoremap`
" insert mode map -- `:inoremap`
" map leader
let g:mapleader = ','
" toggle spelling
nnoremap <leader>s :set invspell<CR>
" when invoking an Ex command from a map, `<CR>` is added at the end
" date+time stamp
inoremap <leader>d <C-R>=strftime("%Y-%m-%dT%H:%M")<CR>
" `<C-R>=` is used to insert the result of an expression at the cursor
" == Plugins ==
" managed by [vim-plug](https://github.com/junegunn/vim-plug)
call plug#begin('~/.local/share/nvim/plugged')
Plug 'vimwiki/vimwiki'
call plug#end()
" == Extras ==
" vimwiki
let g:vimwiki_list = [{'path': '~/doc/wiki/', 'path_html': '~/doc/wiki/html/'}]
#
# run these things when openbox starts
# set background color (`hsetroot` plays nice with picom) and image
hsetroot -solid "#000000"
(sleep 1; /bin/sh ~/.fehbg) &
# detect if secondary display attached and make it primary
~/bin/dldsply -r &
# compositor - background process + disable shadowing effects during session
#picom -CGb &
# power management
xfce4-power-manager &
# notifications
dunst -config ~/.config/dunst/dunstrc &
# panel - taskbar, system tray, battery, clock
tint2 &
# clipboard
#clipit &
# volume control
(sleep 2; volumeicon) &
# network manager
nm-applet &
# launch terminal
urxvt &
#
# User-specific environment variables
#
# To set your language for displaying messages and time/date formats, use the following:
#LANG=en_CA.UTF8
# To set your keyboard layout, you need to modify your X config:
# http://www.google.com/search?q=how+to+set+keyboard+layout+xorg
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://openbox.org/
file:///usr/share/openbox/menu.xsd">
<menu id="root-menu" label="Openbox 3">
<item label="Terminal">
<action name="Execute"><execute>urxvt</execute></action>
</item>
<menu id="scrot-menu" label="Screenshots">
<item label="Now">
<action name="Execute"><execute>
scrot -d 1 -u -z 'screenshot-%Y-%m-%dT%H%M%S.png' -e 'mv $f ~/image/screenshot &amp; viewnior ~/image/screenshot/$f'
</execute></action>
</item>
<item label="In 5 Seconds...">