From e9dc4c1090abb01317847c417b75d3960f3da34d Mon Sep 17 00:00:00 2001 From: Matt Singleton Date: Fri, 3 Feb 2023 14:39:07 -0600 Subject: only install platform-appropriate configs based on uname --- .gitignore | 6 +- bin/all/color_test | 32 ++++ bin/backup | 27 ---- bin/color_test | 32 ---- bin/dmenu-wl | 5 - bin/dnf-needs-restarting | 26 ---- bin/linux/backup | 27 ++++ bin/linux/dmenu-wl | 5 + bin/linux/dnf-needs-restarting | 26 ++++ bin/linux/setbright | 23 +++ bin/linux/setvol | 23 +++ bin/setbright | 23 --- bin/setvol | 23 --- config/all/dircolors.conf | 91 +++++++++++ config/all/git/config | 43 ++++++ config/all/git/ignore | 11 ++ config/all/kitty/kitty.conf | 48 ++++++ config/all/tmux/tmux.conf | 55 +++++++ config/all/zsh/.zprofile | 7 + config/all/zsh/.zshrc | 4 + config/all/zsh/20-appearance.zsh | 79 ++++++++++ config/all/zsh/30-behavior.zsh | 54 +++++++ config/all/zsh/40-key-bindings.zsh | 6 + config/all/zsh/50-completion.zsh | 27 ++++ config/all/zsh/99-function-overrides.zsh | 8 + config/dircolors.conf | 91 ----------- config/foot/foot.ini | 142 ----------------- config/git/config | 43 ------ config/git/ignore | 11 -- config/kitty/kitty.conf | 48 ------ config/linux/foot/foot.ini | 142 +++++++++++++++++ config/linux/sway/config | 256 +++++++++++++++++++++++++++++++ config/linux/swaylock/config | 2 + config/linux/waybar/config | 89 +++++++++++ config/linux/waybar/style.css | 62 ++++++++ config/linux/wob/wob.ini | 6 + config/linux/wofi/style.css | 37 +++++ config/sway/config | 256 ------------------------------- config/swaylock/config | 2 - config/tmux/tmux.conf | 55 ------- config/waybar/config | 89 ----------- config/waybar/style.css | 62 -------- config/wob/wob.ini | 6 - config/wofi/style.css | 37 ----- config/zsh/.zprofile | 7 - config/zsh/.zshrc | 4 - config/zsh/20-appearance.zsh | 79 ---------- config/zsh/30-behavior.zsh | 54 ------- config/zsh/40-key-bindings.zsh | 6 - config/zsh/50-completion.zsh | 27 ---- config/zsh/99-function-overrides.zsh | 8 - deploy.sh | 78 ++++++---- systemd/backup.service | 7 - systemd/backup.timer | 9 -- systemd/linux/backup.service | 7 + systemd/linux/backup.timer | 9 ++ 56 files changed, 1226 insertions(+), 1216 deletions(-) create mode 100755 bin/all/color_test delete mode 100755 bin/backup delete mode 100755 bin/color_test delete mode 100755 bin/dmenu-wl delete mode 100755 bin/dnf-needs-restarting create mode 100755 bin/linux/backup create mode 100755 bin/linux/dmenu-wl create mode 100755 bin/linux/dnf-needs-restarting create mode 100755 bin/linux/setbright create mode 100755 bin/linux/setvol delete mode 100755 bin/setbright delete mode 100755 bin/setvol create mode 100644 config/all/dircolors.conf create mode 100644 config/all/git/config create mode 100644 config/all/git/ignore create mode 100644 config/all/kitty/kitty.conf create mode 100644 config/all/tmux/tmux.conf create mode 100644 config/all/zsh/.zprofile create mode 100644 config/all/zsh/.zshrc create mode 100644 config/all/zsh/20-appearance.zsh create mode 100644 config/all/zsh/30-behavior.zsh create mode 100644 config/all/zsh/40-key-bindings.zsh create mode 100644 config/all/zsh/50-completion.zsh create mode 100644 config/all/zsh/99-function-overrides.zsh delete mode 100644 config/dircolors.conf delete mode 100644 config/foot/foot.ini delete mode 100644 config/git/config delete mode 100644 config/git/ignore delete mode 100644 config/kitty/kitty.conf create mode 100644 config/linux/foot/foot.ini create mode 100644 config/linux/sway/config create mode 100644 config/linux/swaylock/config create mode 100644 config/linux/waybar/config create mode 100644 config/linux/waybar/style.css create mode 100644 config/linux/wob/wob.ini create mode 100644 config/linux/wofi/style.css delete mode 100644 config/sway/config delete mode 100644 config/swaylock/config delete mode 100644 config/tmux/tmux.conf delete mode 100644 config/waybar/config delete mode 100644 config/waybar/style.css delete mode 100644 config/wob/wob.ini delete mode 100644 config/wofi/style.css delete mode 100644 config/zsh/.zprofile delete mode 100644 config/zsh/.zshrc delete mode 100644 config/zsh/20-appearance.zsh delete mode 100644 config/zsh/30-behavior.zsh delete mode 100644 config/zsh/40-key-bindings.zsh delete mode 100644 config/zsh/50-completion.zsh delete mode 100644 config/zsh/99-function-overrides.zsh delete mode 100644 systemd/backup.service delete mode 100644 systemd/backup.timer create mode 100644 systemd/linux/backup.service create mode 100644 systemd/linux/backup.timer diff --git a/.gitignore b/.gitignore index a7b357b..2132b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ config/duplicity/config config/duplicity/excludes -config/git/config-local -config/kitty/local.conf -config/zsh/00-local.zsh +config/all/git/config-local +config/all/kitty/local.conf +config/all/zsh/00-local.zsh dotfiles-backup diff --git a/bin/all/color_test b/bin/all/color_test new file mode 100755 index 0000000..6d6b6aa --- /dev/null +++ b/bin/all/color_test @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Based on Daniel Crisman's ANSI color chart script from +# The Bash Prompt HOWTO: 6.1. Colours +# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html +# +# This function echoes a bunch of color codes to the +# terminal to demonstrate what's available. Each +# line is the color code of one forground color, +# out of 17 (default + 16 escapes), followed by a +# test use of that color on all nine background +# colors (default + 8 escapes). + +set -euo pipefail + +T='gYw' # The test text + +echo -e "\n def 40m 41m 42m 43m 44m 45m 46m 47m"; + +for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ + '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ + ' 36m' '1;36m' ' 37m' '1;37m'; + + do FG=${FGs// /} + echo -en " $FGs \033[$FG $T " + + for BG in 40m 41m 42m 43m 44m 45m 46m 47m; + do echo -en "\033[$FG\033[$BG $T \033[0m"; + done + echo; +done +echo diff --git a/bin/backup b/bin/backup deleted file mode 100755 index 75aded9..0000000 --- a/bin/backup +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -set -o allexport -# shellcheck source=../local/duplicity-config -source ~/.config/duplicity/config -set +o allexport - -source_directory=~ -excludes=~/.config/duplicity/excludes -target_url=b2://"$B2_KEY_ID"@"$B2_BUCKET" - -# take a new full backup every month, incremental otherwise -duplicity --full-if-older-than 1M --exclude-filelist "$excludes" "$source_directory" "$target_url" - -# keep 12 months of full backups -duplicity remove-all-but-n-full 12 --force "$target_url" - -# keep 3 months of incremental backups -duplicity remove-all-inc-of-but-n-full 3 --force "$target_url" - -# cleanup -duplicity cleanup --force "$target_url" - -# show collection status -duplicity collection-status "$target_url" diff --git a/bin/color_test b/bin/color_test deleted file mode 100755 index 6d6b6aa..0000000 --- a/bin/color_test +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# -# Based on Daniel Crisman's ANSI color chart script from -# The Bash Prompt HOWTO: 6.1. Colours -# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html -# -# This function echoes a bunch of color codes to the -# terminal to demonstrate what's available. Each -# line is the color code of one forground color, -# out of 17 (default + 16 escapes), followed by a -# test use of that color on all nine background -# colors (default + 8 escapes). - -set -euo pipefail - -T='gYw' # The test text - -echo -e "\n def 40m 41m 42m 43m 44m 45m 46m 47m"; - -for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ - '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ - ' 36m' '1;36m' ' 37m' '1;37m'; - - do FG=${FGs// /} - echo -en " $FGs \033[$FG $T " - - for BG in 40m 41m 42m 43m 44m 45m 46m 47m; - do echo -en "\033[$FG\033[$BG $T \033[0m"; - done - echo; -done -echo diff --git a/bin/dmenu-wl b/bin/dmenu-wl deleted file mode 100755 index 7ac2273..0000000 --- a/bin/dmenu-wl +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -wofi -d "$@" diff --git a/bin/dnf-needs-restarting b/bin/dnf-needs-restarting deleted file mode 100755 index 60f7f7c..0000000 --- a/bin/dnf-needs-restarting +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -eo pipefail - -if command -v dnf > /dev/null; then - DNFCMD="dnf" -fi -if command -v jq > /dev/null; then - JQCMD="jq" -fi -if [ -z "$DNFCMD" ] || [ -z "$JQCMD" ]; then - echo "{\"tooltip\": \"requires 'jq' and 'dnf'\", \"text\": \"\"}" - exit 1 -fi - -set -u - -if ! output="$($DNFCMD needs-restarting -r)"; then - icon="勒" -else - icon="" -fi - -# this is a literal expression for `jq` -# shellcheck disable=SC2016 -$JQCMD --unbuffered -n -c '{tooltip: $ARGS.positional[0], text: $ARGS.positional[1]}' --args "$output" "$icon" diff --git a/bin/linux/backup b/bin/linux/backup new file mode 100755 index 0000000..75aded9 --- /dev/null +++ b/bin/linux/backup @@ -0,0 +1,27 @@ +#!/bin/bash + +set -euo pipefail + +set -o allexport +# shellcheck source=../local/duplicity-config +source ~/.config/duplicity/config +set +o allexport + +source_directory=~ +excludes=~/.config/duplicity/excludes +target_url=b2://"$B2_KEY_ID"@"$B2_BUCKET" + +# take a new full backup every month, incremental otherwise +duplicity --full-if-older-than 1M --exclude-filelist "$excludes" "$source_directory" "$target_url" + +# keep 12 months of full backups +duplicity remove-all-but-n-full 12 --force "$target_url" + +# keep 3 months of incremental backups +duplicity remove-all-inc-of-but-n-full 3 --force "$target_url" + +# cleanup +duplicity cleanup --force "$target_url" + +# show collection status +duplicity collection-status "$target_url" diff --git a/bin/linux/dmenu-wl b/bin/linux/dmenu-wl new file mode 100755 index 0000000..7ac2273 --- /dev/null +++ b/bin/linux/dmenu-wl @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euo pipefail + +wofi -d "$@" diff --git a/bin/linux/dnf-needs-restarting b/bin/linux/dnf-needs-restarting new file mode 100755 index 0000000..60f7f7c --- /dev/null +++ b/bin/linux/dnf-needs-restarting @@ -0,0 +1,26 @@ +#!/bin/bash + +set -eo pipefail + +if command -v dnf > /dev/null; then + DNFCMD="dnf" +fi +if command -v jq > /dev/null; then + JQCMD="jq" +fi +if [ -z "$DNFCMD" ] || [ -z "$JQCMD" ]; then + echo "{\"tooltip\": \"requires 'jq' and 'dnf'\", \"text\": \"\"}" + exit 1 +fi + +set -u + +if ! output="$($DNFCMD needs-restarting -r)"; then + icon="勒" +else + icon="" +fi + +# this is a literal expression for `jq` +# shellcheck disable=SC2016 +$JQCMD --unbuffered -n -c '{tooltip: $ARGS.positional[0], text: $ARGS.positional[1]}' --args "$output" "$icon" diff --git a/bin/linux/setbright b/bin/linux/setbright new file mode 100755 index 0000000..42cd48f --- /dev/null +++ b/bin/linux/setbright @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +current=$(brightnessctl -m info | cut -d, -f4 | tr --delete '%') +case $1 in + up) + increment=$(( 5 - ( current % 5 ) )) + new=$(( current + increment )) + if [ $new -gt 100 ]; then + new=100 + fi + brightnessctl set $new% > /dev/null 2>&1 + echo $new;; + down) + increment=$(( ( ( current - 1 ) % 5 ) + 1 )) + new=$(( current - increment )) + if [ $new -lt 0 ]; then + new=0 + fi + brightnessctl set $new% > /dev/null 2>&1 + echo $new;; +esac diff --git a/bin/linux/setvol b/bin/linux/setvol new file mode 100755 index 0000000..bf9cbed --- /dev/null +++ b/bin/linux/setvol @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +current_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep Volume | sed -e 's/.* \([0-9][0-9]*\)%.*/\1/') +case $1 in + up) + increment=$(( 5 - ( current_volume % 5 ) )) + newvol=$(( current_volume + increment )) + if [ $newvol -gt 100 ]; then + newvol=100 + fi + pactl set-sink-volume @DEFAULT_SINK@ $newvol% + echo $newvol;; + down) + increment=$(( ( ( current_volume - 1 ) % 5 ) + 1 )) + newvol=$(( current_volume - increment )) + if [ $newvol -lt 0 ]; then + newvol=0 + fi + pactl set-sink-volume @DEFAULT_SINK@ $newvol% + echo $newvol;; +esac diff --git a/bin/setbright b/bin/setbright deleted file mode 100755 index 42cd48f..0000000 --- a/bin/setbright +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -current=$(brightnessctl -m info | cut -d, -f4 | tr --delete '%') -case $1 in - up) - increment=$(( 5 - ( current % 5 ) )) - new=$(( current + increment )) - if [ $new -gt 100 ]; then - new=100 - fi - brightnessctl set $new% > /dev/null 2>&1 - echo $new;; - down) - increment=$(( ( ( current - 1 ) % 5 ) + 1 )) - new=$(( current - increment )) - if [ $new -lt 0 ]; then - new=0 - fi - brightnessctl set $new% > /dev/null 2>&1 - echo $new;; -esac diff --git a/bin/setvol b/bin/setvol deleted file mode 100755 index bf9cbed..0000000 --- a/bin/setvol +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -current_volume=$(pactl get-sink-volume @DEFAULT_SINK@ | grep Volume | sed -e 's/.* \([0-9][0-9]*\)%.*/\1/') -case $1 in - up) - increment=$(( 5 - ( current_volume % 5 ) )) - newvol=$(( current_volume + increment )) - if [ $newvol -gt 100 ]; then - newvol=100 - fi - pactl set-sink-volume @DEFAULT_SINK@ $newvol% - echo $newvol;; - down) - increment=$(( ( ( current_volume - 1 ) % 5 ) + 1 )) - newvol=$(( current_volume - increment )) - if [ $newvol -lt 0 ]; then - newvol=0 - fi - pactl set-sink-volume @DEFAULT_SINK@ $newvol% - echo $newvol;; -esac diff --git a/config/all/dircolors.conf b/config/all/dircolors.conf new file mode 100644 index 0000000..cfd5f8d --- /dev/null +++ b/config/all/dircolors.conf @@ -0,0 +1,91 @@ +# Copyright (C) 1996, 1999-2010 Free Software Foundation, Inc. +# Copying and distribution of this file, with or without modification, +# are permitted provided the copyright notice and this notice are preserved. + +# +# Colorizable terminals + +TERM Eterm +TERM ansi +TERM color-xterm +TERM con132x25 +TERM con132x30 +TERM con132x43 +TERM con132x60 +TERM con80x25 +TERM con80x28 +TERM con80x30 +TERM con80x43 +TERM con80x50 +TERM con80x60 +TERM cons25 +TERM console +TERM cygwin +TERM dtterm +TERM eterm-color +TERM gnome +TERM gnome-256color +TERM jfbterm +TERM konsole +TERM kterm +TERM linux +TERM linux-c +TERM mach-color +TERM mlterm +TERM putty +TERM rxvt +TERM rxvt-256color +TERM rxvt-cygwin +TERM rxvt-cygwin-native +TERM rxvt-unicode +TERM rxvt-unicode-256color +TERM rxvt-unicode256 +TERM screen +TERM screen-256color +TERM screen-256color-bce +TERM screen-bce +TERM screen-w +TERM screen.rxvt +TERM screen.linux +TERM terminator +TERM vt100 +TERM xterm +TERM xterm-16color +TERM xterm-256color +TERM xterm-88color +TERM xterm-color +TERM xterm-debian + +# +# Generic types + +# Attribute codes: +# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed +# +# Text color codes: +# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white +# +# Background color codes: +# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white + +RESET 0 # reset to "normal" color +DIR 34 # directory +LINK 36 # symbolic link +FIFO 40;33 # pipe +SOCK 35 # socket +DOOR 35 # door +BLK 40;33 # block device driver +CHR 40;33 # character device driver +ORPHAN 40;31 # symlink to nonexistent file, or non-stat'able file +SETUID 37;41 # file that is setuid (u+s) +SETGID 30;43 # file that is setgid (g+s) +CAPABILITY 30;41 # file with capability +STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) +OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky +STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable +EXEC 32 # executable files + +# +# Extension-based + +#.tar.gz 01;31 diff --git a/config/all/git/config b/config/all/git/config new file mode 100644 index 0000000..0a3bed8 --- /dev/null +++ b/config/all/git/config @@ -0,0 +1,43 @@ +[user] + name = Matt Singleton + email = matt@xcolour.net + +[alias] + st = status + ci = commit + br = branch + co = checkout + df = diff + lg = log -p + +[core] + whitespace = trailing-space,space-before-tab,cr-at-eol + editor = vim + autocrlf = input + excludesfile = ~/.config/git/ignore + pager = less -+$LESS -RSX + +[push] + default = nothing + +[color] + ui = true + +[mergetool] + keepTemporaries = false + prompt = false + +[merge] + tool = meld + +[diff] + tool = meld + +[init] + defaultBranch = main + +[pull] + ff = only + +[include] + path = config-local diff --git a/config/all/git/ignore b/config/all/git/ignore new file mode 100644 index 0000000..57dd8e6 --- /dev/null +++ b/config/all/git/ignore @@ -0,0 +1,11 @@ +*.class +*.pyc +*.swo +*.swp +.svn +.swo +*#* +# +.#* +doc/tags +.DS_STORE diff --git a/config/all/kitty/kitty.conf b/config/all/kitty/kitty.conf new file mode 100644 index 0000000..318ce8e --- /dev/null +++ b/config/all/kitty/kitty.conf @@ -0,0 +1,48 @@ +font_family JetBrainsMono Nerd Font Mono +disable_ligatures always +font_size 11.0 + +copy_on_select clipboard +shell_integration disabled +enable_audio_bell no + +# theme: Tempus Dawn +# author: Protesilaos Stavrou (https://protesilaos.com) +# description: Light theme with a soft, slightly desaturated palette (WCAG AA compliant) + +cursor #4a4b4e +cursor_text_color #eff0f2 +url_color #4b529a + +active_border_color #676364 +inactive_border_color #dee2e0 +bell_border_color #8b590a + +active_tab_foreground #206620 +active_tab_background #dee2e0 +inactive_tab_foreground #676364 +inactive_tab_background #eff0f2 + +foreground #4a4b4e +background #eff0f2 +selection_foreground #eff0f2 +selection_background #4a4b4e + +color0 #4a4b4e +color1 #a32a3a +color2 #206620 +color3 #745300 +color4 #4b529a +color5 #8d377e +color6 #086784 +color7 #dee2e0 +color8 #676364 +color9 #a64822 +color10 #187408 +color11 #8b590a +color12 #5c59b2 +color13 #8e45a8 +color14 #3f649c +color15 #eff0f2 + +include local.conf diff --git a/config/all/tmux/tmux.conf b/config/all/tmux/tmux.conf new file mode 100644 index 0000000..b1b98e0 --- /dev/null +++ b/config/all/tmux/tmux.conf @@ -0,0 +1,55 @@ +# vi bindings +set -g status-keys vi +setw -g mode-keys vi + +# reasonable history buffer +set -g history-limit 10000 + +# status line +setw -g window-status-current-style bright +set -g status-right '#(date "+%H:%M %Z %Y-%m-%d")' +set -g status-style bg=white +set -g status-left " #S@#h " +set -g status-left-length 15 +set -g status-left-style bg=green,fg=white + +# ui +set -g set-titles on +set -g default-terminal "screen-256color" +set -ga terminal-overrides ",xterm-256color:Tc" +set -g pane-border-style fg=white + +# splits +bind | split-window -h +bind \\ split-window -h +bind - split-window -v + +# reversed to match vim split names +bind v select-layout even-horizontal +bind h select-layout even-vertical + +# vim-style resize +bind -r H resize-pane -L 2 +bind -r J resize-pane -D 2 +bind -r K resize-pane -U 2 +bind -r L resize-pane -R 2 + +# vim-style move +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +# unbind arrow keys +unbind Up +unbind Down +unbind Left +unbind Right +unbind M-Up +unbind M-Down +unbind M-Left +unbind M-Right +unbind C-Up +unbind C-Down +unbind C-Left +unbind C-Right diff --git a/config/all/zsh/.zprofile b/config/all/zsh/.zprofile new file mode 100644 index 0000000..a9a13c9 --- /dev/null +++ b/config/all/zsh/.zprofile @@ -0,0 +1,7 @@ +if [ "$(uname)" = "Darwin" ]; then + # disable Apple Terminal's annoying session restore feature + SHELL_SESSIONS_DISABLE=1 +fi +if [ "$DESKTOP_SESSION" = "sway-session" ]; then + export $(gnome-keyring-daemon --start) +fi diff --git a/config/all/zsh/.zshrc b/config/all/zsh/.zshrc new file mode 100644 index 0000000..f33ca44 --- /dev/null +++ b/config/all/zsh/.zshrc @@ -0,0 +1,4 @@ +for f in $ZDOTDIR/*.zsh +do + source "${f}" +done diff --git a/config/all/zsh/20-appearance.zsh b/config/all/zsh/20-appearance.zsh new file mode 100644 index 0000000..4f7c8d9 --- /dev/null +++ b/config/all/zsh/20-appearance.zsh @@ -0,0 +1,79 @@ +# +# colorize shell programs + +if ls -Z . &>/dev/null 2>&1; then + # gnu coreutils? + alias ls='ls --color=auto' + eval `dircolors ${XDG_CONFIG_HOME:-${HOME}/.config}/dircolors.conf` +elif (( $+commands[gls] )); then + # prefixed gnu coreutils? + alias ls='gls --color=auto' + eval `gdircolors ${XDG_CONFIG_HOME:-${HOME}/.config}/dircolors.conf` +else + # assume bsd ls + alias ls='ls -G' + export LSCOLORS="exgxbxdxcxegedxbxgxcxd" +fi + +# grep +export GREP_COLOR='1;32' +alias grep='grep --color=auto' +alias egrep='egrep --color=auto' +alias fgrep='fgrep --color=auto' + +# less +export LESS_TERMCAP_mb=$'\e[0;31m' # begin blinking - red +export LESS_TERMCAP_md=$'\e[0;34m' # begin bold - blue +export LESS_TERMCAP_me=$'\e[0m' # end mode +export LESS_TERMCAP_so=$'\e[30;46m' # begin standout mode - black on cyan +export LESS_TERMCAP_se=$'\e[0m' # end standout mode +export LESS_TERMCAP_us=$'\e[4;33m' # begin underline - yellow underline +export LESS_TERMCAP_ue=$'\e[0m' # end underline + +# +# make a sweet prompt + +autoload colors; colors; +setopt prompt_subst # expansion of color codes, etc. in the prompt + +# print the fully resolved shell command with time stamp +# to be run from zsh's builtin 'preexec' with all arguments passed through ($*) +function theme_preexec () { + echo "($fg[magenta]`date +%r`$reset_color) $fg[cyan]$3$reset_color" +} + +# print the prompt char in red if the last command exited non-zero +function prompt_char { + echo "%(?.$.%{$fg[red]%}$%{$reset_color%})" +} + +function repo_prompt_info { + # git + ref=$(git symbolic-ref HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null) + if [ $? -eq 0 ]; then + #repo=$(basename $(git rev-parse --show-toplevel)) + echo "%{$fg[cyan]%}%{\e[1m%}${ref#refs/heads/}%{$reset_color%}" + return + fi +} + +function workspace_prompt_info { + repo=$(repo_prompt_info) + if [ "$repo" ]; then + echo "[$repo] " + return + fi +} + +# print the hostname in green if local, else red +function hostname_info { + if [[ $ZSH_LOCAL_ENV == "true" ]]; then + echo "%{$fg[green]%}%{$ZSH_HOST_PREFIX%}%m%{$ZSH_HOST_SUFFIX%}%{$reset_color%}" + else + echo "%{$fg[red]%}%{$ZSH_HOST_PREFIX%}%m%{$ZSH_HOST_SUFFIX%}%{$reset_color%}" + fi +} + +# a colorful multiline prompt using the above defined functions +PROMPT=$'%{$fg[yellow]%}%n%{$reset_color%}@$(hostname_info):%{$fg[blue]%}%~%{$reset_color%} +$(workspace_prompt_info)$(prompt_char)%{$reset_color%} ' diff --git a/config/all/zsh/30-behavior.zsh b/config/all/zsh/30-behavior.zsh new file mode 100644 index 0000000..6b2b2c2 --- /dev/null +++ b/config/all/zsh/30-behavior.zsh @@ -0,0 +1,54 @@ +# +# execution + +setopt rm_star_wait # wait 10 seconds before accepting 'rm *' confirmation +export REPORTTIME=5 # report timing for any command longer than 5 seconds +unsetopt flowcontrol # disable ^s from freezing the terminal + +# +# history + +HISTFILE="${XDG_DATA_HOME:-${HOME}/.local/share}/zsh/history" +HISTSIZE=10000 +SAVEHIST=10000 + +setopt hist_ignore_all_dups # ignore dups including non-sequential ones +setopt share_history # share command history data between sessions +setopt hist_verify # load hist into command buffer rather than exec immediately + +# +# term support + +# make sure $TERM is installed +# if not, fall back on xterm-256color +infocmp "$TERM" > /dev/null 2>&1 || export TERM=xterm-256color + +# set term title appropriately based on term type +# user@host:current_dir (current_command) +case "$TERM" in + xterm*|rxvt*|screen*|alacritty*|foot) + term_preexec () { + printf '\e]0;%s (%s)\a' ${(%):-'%n@%m:%~'} "$1" + } + term_precmd () { + printf '\e]0;%s\a' ${(%):-'%n@%m:%~'} + } + ;; +esac + +# +# draw a horizontal separator + +function hr { + printf "$bg[red]${(l:$COLUMNS:: :)}$reset_color\n" + printf "$bg[yellow]${(l:$COLUMNS:: :)}\n" + printf "$bg[green]${(l:$COLUMNS:: :)}\n" + printf "$bg[cyan]${(l:$COLUMNS:: :)}\n" + printf "$bg[blue]${(l:$COLUMNS:: :)}\n" + printf "$bg[magenta]${(l:$COLUMNS:: :)}$reset_color\n" +} + +# +# less + +export LESS=-i diff --git a/config/all/zsh/40-key-bindings.zsh b/config/all/zsh/40-key-bindings.zsh new file mode 100644 index 0000000..4deac62 --- /dev/null +++ b/config/all/zsh/40-key-bindings.zsh @@ -0,0 +1,6 @@ +bindkey -e # use emacs mode +bindkey '^r' history-incremental-search-backward # ctrl-r +bindkey '^[[Z' reverse-menu-complete # shift-tab + +bindkey '\e[3~' delete-char # make sure delete key works +bindkey ' ' magic-space # also do history expansion on space diff --git a/config/all/zsh/50-completion.zsh b/config/all/zsh/50-completion.zsh new file mode 100644 index 0000000..23cb052 --- /dev/null +++ b/config/all/zsh/50-completion.zsh @@ -0,0 +1,27 @@ +# initialize the completion system +autoload -U compinit +compinit -d "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompdump" +zmodload zsh/complist + +# complete only after the second consecutive tab +setopt auto_menu + +# use GNU ls color specification for completion menu +zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} + +# use menu selection by default +zstyle ':completion:*:default' menu select + +# disable named-directories autocompletion +zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories +cdpath=(.) + +# don't autocomplete local users for (ssh|ftp|scp|rsync) +zstyle ':completion:*:*:(ssh|ftp|scp|rsync):*' users + +# Use caching so that commands like apt and dpkg complete are useable +zstyle ':completion::complete:*' use-cache 1 +zstyle ':completion:*' cache-path "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache" + +# always rehash commands list +zstyle ':completion:*:commands' rehash 1 diff --git a/config/all/zsh/99-function-overrides.zsh b/config/all/zsh/99-function-overrides.zsh new file mode 100644 index 0000000..8b233e5 --- /dev/null +++ b/config/all/zsh/99-function-overrides.zsh @@ -0,0 +1,8 @@ +preexec () { + type term_preexec &> /dev/null && term_preexec $* + type theme_preexec &> /dev/null && theme_preexec $* +} + +precmd () { + type term_precmd &> /dev/null && term_precmd +} diff --git a/config/dircolors.conf b/config/dircolors.conf deleted file mode 100644 index cfd5f8d..0000000 --- a/config/dircolors.conf +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright (C) 1996, 1999-2010 Free Software Foundation, Inc. -# Copying and distribution of this file, with or without modification, -# are permitted provided the copyright notice and this notice are preserved. - -# -# Colorizable terminals - -TERM Eterm -TERM ansi -TERM color-xterm -TERM con132x25 -TERM con132x30 -TERM con132x43 -TERM con132x60 -TERM con80x25 -TERM con80x28 -TERM con80x30 -TERM con80x43 -TERM con80x50 -TERM con80x60 -TERM cons25 -TERM console -TERM cygwin -TERM dtterm -TERM eterm-color -TERM gnome -TERM gnome-256color -TERM jfbterm -TERM konsole -TERM kterm -TERM linux -TERM linux-c -TERM mach-color -TERM mlterm -TERM putty -TERM rxvt -TERM rxvt-256color -TERM rxvt-cygwin -TERM rxvt-cygwin-native -TERM rxvt-unicode -TERM rxvt-unicode-256color -TERM rxvt-unicode256 -TERM screen -TERM screen-256color -TERM screen-256color-bce -TERM screen-bce -TERM screen-w -TERM screen.rxvt -TERM screen.linux -TERM terminator -TERM vt100 -TERM xterm -TERM xterm-16color -TERM xterm-256color -TERM xterm-88color -TERM xterm-color -TERM xterm-debian - -# -# Generic types - -# Attribute codes: -# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed -# -# Text color codes: -# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white -# -# Background color codes: -# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white - -RESET 0 # reset to "normal" color -DIR 34 # directory -LINK 36 # symbolic link -FIFO 40;33 # pipe -SOCK 35 # socket -DOOR 35 # door -BLK 40;33 # block device driver -CHR 40;33 # character device driver -ORPHAN 40;31 # symlink to nonexistent file, or non-stat'able file -SETUID 37;41 # file that is setuid (u+s) -SETGID 30;43 # file that is setgid (g+s) -CAPABILITY 30;41 # file with capability -STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) -OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky -STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable -EXEC 32 # executable files - -# -# Extension-based - -#.tar.gz 01;31 diff --git a/config/foot/foot.ini b/config/foot/foot.ini deleted file mode 100644 index 47ba8be..0000000 --- a/config/foot/foot.ini +++ /dev/null @@ -1,142 +0,0 @@ -# -*- conf -*- - -# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) -# term=foot (or xterm-256color if built with -Dterminfo=disabled) -# login-shell=no - -font=JetBrainsMono Nerd Font:size=9 -# font-bold= -# font-italic= -# font-bold-italic= -# line-height= -# letter-spacing=0 -# horizontal-letter-offset=0 -# vertical-letter-offset=0 -# box-drawings-uses-font-glyphs=no -dpi-aware=yes - -# initial-window-size-pixels=700x500 # Or, -# initial-window-size-chars= -# initial-window-mode=windowed -# pad=2x2 # optionally append 'center' -# resize-delay-ms=100 - -# notify=notify-send -a foot -i foot ${title} ${body} -# url-launch=xdg-open ${url} - -# bold-text-in-bright=no -# bell=none -# word-delimiters=,│`|:"'()[]{}<> -# jump-label-letters=sadfjklewcmpgh -# selection-target=primary -# workers= -# osc8-underline=url-mode - -[scrollback] -# lines=1000 -# multiplier=3.0 -# indicator-position=relative -# indicator-format= - -[cursor] -# style=block -# color=111111 dcdccc -# blink=no - -[mouse] -hide-when-typing=yes -# alternate-scroll-mode=yes - -[colors] -# alpha=1.0 -background=0xeff0f2 -foreground=0x4a4b4e -regular0=0x4a4b4e -regular1=0xa32a3a -regular2=0x206620 -regular3=0x745300 -regular4=0x4b529a -regular5=0x8d377e -regular6=0x086784 -regular7=0xdee2e0 -bright0=0x676364 -bright1=0xa64822 -bright2=0x187408 -bright3=0x8b590a -bright4=0x5c59b2 -bright5=0x8e45a8 -bright6=0x3f649c -bright7=0xeff0f2 - - -# selection-foreground= -# selection-background= -# jump-labels= -# urls= - -[csd] -# preferred=server -# size=26 -# color= -# button-width=26 -# button-minimize-color= -# button-maximize-color= -# button-close-color= - -[key-bindings] -# scrollback-up-page=Shift+Page_Up -# scrollback-up-half-page=none -# scrollback-up-line=none -# scrollback-down-page=Shift+Page_Down -# scrollback-down-half-page=none -# scrollback-down-line=none -# clipboard-copy=Control+Shift+c -# clipboard-paste=Control+Shift+v -# primary-paste=Shift+Insert -# search-start=Control+Shift+r -# font-increase=Control+plus Control+equal Control+KP_Add -# font-decrease=Control+minus Control+KP_Subtract -# font-reset=Control+0 Control+KP_0 -# spawn-terminal=Control+Shift+n -# minimize=none -# maximize=none -# fullscreen=none -# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none -# pipe-selected=[xargs -r firefox] none -# show-urls-launch=Control+Shift+u -# show-urls-copy=none - -[search-bindings] -# cancel=Control+g Escape -# commit=Return -# find-prev=Control+r -# find-next=Control+s -# cursor-left=Left Control+b -# cursor-left-word=Control+Left Mod1+b -# cursor-right=Right Control+f -# cursor-right-word=Control+Right Mod1+f -# cursor-home=Home Control+a -# cursor-end=End Control+e -# delete-prev=BackSpace -# delete-prev-word=Mod1+BackSpace Control+BackSpace -# delete-next=Delete -# delete-next-word=Mod1+d Control+Delete -# extend-to-word-boundary=Control+w -# extend-to-next-whitespace=Control+Shift+w -# clipboard-paste=Control+v Control+y -# primary-paste=Shift+Insert - -#[url-bindings] -# cancel=Control+g Control+d Escape -# toggle-url-visible=t - -[mouse-bindings] -# primary-paste=BTN_MIDDLE -# select-begin=BTN_LEFT -# select-begin-block=Control+BTN_LEFT -# select-extend=BTN_RIGHT -# select-extend-character-wise=Control+BTN_RIGHT -# select-word=BTN_LEFT-2 -# select-word-whitespace=Control+BTN_LEFT-2 -# select-row=BTN_LEFT-3 diff --git a/config/git/config b/config/git/config deleted file mode 100644 index 0a3bed8..0000000 --- a/config/git/config +++ /dev/null @@ -1,43 +0,0 @@ -[user] - name = Matt Singleton - email = matt@xcolour.net - -[alias] - st = status - ci = commit - br = branch - co = checkout - df = diff - lg = log -p - -[core] - whitespace = trailing-space,space-before-tab,cr-at-eol - editor = vim - autocrlf = input - excludesfile = ~/.config/git/ignore - pager = less -+$LESS -RSX - -[push] - default = nothing - -[color] - ui = true - -[mergetool] - keepTemporaries = false - prompt = false - -[merge] - tool = meld - -[diff] - tool = meld - -[init] - defaultBranch = main - -[pull] - ff = only - -[include] - path = config-local diff --git a/config/git/ignore b/config/git/ignore deleted file mode 100644 index 57dd8e6..0000000 --- a/config/git/ignore +++ /dev/null @@ -1,11 +0,0 @@ -*.class -*.pyc -*.swo -*.swp -.svn -.swo -*#* -# -.#* -doc/tags -.DS_STORE diff --git a/config/kitty/kitty.conf b/config/kitty/kitty.conf deleted file mode 100644 index 318ce8e..0000000 --- a/config/kitty/kitty.conf +++ /dev/null @@ -1,48 +0,0 @@ -font_family JetBrainsMono Nerd Font Mono -disable_ligatures always -font_size 11.0 - -copy_on_select clipboard -shell_integration disabled -enable_audio_bell no - -# theme: Tempus Dawn -# author: Protesilaos Stavrou (https://protesilaos.com) -# description: Light theme with a soft, slightly desaturated palette (WCAG AA compliant) - -cursor #4a4b4e -cursor_text_color #eff0f2 -url_color #4b529a - -active_border_color #676364 -inactive_border_color #dee2e0 -bell_border_color #8b590a - -active_tab_foreground #206620 -active_tab_background #dee2e0 -inactive_tab_foreground #676364 -inactive_tab_background #eff0f2 - -foreground #4a4b4e -background #eff0f2 -selection_foreground #eff0f2 -selection_background #4a4b4e - -color0 #4a4b4e -color1 #a32a3a -color2 #206620 -color3 #745300 -color4 #4b529a -color5 #8d377e -color6 #086784 -color7 #dee2e0 -color8 #676364 -color9 #a64822 -color10 #187408 -color11 #8b590a -color12 #5c59b2 -color13 #8e45a8 -color14 #3f649c -color15 #eff0f2 - -include local.conf diff --git a/config/linux/foot/foot.ini b/config/linux/foot/foot.ini new file mode 100644 index 0000000..47ba8be --- /dev/null +++ b/config/linux/foot/foot.ini @@ -0,0 +1,142 @@ +# -*- conf -*- + +# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd) +# term=foot (or xterm-256color if built with -Dterminfo=disabled) +# login-shell=no + +font=JetBrainsMono Nerd Font:size=9 +# font-bold= +# font-italic= +# font-bold-italic= +# line-height= +# letter-spacing=0 +# horizontal-letter-offset=0 +# vertical-letter-offset=0 +# box-drawings-uses-font-glyphs=no +dpi-aware=yes + +# initial-window-size-pixels=700x500 # Or, +# initial-window-size-chars= +# initial-window-mode=windowed +# pad=2x2 # optionally append 'center' +# resize-delay-ms=100 + +# notify=notify-send -a foot -i foot ${title} ${body} +# url-launch=xdg-open ${url} + +# bold-text-in-bright=no +# bell=none +# word-delimiters=,│`|:"'()[]{}<> +# jump-label-letters=sadfjklewcmpgh +# selection-target=primary +# workers= +# osc8-underline=url-mode + +[scrollback] +# lines=1000 +# multiplier=3.0 +# indicator-position=relative +# indicator-format= + +[cursor] +# style=block +# color=111111 dcdccc +# blink=no + +[mouse] +hide-when-typing=yes +# alternate-scroll-mode=yes + +[colors] +# alpha=1.0 +background=0xeff0f2 +foreground=0x4a4b4e +regular0=0x4a4b4e +regular1=0xa32a3a +regular2=0x206620 +regular3=0x745300 +regular4=0x4b529a +regular5=0x8d377e +regular6=0x086784 +regular7=0xdee2e0 +bright0=0x676364 +bright1=0xa64822 +bright2=0x187408 +bright3=0x8b590a +bright4=0x5c59b2 +bright5=0x8e45a8 +bright6=0x3f649c +bright7=0xeff0f2 + + +# selection-foreground= +# selection-background= +# jump-labels= +# urls= + +[csd] +# preferred=server +# size=26 +# color= +# button-width=26 +# button-minimize-color= +# button-maximize-color= +# button-close-color= + +[key-bindings] +# scrollback-up-page=Shift+Page_Up +# scrollback-up-half-page=none +# scrollback-up-line=none +# scrollback-down-page=Shift+Page_Down +# scrollback-down-half-page=none +# scrollback-down-line=none +# clipboard-copy=Control+Shift+c +# clipboard-paste=Control+Shift+v +# primary-paste=Shift+Insert +# search-start=Control+Shift+r +# font-increase=Control+plus Control+equal Control+KP_Add +# font-decrease=Control+minus Control+KP_Subtract +# font-reset=Control+0 Control+KP_0 +# spawn-terminal=Control+Shift+n +# minimize=none +# maximize=none +# fullscreen=none +# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none +# pipe-selected=[xargs -r firefox] none +# show-urls-launch=Control+Shift+u +# show-urls-copy=none + +[search-bindings] +# cancel=Control+g Escape +# commit=Return +# find-prev=Control+r +# find-next=Control+s +# cursor-left=Left Control+b +# cursor-left-word=Control+Left Mod1+b +# cursor-right=Right Control+f +# cursor-right-word=Control+Right Mod1+f +# cursor-home=Home Control+a +# cursor-end=End Control+e +# delete-prev=BackSpace +# delete-prev-word=Mod1+BackSpace Control+BackSpace +# delete-next=Delete +# delete-next-word=Mod1+d Control+Delete +# extend-to-word-boundary=Control+w +# extend-to-next-whitespace=Control+Shift+w +# clipboard-paste=Control+v Control+y +# primary-paste=Shift+Insert + +#[url-bindings] +# cancel=Control+g Control+d Escape +# toggle-url-visible=t + +[mouse-bindings] +# primary-paste=BTN_MIDDLE +# select-begin=BTN_LEFT +# select-begin-block=Control+BTN_LEFT +# select-extend=BTN_RIGHT +# select-extend-character-wise=Control+BTN_RIGHT +# select-word=BTN_LEFT-2 +# select-word-whitespace=Control+BTN_LEFT-2 +# select-row=BTN_LEFT-3 diff --git a/config/linux/sway/config b/config/linux/sway/config new file mode 100644 index 0000000..ae737ea --- /dev/null +++ b/config/linux/sway/config @@ -0,0 +1,256 @@ +### Variables +# +# Logo key. Use Mod1 for Alt. +set $mod Mod4 +# Home row direction keys, like vim +set $left h +set $down j +set $up k +set $right l +# Your preferred terminal emulator +set $term kitty +# Your preferred application launcher +# Note: pass the final command to swaymsg so that the resulting window can be opened +# on the original workspace that the command was run on. +#set $menu dmenu_path | dmenu | xargs swaymsg exec -- +set $menu wofi --show=drun | xargs swaymsg exec -- + +font JetBrainsMono Nerd Font Mono 9 +default_border pixel 1 +smart_borders on + +### Output configuration +# +output * background ~/.local/share/backgrounds/default fill + +# Example configuration: +# +# output HDMI-A-1 resolution 1920x1080 position 1920,0 +# +# You can get the names of your outputs by running: swaymsg -t get_outputs + +### Idle configuration +# +# Example configuration: +# +# exec swayidle -w \ +# timeout 300 'swaylock -f -c 000000' \ +# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ +# before-sleep 'swaylock -f -c 000000' +# +# This will lock your screen after 300 seconds of inactivity, then turn off +# your displays after another 300 seconds, and turn your screens back on when +# resumed. It will also lock your screen before your computer goes to sleep. + + exec swayidle -w \ + timeout 300 'swaylock -f' \ + timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ + before-sleep 'swaylock -f' + +### Input configuration +# +# Example configuration: +# +# input "2:14:SynPS/2_Synaptics_TouchPad" { +# dwt enabled +# tap enabled +# natural_scroll enabled +# middle_emulation enabled +# } +# +# You can get the names of your inputs by running: swaymsg -t get_inputs +# Read `man 5 sway-input` for more information about this section. + + input "type:keyboard" { + xkb_options ctrl:nocaps + } + +### wob indicator + +set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock +exec rm -f $WOBSOCK && mkfifo $WOBSOCK && tail -f $WOBSOCK | wob + +### Key bindings +# +# Basics: +# + # Start a terminal + bindsym $mod+Return exec $term + + # Kill focused window + bindsym $mod+Shift+q kill + + # Start your launcher + bindsym $mod+d exec $menu + + # Drag floating windows by holding down $mod and left mouse button. + # Resize them with right mouse button + $mod. + # Despite the name, also works for non-floating windows. + # Change normal to inverse to use left mouse button for resizing and right + # mouse button for dragging. + floating_modifier $mod normal + + # Reload the configuration file + bindsym $mod+Shift+c reload + + # Exit sway (logs you out of your Wayland session) + bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' + bindsym $mod+Shift+i exec swaylock + + # Media keys + bindsym XF86AudioRaiseVolume exec ~/.local/bin/setvol up > $WOBSOCK + bindsym XF86AudioLowerVolume exec ~/.local/bin/setvol down > $WOBSOCK + bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle + bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle + bindsym XF86MonBrightnessDown exec ~/.local/bin/setbright down > $WOBSOCK + bindsym XF86MonBrightnessUp exec ~/.local/bin/setbright up > $WOBSOCK + #bindsym XF86MonBrightnessDown exec brightnessctl set 5%- + #bindsym XF86MonBrightnessUp exec brightnessctl set +5% + #bindsym XF86AudioPlay exec playerctl play-pause + #bindsym XF86AudioNext exec playerctl next + #bindsym XF86AudioPrev exec playerctl previous + +# +# Moving around: +# + # Move your focus around + bindsym $mod+$left focus left + bindsym $mod+$down focus down + bindsym $mod+$up focus up + bindsym $mod+$right focus right + # Or use $mod+[up|down|left|right] + bindsym $mod+Left focus left + bindsym $mod+Down focus down + bindsym $mod+Up focus up + bindsym $mod+Right focus right + + # Move the focused window with the same, but add Shift + bindsym $mod+Shift+$left move left + bindsym $mod+Shift+$down move down + bindsym $mod+Shift+$up move up + bindsym $mod+Shift+$right move right + # Ditto, with arrow keys + bindsym $mod+Shift+Left move left + bindsym $mod+Shift+Down move down + bindsym $mod+Shift+Up move up + bindsym $mod+Shift+Right move right +# +# Workspaces: +# + # Switch to workspace + bindsym $mod+1 workspace number 1 + bindsym $mod+2 workspace number 2 + bindsym $mod+3 workspace number 3 + bindsym $mod+4 workspace number 4 + bindsym $mod+5 workspace number 5 + bindsym $mod+6 workspace number 6 + bindsym $mod+7 workspace number 7 + bindsym $mod+8 workspace number 8 + bindsym $mod+9 workspace number 9 + bindsym $mod+0 workspace number 10 + # Move focused container to workspace + bindsym $mod+Shift+1 move container to workspace number 1 + bindsym $mod+Shift+2 move container to workspace number 2 + bindsym $mod+Shift+3 move container to workspace number 3 + bindsym $mod+Shift+4 move container to workspace number 4 + bindsym $mod+Shift+5 move container to workspace number 5 + bindsym $mod+Shift+6 move container to workspace number 6 + bindsym $mod+Shift+7 move container to workspace number 7 + bindsym $mod+Shift+8 move container to workspace number 8 + bindsym $mod+Shift+9 move container to workspace number 9 + bindsym $mod+Shift+0 move container to workspace number 10 + # Note: workspaces can have any name you want, not just numbers. + # We just use 1-10 as the default. +# +# Layout stuff: +# + # You can "split" the current object of your focus with + # $mod+b or $mod+v, for horizontal and vertical splits + # respectively. + bindsym $mod+b splith + bindsym $mod+v splitv + + # Switch the current container between different layout styles + bindsym $mod+s layout stacking + bindsym $mod+w layout tabbed + bindsym $mod+e layout toggle split + + # Make the current focus fullscreen + bindsym $mod+f fullscreen + + # Toggle the current focus between tiling and floating mode + bindsym $mod+Shift+space floating toggle + + # Swap focus between the tiling area and the floating area + bindsym $mod+space focus mode_toggle + + # Move focus to the parent container + bindsym $mod+a focus parent +# +# Scratchpad: +# + # Sway has a "scratchpad", which is a bag of holding for windows. + # You can send windows there and get them back later. + + # Move the currently focused window to the scratchpad + bindsym $mod+Shift+minus move scratchpad + + # Show the next scratchpad window or hide the focused scratchpad window. + # If there are multiple scratchpad windows, this command cycles through them. + bindsym $mod+minus scratchpad show +# +# Resizing containers: +# +mode "resize" { + # left will shrink the containers width + # right will grow the containers width + # up will shrink the containers height + # down will grow the containers height + bindsym $left resize shrink width 10px + bindsym $down resize grow height 10px + bindsym $up resize shrink height 10px + bindsym $right resize grow width 10px + + # Ditto, with arrow keys + bindsym Left resize shrink width 10px + bindsym Down resize grow height 10px + bindsym Up resize shrink height 10px + bindsym Right resize grow width 10px + + # Return to default mode + bindsym Return mode "default" + bindsym Escape mode "default" +} +bindsym $mod+r mode "resize" + +# +# Theme Colors +# + +# border bg text ind c_border +client.focused #106e86 #dee2e0 #4a4b4e #a32a3a #106e86 +client.focused_inactive #dee2e0 #dee2e0 #4a4b4e #a32a3a #dee2e0 +client.unfocused #dee2e0 #dee2e0 #4a4b4e #a32a3a #dee2e0 + +# +# Status Bar: waybar +# + +bar { + swaybar_command waybar +} + +# +# Apps +# + +for_window [app_id="firefox"] inhibit_idle fullscreen +assign [app_id="firefox"] workspace number 1 + +workspace 2 +exec $term +exec firefox & + +bindsym $mod+comma exec PATH=~/.local/bin:$PATH /usr/bin/passmenu + +include /etc/sway/config.d/* diff --git a/config/linux/swaylock/config b/config/linux/swaylock/config new file mode 100644 index 0000000..f8ceefc --- /dev/null +++ b/config/linux/swaylock/config @@ -0,0 +1,2 @@ +image=~/.local/share/backgrounds/default +ignore-empty-password diff --git a/config/linux/waybar/config b/config/linux/waybar/config new file mode 100644 index 0000000..d8cefd2 --- /dev/null +++ b/config/linux/waybar/config @@ -0,0 +1,89 @@ +[ + { + "name": "topbar", + "layer": "bottom", + "position": "top", + "height": 0, + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": [], + "modules-right": ["tray", "custom/reboot", "network#wifi", "pulseaudio", "battery#bat1", "temperature", "idle_inhibitor", "clock#local"], + "sway/workspaces": { + "format": "{icon}", + "format-icons": { + "1": "", + "2": "" + } + }, + "clock#local": { + "interval": 1, + "format": "{:%a %d %b %I:%M %p}", + "tooltip-format": "{:%Y %B}\n{calendar}", + "today-format": "{}" + }, + "temperature": { + "critical-threshold": 80, + "format": "{icon} {temperatureC}°C", + "format-icons": ["", "", "", "", ""], + "tooltip": false + }, + "battery#bat1": { + "bat": "BAT0", + "adapter": "AC", + "interval": 60, + "states": { + "5": 100, + "4": 80, + "3": 60, + "2": 40, + "1": 20, + "0": 5 + }, + "format": "{icon} {capacity}%", + "format-charging-5": " {capacity}%", + "format-charging-4": " {capacity}%", + "format-charging-3": " {capacity}%", + "format-charging-2": " {capacity}%", + "format-charging-1": " {capacity}%", + "format-charging-0": " {capacity}%", + "format-icons": ["", "", "", "", "", ""] + }, + "network#wifi": { + "interface": "wlp*", + "format-ethernet": "", + "format-wifi": " {signalStrength}%", + "format-linked": "", + "format-disconnected": "", + "tooltip-format": "{essid}\n{ifname}: {ipaddr}/{cidr}", + "on-click": "nm-connection-editor" + }, + "pulseaudio": { + "scroll-step": 1, + "format": "{icon} {volume}%", + "format-muted": "婢 {volume}%", + "format-bluetooth": "{icon} {volume}%", + "format-bluetooth-muted": "婢 {icon}", + "format-icons": { + "headphone": "", + "phone": "", + "portable": "", + "car": "", + "default": ["奄", "奔", "墳"] + }, + "on-click": "pavucontrol" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + }, + "tooltip": false + }, + "custom/reboot": { + "format": "{}", + "exec": "~/.local/bin/dnf-needs-restarting", + "return-type": "json", + "interval": 60 + } + } +] diff --git a/config/linux/waybar/style.css b/config/linux/waybar/style.css new file mode 100644 index 0000000..ebcf4a6 --- /dev/null +++ b/config/linux/waybar/style.css @@ -0,0 +1,62 @@ +* { + border-radius: 0; + border: 0; + font-family: Noto Sans, JetBrainsMono Nerd Font; + font-size: 11pt; + text-shadow: none; +} + +window#waybar { + background: #eff0f2; + color: #4a4b4e; + border-bottom: 1px solid #dee2e0; +} + +tooltip { + background: alpha(#eff0f2, 0.95); + border: 1px solid #dee2e0; + border-radius: 5px; +} + +tooltip label { + color: #4a4b4e; +} + +label { + padding: 2px 10px; + margin: 0; +} + +#workspaces label { + padding: 0; +} + +#workspaces button { + padding: 0 6px; + font-weight: normal; +} + +#workspaces button:hover { + box-shadow: inherit; + text-shadow: inherit; + background: #eff0f2; +} + +#workspaces button.focused { + background: #dee2e0; +} + +#idle_inhibitor { + margin: 0; + padding: 2px 12px 2px 6px; +} + +#idle_inhibitor.activated { + color: #eff0f2; + background: #a32a3a; + text-shadow: 1px 1px 0 #ae4e2a; +} + +#custom-reboot { + color: #a32a3a; +} diff --git a/config/linux/wob/wob.ini b/config/linux/wob/wob.ini new file mode 100644 index 0000000..8205a29 --- /dev/null +++ b/config/linux/wob/wob.ini @@ -0,0 +1,6 @@ +border_color=676364 +background_color=dee2e0 +bar_color=676364 +border_offset=0 +border_size=1 +bar_padding=5 diff --git a/config/linux/wofi/style.css b/config/linux/wofi/style.css new file mode 100644 index 0000000..abf8ae8 --- /dev/null +++ b/config/linux/wofi/style.css @@ -0,0 +1,37 @@ +window { + background: #eff0f2; + color: #4a4b4e; + font-family: Noto Sans, JetBrainsMono Nerd Font; + font-size: 10pt; + border: 1px solid #dee2e0; +} + +#input { + padding: 2px; + margin: 5px; + border: 0; + border-radius: 0; +} + +#input:active { + border: 0; +} + +#inner-box { +} + +#outer-box { +} + +#scroll { + padding: 2px; + margin: 5px; +} + +#text { + color: #4a4b4e; +} + +#entry:selected { + background: #dee2e0; +} diff --git a/config/sway/config b/config/sway/config deleted file mode 100644 index ae737ea..0000000 --- a/config/sway/config +++ /dev/null @@ -1,256 +0,0 @@ -### Variables -# -# Logo key. Use Mod1 for Alt. -set $mod Mod4 -# Home row direction keys, like vim -set $left h -set $down j -set $up k -set $right l -# Your preferred terminal emulator -set $term kitty -# Your preferred application launcher -# Note: pass the final command to swaymsg so that the resulting window can be opened -# on the original workspace that the command was run on. -#set $menu dmenu_path | dmenu | xargs swaymsg exec -- -set $menu wofi --show=drun | xargs swaymsg exec -- - -font JetBrainsMono Nerd Font Mono 9 -default_border pixel 1 -smart_borders on - -### Output configuration -# -output * background ~/.local/share/backgrounds/default fill - -# Example configuration: -# -# output HDMI-A-1 resolution 1920x1080 position 1920,0 -# -# You can get the names of your outputs by running: swaymsg -t get_outputs - -### Idle configuration -# -# Example configuration: -# -# exec swayidle -w \ -# timeout 300 'swaylock -f -c 000000' \ -# timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ -# before-sleep 'swaylock -f -c 000000' -# -# This will lock your screen after 300 seconds of inactivity, then turn off -# your displays after another 300 seconds, and turn your screens back on when -# resumed. It will also lock your screen before your computer goes to sleep. - - exec swayidle -w \ - timeout 300 'swaylock -f' \ - timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \ - before-sleep 'swaylock -f' - -### Input configuration -# -# Example configuration: -# -# input "2:14:SynPS/2_Synaptics_TouchPad" { -# dwt enabled -# tap enabled -# natural_scroll enabled -# middle_emulation enabled -# } -# -# You can get the names of your inputs by running: swaymsg -t get_inputs -# Read `man 5 sway-input` for more information about this section. - - input "type:keyboard" { - xkb_options ctrl:nocaps - } - -### wob indicator - -set $WOBSOCK $XDG_RUNTIME_DIR/wob.sock -exec rm -f $WOBSOCK && mkfifo $WOBSOCK && tail -f $WOBSOCK | wob - -### Key bindings -# -# Basics: -# - # Start a terminal - bindsym $mod+Return exec $term - - # Kill focused window - bindsym $mod+Shift+q kill - - # Start your launcher - bindsym $mod+d exec $menu - - # Drag floating windows by holding down $mod and left mouse button. - # Resize them with right mouse button + $mod. - # Despite the name, also works for non-floating windows. - # Change normal to inverse to use left mouse button for resizing and right - # mouse button for dragging. - floating_modifier $mod normal - - # Reload the configuration file - bindsym $mod+Shift+c reload - - # Exit sway (logs you out of your Wayland session) - bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' - bindsym $mod+Shift+i exec swaylock - - # Media keys - bindsym XF86AudioRaiseVolume exec ~/.local/bin/setvol up > $WOBSOCK - bindsym XF86AudioLowerVolume exec ~/.local/bin/setvol down > $WOBSOCK - bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle - bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle - bindsym XF86MonBrightnessDown exec ~/.local/bin/setbright down > $WOBSOCK - bindsym XF86MonBrightnessUp exec ~/.local/bin/setbright up > $WOBSOCK - #bindsym XF86MonBrightnessDown exec brightnessctl set 5%- - #bindsym XF86MonBrightnessUp exec brightnessctl set +5% - #bindsym XF86AudioPlay exec playerctl play-pause - #bindsym XF86AudioNext exec playerctl next - #bindsym XF86AudioPrev exec playerctl previous - -# -# Moving around: -# - # Move your focus around - bindsym $mod+$left focus left - bindsym $mod+$down focus down - bindsym $mod+$up focus up - bindsym $mod+$right focus right - # Or use $mod+[up|down|left|right] - bindsym $mod+Left focus left - bindsym $mod+Down focus down - bindsym $mod+Up focus up - bindsym $mod+Right focus right - - # Move the focused window with the same, but add Shift - bindsym $mod+Shift+$left move left - bindsym $mod+Shift+$down move down - bindsym $mod+Shift+$up move up - bindsym $mod+Shift+$right move right - # Ditto, with arrow keys - bindsym $mod+Shift+Left move left - bindsym $mod+Shift+Down move down - bindsym $mod+Shift+Up move up - bindsym $mod+Shift+Right move right -# -# Workspaces: -# - # Switch to workspace - bindsym $mod+1 workspace number 1 - bindsym $mod+2 workspace number 2 - bindsym $mod+3 workspace number 3 - bindsym $mod+4 workspace number 4 - bindsym $mod+5 workspace number 5 - bindsym $mod+6 workspace number 6 - bindsym $mod+7 workspace number 7 - bindsym $mod+8 workspace number 8 - bindsym $mod+9 workspace number 9 - bindsym $mod+0 workspace number 10 - # Move focused container to workspace - bindsym $mod+Shift+1 move container to workspace number 1 - bindsym $mod+Shift+2 move container to workspace number 2 - bindsym $mod+Shift+3 move container to workspace number 3 - bindsym $mod+Shift+4 move container to workspace number 4 - bindsym $mod+Shift+5 move container to workspace number 5 - bindsym $mod+Shift+6 move container to workspace number 6 - bindsym $mod+Shift+7 move container to workspace number 7 - bindsym $mod+Shift+8 move container to workspace number 8 - bindsym $mod+Shift+9 move container to workspace number 9 - bindsym $mod+Shift+0 move container to workspace number 10 - # Note: workspaces can have any name you want, not just numbers. - # We just use 1-10 as the default. -# -# Layout stuff: -# - # You can "split" the current object of your focus with - # $mod+b or $mod+v, for horizontal and vertical splits - # respectively. - bindsym $mod+b splith - bindsym $mod+v splitv - - # Switch the current container between different layout styles - bindsym $mod+s layout stacking - bindsym $mod+w layout tabbed - bindsym $mod+e layout toggle split - - # Make the current focus fullscreen - bindsym $mod+f fullscreen - - # Toggle the current focus between tiling and floating mode - bindsym $mod+Shift+space floating toggle - - # Swap focus between the tiling area and the floating area - bindsym $mod+space focus mode_toggle - - # Move focus to the parent container - bindsym $mod+a focus parent -# -# Scratchpad: -# - # Sway has a "scratchpad", which is a bag of holding for windows. - # You can send windows there and get them back later. - - # Move the currently focused window to the scratchpad - bindsym $mod+Shift+minus move scratchpad - - # Show the next scratchpad window or hide the focused scratchpad window. - # If there are multiple scratchpad windows, this command cycles through them. - bindsym $mod+minus scratchpad show -# -# Resizing containers: -# -mode "resize" { - # left will shrink the containers width - # right will grow the containers width - # up will shrink the containers height - # down will grow the containers height - bindsym $left resize shrink width 10px - bindsym $down resize grow height 10px - bindsym $up resize shrink height 10px - bindsym $right resize grow width 10px - - # Ditto, with arrow keys - bindsym Left resize shrink width 10px - bindsym Down resize grow height 10px - bindsym Up resize shrink height 10px - bindsym Right resize grow width 10px - - # Return to default mode - bindsym Return mode "default" - bindsym Escape mode "default" -} -bindsym $mod+r mode "resize" - -# -# Theme Colors -# - -# border bg text ind c_border -client.focused #106e86 #dee2e0 #4a4b4e #a32a3a #106e86 -client.focused_inactive #dee2e0 #dee2e0 #4a4b4e #a32a3a #dee2e0 -client.unfocused #dee2e0 #dee2e0 #4a4b4e #a32a3a #dee2e0 - -# -# Status Bar: waybar -# - -bar { - swaybar_command waybar -} - -# -# Apps -# - -for_window [app_id="firefox"] inhibit_idle fullscreen -assign [app_id="firefox"] workspace number 1 - -workspace 2 -exec $term -exec firefox & - -bindsym $mod+comma exec PATH=~/.local/bin:$PATH /usr/bin/passmenu - -include /etc/sway/config.d/* diff --git a/config/swaylock/config b/config/swaylock/config deleted file mode 100644 index f8ceefc..0000000 --- a/config/swaylock/config +++ /dev/null @@ -1,2 +0,0 @@ -image=~/.local/share/backgrounds/default -ignore-empty-password diff --git a/config/tmux/tmux.conf b/config/tmux/tmux.conf deleted file mode 100644 index b1b98e0..0000000 --- a/config/tmux/tmux.conf +++ /dev/null @@ -1,55 +0,0 @@ -# vi bindings -set -g status-keys vi -setw -g mode-keys vi - -# reasonable history buffer -set -g history-limit 10000 - -# status line -setw -g window-status-current-style bright -set -g status-right '#(date "+%H:%M %Z %Y-%m-%d")' -set -g status-style bg=white -set -g status-left " #S@#h " -set -g status-left-length 15 -set -g status-left-style bg=green,fg=white - -# ui -set -g set-titles on -set -g default-terminal "screen-256color" -set -ga terminal-overrides ",xterm-256color:Tc" -set -g pane-border-style fg=white - -# splits -bind | split-window -h -bind \\ split-window -h -bind - split-window -v - -# reversed to match vim split names -bind v select-layout even-horizontal -bind h select-layout even-vertical - -# vim-style resize -bind -r H resize-pane -L 2 -bind -r J resize-pane -D 2 -bind -r K resize-pane -U 2 -bind -r L resize-pane -R 2 - -# vim-style move -bind h select-pane -L -bind j select-pane -D -bind k select-pane -U -bind l select-pane -R - -# unbind arrow keys -unbind Up -unbind Down -unbind Left -unbind Right -unbind M-Up -unbind M-Down -unbind M-Left -unbind M-Right -unbind C-Up -unbind C-Down -unbind C-Left -unbind C-Right diff --git a/config/waybar/config b/config/waybar/config deleted file mode 100644 index d8cefd2..0000000 --- a/config/waybar/config +++ /dev/null @@ -1,89 +0,0 @@ -[ - { - "name": "topbar", - "layer": "bottom", - "position": "top", - "height": 0, - "modules-left": ["sway/workspaces", "sway/mode"], - "modules-center": [], - "modules-right": ["tray", "custom/reboot", "network#wifi", "pulseaudio", "battery#bat1", "temperature", "idle_inhibitor", "clock#local"], - "sway/workspaces": { - "format": "{icon}", - "format-icons": { - "1": "", - "2": "" - } - }, - "clock#local": { - "interval": 1, - "format": "{:%a %d %b %I:%M %p}", - "tooltip-format": "{:%Y %B}\n{calendar}", - "today-format": "{}" - }, - "temperature": { - "critical-threshold": 80, - "format": "{icon} {temperatureC}°C", - "format-icons": ["", "", "", "", ""], - "tooltip": false - }, - "battery#bat1": { - "bat": "BAT0", - "adapter": "AC", - "interval": 60, - "states": { - "5": 100, - "4": 80, - "3": 60, - "2": 40, - "1": 20, - "0": 5 - }, - "format": "{icon} {capacity}%", - "format-charging-5": " {capacity}%", - "format-charging-4": " {capacity}%", - "format-charging-3": " {capacity}%", - "format-charging-2": " {capacity}%", - "format-charging-1": " {capacity}%", - "format-charging-0": " {capacity}%", - "format-icons": ["", "", "", "", "", ""] - }, - "network#wifi": { - "interface": "wlp*", - "format-ethernet": "", - "format-wifi": " {signalStrength}%", - "format-linked": "", - "format-disconnected": "", - "tooltip-format": "{essid}\n{ifname}: {ipaddr}/{cidr}", - "on-click": "nm-connection-editor" - }, - "pulseaudio": { - "scroll-step": 1, - "format": "{icon} {volume}%", - "format-muted": "婢 {volume}%", - "format-bluetooth": "{icon} {volume}%", - "format-bluetooth-muted": "婢 {icon}", - "format-icons": { - "headphone": "", - "phone": "", - "portable": "", - "car": "", - "default": ["奄", "奔", "墳"] - }, - "on-click": "pavucontrol" - }, - "idle_inhibitor": { - "format": "{icon}", - "format-icons": { - "activated": "", - "deactivated": "" - }, - "tooltip": false - }, - "custom/reboot": { - "format": "{}", - "exec": "~/.local/bin/dnf-needs-restarting", - "return-type": "json", - "interval": 60 - } - } -] diff --git a/config/waybar/style.css b/config/waybar/style.css deleted file mode 100644 index ebcf4a6..0000000 --- a/config/waybar/style.css +++ /dev/null @@ -1,62 +0,0 @@ -* { - border-radius: 0; - border: 0; - font-family: Noto Sans, JetBrainsMono Nerd Font; - font-size: 11pt; - text-shadow: none; -} - -window#waybar { - background: #eff0f2; - color: #4a4b4e; - border-bottom: 1px solid #dee2e0; -} - -tooltip { - background: alpha(#eff0f2, 0.95); - border: 1px solid #dee2e0; - border-radius: 5px; -} - -tooltip label { - color: #4a4b4e; -} - -label { - padding: 2px 10px; - margin: 0; -} - -#workspaces label { - padding: 0; -} - -#workspaces button { - padding: 0 6px; - font-weight: normal; -} - -#workspaces button:hover { - box-shadow: inherit; - text-shadow: inherit; - background: #eff0f2; -} - -#workspaces button.focused { - background: #dee2e0; -} - -#idle_inhibitor { - margin: 0; - padding: 2px 12px 2px 6px; -} - -#idle_inhibitor.activated { - color: #eff0f2; - background: #a32a3a; - text-shadow: 1px 1px 0 #ae4e2a; -} - -#custom-reboot { - color: #a32a3a; -} diff --git a/config/wob/wob.ini b/config/wob/wob.ini deleted file mode 100644 index 8205a29..0000000 --- a/config/wob/wob.ini +++ /dev/null @@ -1,6 +0,0 @@ -border_color=676364 -background_color=dee2e0 -bar_color=676364 -border_offset=0 -border_size=1 -bar_padding=5 diff --git a/config/wofi/style.css b/config/wofi/style.css deleted file mode 100644 index abf8ae8..0000000 --- a/config/wofi/style.css +++ /dev/null @@ -1,37 +0,0 @@ -window { - background: #eff0f2; - color: #4a4b4e; - font-family: Noto Sans, JetBrainsMono Nerd Font; - font-size: 10pt; - border: 1px solid #dee2e0; -} - -#input { - padding: 2px; - margin: 5px; - border: 0; - border-radius: 0; -} - -#input:active { - border: 0; -} - -#inner-box { -} - -#outer-box { -} - -#scroll { - padding: 2px; - margin: 5px; -} - -#text { - color: #4a4b4e; -} - -#entry:selected { - background: #dee2e0; -} diff --git a/config/zsh/.zprofile b/config/zsh/.zprofile deleted file mode 100644 index a9a13c9..0000000 --- a/config/zsh/.zprofile +++ /dev/null @@ -1,7 +0,0 @@ -if [ "$(uname)" = "Darwin" ]; then - # disable Apple Terminal's annoying session restore feature - SHELL_SESSIONS_DISABLE=1 -fi -if [ "$DESKTOP_SESSION" = "sway-session" ]; then - export $(gnome-keyring-daemon --start) -fi diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc deleted file mode 100644 index f33ca44..0000000 --- a/config/zsh/.zshrc +++ /dev/null @@ -1,4 +0,0 @@ -for f in $ZDOTDIR/*.zsh -do - source "${f}" -done diff --git a/config/zsh/20-appearance.zsh b/config/zsh/20-appearance.zsh deleted file mode 100644 index 4f7c8d9..0000000 --- a/config/zsh/20-appearance.zsh +++ /dev/null @@ -1,79 +0,0 @@ -# -# colorize shell programs - -if ls -Z . &>/dev/null 2>&1; then - # gnu coreutils? - alias ls='ls --color=auto' - eval `dircolors ${XDG_CONFIG_HOME:-${HOME}/.config}/dircolors.conf` -elif (( $+commands[gls] )); then - # prefixed gnu coreutils? - alias ls='gls --color=auto' - eval `gdircolors ${XDG_CONFIG_HOME:-${HOME}/.config}/dircolors.conf` -else - # assume bsd ls - alias ls='ls -G' - export LSCOLORS="exgxbxdxcxegedxbxgxcxd" -fi - -# grep -export GREP_COLOR='1;32' -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' - -# less -export LESS_TERMCAP_mb=$'\e[0;31m' # begin blinking - red -export LESS_TERMCAP_md=$'\e[0;34m' # begin bold - blue -export LESS_TERMCAP_me=$'\e[0m' # end mode -export LESS_TERMCAP_so=$'\e[30;46m' # begin standout mode - black on cyan -export LESS_TERMCAP_se=$'\e[0m' # end standout mode -export LESS_TERMCAP_us=$'\e[4;33m' # begin underline - yellow underline -export LESS_TERMCAP_ue=$'\e[0m' # end underline - -# -# make a sweet prompt - -autoload colors; colors; -setopt prompt_subst # expansion of color codes, etc. in the prompt - -# print the fully resolved shell command with time stamp -# to be run from zsh's builtin 'preexec' with all arguments passed through ($*) -function theme_preexec () { - echo "($fg[magenta]`date +%r`$reset_color) $fg[cyan]$3$reset_color" -} - -# print the prompt char in red if the last command exited non-zero -function prompt_char { - echo "%(?.$.%{$fg[red]%}$%{$reset_color%})" -} - -function repo_prompt_info { - # git - ref=$(git symbolic-ref HEAD 2> /dev/null || git rev-parse --short HEAD 2> /dev/null) - if [ $? -eq 0 ]; then - #repo=$(basename $(git rev-parse --show-toplevel)) - echo "%{$fg[cyan]%}%{\e[1m%}${ref#refs/heads/}%{$reset_color%}" - return - fi -} - -function workspace_prompt_info { - repo=$(repo_prompt_info) - if [ "$repo" ]; then - echo "[$repo] " - return - fi -} - -# print the hostname in green if local, else red -function hostname_info { - if [[ $ZSH_LOCAL_ENV == "true" ]]; then - echo "%{$fg[green]%}%{$ZSH_HOST_PREFIX%}%m%{$ZSH_HOST_SUFFIX%}%{$reset_color%}" - else - echo "%{$fg[red]%}%{$ZSH_HOST_PREFIX%}%m%{$ZSH_HOST_SUFFIX%}%{$reset_color%}" - fi -} - -# a colorful multiline prompt using the above defined functions -PROMPT=$'%{$fg[yellow]%}%n%{$reset_color%}@$(hostname_info):%{$fg[blue]%}%~%{$reset_color%} -$(workspace_prompt_info)$(prompt_char)%{$reset_color%} ' diff --git a/config/zsh/30-behavior.zsh b/config/zsh/30-behavior.zsh deleted file mode 100644 index 6b2b2c2..0000000 --- a/config/zsh/30-behavior.zsh +++ /dev/null @@ -1,54 +0,0 @@ -# -# execution - -setopt rm_star_wait # wait 10 seconds before accepting 'rm *' confirmation -export REPORTTIME=5 # report timing for any command longer than 5 seconds -unsetopt flowcontrol # disable ^s from freezing the terminal - -# -# history - -HISTFILE="${XDG_DATA_HOME:-${HOME}/.local/share}/zsh/history" -HISTSIZE=10000 -SAVEHIST=10000 - -setopt hist_ignore_all_dups # ignore dups including non-sequential ones -setopt share_history # share command history data between sessions -setopt hist_verify # load hist into command buffer rather than exec immediately - -# -# term support - -# make sure $TERM is installed -# if not, fall back on xterm-256color -infocmp "$TERM" > /dev/null 2>&1 || export TERM=xterm-256color - -# set term title appropriately based on term type -# user@host:current_dir (current_command) -case "$TERM" in - xterm*|rxvt*|screen*|alacritty*|foot) - term_preexec () { - printf '\e]0;%s (%s)\a' ${(%):-'%n@%m:%~'} "$1" - } - term_precmd () { - printf '\e]0;%s\a' ${(%):-'%n@%m:%~'} - } - ;; -esac - -# -# draw a horizontal separator - -function hr { - printf "$bg[red]${(l:$COLUMNS:: :)}$reset_color\n" - printf "$bg[yellow]${(l:$COLUMNS:: :)}\n" - printf "$bg[green]${(l:$COLUMNS:: :)}\n" - printf "$bg[cyan]${(l:$COLUMNS:: :)}\n" - printf "$bg[blue]${(l:$COLUMNS:: :)}\n" - printf "$bg[magenta]${(l:$COLUMNS:: :)}$reset_color\n" -} - -# -# less - -export LESS=-i diff --git a/config/zsh/40-key-bindings.zsh b/config/zsh/40-key-bindings.zsh deleted file mode 100644 index 4deac62..0000000 --- a/config/zsh/40-key-bindings.zsh +++ /dev/null @@ -1,6 +0,0 @@ -bindkey -e # use emacs mode -bindkey '^r' history-incremental-search-backward # ctrl-r -bindkey '^[[Z' reverse-menu-complete # shift-tab - -bindkey '\e[3~' delete-char # make sure delete key works -bindkey ' ' magic-space # also do history expansion on space diff --git a/config/zsh/50-completion.zsh b/config/zsh/50-completion.zsh deleted file mode 100644 index 23cb052..0000000 --- a/config/zsh/50-completion.zsh +++ /dev/null @@ -1,27 +0,0 @@ -# initialize the completion system -autoload -U compinit -compinit -d "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompdump" -zmodload zsh/complist - -# complete only after the second consecutive tab -setopt auto_menu - -# use GNU ls color specification for completion menu -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} - -# use menu selection by default -zstyle ':completion:*:default' menu select - -# disable named-directories autocompletion -zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories -cdpath=(.) - -# don't autocomplete local users for (ssh|ftp|scp|rsync) -zstyle ':completion:*:*:(ssh|ftp|scp|rsync):*' users - -# Use caching so that commands like apt and dpkg complete are useable -zstyle ':completion::complete:*' use-cache 1 -zstyle ':completion:*' cache-path "${XDG_CACHE_HOME:-${HOME}/.cache}/zsh/zcompcache" - -# always rehash commands list -zstyle ':completion:*:commands' rehash 1 diff --git a/config/zsh/99-function-overrides.zsh b/config/zsh/99-function-overrides.zsh deleted file mode 100644 index 8b233e5..0000000 --- a/config/zsh/99-function-overrides.zsh +++ /dev/null @@ -1,8 +0,0 @@ -preexec () { - type term_preexec &> /dev/null && term_preexec $* - type theme_preexec &> /dev/null && theme_preexec $* -} - -precmd () { - type term_precmd &> /dev/null && term_precmd -} diff --git a/deploy.sh b/deploy.sh index baf4c7f..675490d 100755 --- a/deploy.sh +++ b/deploy.sh @@ -28,29 +28,42 @@ xconfig="${XDG_CONFIG_HOME:-${HOME}/.config}" userbin="$HOME/.local/bin" systemd="$xconfig/systemd/user" +uname=$(uname | tr '[:upper:]' '[:lower:]') + mkdir -p "$xcache" "$xdata" "$xconfig" "$userbin" "$systemd" function link { - src="$1" - dest="$2" - if [ -e "$dest" ] && [ ! -L "$dest" ]; then + link_src="$1" + link_dest="$2" + if [ -e "$link_dest" ] && [ ! -L "$link_dest" ]; then mkdir -p "../dotfiles-backup" - mv "$dest" "../dotfiles-backup/." + mv "$link_dest" "../dotfiles-backup/." fi - if [ ! -e "$dest" ]; then - ln -sf "$src" "$dest" + if [ ! -e "$link_dest" ]; then + ln -sf "$link_src" "$link_dest" fi } -# deploy to XDG dirs -mkdir -p "${xcache}/zsh" -mkdir -p "${xdata}/zsh" -cd config -for d in * -do - link "$(pwd)/$d" "${xconfig}/$d" -done -cd .. +function deploy { + deploy_src="$1" + deploy_dest="$2" + if [ -e "$deploy_src/all" ]; then + cd "$deploy_src/all" + for f in * + do + link "$(pwd)/${f}" "$deploy_dest/${f}" + done + cd ../.. + fi + if [ -e "$deploy_src/$uname" ]; then + cd "$deploy_src/$uname" + for f in * + do + link "$(pwd)/${f}" "$deploy_dest/${f}" + done + cd ../.. + fi +} # deploy to home cd home @@ -60,21 +73,16 @@ do done cd .. +# deploy to XDG dirs +mkdir -p "${xcache}/zsh" +mkdir -p "${xdata}/zsh" +deploy config "$xconfig" + # deploy user executables -cd bin -for f in * -do - link "$(pwd)/${f}" "$userbin/${f}" -done -cd .. +deploy bin "$userbin" # deploy systemd user units -cd systemd -for f in * -do - link "$(pwd)/${f}" "$systemd/${f}" -done -cd .. +deploy systemd "$systemd" autoload="$HOME/.vim/autoload" mkdir -p "$autoload" @@ -103,13 +111,15 @@ fi if [ ! -e "$HOME/.config/kitty/local.conf" ]; then cp local/kitty-local.conf config/kitty/local.conf fi -dconfig="$xconfig/duplicity" -mkdir -p "$dconfig" -if [ ! -e "$dconfig/config" ]; then - cp local/duplicity-config "$dconfig/config" -fi -if [ ! -e "$dconfig/excludes" ]; then - cp local/duplicity-excludes "$dconfig/excludes" +if [ "$uname" = "linux" ]; then + dconfig="$xconfig/duplicity" + mkdir -p "$dconfig" + if [ ! -e "$dconfig/config" ]; then + cp local/duplicity-config "$dconfig/config" + fi + if [ ! -e "$dconfig/excludes" ]; then + cp local/duplicity-excludes "$dconfig/excludes" + fi fi # download nerdfonts diff --git a/systemd/backup.service b/systemd/backup.service deleted file mode 100644 index c1adfde..0000000 --- a/systemd/backup.service +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=Backup with duplicity -After=network.target - -[Service] -Type=oneshot -ExecStart=bash ${HOME}/.local/bin/backup diff --git a/systemd/backup.timer b/systemd/backup.timer deleted file mode 100644 index b7815d6..0000000 --- a/systemd/backup.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Run backup every four hours - -[Timer] -OnCalendar=*-*-* 0/4:15 -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/systemd/linux/backup.service b/systemd/linux/backup.service new file mode 100644 index 0000000..c1adfde --- /dev/null +++ b/systemd/linux/backup.service @@ -0,0 +1,7 @@ +[Unit] +Description=Backup with duplicity +After=network.target + +[Service] +Type=oneshot +ExecStart=bash ${HOME}/.local/bin/backup diff --git a/systemd/linux/backup.timer b/systemd/linux/backup.timer new file mode 100644 index 0000000..b7815d6 --- /dev/null +++ b/systemd/linux/backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run backup every four hours + +[Timer] +OnCalendar=*-*-* 0/4:15 +Persistent=true + +[Install] +WantedBy=timers.target -- cgit v1.2.3