From 5a7db2f34aa6a6787d98a001b6d28be97f36abf4 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 25 Jun 2021 12:56:30 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- .gitignore | 2 + Makefile | 14 ++ README | 7 + asroot/Makefile | 12 ++ asroot/bash-aliases | 4 + atril/Makefile | 12 ++ atril/atril_toolbar.xml | 29 +++ audacity/Makefile | 18 ++ audacity/audacity.cfg | 3 + audacity/user-profile | 3 + base/Makefile | 25 +++ base/faces/gnu-wink.svg | 217 ++++++++++++++++++++++ base/faces/penguin.png | Bin 0 -> 12839 bytes base/profile | 43 +++++ base/user-dirs.locale | 1 + bash-completion/Makefile | 17 ++ bash-completion/bash-aliases | 29 +++ bash-completion/bash-bashrc | 3 + bash/Makefile | 47 +++++ bash/aliases | 87 +++++++++ bash/aliases-Zenith | 17 ++ bash/bashrc | 64 +++++++ bash/bashrc_palette | 89 +++++++++ bash/bashrc_prompt | 413 ++++++++++++++++++++++++++++++++++++++++++ bash/logout | 9 + bash/profile | 17 ++ bus/Makefile | 21 +++ bus/user-profile | 15 ++ bus/xinit | 9 + coreutils/Makefile | 17 ++ coreutils/bash-aliases | 5 + coreutils/bash-bashrc | 51 ++++++ cvs/Makefile | 12 ++ cvs/user-profile | 4 + dconf/Makefile | 16 ++ dconf/xinit | 17 ++ featherweight/Makefile | 12 ++ featherweight/bash-aliases | 3 + ffmpeg/Makefile | 12 ++ ffmpeg/bash-aliases | 25 +++ filesystem/Makefile | 90 +++++++++ filesystem/user-dirs.dirs | 15 ++ gcc/Makefile | 12 ++ gcc/user-profile | 4 + git/Makefile | 12 ++ git/bash-aliases | 50 +++++ gnupg/Makefile | 14 ++ gnupg/user-profile | 8 + google-chrome/Makefile | 9 + gpm/Makefile | 12 ++ gpm/bash-aliases | 4 + grep/Makefile | 12 ++ grep/bash-aliases | 7 + gtk3/Makefile | 12 ++ gtk3/user-profile | 3 + info | 1 + java-runtime/Makefile | 18 ++ java-runtime/user-profile | 3 + kdenlive/Makefile | 9 + less/Makefile | 12 ++ less/user-profile | 3 + libcontacts-glibc | 1 + libcontacts-musl | 1 + libcontacts/.gitignore | 1 + libcontacts/Makefile | 15 ++ meld/Makefile | 15 ++ meld/meldrc.ini | 14 ++ moc/Makefile | 17 ++ moc/bash-aliases | 7 + mplayer/Makefile | 13 ++ mplayer/user-profile | 3 + my-scripts/Makefile | 12 ++ my-scripts/bash-aliases | 5 + openssh/Makefile | 12 ++ openssh/bash-aliases | 9 + pluma/Makefile | 9 + pony.computer/Makefile | 12 ++ pony.computer/bash-aliases | 10 + ponysay/Makefile | 12 ++ ponysay/bash-aliases | 10 + procps/Makefile | 9 + pytagomacs/Makefile | 11 ++ pytagomacs/pytagomacsrc | 7 + python/Makefile | 16 ++ python/user-profile | 3 + qt5-styleplugins/Makefile | 12 ++ qt5-styleplugins/user-profile | 3 + radharc/Makefile | 16 ++ radharc/xinit | 3 + rotd/.gitignore | 1 + rotd/Makefile | 15 ++ rust/Makefile | 20 ++ rust/user-profile | 3 + signal-desktop/Makefile | 12 ++ signal-desktop/bash-aliases | 15 ++ ssh | 1 + sudo/Makefile | 12 ++ sudo/bash-aliases | 8 + texinfo/Makefile | 16 ++ texinfo/bash-aliases | 30 +++ texlive-bin/Makefile | 17 ++ vlc/Makefile | 9 + wget/Makefile | 10 + xmonad/Makefile | 21 +++ xmonad/xinit | 24 +++ xorg-twm/Makefile | 11 ++ xorg-twm/twmrc | 93 ++++++++++ xorg-xinit/Makefile | 36 ++++ xorg-xinit/bash-aliases | 9 + xorg-xinit/xinit | 7 + xorg-xinit/xinitrc | 30 +++ xorg-xrandr/Makefile | 18 ++ xorg-xrandr/xinit | 4 + xorg-xrdb/Makefile | 16 ++ xorg-xrdb/xinit | 12 ++ xorg-xset/Makefile | 16 ++ xorg-xset/xinit | 4 + xorg-xsetroot/Makefile | 16 ++ xorg-xsetroot/xinit | 4 + xwallpaper/Makefile | 20 ++ xwallpaper/xinit | 10 + zathura/Makefile | 9 + 122 files changed, 2498 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README create mode 100644 asroot/Makefile create mode 100644 asroot/bash-aliases create mode 100644 atril/Makefile create mode 100644 atril/atril_toolbar.xml create mode 100644 audacity/Makefile create mode 100644 audacity/audacity.cfg create mode 100644 audacity/user-profile create mode 100644 base/Makefile create mode 100644 base/faces/gnu-wink.svg create mode 100644 base/faces/penguin.png create mode 100644 base/profile create mode 100644 base/user-dirs.locale create mode 100644 bash-completion/Makefile create mode 100644 bash-completion/bash-aliases create mode 100644 bash-completion/bash-bashrc create mode 100644 bash/Makefile create mode 100644 bash/aliases create mode 100644 bash/aliases-Zenith create mode 100644 bash/bashrc create mode 100644 bash/bashrc_palette create mode 100644 bash/bashrc_prompt create mode 100644 bash/logout create mode 100644 bash/profile create mode 100644 bus/Makefile create mode 100644 bus/user-profile create mode 100644 bus/xinit create mode 100644 coreutils/Makefile create mode 100644 coreutils/bash-aliases create mode 100644 coreutils/bash-bashrc create mode 100644 cvs/Makefile create mode 100644 cvs/user-profile create mode 100644 dconf/Makefile create mode 100644 dconf/xinit create mode 100644 featherweight/Makefile create mode 100644 featherweight/bash-aliases create mode 100644 ffmpeg/Makefile create mode 100644 ffmpeg/bash-aliases create mode 100644 filesystem/Makefile create mode 100644 filesystem/user-dirs.dirs create mode 100644 gcc/Makefile create mode 100644 gcc/user-profile create mode 100644 git/Makefile create mode 100644 git/bash-aliases create mode 100644 gnupg/Makefile create mode 100644 gnupg/user-profile create mode 100644 google-chrome/Makefile create mode 100644 gpm/Makefile create mode 100644 gpm/bash-aliases create mode 100644 grep/Makefile create mode 100644 grep/bash-aliases create mode 100644 gtk3/Makefile create mode 100644 gtk3/user-profile create mode 120000 info create mode 100644 java-runtime/Makefile create mode 100644 java-runtime/user-profile create mode 100644 kdenlive/Makefile create mode 100644 less/Makefile create mode 100644 less/user-profile create mode 120000 libcontacts-glibc create mode 120000 libcontacts-musl create mode 100644 libcontacts/.gitignore create mode 100644 libcontacts/Makefile create mode 100644 meld/Makefile create mode 100644 meld/meldrc.ini create mode 100644 moc/Makefile create mode 100644 moc/bash-aliases create mode 100644 mplayer/Makefile create mode 100644 mplayer/user-profile create mode 100644 my-scripts/Makefile create mode 100644 my-scripts/bash-aliases create mode 100644 openssh/Makefile create mode 100644 openssh/bash-aliases create mode 100644 pluma/Makefile create mode 100644 pony.computer/Makefile create mode 100644 pony.computer/bash-aliases create mode 100644 ponysay/Makefile create mode 100644 ponysay/bash-aliases create mode 100644 procps/Makefile create mode 100644 pytagomacs/Makefile create mode 100644 pytagomacs/pytagomacsrc create mode 100644 python/Makefile create mode 100644 python/user-profile create mode 100644 qt5-styleplugins/Makefile create mode 100644 qt5-styleplugins/user-profile create mode 100644 radharc/Makefile create mode 100644 radharc/xinit create mode 100644 rotd/.gitignore create mode 100644 rotd/Makefile create mode 100644 rust/Makefile create mode 100644 rust/user-profile create mode 100644 signal-desktop/Makefile create mode 100644 signal-desktop/bash-aliases create mode 120000 ssh create mode 100644 sudo/Makefile create mode 100644 sudo/bash-aliases create mode 100644 texinfo/Makefile create mode 100644 texinfo/bash-aliases create mode 100644 texlive-bin/Makefile create mode 100644 vlc/Makefile create mode 100644 wget/Makefile create mode 100644 xmonad/Makefile create mode 100644 xmonad/xinit create mode 100644 xorg-twm/Makefile create mode 100644 xorg-twm/twmrc create mode 100644 xorg-xinit/Makefile create mode 100644 xorg-xinit/bash-aliases create mode 100644 xorg-xinit/xinit create mode 100644 xorg-xinit/xinitrc create mode 100644 xorg-xrandr/Makefile create mode 100644 xorg-xrandr/xinit create mode 100644 xorg-xrdb/Makefile create mode 100644 xorg-xrdb/xinit create mode 100644 xorg-xset/Makefile create mode 100644 xorg-xset/xinit create mode 100644 xorg-xsetroot/Makefile create mode 100644 xorg-xsetroot/xinit create mode 100644 xwallpaper/Makefile create mode 100644 xwallpaper/xinit create mode 100644 zathura/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1189c62 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*\#* +*~ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..36ff3a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +update: + @for PKG in *; do \ + if test -d "$${PKG}"; then \ + if pacman -Qq -- $${PKG} /dev/null 2>/dev/null ; then \ + printf -- '\033[1mmake -C %s install\033[m\n' "$${PKG}"; \ + make -C "$${PKG}" install; \ + else\ + printf -- '\033[1mmake -C %s uninstall\033[m\n' "$${PKG}"; \ + make -C "$${PKG}" uninstall; \ + fi; \ + fi; \ + done + +.PHONY: update diff --git a/README b/README new file mode 100644 index 0000000..6948a00 --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +The following directories have the own source control: + rotd/config + libcontacts/contacts + +Configurations that are not tied to any package in particular +are stored in filesystem/ if they are related to the filesystem +and in base/ otherwise. diff --git a/asroot/Makefile b/asroot/Makefile new file mode 100644 index 0000000..1069f68 --- /dev/null +++ b/asroot/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/asroot + ln -sf -- ~/.dotfiles/asroot/bash-aliases ~/.config/bash/aliases.d/asroot + +uninstall: + -unlink -- ~/.config/bash/aliases.d/asroot + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/asroot/bash-aliases b/asroot/bash-aliases new file mode 100644 index 0000000..6b20486 --- /dev/null +++ b/asroot/bash-aliases @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +#DESCRIPTION: Run a command under `asroot` +alias _="asroot" diff --git a/atril/Makefile b/atril/Makefile new file mode 100644 index 0000000..cab4117 --- /dev/null +++ b/atril/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/atril + test ! -d ~/.config/atril/atril_toolbar.xml + ln -sf -- ~/.dotfiles/atril/atril_toolbar.xml ~/.config/atril/atril_toolbar.xml + +uninstall: + -unlink -- ~/.config/atril/atril_toolbar.xml + -rm -rf -- ~/.config/atril + +.PHONY: install uninstall diff --git a/atril/atril_toolbar.xml b/atril/atril_toolbar.xml new file mode 100644 index 0000000..1b5c719 --- /dev/null +++ b/atril/atril_toolbar.xml @@ -0,0 +1,29 @@ + + + + diff --git a/audacity/Makefile b/audacity/Makefile new file mode 100644 index 0000000..ea262e6 --- /dev/null +++ b/audacity/Makefile @@ -0,0 +1,18 @@ +.POSIX: + +# Audacity heavily edits audacity.cfg so we make copy it instead of linking it + +install: + mkdir -p -- ~/.var/lib/audacity + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/audacity + ln -sf -- ~/.dotfiles/audacity/user-profile ~/.config/profile.d/audacity + cp -- audacity.cfg ~/.var/lib/audacity/ + +uninstall: + -unlink -- ~/.config/profile.d/audacity + -rmdir -- ~/.config/profile.d + -rm -rf -- ~/.var/lib/audacity + -rm -rf -- /var/tmp/"audacity-$$(whoami)" + +.PHONY: install uninstall diff --git a/audacity/audacity.cfg b/audacity/audacity.cfg new file mode 100644 index 0000000..5c2b45e --- /dev/null +++ b/audacity/audacity.cfg @@ -0,0 +1,3 @@ +[GUI] +Theme=dark +ShowExtraMenus=1 diff --git a/audacity/user-profile b/audacity/user-profile new file mode 100644 index 0000000..99162c5 --- /dev/null +++ b/audacity/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export AUDACITY_PATH=~/.var/lib/audacity diff --git a/base/Makefile b/base/Makefile new file mode 100644 index 0000000..8006e1f --- /dev/null +++ b/base/Makefile @@ -0,0 +1,25 @@ +.POSIX: + +FACE = penguin.png + +install: + mkdir -p -- ~/.config + test ! -d ~/.profile + test ! -d ~/.config/profile + test ! -d ~/.config/user-dirs.locale + test ! -d ~/.config/face + test ! -d ~/.face + test ! -d ~/.face.icon + ln -sf -- .config/profile ~/.profile + ln -sf -- ~/.dotfiles/base/profile ~/.config/profile + ln -sf -- ~/.dotfiles/base/user-dirs.locale ~/.config/ + ln -sf -- ~/.dotfiles/base/faces/$(FACE) ~/.config/face + ln -sf -- .face ~/.face.icon + ln -sf -- .config/face ~/.face + +uninstall: + -unlink -- ~/.config/profile + -unlink -- ~/.config/user-dirs.locale + -unlink -- ~/.profile + +.PHONY: install uninstall diff --git a/base/faces/gnu-wink.svg b/base/faces/gnu-wink.svg new file mode 100644 index 0000000..f9939e4 --- /dev/null +++ b/base/faces/gnu-wink.svg @@ -0,0 +1,217 @@ + + + + +Created by potrace 1.12, written by Peter Selinger 2001-2015 + + + + + + + + + + diff --git a/base/faces/penguin.png b/base/faces/penguin.png new file mode 100644 index 0000000..10be782 Binary files /dev/null and b/base/faces/penguin.png differ diff --git a/base/profile b/base/profile new file mode 100644 index 0000000..4410d8e --- /dev/null +++ b/base/profile @@ -0,0 +1,43 @@ +# -*- shell-script -*- + +export LOCALE="en_GB.UTF-8" +export LC_ALL="en_GB.UTF-8" +export LANG="en_GB.UTF-8" + +export MAIN_ALSA_CARD=0 +export MAIN_ALSA_MIXER=PCM + +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR='/tmp/.~'"$(whoami)" +fi +mkdir -p -- "${XDG_RUNTIME_DIR}" + +if test -x ~/.local/bin/e; then + export EDITOR=~/.local/bin/e +elif test -x /usr/bin/emacs; then + export EDITOR="emacs -nw" +elif test -x /usr/bin/vis; then + export EDITOR="vis" +elif test -x /usr/bin/nano; then + export EDITOR="nano" +elif test -x /usr/bin/vim; then + export EDITOR="vim" +elif test -x /usr/bin/vi; then + export EDITOR="vi" +fi +export VISUAL="${EDITOR}" + +for __script in ~/.config/profile.d/*; do + if test -r "${__script}"; then + . "${__script}" + fi +done +unset __script + +if test -r ~/.config/"profile-$(hostname)"; then + . ~/.config/"profile-$(hostname)" +fi + +if test -r ~/work/.config/profile; then + . ~/work/.config/profile +fi diff --git a/base/user-dirs.locale b/base/user-dirs.locale new file mode 100644 index 0000000..daa2955 --- /dev/null +++ b/base/user-dirs.locale @@ -0,0 +1 @@ +en_GB diff --git a/bash-completion/Makefile b/bash-completion/Makefile new file mode 100644 index 0000000..7d9fcc9 --- /dev/null +++ b/bash-completion/Makefile @@ -0,0 +1,17 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + mkdir -p -- ~/.config/bash/bashrc.d + test ! -d ~/.config/bash/aliases.d/bash-completion + test ! -d ~/.config/bash/bashrc.d/bash-completion + ln -sf -- ~/.dotfiles/bash-completion/bash-aliases ~/.config/bash/aliases.d/bash-completion + ln -sf -- ~/.dotfiles/bash-completion/bash-bashrc ~/.config/bash/bashrc.d/bash-completion + +uninstall: + -unlink -- ~/.config/bash/aliases.d/bash-completion + -unlink -- ~/.config/bash/bashrc.d/bash-completion + -rmdir -- ~/.config/bash/aliases.d + -rmdir -- ~/.config/bash/bashrc.d + +.PHONY: install uninstall diff --git a/bash-completion/bash-aliases b/bash-completion/bash-aliases new file mode 100644 index 0000000..92aab19 --- /dev/null +++ b/bash-completion/bash-aliases @@ -0,0 +1,29 @@ +# -*- shell-script -*- + +# DESCRIPTION: reload autocompletion scripts and load new ones +# USAGE: recomplete + +recomplete () { + if test -f /etc/bash_completion && ! shopt -oq posix; then + . /etc/bash_completion + fi + if test -f /usr/share/bash-completion/bash_completion && ! shopt -oq posix; then + . /usr/share/bash-completion/bash_completion + fi + if test -d ~/.local/bash_completion.d ] && ! shopt -oq posix; then + for __completionscript in ~/.local/bash_completion.d/*; do + if test -r "${__completionscript}"; then + . "${__completionscript}" + fi + done + unset __completionscript + fi + if test -d ~/.local/share/bash_completion.d && ! shopt -oq posix; then + for __completionscript in ~/.local/share/bash_completion.d/*; do + if [ -r "${__completionscript}" ]; then + . "${__completionscript}" + fi + done + unset __completionscript + fi +} diff --git a/bash-completion/bash-bashrc b/bash-completion/bash-bashrc new file mode 100644 index 0000000..5222094 --- /dev/null +++ b/bash-completion/bash-bashrc @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +recomplete diff --git a/bash/Makefile b/bash/Makefile new file mode 100644 index 0000000..7ea782a --- /dev/null +++ b/bash/Makefile @@ -0,0 +1,47 @@ +.POSIX: + +install: + mkdir -p -- ~/.var/cache + mkdir -p -- ~/.config/bash + touch -- ~/.var/cache/bash_history + test ! -d ~/.bash_history + test ! -d ~/.bash_logout + test ! -d ~/.bash_profile + test ! -d ~/.bashrc + test ! -d ~/.config/bash/logout + test ! -d ~/.config/bash/profile + test ! -d ~/.config/bash/bashrc + test ! -d ~/.config/bash/bashrc_palette + test ! -d ~/.config/bash/bashrc_prompt + test ! -d ~/.config/bash/aliases + test ! -d ~/.config/bash/aliases-Zenith + ln -sf -- .var/cache/bash_history ~/.bash_history + ln -sf -- .config/bash/logout ~/.bash_logout + ln -sf -- .config/bash/profile ~/.bash_profile + ln -sf -- .config/bash/bashrc ~/.bashrc + ln -sf -- ~/.dotfiles/bash/logout ~/.config/bash/logout + ln -sf -- ~/.dotfiles/bash/profile ~/.config/bash/profile + ln -sf -- ~/.dotfiles/bash/bashrc ~/.config/bash/bashrc + ln -sf -- ~/.dotfiles/bash/bashrc_palette ~/.config/bash/bashrc_palette + ln -sf -- ~/.dotfiles/bash/bashrc_prompt ~/.config/bash/bashrc_prompt + ln -sf -- ~/.dotfiles/bash/aliases ~/.config/bash/aliases + ln -sf -- ~/.dotfiles/bash/aliases-Zenith ~/.config/bash/aliases-Zenith + +uninstall: + -unlink -- ~/.bash_history + -unlink -- ~/.bash_logout + -unlink -- ~/.bash_profile + -unlink -- ~/.bashrc + -rm -f -- ~/.var/cache/bash_history + -unlink -- ~/.config/bash/logout + -unlink -- ~/.config/bash/profile + -unlink -- ~/.config/bash/bashrc + -unlink -- ~/.config/bash/bashrc_palette + -unlink -- ~/.config/bash/bashrc_prompt + -unlink -- ~/.config/bash/aliases + -unlink -- ~/.config/bash/aliases-Zenith + -rmdir -- ~/.config/bash/aliases.d + -rmdir -- ~/.config/bash/bashrc.d + -rmdir -- ~/.config/bash + +.PHONY: install uninstall diff --git a/bash/aliases b/bash/aliases new file mode 100644 index 0000000..140f958 --- /dev/null +++ b/bash/aliases @@ -0,0 +1,87 @@ +# -*- shell-script -*- + +# DESCRIPTION: Create directories and parents, if missing, and move into the first one +# USAGE: mkcd [] +mkcd () { + mkdir -p -- "$@" + cd -- "$1" +} + +# DESCRIPTION: Start bash in a temporary directory and destroy it after exiting the new bash instance +# USAGE: tmpsh +tmpsh () ( + local tmpdir + tmpdir="${XDG_RUNTIME_DIR}" + if test -z "$tmpdir"; then + tmpdir=/tmp + fi + tmpdir="$tmpdir/tmpsh-$$.d" + mkdir -p -- "$tmpdir" + cd -- "$tmpdir" + bash + cd / + rm -rf -- "$tmpdir" + test ! -e "$tmpdir" +) + +#DESCRIPTION: Reload the shell configurations +#USAGE: resh +resh () { + . ~/.bashrc +} + +#DESCRIPTION: Edit the shell configurations +#USAGE: edsh +edsh () { + if [ -z "$EDITOR" ]; then + echo 'No default editor is set, please configure the environment variable EDITOR' + else + $EDITOR ~/.bashrc + fi +} + +# DESCRIPTION: Run a command in a infinite loop with a sleep between executions +# USAGE: forever "" +forever () { + time="$1" + shift 1 + while true; do + "$@" + sleep $time + done +} + +#DESCRIPTION: ls with long listing, classification with appendix character, hidden files and the . and .. directories +alias ll='ls -alF' + +#DESCRIPTION: ls with hidden files +alias la='ls -A' + +#DESCRIPTION: ls with classification with appendix character +alias l='ls -CF' + +#DESCRIPTION: Go to the parent directory +alias ..="cd .." + + + +#libnotify +# DESCRIPTION: Add an "alert" alias for long running commands. Use like so: sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history | tail -n1 | sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + + + +for __script in ~/.config/bash/aliases.d/*; do + if test -r "${__script}"; then + . "${__script}" + fi +done +unset __script + +if test -r ~/.config/bash/"aliases-$(hostname)"; then + . ~/.config/bash/"aliases-$(hostname)" +fi + +if test -r ~/work/.config/bash/aliases; then + . ~/work/.config/bash/aliases +fi diff --git a/bash/aliases-Zenith b/bash/aliases-Zenith new file mode 100644 index 0000000..ac794c9 --- /dev/null +++ b/bash/aliases-Zenith @@ -0,0 +1,17 @@ +# -*- shell-script -*- + +mount-crypt () { + sudo printf '' && \ + device="$(sudo losetup --show -f -P /media/Secondary/.crypt/crypt.img)" && \ + printf '%s\n' "${device}" > "${XDG_RUNTIME_DIR}/CryptCrypt" && \ + gpg --decrypt /media/Secondary/.crypt/crypt.key | sudo cryptsetup -d - open "${device}" CryptCrypt && \ + mkdir -p ~/Crypt && \ + sudo mount /dev/mapper/CryptCrypt ~/Crypt +} + +umount-crypt () { + sudo umount ~/Crypt + rmdir ~/Crypt + sudo cryptsetup close CryptCrypt + sudo losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/CryptCrypt")" +} diff --git a/bash/bashrc b/bash/bashrc new file mode 100644 index 0000000..a500a9d --- /dev/null +++ b/bash/bashrc @@ -0,0 +1,64 @@ +# -*- shell-script -*- + +# If not running interactively, don't do anything +if [[ $- != *i* ]]; then + return +fi + + +# Don't put duplicate lines in the history. See bash(1) for more options +# ... or force ignoredups and ignorespace +HISTCONTROL=ignoredups:ignorespace +# Append to the history file, don't overwrite it +shopt -s histappend +# For setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# Check the window size after each command and, if necessary, update the values of LINES and COLUMNS. +shopt -s checkwinsize + + +set -o physical +alias cd='cd -L' + + + +if test -r ~/.config/bash/aliases; then + . ~/.config/bash/aliases +fi + +if test -r /etc/bash_opt; then + . /etc/bash_opt +fi + +~/.config/bash/bashrc_palette +~/.config/bash/bashrc_prompt + +for __script in ~/.config/bash/bashrc.d/*; do + if test -r "${__script}"; then + . "${__script}" + fi +done +unset __script + +if test -r ~/.config/bash/"bashrc-$(hostname)"; then + . ~/.config/bash/"bashrc-$(hostname)" +fi + +if test -r ~/work/.config/bash/bashrc; then + . ~/work/.config/bash/bashrc +fi + + + +if test "$TERM" = linux; then + printf '\e[?8c' + if test -n "$PALETTE"; then + printf "$PALETTE"'\e[H\e[2J' + fi + palette-set `blackNcsColours` +elif test "$TERM" = xterm; then + export TERM=xterm-256color +fi +featherweight-off diff --git a/bash/bashrc_palette b/bash/bashrc_palette new file mode 100644 index 0000000..8a4405a --- /dev/null +++ b/bash/bashrc_palette @@ -0,0 +1,89 @@ +# DESCRIPTION: Palettes for the terminal + +# DESCRIPTION: Restore to the last selected palette +# USAGE: palette-reset + +# DESCRIPTION: Store the last selected palette has that on set by +# USAGE: palette-set + +# DESCRIPTION: The last choosen palette +# VARIABLE: $PALETTE + +# Commands for setting the palette: +# linuxColours The standard Linux VT palette +# tangoColours The Tango palette +# tangoidColours The Tango palette, but with black background +# cobaltColours The Cobalt palette +# yellowColours A palette with yellow background +# redColours A palette with red background +# ncsColours A palette based on NCS S 2050 with blue background +# lightNcsColours A palette based on NCS S 2050 with lighter blue background +# blackNcsColours A palette based on NCS S 2050 with black background + + +__linux_c='\e]4;0;rgb:00/00/00\e\\\e]4;1;rgb:AA/00/00\e\\\e]4;2;rgb:00/AA/00\e\\\e]4;3;rgb:AA/55/00\e\\\e]4;4;rgb:00/00/AA\e\\\e]4;5;rgb:AA/00/AA\e\\\e]4;6;rgb:00/AA/AA\e\\\e]4;7;rgb:AA/AA/AA\e\\\e]4;8;rgb:55/55/55\e\\\e]4;9;rgb:FF/55/55\e\\\e]4;10;rgb:55/FF/55\e\\\e]4;11;rgb:FF/FF/55\e\\\e]4;12;rgb:55/55/FF\e\\\e]4;13;rgb:FF/55/FF\e\\\e]4;14;rgb:55/FF/FF\e\\\e]4;15;rgb:FF/FF/FF\e\\' + +__tango_c='\e]4;0;rgb:2E/34/36\e\\\e]4;1;rgb:CC/00/00\e\\\e]4;2;rgb:4E/9A/06\e\\\e]4;3;rgb:C4/A0/00\e\\\e]4;4;rgb:34/65/A4\e\\\e]4;5;rgb:75/50/7B\e\\\e]4;6;rgb:06/98/9A\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:58/58/58\e\\\e]4;9;rgb:FF/55/55\e\\\e]4;10;rgb:55/FF/55\e\\\e]4;11;rgb:FF/FF/55\e\\\e]4;12;rgb:55/55/FF\e\\\e]4;13;rgb:FF/55/FF\e\\\e]4;14;rgb:55/FF/FF\e\\\e]4;15;rgb:FF/FF/FF\e\\' + +__tangoid_c='\e]4;0;rgb:00/00/00\e\\\e]4;1;rgb:CC/00/00\e\\\e]4;2;rgb:4E/9A/06\e\\\e]4;3;rgb:C4/A0/00\e\\\e]4;4;rgb:34/65/A4\e\\\e]4;5;rgb:75/50/7B\e\\\e]4;6;rgb:06/98/9A\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:58/58/58\e\\\e]4;9;rgb:FF/55/55\e\\\e]4;10;rgb:55/FF/55\e\\\e]4;11;rgb:FF/FF/55\e\\\e]4;12;rgb:55/55/FF\e\\\e]4;13;rgb:FF/25/5FF\e\\\e]4;14;rgb:55/FF/FF\e\\\e]4;15;rgb:FF/FF/FF\e\\' + +__cobalt_c='\e]4;0;rgb:02/08/40\e\\\e]4;1;rgb:CC/00/00\e\\\e]4;2;rgb:4E/9A/06\e\\\e]4;3;rgb:C4/A0/00\e\\\e]4;4;rgb:34/657A4\e\\\e]4;5;rgb:75/50/7B\e\\\e]4;6;rgb:06/98/9A\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:58/58/58\e\\\e]4;9;rgb:FF/55/55\e\\\e]4;10;rgb:55/FF/55\e\\\e]4;11;rgb:FF/FF/55\e\\\e]4;12;rgb:55/55/FF\e\\\e]4;13;rgb:FF/55/FF\e\\\e]4;14;rgb:55/FF/FF\e\\\e]4;15;rgb:FF/FF/FF\e\\' + +__yellow_c='\e]4;0;rgb:30/30/08\e\\\e]4;1;rgb:CC/00/00\e\\\e]4;2;rgb:4E/9A/06\e\\\e]4;3;rgb:C4/A0/00\e\\\e]4;4;rgb:34/65/A4\e\\\e]4;5;rgb:75/50/7B\e\\\e]4;6;rgb:06/98/9A\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:58/58/58\e\\\e]4;9;rgb:FF/55/55\e\\\e]4;10;rgb:55/FF/55\e\\\e]4;11;rgb:FF/FF/55\e\\\e]4;12;rgb:55/55/FF\e\\\e]4;13;rgb:FF/55/FF\e\\\e]4;14;rgb:55/FF/FF\e\\\e]4;15;rgb:FF/FF/FF\e\\' + +__red_c='\e]4;0;rgb:30/00/00\e\\\e]4;1;rgb:CD/65/6C\e\\\e]4;2;rgb:32/A6/79\e\\\e]4;3;rgb:CC/AD/47\e\\\e]4;4;rgb:24/95/BE\e\\\e]4;5;rgb:A4/6E/B0\e\\\e]4;6;rgb:00/A0/9F\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:55/57/53\e\\\e]4;9;rgb:EB/5E/6A\e\\\e]4;10;rgb:0E/C2/87\e\\\e]4;11;rgb:F2/CA/38\e\\\e]4;12;rgb:00/AC/E0\e\\\e]4;13;rgb:C4/73/D1\e\\\e]4;14;rgb:00/C3/C7\e\\\e]4;15;rgb:EE/EE/EE\e\\' + +__ncs_c='\e]4;0;rgb:02/08/40\e\\\e]4;1;rgb:CD/65/6C\e\\\e]4;2;rgb:32/A6/79\e\\\e]4;3;rgb:CC/AD/47\e\\\e]4;4;rgb:24/95/BE\e\\\e]4;5;rgb:A4/6E/B0\e\\\e]4;6;rgb:00/A0/9F\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:55/57/53\e\\\e]4;9;rgb:EB/5E/6A\e\\\e]4;10;rgb:0E/C2/87\e\\\e]4;11;rgb:F2/CA/38\e\\\e]4;12;rgb:00/AC/E0\e\\\e]4;13;rgb:C4/73/D1\e\\\e]4;14;rgb:00/C3/C7\e\\\e]4;15;rgb:EE/EE/EE\e\\' + +__light_ncs_c='\e]4;0;rgb:0C/14/58\e\\\e]4;1;rgb:CD/65/6C\e\\\e]4;2;rgb:32/A6/79\e\\\e]4;3;rgb:CC/AD/47\e\\\e]4;4;rgb:24/95/BE\e\\\e]4;5;rgb:A4/6E/B0\e\\\e]4;6;rgb:00/A0/9F\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:55/57/53\e\\\e]4;9;rgb:EB/5E/6A\e\\\e]4;10;rgb:0E/C2/87\e\\\e]4;11;rgb:F2/CA/38\e\\\e]4;12;rgb:00/AC/E0\e\\\e]4;13;rgb:C4/73/D1\e\\\e]4;14;rgb:00/C3/C7\e\\\e]4;15;rgb:EE/EE/EE\e\\' + +__black_ncs_c='\e]4;0;rgb:00/00/00\e\\\e]4;1;rgb:CD/65/6C\e\\\e]4;2;rgb:32/A6/79\e\\\e]4;3;rgb:CC/AD/47\e\\\e]4;4;rgb:24/95/BE\e\\\e]4;5;rgb:A4/6E/B0\e\\\e]4;6;rgb:00/A0/9F\e\\\e]4;7;rgb:D3/D7/CF\e\\\e]4;8;rgb:55/57/53\e\\\e]4;9;rgb:EB/5E/6A\e\\\e]4;10;rgb:0E/C2/87\e\\\e]4;11;rgb:F2/CA/38\e\\\e]4;12;rgb:00/AC/E0\e\\\e]4;13;rgb:C4/73/D1\e\\\e]4;14;rgb:00/C3/C7\e\\\e]4;15;rgb:EE/EE/EE\e\\' + + +if [ "$TERM" = "linux" ]; then + __c () { + sed -e 's:;10;:A:g' -e 's:;11;:B:g' -e 's:;12;:C:g' -e 's:;13;:D:g' -e 's:;14;:E:g' -e 's:;15;:F:g' | + sed -e 's:]4:]P:g' -e 's:;::g' -e 's:rgb::g' -e 's:/::g' -e 's/://g' -e 's:\\e\\\\::g' + } + __linux_c="$(__c <<<"${__linux_c}")" + __tango_c="$(__c <<<"${__tango_c}")" + __tangoid_c="$(__c <<<"${__tangoid_c}")" + __cobalt_c="$(__c <<<"${__cobalt_c}")" + __yellow_c="$(__c <<<"${__yellow_c}")" + __red_c="$(__c <<<"${__red_c}")" + __ncs_c="$(__c <<<"${__ncs_c}")" + __light_ncs_c="$(__c <<<"${__light_ncs_c}")" + __black_ncs_c="$(__c <<<"${__black_ncs_c}")" +fi + +alias linuxColours='echo -en "${__linux_c}"' +alias tangoColours='echo -en "${__tango_c}"' +alias tangoidColours='echo -en "${__tangoid_c}"' +alias cobaltColours='echo -en "${__cobalt_c}"' +alias yellowColours='echo -en "${__yellow_c}"' +alias redColours='echo -en "${__red_c}"' +alias ncsColours='echo -en "${__ncs_c}"' +alias lightNcsColours='echo -en "${__light_ncs_c}"' +alias blackNcsColours='echo -en "${__black_ncs_c}"' + +if [ "$USER" = 'root' ]; then + alias stdColours=redColours +else + alias stdColours=blackNcsColours +fi + +if [ "$COLORTERM" = '' ]; then + stdColours +fi + +PALETTE= + +palette-set () { + PALETTE="$*" +} + +palette-reset () { + printf '%s' "$PALETTE" +} + +palette-set `stdColours` diff --git a/bash/bashrc_prompt b/bash/bashrc_prompt new file mode 100644 index 0000000..5463afb --- /dev/null +++ b/bash/bashrc_prompt @@ -0,0 +1,413 @@ +#DESCRIPTION: A nicer default shell prompt line + + +#DESCRIPTION: Use full block cursor Do not use full block cursor +#USAGE block-on block-off + +#DESCRIPTION: Print username Do not print username Set colour of username +#USAGE: username-on username-off username-colour + +#DESCRIPTION: Print hostname Do not print hostname Set colour of hostname +#USAGE: hostname-on hostname-off hostname-colour + +#DESCRIPTION: Print IP address in place hostname +#USAGE: hostname-ip + +#DESCRIPTION: Print terminal name Do not print terminal name Set colour of terminal name +#USAGE: pts-on pts-off pts-colour + +#DESCRIPTION: Print git branch Do not print git branch Set colour of git branch +#USAGE: git-on git-off git-colour + +#DESCRIPTION: Print directory Do not print directory Set colour of directory +#USAGE: dir-on dir-off dir-colour + +#DESCRIPTION: Print directory tip Print absolute directory Print custom directory +#USAGE: dir-short dir-full dir-text + +#DESCRIPTION: Print current time Do not print current time Set colour of current time +#USAGE: clock-on clock-off clock-colour + +#DESCRIPTION: Print battery status Do not print battery status Set colour of battery status +#USAGE: battery-on battery-off battery-colour + +#DESCRIPTION: Print featherweight status Do not print featherweight status Set the used colour +#USAGE featherweight-on featherweight-off featherweight-colour + +#DESCRIPTION: Set title on terminal Do not set title on terminal +#USAGE title-on title-off + +#DESCRIPTION: Use two lines Use a single line +#USAGE dual-on dual-off + +#DESCRIPTION: Set colour of error code +#USAGE error-colour + +#DESCRIPTION: Set colour of dollar/hash sign +#USAGE dollar-colour + + +prompt_addons=() + + +__prompt_block="" +if [ "$TERM" = "linux" ]; then + __prompt_block="\033[?8c" +fi +block-on () { + __prompt_block="\033[?8c" + update-prompt +} +block-off () { + __prompt_block="" + update-prompt +} + + +__prompt_username="\u" +username-on () { + __prompt_username="\u" + update-prompt +} +username-off () { + __prompt_username="" + update-prompt +} + + +__prompt_username_colour="94" +if [ "$USER" = "root" ]; then + __prompt_username_colour="91" + if [ "$TERM" = "linux" ]; then + __prompt_username_colour="31;01" + fi +elif [ "$TERM" = "linux" ]; then + __prompt_username_colour="34;01" +fi +username-colour () { + __prompt_username_colour="$*" + update-prompt +} + + +__prompt_hostname="1" +hostname-on () { + __prompt_hostname="1" + update-prompt +} +hostname-ip () { + __prompt_hostname="$( (ifconfig | sed -n 's/^[\t ]*inet[\t ][\t ]*\([^\t ]*\).*$/\1/p' | + sed '/^127\.0\.0\.1$/d' ; echo 127.0.0.1) | sed 1q )" + update-prompt +} +hostname-off () { + __prompt_hostname="0" + update-prompt +} + + +__prompt_hostname_colour="34" +hostname-colour () { + __prompt_hostname_colour="$*" + update-prompt +} + + +__prompt_pts="0" +if [ "$TERM" = "linux" ]; then + __prompt_pts="1" +fi +pts-on () { + __prompt_pts="1" + update-prompt +} +pts-off () { + __prompt_pts="0" + update-prompt +} + + +__prompt_pts_colour="36" +pts-colour () { + __prompt_pts_colour="$*" + update-prompt +} + + +__prompt_git="1" +git-on () { + __prompt_git="1" + update-prompt +} +git-off () { + __prompt_git="0" + update-prompt +} + + +__prompt_git_colour="32" +git-colour () { + __prompt_git_colour="$*" + update-prompt +} + + +__prompt_func_git () { + exec 2>/dev/null + if git status >&2; then + status="$(git status -s -b | head -n 1)" + if [ "$(echo "${status}" | cut -d ' ' -f 3)" = '[ahead' ]; then + echo "${status}" | cut -d ' ' -f 2 + else + echo "${status}" | cut -d ' ' -f 2 | cut -d . -f 1 + fi + fi +} + + +__prompt_dir="\w" +dir-on () { + __prompt_dir="\w" + update-prompt +} +dir-short () { + __prompt_dir="\W" + update-prompt +} +dir-full () { + __prompt_dir='$(pwd)' + update-prompt +} +dir-text () { + __prompt_dir="$(sed -e 's:\\:\\\\:g' <<<"$*")" + update-prompt +} +dir-off () { + __prompt_dir="" + update-prompt +} + + +__prompt_dir_colour="35" +dir-colour () { + __prompt_dir_colour="$*" + update-prompt +} + + +__prompt_clock="(\t)" +clock-on () { + __prompt_clock="(\t)" + update-prompt +} +clock-off () { + __prompt_clock="" + update-prompt +} + + +__prompt_clock_colour="33" +clock-colour () { + __prompt_clock_colour="$*" + update-prompt +} + + +__prompt_dual="\[\033[00m\]\n\[\033[1K\]" +dual-on () { + __prompt_dual="\[\033[00m\]\n\[\033[1K\]" + update-prompt +} +dual-off () { + __prompt_dual="" + update-prompt +} + + +__prompt_dollar_colour="01;34" +if [ "$USER" = "root" ]; then + __prompt_dollar_colour="01;31" +fi +dollar-colour () { + __prompt_dollar_colour="$*" + update-prompt +} + + +__prompt_error_colour="01;31" +error-colour () { + __prompt_error_colour="$*" + update-prompt +} + + +__prompt_func_error () { + if [ "$1" = "0" ]; then + echo -n "" + else + echo -n "(error: $1) " + fi +} + + +__prompt_battery="" +battery-on () { + __prompt_battery='$(__prompt_func_battery)' + update-prompt +} +battery-off () { + __prompt_battery="" + update-prompt +} + + +__prompt_battery_colour="33" +battery-colour () { + __prompt_battery_colour="$*" + update-prompt +} + + +__prompt_func_battery () { + local __first=1 + acpi --battery 2>/dev/null | while read info; do + if [ $__first = 1 ]; then + echo -n "(${info})" + __first=0 + else + echo -n " (${info})" + fi + done +} + + +__prompt_featherweight='$(__prompt_func_featherweight)' +featherweight-on () { + __prompt_featherweight='$(__prompt_func_featherweight)' + update-prompt +} +featherweight-off () { + __prompt_featherweight='' + update-prompt +} + + +__prompt_featherweight_colour="36" +featherweight-colour () { + __prompt_featherweight_colour="$*" + update-prompt +} + + +__prompt_func_featherweight () { + local status + if [ -r ~/.var/lib/featherweight/status ]; then + status="$(cat ~/.var/lib/featherweight/status)" + if [ ! "${status}" = "0" ]; then + echo "(fw: ${status})" + fi + fi +} + + +__prompt_title="" +case "$TERM" in + xterm*|rxvt*|Eterm|aterm|kterm|gnome*) + __prompt_title="\033]0;\u@\h: \w || $(tty)\a" + ;; +esac +title-on () { + __prompt_title="\033]0;\u@\h: \w || $(tty)\a" + update-prompt +} +title-off () { + __prompt_title="" + update-prompt +} + + +__screen_title="" +case "$TERM" in + screen) + __screen_title="\033_\u@\h: \w || $(tty)\033\\" + ;; +esac +screen-title-on () { + __screen_title="\033_\u@\h: \w || $(tty)\033\\" + update-prompt +} +screen-title-off () { + __screen_title="" + update-prompt +} + + +update-prompt () { + local __invisible __addon + __invisible="\[${__prompt_title}${__screen_title}${__prompt_block}\033[00m\]" + PS1="" + if [ ! "${__prompt_username}" = "" ]; then + PS1="${PS1}\[\033[${__prompt_username_colour}m\]${__prompt_username}\[\033[00m\]" + fi + if [ "${__prompt_hostname}" = "1" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1}@" + fi + PS1="${PS1}\[\033[${__prompt_hostname_colour}m\]\h\[\033[00m\]" + elif [ ! "${__prompt_hostname}" = "0" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1}@" + fi + PS1="${PS1}\[\033[${__prompt_hostname_colour}m\]${__prompt_hostname}\[\033[00m\]" + fi + if [ "${__prompt_pts}" = "1" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1}." + fi + PS1="${PS1}\[\033[${__prompt_pts_colour}m\]\l\[\033[00m\]" + fi + if [ "${__prompt_git}" = "1" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1}"'$(git status 2>/dev/null >&2 && echo -n : || echo -n "")' + fi + PS1="${PS1}\[\033[${__prompt_git_colour}m\]"'$(__prompt_func_git)'"\[\033[00m\]" + fi + if [ ! "${__prompt_dir}" = "" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1}: " + fi + PS1="${PS1}\[\033[${__prompt_dir_colour}m\]${__prompt_dir}\[\033[00m\]" + fi + if [ ! "${__prompt_clock}" = "" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1} " + fi + PS1="${PS1}\[\033[${__prompt_clock_colour}m\]${__prompt_clock}\[\033[00m\]" + fi + if [ ! "${__prompt_battery}" = "" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1} " + fi + PS1="${PS1}\[\033[${__prompt_battery_colour}m\]${__prompt_battery}\[\033[00m\]" + fi + if [ ! "${__prompt_featherweight}" = "" ]; then + if [ ! "${PS1}" = "" ]; then + PS1="${PS1} " + fi + PS1="${PS1}\[\033[${__prompt_featherweight_colour}m\]${__prompt_featherweight}\[\033[00m\]" + fi + __sh="\[\033[00m\033[${__prompt_dollar_colour}m\]\\$\[\033[00m\]" + __err="\[\033[${__prompt_error_colour}m\]"'$(__prompt_func_error $?)'"\[\033[00m\]" + for __addon in "${prompt_addons[@]}"; do + PS1="${PS1}$(${__addon})" + done + PS1="${__invisible}${__err}${PS1}${__prompt_dual}${__sh} " +} + + +update-prompt + + +PS2='\[\e[01;31m\]> \[\e[00m\]' +PS3='\[\e[01;31m\]> \[\e[00m\]' +PS4='\[\e[01;31m\]+ \[\e[00m\]' diff --git a/bash/logout b/bash/logout new file mode 100644 index 0000000..ef22cbc --- /dev/null +++ b/bash/logout @@ -0,0 +1,9 @@ +# -*- shell-script -*- + +if test -r ~/.config/bash/"logout-$(hostname)"; then + . ~/.config/bash/"logout-$(hostname)" +fi + +if test -r ~/work/.config/bash/logout; then + . ~/work/.config/bash/logout +fi diff --git a/bash/profile b/bash/profile new file mode 100644 index 0000000..096711e --- /dev/null +++ b/bash/profile @@ -0,0 +1,17 @@ +# -*- shell-script -*- + +if test -r ~/.config/profile; then + . ~/.config/profile +fi + +if test -r ~/.config/bash/"profile-$(hostname)"; then + . ~/.config/bash/"profile-$(hostname)" +fi + +if test -r ~/work/.config/bash/profile; then + . ~/work/.config/bash/profile +fi + +if test -r ~/.config/bash/bashrc; then + . ~/.config/bash/bashrc; +fi diff --git a/bus/Makefile b/bus/Makefile new file mode 100644 index 0000000..e677bd6 --- /dev/null +++ b/bus/Makefile @@ -0,0 +1,21 @@ +.POSIX: + +XINITRC_ORDER = 10 + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/bus + ln -sf -- ~/.dotfiles/bus/user-profile ~/.config/profile.d/bus + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-bus + ln -sf -- ~/.dotfiles/bus/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-bus + +uninstall: + -unlink -- ~/.config/profile.d/bus + -rmdir -- ~/.config/profile.d + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-bus + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/bus/user-profile b/bus/user-profile new file mode 100644 index 0000000..521cb46 --- /dev/null +++ b/bus/user-profile @@ -0,0 +1,15 @@ +# -*- shell-script -*- + +mkdir -p "${XDG_RUNTIME_DIR}/@bus" + +export BUS_AUDIO="${XDG_RUNTIME_DIR}/@bus/audio" +export BUS_INPUT="${XDG_RUNTIME_DIR}/@bus/input" +export BUS_VIDEO="${XDG_RUNTIME_DIR}/@bus/video" +export BUS_FILES="${XDG_RUNTIME_DIR}/@bus/files" +export BUS_GENERIC="${XDG_RUNTIME_DIR}/@bus/generic" + +if test ! -e "${BUS_AUDIO}"; then bus create "${BUS_AUDIO}"; fi +if test ! -e "${BUS_INPUT}"; then bus create "${BUS_INPUT}"; fi +if test ! -e "${BUS_VIDEO}"; then bus create "${BUS_VIDEO}"; fi +if test ! -e "${BUS_FILES}"; then bus create "${BUS_FILES}"; fi +if test ! -e "${BUS_GENERIC}"; then bus create "${BUS_GENERIC}"; fi diff --git a/bus/xinit b/bus/xinit new file mode 100644 index 0000000..de6c824 --- /dev/null +++ b/bus/xinit @@ -0,0 +1,9 @@ +# -*- shell-script -*- + +# Create buses +if test -z "${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR='/tmp/.~'"$(whoami)" +fi +mkdir -p "${XDG_RUNTIME_DIR}/@bus" +export BUS_AUDIO="${XDG_RUNTIME_DIR}/@bus/audio" +bus create "${BUS_AUDIO}" diff --git a/coreutils/Makefile b/coreutils/Makefile new file mode 100644 index 0000000..9058e3e --- /dev/null +++ b/coreutils/Makefile @@ -0,0 +1,17 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + mkdir -p -- ~/.config/bash/bashrc.d + test ! -d ~/.config/bash/aliases.d/coreutils + test ! -d ~/.config/bash/bashrc.d/coreutils + ln -sf -- ~/.dotfiles/coreutils/bash-aliases ~/.config/bash/aliases.d/coreutils + ln -sf -- ~/.dotfiles/coreutils/bash-bashrc ~/.config/bash/bashrc.d/coreutils + +uninstall: + -unlink -- ~/.config/bash/aliases.d/coreutils + -unlink -- ~/.config/bash/bashrc.d/coreutils + -rmdir -- ~/.config/bash/aliases.d + -rmdir -- ~/.config/bash/bashrc.d + +.PHONY: install uninstall diff --git a/coreutils/bash-aliases b/coreutils/bash-aliases new file mode 100644 index 0000000..378c1d7 --- /dev/null +++ b/coreutils/bash-aliases @@ -0,0 +1,5 @@ +# -*- shell-script -*- + +#DESCRIPTION: Use colours in ls when the output is not piped + +alias ls='ls --color=auto' diff --git a/coreutils/bash-bashrc b/coreutils/bash-bashrc new file mode 100644 index 0000000..c4df04b --- /dev/null +++ b/coreutils/bash-bashrc @@ -0,0 +1,51 @@ +# -*- shell-script -*- + +# lc = left of colour sequence (default = "\033[") +# rc = right of colour sequence (default = "m") +# en = end color (replaced lc+no+rc; default = NULL) +# cl = clear to end of line (default = "\033[K") +# rs = reset to ordinary colors (default = "0") + +# no = normal (global default) +# di = directory +# fi = regular file +# ex = executable regular file +# pi = named pipe (FIFO) +# bd = block device +# cd = character device +# ln = symbolic link +# or = orphaned symbolic link (points to a file that no longer exists) +# mi = missing file (a missing file that an orphan symbolic link points to) +# so = socket +# do = door +# su = setuid +# sg = setgid +# st = sticky +# ow = other-writable +# tw = ow (other-writable) + st (sticky) +# ca = ??? +# mh = ??? + +export LS_COLORS=\ +"di=1;34:"\ +"fi=0:"\ +"ex=1;32:"\ +"pi=42;30:"\ +"bd=46;37:"\ +"cd=46;30:"\ +"ln=1;36:"\ +"or=1;31:"\ +"mi=1;31:"\ +"so=41;37:"\ +"do=41;30:"\ +"su=1;45;7:"\ +"sg=1;35:"\ +"st=31:"\ +"ow=32:"\ +"tw=33:"\ +"$(printf "*.%s=34:" tar tgz arj taz lzh lzma tlz txz zip z Z dz gz lz xz bz2 bz tbz tbz2 tz deb rpm jar war ear sar rar + ace zoo cpio 7z rz zst dmg)"\ +"$(printf "*.%s=35:" jpg jpeg gif bmp pbm pgm ppm tga zbm xpm tif tiff png svg svgz mng pcx mov mpg mpeg m2v mkc webm ogm + mp4 m4v mp4v vob nuv wmv asf rm rmvb flv avi fli flv gl dl xcf xwd yuv cgm emf axv anx ogv ogx pam + ff webm webp)"\ +"$(printf "*.%s=36:" aac au flc flac m4a mid midi mka mp3 mpc ogg ra wav axa oga spx xsdf opus)" diff --git a/cvs/Makefile b/cvs/Makefile new file mode 100644 index 0000000..c834e59 --- /dev/null +++ b/cvs/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/cvs + ln -sf -- ~/.dotfiles/cvs/user-profile ~/.config/profile.d/cvs + +uninstall: + -unlink -- ~/.config/profile.d/cvs + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/cvs/user-profile b/cvs/user-profile new file mode 100644 index 0000000..0788bd0 --- /dev/null +++ b/cvs/user-profile @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +export CVSROOT=~/.var/lib/cvsroot +export CVS_RSH=ssh diff --git a/dconf/Makefile b/dconf/Makefile new file mode 100644 index 0000000..0b1b6a1 --- /dev/null +++ b/dconf/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +XINITRC_ORDER = 10 + +install: + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-dconf + ln -sf -- ~/.dotfiles/dconf/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-dconf + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-dconf + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/dconf/xinit b/dconf/xinit new file mode 100644 index 0000000..645f699 --- /dev/null +++ b/dconf/xinit @@ -0,0 +1,17 @@ +# -*- shell-script -*- + +# Set dconf profile +if test ! "${SET_DCONF_PROFILE}" = 0; then + export DCONF_PROFILE=~/.config/dconf/profiles/"${SESSION/-/_}" + + mkdir -p ~/.config/dconf/profiles + + if test ! -e ~/.config/dconf/profiles/"${SESSION/-/_}"; then + printf '%s\n' "user-db:${SESSION}" user-db:user system-db:local system-db:site \ + > ~/.config/dconf/profiles/"${SESSION/-/_}" + fi + + if test ! -e ~/.config/dconf/"${SESSION/-/_}" && test -e ~/.config/dconf/user; then + cp -- ~/.config/dconf/user ~/.config/dconf/"${SESSION/-/_}" + fi +fi diff --git a/featherweight/Makefile b/featherweight/Makefile new file mode 100644 index 0000000..cc4f9db --- /dev/null +++ b/featherweight/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/featherweight + ln -sf -- ~/.dotfiles/featherweight/bash-aliases ~/.config/bash/aliases.d/featherweight + +uninstall: + -unlink -- ~/.config/bash/aliases.d/featherweight + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/featherweight/bash-aliases b/featherweight/bash-aliases new file mode 100644 index 0000000..b81fa18 --- /dev/null +++ b/featherweight/bash-aliases @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +alias fw=featherweight diff --git a/ffmpeg/Makefile b/ffmpeg/Makefile new file mode 100644 index 0000000..32991b3 --- /dev/null +++ b/ffmpeg/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/ffmpeg + ln -sf -- ~/.dotfiles/ffmpeg/bash-aliases ~/.config/bash/aliases.d/ffmpeg + +uninstall: + -unlink -- ~/.config/bash/aliases.d/ffmpeg + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/ffmpeg/bash-aliases b/ffmpeg/bash-aliases new file mode 100644 index 0000000..41846c8 --- /dev/null +++ b/ffmpeg/bash-aliases @@ -0,0 +1,25 @@ +# -*- shell-script -*- + +remove-video-on-all () ( + for ext in opus aac mp3 m4a; do + for f in *.{mkv,mp4,webm}; do + if ffmpeg -i "$f" -map 0:a -codec copy -y -- "$f.$ext"; then + rm -- "$f" + else + rm -- "$f.$ext" + fi + done + done +) + +remove-video-on-all-1 () ( + for ext in opus aac mp3 m4a; do + for f in *."$1"; do + if ffmpeg -i "$f" -map 0:a -codec copy -y -- "$f.$ext"; then + rm -- "$f" + else + rm -- "$f.$ext" + fi + done + done +) diff --git a/filesystem/Makefile b/filesystem/Makefile new file mode 100644 index 0000000..c46eea2 --- /dev/null +++ b/filesystem/Makefile @@ -0,0 +1,90 @@ +.POSIX: + +install: + mkdir -p -- ~/.config + mkdir -p -- ~/.var/cache/.thumbnails + rm -rf -- ~/.config/.cache + rm -rf -- ~/.cache + rm -rf -- ~/.thumbnails + ln -sf -- ../.cache ~/.config/.cache + ln -sf -- .var/cache ~/.cache + ln -sf -- .cache/.thumbnails ~/.thumbnails + mkdir -p -- ~/.var/games + mkdir -p -- ~/.var/lib + mkdir -p -- ~/.var/mail + mkdir -p -- ~/.var/spool + rm -f -- ~/.spool + rm -f -- ~/.local/var + ln -sf .var/spool/ ~/.spool + ln -sf ../.var ~/.local/var + mkdir -p -- ~/.local/bin + mkdir -p -- ~/.local/src + if test -d ~/.fonts && test ! -L ~/.fonts; then \ + mkdir -p -- ~/.local/share && \ + test ! -e ~/.local/share/fonts && \ + mv ~/.fonts ~/.local/share/fonts; \ + else \ + mkdir -p -- ~/.local/share/fonts && \ + rm -f -- ~/.fonts && \ + ln -sf -- .local/share/fonts ~/.fonts; \ + fi + if test -d ~/.icons && test ! -L ~/.icons; then \ + mkdir -p -- ~/.local/share && \ + test ! -e ~/.local/share/icons && \ + mv ~/.icons ~/.local/share/icons; \ + else \ + mkdir -p -- ~/.local/share/icons && \ + rm -f -- ~/.icons && \ + ln -sf -- .local/share/icons ~/.icons; \ + fi + if test -d ~/.themes && test ! -L ~/.themes; then \ + mkdir -p -- ~/.local/share && \ + test ! -e ~/.local/share/themes && \ + mv ~/.themes ~/.local/share/themes; \ + else \ + mkdir -p -- ~/.local/share/themes && \ + rm -f -- ~/.themes && \ + ln -sf -- .local/share/themes ~/.themes; \ + fi + mkdir -p -- ~/.usr/bin + mkdir -p -- ~/.usr/include + mkdir -p -- ~/.usr/lib + mkdir -p -- ~/.usr/libexec + mkdir -p -- ~/.usr/share/man + mkdir -p -- ~/.usr/src + ln -sf -- ~/.dotfiles/filesystem/user-dirs.dirs ~/.config/ + +uninstall: + -unlink -- ../.cache ~/.config/.cache + -unlink -- .var/cache ~/.cache + -unlink -- .cache/.thumbnails ~/.thumbnails + -unlink -- .var/spool/ ~/.spool + -unlink -- ../.var ~/.local/var + -unlink -- .local/share/fonts ~/.fonts + -unlink -- .local/share/icons ~/.icons + -unlink -- .local/share/themes ~/.themes + -rmdir -- ~/.config + -rmdir -- ~/.var/cache/.thumbnails + -rmdir -- ~/.var/cache + -rmdir -- ~/.var/games + -rmdir -- ~/.var/lib + -rmdir -- ~/.var/mail + -rmdir -- ~/.var/spool + -rmdir -- ~/.var + -rmdir -- ~/.local/bin + -rmdir -- ~/.local/src + -rmdir -- ~/.local/share/fonts + -rmdir -- ~/.local/share/icons + -rmdir -- ~/.local/share/themes + -rmdir -- ~/.local/share + -rmdir -- ~/.local + -rmdir -- ~/.usr/bin + -rmdir -- ~/.usr/include + -rmdir -- ~/.usr/lib + -rmdir -- ~/.usr/libexec + -rmdir -- ~/.usr/share/man + -rmdir -- ~/.usr/share + -rmdir -- ~/.usr/src + -rmdir -- ~/.usr + +.PHONY: install uninstall diff --git a/filesystem/user-dirs.dirs b/filesystem/user-dirs.dirs new file mode 100644 index 0000000..a6adde0 --- /dev/null +++ b/filesystem/user-dirs.dirs @@ -0,0 +1,15 @@ +# This file is written by xdg-user-dirs-update +# If you want to change or add directories, just edit the line you're +# interested in. All local changes will be retained on the next run +# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped +# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an +# absolute path. No other format is supported. +# +XDG_DESKTOP_DIR="/var/empty" +XDG_DOWNLOAD_DIR="$HOME/" +XDG_TEMPLATES_DIR="$HOME/Templates" +XDG_PUBLICSHARE_DIR="$HOME/Public" +XDG_DOCUMENTS_DIR="$HOME/" +XDG_MUSIC_DIR="$HOME/" +XDG_PICTURES_DIR="$HOME/" +XDG_VIDEOS_DIR="$HOME/" diff --git a/gcc/Makefile b/gcc/Makefile new file mode 100644 index 0000000..ce541b9 --- /dev/null +++ b/gcc/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/gcc + ln -sf -- ~/.dotfiles/gcc/user-profile ~/.config/profile.d/gcc + +uninstall: + -unlink -- ~/.config/profile.d/gcc + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/gcc/user-profile b/gcc/user-profile new file mode 100644 index 0000000..0d231e6 --- /dev/null +++ b/gcc/user-profile @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +export CC="gcc -fdiagnostics-color=auto" +export CXX="g++ -fdiagnostics-color=auto" diff --git a/git/Makefile b/git/Makefile new file mode 100644 index 0000000..a428302 --- /dev/null +++ b/git/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/git + ln -sf -- ~/.dotfiles/git/bash-aliases ~/.config/bash/aliases.d/git + +uninstall: + -unlink -- ~/.config/bash/aliases.d/git + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/git/bash-aliases b/git/bash-aliases new file mode 100644 index 0000000..3552668 --- /dev/null +++ b/git/bash-aliases @@ -0,0 +1,50 @@ +# -*- shell-script -*- + +alias gitlog="git log --graph --decorate" +alias gitlogg="git log --graph --decorate --full-history" + +gitcomm () { + git commit --signoff -S"$GPG_KEY" -m "$*" +} + +ge () { + if [ -z "$EDITOR" ]; then + printf '\e[1;31m%s\e[0m\n' 'No default editor is set, please configure the environment variable EDITOR' + else + $EDITOR -- "$@" + git add -- "$@" + fi +} + +gitpush () { + git push -u origin `___git_branch_` +} + +gitpull () { + __gb_=`___git_branch_` + git checkout "$1" && + git pull && + git checkout $__gb_ && + git pull . "$1" + unset __gb_ +} + +gitp () { + __gb_=`___git_branch_` + git pull && + git checkout "$1" && + git pull && + git pull . $__gb_ + unset __gb_ +} + + +_____gp___bashrc_ () { + printf '%s\n' "$2" +} +_____gp__bashrc_ () { + _____gp___bashrc_ `git status -b -s 2>/dev/null` +} +___git_branch_ () { + printf '%s\n' `_____gp__bashrc_ | cut -d . -f 1` +} diff --git a/gnupg/Makefile b/gnupg/Makefile new file mode 100644 index 0000000..ac5408f --- /dev/null +++ b/gnupg/Makefile @@ -0,0 +1,14 @@ +.POSIX: + +install: + mkdir -p -- ~/.var/lib/gnupg + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/gnupg + ln -sf -- ~/.dotfiles/gnupg/user-profile ~/.config/profile.d/gnupg + +uninstall: + -unlink -- ~/.config/profile.d/gnupg + -rmdir -- ~/.config/profile.d + -rmdir -- ~/.var/lib/gnupg + +.PHONY: install uninstall diff --git a/gnupg/user-profile b/gnupg/user-profile new file mode 100644 index 0000000..67cbb86 --- /dev/null +++ b/gnupg/user-profile @@ -0,0 +1,8 @@ +# -*- shell-script -*- + +export GNUPGHOME=~/.var/lib/.gnupg + +export GPG_KEY=69E7C5ED +export GPG_KEYA=45668AAD +export GPG_KEY_EMAIL=6ABC233E # 8AAD AC7C E522 E5E8 674C F187 5319 6754 6ABC 233E +# Old GPG_KEY_EMAIL: 678A6A76 diff --git a/google-chrome/Makefile b/google-chrome/Makefile new file mode 100644 index 0000000..88142fa --- /dev/null +++ b/google-chrome/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + @: + +uninstall: + -rm -rf -- ~/.config/google-chrome + +.PHONY: install uninstall diff --git a/gpm/Makefile b/gpm/Makefile new file mode 100644 index 0000000..7e3b16f --- /dev/null +++ b/gpm/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/gpm + ln -sf -- ~/.dotfiles/gpm/bash-aliases ~/.config/bash/aliases.d/gpm + +uninstall: + -unlink -- ~/.config/bash/aliases.d/gpm + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/gpm/bash-aliases b/gpm/bash-aliases new file mode 100644 index 0000000..8c24fdd --- /dev/null +++ b/gpm/bash-aliases @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +alias start-gpm="asroot gpm -m /dev/input/mice -t imps2" +alias stop-gpm="asroot gpm -k" diff --git a/grep/Makefile b/grep/Makefile new file mode 100644 index 0000000..6c0d4e8 --- /dev/null +++ b/grep/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/grep + ln -sf -- ~/.dotfiles/grep/bash-aliases ~/.config/bash/aliases.d/grep + +uninstall: + -unlink -- ~/.config/bash/aliases.d/grep + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/grep/bash-aliases b/grep/bash-aliases new file mode 100644 index 0000000..59c21d8 --- /dev/null +++ b/grep/bash-aliases @@ -0,0 +1,7 @@ +# -*- shell-script -*- + +#DESCRIPTION: Use colours with grep when the output is not piped + +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' diff --git a/gtk3/Makefile b/gtk3/Makefile new file mode 100644 index 0000000..750394e --- /dev/null +++ b/gtk3/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/gtk3 + ln -sf -- ~/.dotfiles/gtk3/user-profile ~/.config/profile.d/gtk3 + +uninstall: + -unlink -- ~/.config/profile.d/gtk3 + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/gtk3/user-profile b/gtk3/user-profile new file mode 100644 index 0000000..e53ea36 --- /dev/null +++ b/gtk3/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export GTK_THEME=Adwaita:dark diff --git a/info b/info new file mode 120000 index 0000000..f00c57d --- /dev/null +++ b/info @@ -0,0 +1 @@ +texinfo \ No newline at end of file diff --git a/java-runtime/Makefile b/java-runtime/Makefile new file mode 100644 index 0000000..9d4947b --- /dev/null +++ b/java-runtime/Makefile @@ -0,0 +1,18 @@ +.POSIX: + +install: + mkdir -p -- ~/.var/cache/java + -rm -rf -- ~/.java + test ! -e ~/.java + ln -s -- .var/cache/java ~/.java + mkdir -p -- ~/.config/profile.d + test ! d ~/.config/profile.d/java-runtime + ln -sf -- ~/.dotfiles/java-runtime/user-profile ~/.config/profile.d/java-runtime + +uninstall: + -unlink -- ~/.config/profile.d/java-runtime + -rmdir -- ~/.config/profile.d + -rm -rf -- ~/.java + -rm -rf -- ~/.var/cache/java + +.PHONY: install uninstall diff --git a/java-runtime/user-profile b/java-runtime/user-profile new file mode 100644 index 0000000..9b60457 --- /dev/null +++ b/java-runtime/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export _JAVA_OPTIONS='-Djdk.gtk.version=2.2' diff --git a/kdenlive/Makefile b/kdenlive/Makefile new file mode 100644 index 0000000..d482e64 --- /dev/null +++ b/kdenlive/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + @: + +uninstall: + -rm -f -- ~/.config/kdenliverc + +.PHONY: install uninstall diff --git a/less/Makefile b/less/Makefile new file mode 100644 index 0000000..73b43c7 --- /dev/null +++ b/less/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/less + ln -sf -- ~/.dotfiles/less/user-profile ~/.config/profile.d/less + +uninstall: + -unlink -- ~/.config/profile.d/less + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/less/user-profile b/less/user-profile new file mode 100644 index 0000000..469134d --- /dev/null +++ b/less/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export LESSHISTFILE=/dev/null diff --git a/libcontacts-glibc b/libcontacts-glibc new file mode 120000 index 0000000..205dcc8 --- /dev/null +++ b/libcontacts-glibc @@ -0,0 +1 @@ +libcontacts \ No newline at end of file diff --git a/libcontacts-musl b/libcontacts-musl new file mode 120000 index 0000000..205dcc8 --- /dev/null +++ b/libcontacts-musl @@ -0,0 +1 @@ +libcontacts \ No newline at end of file diff --git a/libcontacts/.gitignore b/libcontacts/.gitignore new file mode 100644 index 0000000..9b698a0 --- /dev/null +++ b/libcontacts/.gitignore @@ -0,0 +1 @@ +/contacts/ diff --git a/libcontacts/Makefile b/libcontacts/Makefile new file mode 100644 index 0000000..7b7ad08 --- /dev/null +++ b/libcontacts/Makefile @@ -0,0 +1,15 @@ +.POSIX: + +install: + mkdir -p -- ~/.config + if test ! -L ~/.config/contacts; then \ + test ! -e ~/.config/contacts && \ + ln -sf -- ~/.dotfiles/libcontacts/contacts ~/.config/contacts; \ + else \ + test "$(readlink ~/.config/contacts)" = ~/.dotfiles/libcontacts/contacts; \ + fi + +uninstall: + -unlink -- ~/.config/contacts + +.PHONY: install uninstall diff --git a/meld/Makefile b/meld/Makefile new file mode 100644 index 0000000..bda9978 --- /dev/null +++ b/meld/Makefile @@ -0,0 +1,15 @@ +.POSIX: + +# Unfortunely meldrc.ini contains both (for us unless) state and settings, +# therefore we are making a copy instead of a link. Otherwise running meld +# could make changes to our dotfiles. + +install: + mkdir -p -- ~/.config/meld + cp -- meldrc.ini ~/.config/meld/ + +uninstall: + -unlink -- ~/.config/meld/meldrc.ini + -rm -rf -- ~/.config/meld + +.PHONY: install uninstall diff --git a/meld/meldrc.ini b/meld/meldrc.ini new file mode 100644 index 0000000..fba8e9b --- /dev/null +++ b/meld/meldrc.ini @@ -0,0 +1,14 @@ +[DEFAULT] +use_custom_font = True +custom_font = Fixed 10 +tab_size = 8 +edit_wrap_lines = 0 +highlight_current_line = True +show_line_numbers = False +show_whitespace = False +use_syntax_highlighting = False +edit_command_type = custom +edit_command_custom = emacs +dirdiff_time_resolution_ns = 1 +text_codecs = utf8 +vc_show_commit_margin = True diff --git a/moc/Makefile b/moc/Makefile new file mode 100644 index 0000000..0d4ee14 --- /dev/null +++ b/moc/Makefile @@ -0,0 +1,17 @@ +.POSIX: + +install: + mkdir -p -- ~/.var/lib/moc + mkdir -p -- ~/.config/bash/aliases.d + rm -rf ~/.moc + test ! -d ~/.config/bash/aliases.d/moc + ln -sf -- .var/lib/moc ~/.moc + ln -sf -- ~/.dotfiles/moc/bash-aliases ~/.config/bash/aliases.d/moc + +uninstall: + -unlink -- ~/.moc + -unlink -- ~/.config/bash/aliases.d/moc + -rmdir -- ~/.config/bash/aliases.d + -rm -rf -- ~/.var/lib/moc + +.PHONY: install uninstall diff --git a/moc/bash-aliases b/moc/bash-aliases new file mode 100644 index 0000000..6dc6ab2 --- /dev/null +++ b/moc/bash-aliases @@ -0,0 +1,7 @@ +# -*- shell-script -*- + +if test "$TERM" = linux; then + alias mocp="mocp --theme darkdot_theme" +else + alias mocp="etty; exec mocp --theme darkdot_theme" +fi diff --git a/mplayer/Makefile b/mplayer/Makefile new file mode 100644 index 0000000..57e4ff8 --- /dev/null +++ b/mplayer/Makefile @@ -0,0 +1,13 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/mplayer + ln -sf -- ~/.dotfiles/mplayer/user-profile ~/.config/profile.d/mplayer + +uninstall: + -unlink -- ~/.config/profile.d/mplayer + -rmdir -- ~/.config/profile.d + -rm -rf -- ~/.config/mplayer + +.PHONY: install uninstall diff --git a/mplayer/user-profile b/mplayer/user-profile new file mode 100644 index 0000000..581717b --- /dev/null +++ b/mplayer/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export MPLAYER_HOME="${XDG_CONFIG_HOME}/mplayer" diff --git a/my-scripts/Makefile b/my-scripts/Makefile new file mode 100644 index 0000000..23d998a --- /dev/null +++ b/my-scripts/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/my-scripts + ln -sf -- ~/.dotfiles/my-scripts/bash-aliases ~/.config/bash/aliases.d/my-scripts + +uninstall: + -unlink -- ~/.config/bash/aliases.d/my-scripts + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/my-scripts/bash-aliases b/my-scripts/bash-aliases new file mode 100644 index 0000000..4b3b78b --- /dev/null +++ b/my-scripts/bash-aliases @@ -0,0 +1,5 @@ +# -*- shell-script -*- + +if test "$TERM" = linux; then + alias etty='etty;palette-reset' +fi diff --git a/openssh/Makefile b/openssh/Makefile new file mode 100644 index 0000000..41a8d84 --- /dev/null +++ b/openssh/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/openssh + ln -sf -- ~/.dotfiles/openssh/bash-aliases ~/.config/bash/aliases.d/openssh + +uninstall: + -unlink -- ~/.config/bash/aliases.d/openssh + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/openssh/bash-aliases b/openssh/bash-aliases new file mode 100644 index 0000000..38f7a01 --- /dev/null +++ b/openssh/bash-aliases @@ -0,0 +1,9 @@ +# -*- shell-script -*- + +if test -n "$DISPLAY"; then + alias sshhome="ssh -YC -p7777 mattias@maandree.ignorelist.com" +else + alias sshhome="ssh -p7777 mattias@maandree.ignorelist.com" +fi +alias sftphome="sftp -P7777 mattias@maandree.ignorelist.com" +alias scphome="scp -P7777" diff --git a/pluma/Makefile b/pluma/Makefile new file mode 100644 index 0000000..0971cfd --- /dev/null +++ b/pluma/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + @: + +uninstall: + -rm -rf -- ~/.config/pluma + +.PHONY: install uninstall diff --git a/pony.computer/Makefile b/pony.computer/Makefile new file mode 100644 index 0000000..4aa7464 --- /dev/null +++ b/pony.computer/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/pony.computer + ln -sf -- ~/.dotfiles/pony.computer/bash-aliases ~/.config/bash/aliases.d/pony.computer + +uninstall: + -unlink -- ~/.config/bash/aliases.d/pony.computer + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/pony.computer/bash-aliases b/pony.computer/bash-aliases new file mode 100644 index 0000000..4a9326d --- /dev/null +++ b/pony.computer/bash-aliases @@ -0,0 +1,10 @@ +# -*- shell-script -*- + +#DESCRIPTION: Utilise KMS support in ponysay when in a TTY and running pony.computer + +if "$TERM" = "linux"; then + pony.computer () { + PONYSAY_KMS_PALETTE="$PALETTE" /usr/bin/pony.computer "$@" + printf "$PALETTE" + } +fi diff --git a/ponysay/Makefile b/ponysay/Makefile new file mode 100644 index 0000000..7b90bd9 --- /dev/null +++ b/ponysay/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/ponysay + ln -sf -- ~/.dotfiles/ponysay/bash-aliases ~/.config/bash/aliases.d/ponysay + +uninstall: + -unlink -- ~/.config/bash/aliases.d/ponysay + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/ponysay/bash-aliases b/ponysay/bash-aliases new file mode 100644 index 0000000..3b9faed --- /dev/null +++ b/ponysay/bash-aliases @@ -0,0 +1,10 @@ +# -*- shell-script -*- + +#DESCRIPTION: Utilise KMS support in ponysay when in a TTY + +if test"$TERM" = "linux"; then + ponysay () { + PONYSAY_KMS_PALETTE="$PALETTE" /usr/bin/ponysay "$@" + printf "$PALETTE" + } +fi diff --git a/procps/Makefile b/procps/Makefile new file mode 100644 index 0000000..d7b150c --- /dev/null +++ b/procps/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + -rmdir -- ~/.config/procps + +uninstall: + -rm -rf -- ~/.config/procps + +.PHONY: install uninstall diff --git a/pytagomacs/Makefile b/pytagomacs/Makefile new file mode 100644 index 0000000..139cef6 --- /dev/null +++ b/pytagomacs/Makefile @@ -0,0 +1,11 @@ +.POSIX: + +install: + mkdir -p -- ~/.config + test ! -d ~/.config/pytagomacsrc + ln -sf -- ~/.dotfiles/pytagomacs/pytagomacsrc ~/.config/pytagomacsrc + +uninstall: + -unlink -- ~/.config/pytagomacsrc + +.PHONY: install uninstall diff --git a/pytagomacs/pytagomacsrc b/pytagomacs/pytagomacsrc new file mode 100644 index 0000000..d35fa58 --- /dev/null +++ b/pytagomacs/pytagomacsrc @@ -0,0 +1,7 @@ +# -*- python -*- + +INACTIVE_COLOUR = '34' +ACTIVE_COLOUR = '01;31' +SELECTED_COLOUR = '44;37' +STATUS_COLOUR = '07' +ALERT_COLOUR = None diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 0000000..8c2d730 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +install: + mkdir -p -- ~/.var/cache + ln -sf .var/cache/python_history ~/ + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/python + ln -sf -- ~/.dotfiles/python/user-profile ~/.config/profile.d/python + +uninstall: + -unlink -- ~/.config/profile.d/python + -rmdir -- ~/.config/profile.d + -unlink -- ~/.var/cache/python_history + -unlink -- ~/.python_history + +.PHONY: install uninstall diff --git a/python/user-profile b/python/user-profile new file mode 100644 index 0000000..8c9f982 --- /dev/null +++ b/python/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export PYTHON_EGG_CACHE="${XDG_CACHE_HOME}/python-eggs" diff --git a/qt5-styleplugins/Makefile b/qt5-styleplugins/Makefile new file mode 100644 index 0000000..3f0c44f --- /dev/null +++ b/qt5-styleplugins/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/profile.d + test ! -d ~/.config/profile.d/qt5-styleplugins + ln -sf -- ~/.dotfiles/qt5-styleplugins/user-profile ~/.config/profile.d/qt5-styleplugins + +uninstall: + -unlink -- ~/.config/profile.d/qt5-styleplugins + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/qt5-styleplugins/user-profile b/qt5-styleplugins/user-profile new file mode 100644 index 0000000..1491d3b --- /dev/null +++ b/qt5-styleplugins/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export QT_STYLE_OVERRIDE=GTK2 diff --git a/radharc/Makefile b/radharc/Makefile new file mode 100644 index 0000000..f5f2c66 --- /dev/null +++ b/radharc/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +XINITRC_ORDER = 20 + +install: + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-radharc + ln -sf -- ~/.dotfiles/radharc/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-radharc + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-radharc + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/radharc/xinit b/radharc/xinit new file mode 100644 index 0000000..f0051b5 --- /dev/null +++ b/radharc/xinit @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +radharc & diff --git a/rotd/.gitignore b/rotd/.gitignore new file mode 100644 index 0000000..5b8a7b8 --- /dev/null +++ b/rotd/.gitignore @@ -0,0 +1 @@ +/config/ diff --git a/rotd/Makefile b/rotd/Makefile new file mode 100644 index 0000000..5db6e1b --- /dev/null +++ b/rotd/Makefile @@ -0,0 +1,15 @@ +.POSIX: + +install: + mkdir -p -- ~/.config + if test ! -L ~/.config/rotd; then \ + test ! -e ~/.config/rotd && \ + ln -sf -- ~/.dotfiles/rotd/config ~/.config/rotd; \ + else \ + test "$(readlink ~/.config/rotd)" = ~/.dotfiles/rotd/config; \ + fi + +uninstall: + -unlink -- ~/.config/rotd + +.PHONY: install uninstall diff --git a/rust/Makefile b/rust/Makefile new file mode 100644 index 0000000..d58e207 --- /dev/null +++ b/rust/Makefile @@ -0,0 +1,20 @@ +.POSIX: + +install: + if test -d ~/.cargo; then \ + test ! -d ~/.var/lib/cargo && \ + mkdir -p -- ~/.var/lib && \ + mv ~/.cargo ~/.var/lib/cargo; \ + else \ + mkdir -p -- ~/.var/lib; \ + fi + test ! -d ~/.config/profile.d/rust + ln -sf -- ~/.dotfiles/rust/user-profile ~/.config/profile.d/rust + +uninstall: + -rm -rf -- ~/.var/cache/cargo + -rm -rf -- ~/.cargo + -unlink -- ~/.config/profile.d/rust + -rmdir -- ~/.config/profile.d + +.PHONY: install uninstall diff --git a/rust/user-profile b/rust/user-profile new file mode 100644 index 0000000..be94b1a --- /dev/null +++ b/rust/user-profile @@ -0,0 +1,3 @@ +# -*- shell-script -*- + +export CARGO_HOME=~/.var/lib/cargo diff --git a/signal-desktop/Makefile b/signal-desktop/Makefile new file mode 100644 index 0000000..1d82c40 --- /dev/null +++ b/signal-desktop/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/signal-desktop + ln -sf -- ~/.dotfiles/signal-desktop/bash-aliases ~/.config/bash/aliases.d/signal-desktop + +uninstall: + -unlink -- ~/.config/bash/aliases.d/signal-desktop + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/signal-desktop/bash-aliases b/signal-desktop/bash-aliases new file mode 100644 index 0000000..1e76a52 --- /dev/null +++ b/signal-desktop/bash-aliases @@ -0,0 +1,15 @@ +# -*- shell-script -*- + +mount-signal () { + sudo printf '' && \ + device="$(sudo losetup --show -f -P ~/.var/signal/SignalCrypt.img)" && \ + printf '%s\n' "${device}" > "${XDG_RUNTIME_DIR}/SignalCrypt" && \ + gpg --decrypt ~/.var/signal/SignalCrypt.key | sudo cryptsetup -d - open "${device}" SignalCrypt && \ + sudo mount /dev/mapper/SignalCrypt /home/mattias/.var/signal/SignalCrypt.d +} + +umount-signal () { + sudo umount /home/mattias/.var/signal/SignalCrypt.d + sudo cryptsetup close SignalCrypt + sudo losetup --detach "$(cat -- "${XDG_RUNTIME_DIR}/SignalCrypt")" +} diff --git a/ssh b/ssh new file mode 120000 index 0000000..dc275a7 --- /dev/null +++ b/ssh @@ -0,0 +1 @@ +openssh \ No newline at end of file diff --git a/sudo/Makefile b/sudo/Makefile new file mode 100644 index 0000000..479092b --- /dev/null +++ b/sudo/Makefile @@ -0,0 +1,12 @@ +.POSIX: + +install: + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/sudo + ln -sf -- ~/.dotfiles/sudo/bash-aliases ~/.config/bash/aliases.d/sudo + +uninstall: + -unlink -- ~/.config/bash/aliases.d/sudo + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/sudo/bash-aliases b/sudo/bash-aliases new file mode 100644 index 0000000..8276bd3 --- /dev/null +++ b/sudo/bash-aliases @@ -0,0 +1,8 @@ +# -*- shell-script -*- + +# DESCRIPTION: safeguards to prevent security exploitations + +# Prevents a program or shell function from pretending to be sudo +sudo () { + /usr/bin/sudo --prompt $'\e[01;32m[sudo] password for '"$USER"$': \033[00m' "$@" +} diff --git a/texinfo/Makefile b/texinfo/Makefile new file mode 100644 index 0000000..0cc5a60 --- /dev/null +++ b/texinfo/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +install: + if test -x /usr/bin/info; then \ + mkdir -p -- ~/.config/bash/aliases.d && \ + test ! -d ~/.config/bash/aliases.d/texinfo && \ + ln -sf -- ~/.dotfiles/texinfo/bash-aliases ~/.config/bash/aliases.d/texinfo; \ + else \ + make uninstall; \ + fi + +uninstall: + -unlink -- ~/.config/bash/aliases.d/texinfo + -rmdir -- ~/.config/bash/aliases.d + +.PHONY: install uninstall diff --git a/texinfo/bash-aliases b/texinfo/bash-aliases new file mode 100644 index 0000000..b52e4e8 --- /dev/null +++ b/texinfo/bash-aliases @@ -0,0 +1,30 @@ +# -*- shell-script -*- + +#DESCRIPTION: Open a programs info manual and open the invoking chapter +#USAGE: iv [program] + +iv () { + __texinfo="$1" + shift 1 + info "(${__texinfo})" invoking "$@" + unset __texinfo +} + + +#DESCRIPTION: Open a programs info manual and try to select a usage page +#USAGE: iu [program] [node] + +iu () { + info --usage "$@" +} + + +#DESCRIPTION: Open a programs info manual +#USAGE: i [program] [node] + +i () { + __texinfo="$1" + shift 1 + info "(${__texinfo})" "$@" + unset __texinfo +} diff --git a/texlive-bin/Makefile b/texlive-bin/Makefile new file mode 100644 index 0000000..4b21f55 --- /dev/null +++ b/texlive-bin/Makefile @@ -0,0 +1,17 @@ +.POSIX: + +install: + if test -d ~/.texlive; then \ + test ! -d ~/.var/cache/texlive && \ + mkdir -p -- ~/.var/cache && \ + mv ~/.texlive ~/.var/cache/texlive; \ + else \ + mkdir -p -- ~/.var/cache/texlive; \ + fi + ln -sf -- .var/cache/texlive ~/.texlive + +uninstall: + -rm -rf -- ~/.var/cache/texlive + -rm -rf -- ~/.texlive + +.PHONY: install uninstall diff --git a/vlc/Makefile b/vlc/Makefile new file mode 100644 index 0000000..1438ec6 --- /dev/null +++ b/vlc/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + @: + +uninstall: + -rm -rf -- ~/.config/vlc + +.PHONY: install uninstall diff --git a/wget/Makefile b/wget/Makefile new file mode 100644 index 0000000..35c640f --- /dev/null +++ b/wget/Makefile @@ -0,0 +1,10 @@ +.POSIX: + +install: + test ! -d ~/.wget-hsts + ln -sf -- /dev/null ~/.wget-hsts + +uninstall: + -unlink -- ~/.wget-hsts + +.PHONY: install uninstall diff --git a/xmonad/Makefile b/xmonad/Makefile new file mode 100644 index 0000000..afb5a4b --- /dev/null +++ b/xmonad/Makefile @@ -0,0 +1,21 @@ +.POSIX: + +XINITRC_ORDER = 80 + +install: + pacman -Qq -- xwallpaper /dev/null + pacman -Qq -- xcman /dev/null + pacman -Qq -- pdeath /dev/null + pacman -Qq -- mate-panel /dev/null + -pacman -Qq -- mate-settings-daemon /dev/null + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xmonad + ln -sf -- ~/.dotfiles/xmonad/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xmonad + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xmonad + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xmonad/xinit b/xmonad/xinit new file mode 100644 index 0000000..13f8392 --- /dev/null +++ b/xmonad/xinit @@ -0,0 +1,24 @@ +# -*- shell-script -*- + +# Only apply if starting xmonad as the window manager +if test "${SESSION}" = xmonad; then + + # Tell Java if we are using a non-reparenting window manager + export _JAVA_AWT_WM_NONREPARENTING=1 + + # Start GTK2 settings daemon + if test ! "${NO_MATE}" = y && test -x /usr/lib/mate-settings-daemon/mate-settings-daemon; then + /usr/lib/mate-settings-daemon/mate-settings-daemon & + sleep 0.5 + fi + + # Automatically focus output when mouse is moving in root window + pdeath HUP xmonad-autofocus-output & + + # Start composition manager + xcman & + + # Start application panel + mate-panel & + +fi diff --git a/xorg-twm/Makefile b/xorg-twm/Makefile new file mode 100644 index 0000000..8935a6f --- /dev/null +++ b/xorg-twm/Makefile @@ -0,0 +1,11 @@ +.POSIX: + +install: + mkdir -p -- ~/.config + test ! -d ~/.config/twmrc + ln -sf -- ~/.dotfiles/xorg-twm/twmrc ~/.config/twmrc + +uninstall: + -unlink -- ~/.config/twmrc + +.PHONY: install uninstall diff --git a/xorg-twm/twmrc b/xorg-twm/twmrc new file mode 100644 index 0000000..91869e1 --- /dev/null +++ b/xorg-twm/twmrc @@ -0,0 +1,93 @@ +# +# Default twm configuration file; needs to be kept small to conserve string +# space in systems whose compilers don't handle medium-sized strings. +# +# Sites should tailor this file, providing any extra title buttons, menus, etc. +# that may be appropriate for their environment. For example, if most of the +# users were accustomed to uwm, the defaults could be set up not to decorate +# any windows and to use meta-keys. +# + +NoGrabServer +RestartPreviousState +DecorateTransients +TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*" +IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*" +#ClientBorderWidth + +Color +{ + BorderColor "slategrey" + DefaultBackground "rgb:2/a/9" + DefaultForeground "gray85" + TitleBackground "rgb:2/a/9" + TitleForeground "gray85" + MenuBackground "rgb:2/a/9" + MenuForeground "gray85" + MenuBorderColor "slategrey" + MenuTitleBackground "gray70" + MenuTitleForeground "rgb:2/a/9" + IconBackground "rgb:2/a/9" + IconForeground "gray85" + IconBorderColor "gray85" + IconManagerBackground "rgb:2/a/9" + IconManagerForeground "gray85" +} + +# +# Define some useful functions for motion-based actions. +# +MoveDelta 3 +Function "move-or-lower" { f.move f.deltastop f.lower } +Function "move-or-raise" { f.move f.deltastop f.raise } +Function "move-or-iconify" { f.move f.deltastop f.iconify } + +# +# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish +# +Button1 = : root : f.menu "defops" + +Button1 = m : window|icon : f.function "move-or-lower" +Button2 = m : window|icon : f.iconify +Button3 = m : window|icon : f.function "move-or-raise" + +Button1 = : title : f.function "move-or-raise" +Button2 = : title : f.raiselower + +Button1 = : icon : f.function "move-or-iconify" +Button2 = : icon : f.iconify + +Button1 = : iconmgr : f.iconify +Button2 = : iconmgr : f.iconify + +# +# And a menus with the usual things +# +menu "defops" +{ +"Twm" f.title +"Iconify" f.iconify +"Resize" f.resize +"Move" f.move +"Raise" f.raise +"Lower" f.lower +"" f.nop +"Focus" f.focus +"Unfocus" f.unfocus +"Show Iconmgr" f.showiconmgr +"Hide Iconmgr" f.hideiconmgr +"" f.nop +"Terminator" f.exec "exec terminator &" +"Xterm" f.exec "exec xterm &" +"Firefox" f.exec "exec firefox &" +"Caja" f.exec "exec c &" +"" f.nop +"Kill" f.destroy +"Delete" f.delete +"" f.nop +"Restart" f.restart +"Exit" f.quit +} diff --git a/xorg-xinit/Makefile b/xorg-xinit/Makefile new file mode 100644 index 0000000..1c37d2f --- /dev/null +++ b/xorg-xinit/Makefile @@ -0,0 +1,36 @@ +.POSIX: + +XINITRC_ORDER = 50 + +# Testing that xmonad is installed because it is the default sessions +# Testing that asroot, xorg-setxkbmap, and xorg-xmodmap are installed because setkeys uses them +install: + pacman -Qq -- asroot /dev/null + pacman -Qq -- dconf /dev/null + pacman -Qq -- xmonad /dev/null + pacman -Qq -- xorg-setxkbmap /dev/null + pacman -Qq -- xorg-xmodmap /dev/null + pacman -Qq -- xorg-xrandr /dev/null + pacman -Qq -- xorg-xrdb /dev/null + pacman -Qq -- xorg-xset /dev/null + pacman -Qq -- xorg-xsetroot /dev/null + mkdir -p -- ~/.config/bash/aliases.d + test ! -d ~/.config/bash/aliases.d/xorg-xinit + ln -sf -- ~/.dotfiles/xorg-xinit/bash-aliases ~/.config/bash/aliases.d/xorg-xinit + mkdir -p -- ~/.config/X11/xinit + test ! -d ~/.config/X11/xinit/xinitrc + ln -sf -- ~/.dotfiles/xorg-xinit/xinitrc ~/.config/X11/xinit/xinitrc + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + ln -sf -- ~/.dotfiles/xorg-xinit/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + +uninstall: + -unlink -- ~/.config/bash/aliases.d/xorg-xinit + -rmdir -- ~/.config/bash/aliases.d + -unlink -- ~/.config/X11/xinit/xinitrc + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xinit + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xinit/bash-aliases b/xorg-xinit/bash-aliases new file mode 100644 index 0000000..14b2000 --- /dev/null +++ b/xorg-xinit/bash-aliases @@ -0,0 +1,9 @@ +# -*- shell-script -*- + +if test "$TERM" = dumb; then + alias startx='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from a dumb terminal"; false' + alias xinit='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from a dumb terminal"; false' +elif test ! "$TERM" = linux || test -n "$DISPLAY"; then + alias startx='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from within an X session"; false' + alias xinit='printf '\''\e[1;31m%s\e[0m\n\c'\'' "Do not start an X session from within an X session"; false' +fi diff --git a/xorg-xinit/xinit b/xorg-xinit/xinit new file mode 100644 index 0000000..bd1874c --- /dev/null +++ b/xorg-xinit/xinit @@ -0,0 +1,7 @@ +# -*- shell-script -*- + +for f in /etc/X11/xinit/xinitrc.d/*; do + if test -r "$f"; then + . -- "$f" + fi +done diff --git a/xorg-xinit/xinitrc b/xorg-xinit/xinitrc new file mode 100644 index 0000000..5d6a3ab --- /dev/null +++ b/xorg-xinit/xinitrc @@ -0,0 +1,30 @@ +# -*- shell-script -*- + +# Get selected session +default_session=xmonad +SESSION_="$SESSION" +if test -z "$SESSION" = ""; then + SESSION="$default_session" + SESSION_="$SESSION" +fi + +# Export DESKTOP_SESSION +if [ ! "${SET_DESKTOP_SESSION}" = n ]; then + export DESKTOP_SESSION="$SESSION" +fi + +# Apply package specific settings and run package specific programs +for f in ~/.config/X11/xinit/xinitrc.d/*; do + if test -r "$f"; then + . -- "$f" + fi +done + +# Set keyboard settings +setkeys + +# Start hotkey daemon +xkbdbind & + +# Start session +exec ${SESSION_WRAPPER} "$SESSION" diff --git a/xorg-xrandr/Makefile b/xorg-xrandr/Makefile new file mode 100644 index 0000000..6eed73b --- /dev/null +++ b/xorg-xrandr/Makefile @@ -0,0 +1,18 @@ +.POSIX: + +XINITRC_ORDER = 15 + +# Testing that xwallpaper is installed because setres calls it +install: + pacman -Qq -- xwallpaper /dev/null + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrandr + ln -sf -- ~/.dotfiles/xorg-xrandr/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrandr + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrandr + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xrandr/xinit b/xorg-xrandr/xinit new file mode 100644 index 0000000..771d2ff --- /dev/null +++ b/xorg-xrandr/xinit @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +# Set screen layout, resolution and calibration +setres diff --git a/xorg-xrdb/Makefile b/xorg-xrdb/Makefile new file mode 100644 index 0000000..7dce6db --- /dev/null +++ b/xorg-xrdb/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +XINITRC_ORDER = 20 + +install: + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrdb + ln -sf -- ~/.dotfiles/xorg-xrdb/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrdb + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xrdb + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xrdb/xinit b/xorg-xrdb/xinit new file mode 100644 index 0000000..b93f2d0 --- /dev/null +++ b/xorg-xrdb/xinit @@ -0,0 +1,12 @@ +# -*- shell-script -*- + +# Set font settings and potentionally other resources +if test -r /etc/X11/xinit/Xresources; then + xrdb -merge /etc/X11/xinit/Xresources +fi +if test -r ~/.config/X11/xinit/Xresources; then + xrdb -merge ~/.config/X11/xinit/Xresources +fi +if test -r ~/.Xresources; then + xrdb -merge ~/.Xresources +fi diff --git a/xorg-xset/Makefile b/xorg-xset/Makefile new file mode 100644 index 0000000..18a23be --- /dev/null +++ b/xorg-xset/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +XINITRC_ORDER = 20 + +install: + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xset + ln -sf -- ~/.dotfiles/xorg-xset/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xset + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xset + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xset/xinit b/xorg-xset/xinit new file mode 100644 index 0000000..1d8433a --- /dev/null +++ b/xorg-xset/xinit @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +# Turn off screen saver +xset -dpms s off diff --git a/xorg-xsetroot/Makefile b/xorg-xsetroot/Makefile new file mode 100644 index 0000000..05648e8 --- /dev/null +++ b/xorg-xsetroot/Makefile @@ -0,0 +1,16 @@ +.POSIX: + +XINITRC_ORDER = 20 + +install: + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xsetroot + ln -sf -- ~/.dotfiles/xorg-xsetroot/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xsetroot + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xorg-xsetroot + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xorg-xsetroot/xinit b/xorg-xsetroot/xinit new file mode 100644 index 0000000..27f06b1 --- /dev/null +++ b/xorg-xsetroot/xinit @@ -0,0 +1,4 @@ +# -*- shell-script -*- + +# Set cursor to right handed pointer +xsetroot -cursor_name left_ptr diff --git a/xwallpaper/Makefile b/xwallpaper/Makefile new file mode 100644 index 0000000..1d7f330 --- /dev/null +++ b/xwallpaper/Makefile @@ -0,0 +1,20 @@ +.POSIX: + +XINITRC_ORDER = 20 + +install: + pacman -Qq -- xcman /dev/null + pacman -Qq -- pdeath /dev/null + pacman -Qq -- mate-panel /dev/null + -pacman -Qq -- mate-settings-daemon /dev/null + mkdir -p -- ~/.config/X11/xinit/xinitrc.d + test ! -d ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xwallpaper + ln -sf -- ~/.dotfiles/xwallpaper/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xwallpaper + +uninstall: + -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-xwallpaper + -rmdir -- ~/.config/X11/xinit/xinitrc.d + -rmdir -- ~/.config/X11/xinit + -rmdir -- ~/.config/X11 + +.PHONY: install uninstall diff --git a/xwallpaper/xinit b/xwallpaper/xinit new file mode 100644 index 0000000..9080e46 --- /dev/null +++ b/xwallpaper/xinit @@ -0,0 +1,10 @@ +# -*- shell-script -*- + +# Set background +if test -f ~/.config/background."${SESSION_}"; then + xwallpaper --zoom ~/.config/background."${SESSION_}" +elif test -f ~/.config/background; then + xwallpaper --zoom ~/.config/background +elif test -f /etc/background; then + xwallpaper --zoom /etc/background +fi diff --git a/zathura/Makefile b/zathura/Makefile new file mode 100644 index 0000000..cd99a66 --- /dev/null +++ b/zathura/Makefile @@ -0,0 +1,9 @@ +.POSIX: + +install: + -rmdir -- ~/.config/zathura + +uninstall: + -rm -rf -- ~/.config/zathura + +.PHONY: install uninstall -- cgit v1.2.3-70-g09d2