├── .gitignore ├── .gitmodules ├── README.md ├── bash ├── config.bash └── profile.bash ├── bat ├── bin ├── bootstrap.bash └── install.bash ├── colordiff ├── contrib ├── background.jpg ├── diff-highlight ├── mouserate.py ├── spotify-dbus.bash ├── tm └── user-dirs.dirs ├── curl ├── cursor ├── keybindings.json └── settings.json ├── git ├── attributes ├── config └── ignore ├── gpg-agent ├── gtk └── gtk3.css ├── htop ├── ipython ├── iterm2 ├── linearmouse ├── pip ├── readline ├── rofi ├── config.rasi └── theme.rasi ├── roxterm ├── Colours │ └── Tango ├── Global ├── Profiles │ └── Default └── Shortcuts │ ├── Custom │ └── Default ├── skhd ├── scripts │ ├── chrome.sh │ └── iterm2.sh └── skhdrc ├── splatmoji ├── ssh ├── tmux ├── urxvt ├── xinitrc ├── xprofile └── yabai └── yabairc /.gitignore: -------------------------------------------------------------------------------- 1 | roxterm/Searches 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "emacs"] 2 | path = emacs 3 | url = https://github.com/ramnes/.emacs.d.git 4 | [submodule "qtile"] 5 | path = qtile 6 | url = https://github.com/ramnes/qtile-config.git 7 | [submodule "misc/context-color"] 8 | path = contrib/context-color 9 | url = https://github.com/ramnes/context-color.git 10 | [submodule "contrib/kubetail"] 11 | path = contrib/kubetail 12 | url = https://github.com/johanhaleby/kubetail.git 13 | [submodule "contrib/kubectx"] 14 | path = contrib/kubectx 15 | url = https://github.com/ahmetb/kubectx.git 16 | [submodule "contrib/splatmoji"] 17 | path = contrib/splatmoji 18 | url = https://github.com/cspeterson/splatmoji.git 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ramnes/dotfiles 2 | 3 | These dotfiles do a lot of things, eh. 4 | 5 | They configure: 6 | * `git` 7 | * `ssh` 8 | * `qtile` 9 | * `yabai` 10 | * `roxterm` 11 | * `bash` 12 | * `emacs` 13 | * `tmux` 14 | * `htop` 15 | * `rofi` 16 | 17 | They use: 18 | * `pip` 19 | * `go` 20 | * `virtualenv` 21 | * `feh` 22 | * `setxkbmap` 23 | * `xrandr` 24 | * `autorandr` 25 | * `nm-applet` 26 | * `redshift` 27 | * `gnome-screenshot` 28 | * `i3lock` 29 | * `jq` 30 | * `shpotify` 31 | 32 | They bundle: 33 | * `context-color`, that gives a different color for each output of a command 34 | * `kt` and `kctx`, for an easier administration of Kubernetes clusters 35 | (requires `kubectl`) 36 | * `mouserate`, that gives you your current mouse polling rate (requires `xev`) 37 | * `splatmoji`, to pick up fancy emojis (requires `rofi`, `xdotool` and `xsel`) 38 | * `spotify-dbus`, to control Spotify from the command line (requires `dbus`) 39 | * `tm`, to write on multiple servers shells at once (requires `tmux`) 40 | 41 | I will probably be too lazy to keep these lists up to date, so you should 42 | rather refer to the different files in tree, I tried to make it pretty 43 | explicit. `contrib/` contains all the bundled tools, `bin/` has the installer 44 | and stuff, and everything else is a configuration. 45 | 46 | 47 | ## Install 48 | 49 | ```sh 50 | $ git clone --recurse-submodules git@github.com:ramnes/dotfiles.git .dotfiles 51 | $ ./.dotfiles/bin/bootstrap.sh 52 | ``` 53 | 54 | This will create a lot of symbolic links in `/home/${USER}/`, and gently ask 55 | for authorization if it needs to overwrite anything. 56 | 57 | 58 | ## More 59 | 60 | Hereafter is a list of things you might want (or not) to add as root along with 61 | the installation of the dotfiles. 62 | 63 | In `/etc/environment`: 64 | 65 | ```sh 66 | GTK_IM_MODULE=cedilla 67 | QT_IM_MODULE=cedilla 68 | ``` 69 | 70 | In `/etc/X11/xorg.conf.d/10keyboard.conf`: 71 | 72 | ```sh 73 | Section "InputClass" 74 | Identifier "keyboard" 75 | MatchIsKeyboard "on" 76 | Option "XkbLayout" "us" 77 | Option "XkbVariant" "intl" 78 | Option "XkbOptions" "compose:lwin,ctrl:swap_lwin_lctl,caps:ctrl_modifier,shift:both_capslock_cancel" 79 | EndSection 80 | ``` 81 | 82 | In `/etc/X11/xorg.conf.d/40monitor.conf`: 83 | 84 | ```sh 85 | Section "Monitor" 86 | Identifier "eDP1" 87 | Modeline "1920x1080" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync 88 | Option "PreferredMode" "1920x1080" 89 | EndSection 90 | Section "Monitor" 91 | Identifier "DP1" 92 | Option "LeftOf" "eDP1" 93 | EndSection 94 | ``` 95 | 96 | In `/etc/X11/xorg.conf.d/50touchpad.conf`: 97 | 98 | ```sh 99 | Section "InputClass" 100 | Identifier "touchpad" 101 | MatchIsTouchpad "on" 102 | Option "NaturalScrolling" "on" 103 | EndSection 104 | ``` 105 | 106 | In `/etc/inittab` (yep, I'm still not using systemd), replace tty1 with: 107 | 108 | ``` 109 | c1:12345:respawn:/sbin/agetty --autologin --noclear 38400 tty1 linux 110 | ``` 111 | -------------------------------------------------------------------------------- /bash/config.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | stty ixany 3 | stty ixoff -ixon 4 | set -o ignoreeof 5 | 6 | export AWS_PAGER="" 7 | export AWS_PROFILE="$(cat ~/.aws/current-profile)" 8 | export EDITOR="emacs -nw" 9 | export GPG_TTY="$(tty)" 10 | export GIT_EDITOR="emacs -nw" 11 | export GOPATH="$HOME/.go" 12 | export KREW_ROOT="$HOME/.krew" 13 | export HISTCONTROL=ignoreboth:erasedups 14 | export HISTFILESIZE=-1 15 | export HISTSIZE=-1 16 | export HOMEBREW_NO_AUTO_UPDATE=1 17 | export LESS="-R -S -# 10" 18 | export LS_COLORS="or=41;01:mi=41;01" 19 | export NVM_DIR="$HOME/.nvm" 20 | export PYTHONDONTWRITEBYTECODE=1 21 | export PYTHONBREAKPOINT="ipdb.set_trace" 22 | export TERM="xterm-256color" 23 | export VISUAL=emacs 24 | export _ZO_ECHO=1 25 | 26 | # shellcheck disable=SC2206 27 | paths=( 28 | /opt/homebrew/bin 29 | /opt/homebrew/opt/coreutils/libexec/gnubin 30 | /opt/homebrew/opt/gnu-sed/libexec/gnubin 31 | /opt/homebrew/opt/ruby/bin 32 | /opt/homebrew/lib/ruby/gems/*/bin 33 | /opt/homebrew/Cellar/libpq/*/bin 34 | /usr/local/heroku/bin 35 | $GOPATH/bin 36 | $KREW_ROOT/bin 37 | $HOME/.cargo/bin 38 | $HOME/.emacs.d/bin 39 | $HOME/.local/bin 40 | $HOME/.krew/bin 41 | $HOME/Library/Python/*/bin 42 | $HOME/Library/pnpm/ 43 | ) 44 | for path in "${paths[@]}"; do 45 | PATH="$path:$PATH" 46 | done 47 | 48 | echo-and-run() { 49 | echo -e "$@" 50 | eval "$@" 51 | } 52 | 53 | source-if-exists() { 54 | if [[ -f "$1" ]] 55 | then 56 | # shellcheck source=/dev/null 57 | source "$1" 58 | fi 59 | } 60 | 61 | source-if-exists ~/.bash_aliases 62 | 63 | CONTEXT_COLOR="$(context-color -p)" 64 | FAIL_COLOR="\\[$(tput setaf 1)\\]" 65 | 66 | set-venv() { 67 | if [[ -d ".venv" ]] && [ ! "$AUTO_SOURCED_VENV" ]; 68 | then 69 | echo-and-run source .venv/bin/activate 70 | AUTO_SOURCED_VENV="$(pwd)" 71 | export AUTO_SOURCED_VENV 72 | elif [ "$AUTO_SOURCED_VENV" ] \ 73 | && { [[ ! "$(pwd)" =~ $AUTO_SOURCED_VENV ]] \ 74 | || [[ ! -d "$AUTO_SOURCED_VENV/.venv" ]]; } 75 | then 76 | echo-and-run deactivate 2> /dev/null 77 | unset AUTO_SOURCED_VENV 78 | fi 79 | } 80 | 81 | set-nvm() { 82 | if [[ -f ".nvmrc" ]] && [ ! "$AUTO_USED_NVMRC" ]; 83 | then 84 | fnm use 85 | AUTO_USED_NVMRC="$(pwd)" 86 | export AUTO_USED_NVMRC 87 | elif [ "$AUTO_USED_NVMRC" ] \ 88 | && { [[ ! "$(pwd)" =~ $AUTO_USED_NVMRC ]] \ 89 | || [[ ! -f "$AUTO_USED_NVMRC/.nvmrc" ]]; } 90 | then 91 | fnm use default 92 | unset AUTO_USED_NVMRC 93 | fi 94 | } 95 | 96 | set-prompt() { 97 | # shellcheck disable=SC2181 98 | if [[ "$?" != 0 ]] 99 | then 100 | color="$FAIL_COLOR" 101 | else 102 | color="$CONTEXT_COLOR" 103 | fi 104 | 105 | user="\\[\\e[37;1m\\]\\u" 106 | at="$color@" 107 | host="\\[\\e[37;1m\\]\\h" 108 | jobs="\\[\\e[0m\\]$color:\\j" 109 | path="\\[\\e[37;1m\\]$color\\w" 110 | 111 | set-venv 112 | if [[ "$VIRTUAL_ENV" ]] 113 | then 114 | venv="\\[\\e[38;5;242m\\]◌$(basename "$VIRTUAL_ENV") " 115 | else 116 | venv="" 117 | fi 118 | 119 | set-nvm 120 | if [[ "$AUTO_USED_NVMRC" ]] 121 | then 122 | nvm="\\[\\e[38;5;242m\\]$(node --version ) " 123 | else 124 | nvm="" 125 | fi 126 | 127 | if [[ -n "$(type -t __git_ps1)" ]] 128 | then 129 | git="\\[\\e[38;5;242m\\]$(__git_ps1 '⎇ %s ')" 130 | else 131 | git="" 132 | fi 133 | 134 | PS1="$user$at$host $jobs $path $venv$nvm$git\\[\\e[0m\\]" 135 | } 136 | 137 | load-env() { 138 | set -o allexport 139 | source-if-exists .env 140 | set +o allexport 141 | } 142 | 143 | set-title() { 144 | echo -ne "\033]0;$(whoami)@$(hostname) :$(jobs | wc -l) $(dirs)\007" 145 | } 146 | 147 | reload-history() { 148 | history -a 149 | history -r 150 | } 151 | 152 | PROMPT_COMMAND="set-prompt; load-env; set-title; reload-history; stty sane" 153 | 154 | shopt -s autocd 155 | shopt -s checkwinsize 156 | shopt -s cmdhist 157 | shopt -s extglob 158 | shopt -s globstar 159 | shopt -s histappend 160 | 161 | alias activate='. .venv/bin/activate 2>/dev/null || . .env/bin/activate 2>/dev/null' 162 | alias gr='cd $(git root)' 163 | alias clean='rm -vf $(find . -name "*~" -or -name "*.pyc" -or -name "*.pyo" -or -name "#*#" \ 164 | -or -name "*.class" -or -name "*_flymake.py" 2> /dev/null)' 165 | alias compose="docker compose --ansi always" 166 | alias dog='pygmentize -g' 167 | alias emacs-clean='rm -vf `find ~/.emacs.d/ | grep \.elc`' 168 | alias emacs-re="emacs-clean && emacs-compile" 169 | alias grep='grep --color=auto -I --line-buffered' 170 | alias killmosh='pgrep mosh-server | grep -v $(ps -o ppid --no-headers $$) | xargs kill &> /dev/null || true' 171 | alias lines='cat `find . -type f` | wc -l' 172 | alias loc='find . -not -path "*.git*" -not -path "*.venv*" -type f | xargs wc -l' 173 | alias ls='ls --color=auto -F' 174 | alias modprobe='modprobe --first-time' 175 | alias mv='mv -i' 176 | alias nautilus='nautilus --no-desktop' 177 | alias pytest='pytest --pdbcls=IPython.terminal.debugger:TerminalPdb' 178 | alias randpass='apg -MsNCL -m10' 179 | alias reactivate='deactivate; activate' 180 | alias reload='source ~/.bashrc' 181 | alias sudo='sudo -E ' 182 | alias spacer="command spacer --after 30 -d' ' -p1" 183 | alias tf="terraform" 184 | 185 | awsp() { 186 | profile=$(aws configure list-profiles | sk --prompt "Choose active AWS profile:" -m --bind enter:deselect-all+accept --pre-select-items "$AWS_PROFILE") 187 | if [[ "$profile" ]] 188 | then 189 | export AWS_PROFILE="$profile" 190 | echo "$profile" > ~/.aws/current-profile 191 | fi 192 | } 193 | 194 | diff() { 195 | colordiff -Nu "$@" | diff-highlight 196 | } 197 | 198 | hl() { 199 | # shellcheck disable=SC2145 200 | sed "s/\($@\)/$(tput setab 1)\1$(tput sgr0)/" 201 | } 202 | 203 | kt() { 204 | command kt "$@" -z 2,8,10,16,17,18,19,20,21,22,23,24,25,26,27 205 | } 206 | 207 | q() { 208 | shell-genie ask "$*" 209 | } 210 | 211 | csv_pp() { 212 | if [[ "$2" ]] 213 | then 214 | DELIMITER="$2" 215 | else 216 | DELIMITER="," 217 | fi 218 | column -s"$DELIMITER" -t < "$1" | less -#2 -N -S 219 | } 220 | 221 | emacs() { 222 | if [[ "$*" == *"--daemon"* || "$*" == *"--help"* || "$*" == *"--version"* || "$*" == *"--batch"* ]] 223 | then 224 | command emacs -nw "$@" 225 | else 226 | emacsclient --tty -c -nw -a= --socket-name=$(whoami) "$@" 227 | fi 228 | } 229 | 230 | files=( 231 | ~/.kctx.bash 232 | ~/.kns.bash 233 | ~/.kt.bash 234 | /usr/share/bash-completion/bash_completion 235 | /opt/homebrew/etc/profile.d/bash_completion.sh 236 | /opt/homebrew/share/google-cloud-sdk/path.bash.inc 237 | ) 238 | for file in "${files[@]}"; do 239 | source-if-exists "$file" 240 | done 241 | 242 | bash-re() { 243 | rm -f ~/.bashrc-contrib 244 | commands=( 245 | "fnm env" 246 | "fzf --bash" 247 | "gh completion -s bash" 248 | "mcfly init bash" 249 | "mcfly-fzf init bash" 250 | "qovery completion bash" 251 | "pulumi gen-completion bash" 252 | "ngrok completion" 253 | "zoxide init --cmd cd bash" 254 | "brew shellenv" 255 | "mise activate bash" 256 | "kaf completion bash" 257 | ) 258 | for command in "${commands[@]}"; do 259 | # shellcheck disable=SC1090 260 | echo-and-run "$command >> ~/.bashrc-contrib" 261 | done 262 | } 263 | 264 | if [[ ! -f ~/.bashrc-contrib ]] 265 | then 266 | bash-re 267 | fi 268 | source ~/.bashrc-contrib 269 | 270 | complete -C 'terraform' terraform 271 | complete -C 'terraform' tf 272 | complete -C 'aws_completer' aws 273 | complete -C 'gocomplete' go 274 | 275 | if [[ "$OSTYPE" == "darwin"* ]]; then 276 | ulimit -S -n unlimited 277 | fi 278 | 279 | tac "$HISTFILE" | awk '!x[$0]++' > /tmp/histfile && tac /tmp/histfile > "$HISTFILE" 280 | 281 | # keep this at the bottom, it needs to be evaluated after `complete` commands 282 | export COMP_WORDBREAKS=${COMP_WORDBREAKS//:} 283 | -------------------------------------------------------------------------------- /bash/profile.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ -f ~/.bashrc ]; then 3 | # shellcheck disable=SC1090 4 | . ~/.bashrc 5 | fi 6 | 7 | if [[ $(tty) == /dev/tty1 && ! $DISPLAY ]]; then 8 | exec xinit -- -ardelay 200 -arinterval 20 9 | fi 10 | -------------------------------------------------------------------------------- /bat: -------------------------------------------------------------------------------- 1 | --theme="Nord" 2 | --pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" 3 | --style="numbers,rule,snip" 4 | -------------------------------------------------------------------------------- /bin/bootstrap.bash: -------------------------------------------------------------------------------- 1 | cd $(dirname "$0")/.. 2 | 3 | function title() { 4 | echo 5 | echo "$(context-color 2> /dev/null) * $(tput bold; tput setaf 7)$1$(tput sgr0)" 6 | } 7 | 8 | title "Installing dotfiles" 9 | ./bin/install.bash && source ~/.bashrc 2> /dev/null 10 | 11 | title "Bootstrapping SSH" 12 | mkdir -p ~/.ssh/connections 13 | chmod 700 ~/.ssh 14 | cp -i ssh ~/.ssh/config 15 | 16 | title "Bootstrapping GPG" 17 | mkdir ~/.gnupg 18 | chmod 700 ~/.gnupg 19 | 20 | bash_path=$(which bash) 21 | title "Setting bash (${bash_path}) as the default shell" 22 | if finger $(whoami) | grep -q "${bash_path}" 23 | then 24 | echo "Skipping (already installed)" 25 | else 26 | grep -q "${bash_path}" /etc/shells || sudo sh -c "echo ${bash_path} >> /etc/shells" 27 | chsh -s "${bash_path}" 28 | fi 29 | 30 | title "Bootstrapping Bash" 31 | shopt -s expand_aliases 32 | source ~/.bashrc 33 | bash-re 34 | 35 | title "Bootstrapping Emacs" 36 | pip3 install --user -I ipython 37 | pip3 install --user -I flake8 38 | pip3 install --user -I black black-macchiato 39 | pip3 install --user -I ipdb 40 | go get github.com/nsf/gocode 41 | go get golang.org/x/tools/cmd/goimports 42 | emacs-re 43 | emacs --load ~/.emacs.d/init.el --batch -f "copilot-install-server" 44 | -------------------------------------------------------------------------------- /bin/install.bash: -------------------------------------------------------------------------------- 1 | function clean { 2 | echo $@ | xargs -p rm -rf 3 | } 4 | 5 | function install { 6 | origin=$(pwd)/$1 7 | destination=$2 8 | 9 | test $origin == $destination && return 10 | test -L $destination && test $origin == $(readlink $destination) && return 11 | test -e $(dirname $destination) || mkdir -vp $(dirname $destination) 12 | test -e $destination || test -L $destination && clean $destination 13 | test -e $destination || ln -vs $origin $destination 14 | } 15 | 16 | cd $(dirname $0)/.. 17 | install bash/config.bash ~/.bashrc 18 | install bash/profile.bash ~/.bash_profile 19 | install bat ~/.config/bat/config 20 | install colordiff ~/.colordiffrc 21 | install contrib/background.jpg ~/.background.jpg 22 | install contrib/context-color/context-color ~/.local/bin/context-color 23 | install contrib/diff-highlight ~/.local/bin/diff-highlight 24 | install contrib/kubectx/completion/kubectx.bash ~/.kctx.bash 25 | install contrib/kubectx/completion/kubens.bash ~/.kns.bash 26 | install contrib/kubectx/kubectx ~/.local/bin/kctx 27 | install contrib/kubectx/kubens ~/.local/bin/kns 28 | install contrib/kubetail/completion/kubetail.bash ~/.kt.bash 29 | install contrib/kubetail/kubetail ~/.local/bin/kt 30 | install contrib/mouserate.py ~/.local/bin/mouserate 31 | install contrib/splatmoji/splatmoji ~/.local/bin/splatmoji 32 | install contrib/spotify-dbus.bash ~/.local/bin/spotify-dbus 33 | install contrib/tm ~/.local/bin/tm 34 | install contrib/user-dirs.dirs ~/.config/user-dirs.dirs 35 | install curl ~/.curlrc 36 | install cursor/keybindings.json "~/Library/Application Support/Cursor/User/keybindings.json" 37 | install cursor/settings.json "~/Library/Application Support/Cursor/User/settings.json" 38 | install emacs ~/.emacs.d 39 | install gpg-agent ~/.gnupg/gpg-agent.conf 40 | install git/attributes ~/.gitattributes 41 | install git/config ~/.gitconfig 42 | install git/ignore ~/.gitignore 43 | install gtk/gtk3.css ~/.config/gtk-3.0/gtk.css 44 | install htop ~/.config/htop/htoprc 45 | install ipython ~/.ipython/profile_default/ipython_config.py 46 | install iterm2 ~/.config/iterm2/preferences/com.googlecode.iterm2.plist 47 | install linearmouse ~/.config/linearmouse/linearmouse.json 48 | install pip ~/.config/pip/pip.conf 49 | install qtile ~/.config/qtile 50 | install readline ~/.inputrc 51 | install rofi ~/.config/rofi 52 | install roxterm ~/.config/roxterm.sourceforge.net 53 | install skhd ~/.config/skhd 54 | install splatmoji ~/.config/splatmoji/splatmoji.config 55 | install tmux ~/.tmux.conf 56 | install urxvt ~/.Xresources 57 | install xinitrc ~/.xinitrc 58 | install xprofile ~/.xprofile 59 | install yabai ~/.config/yabai 60 | -------------------------------------------------------------------------------- /colordiff: -------------------------------------------------------------------------------- 1 | plain=off 2 | newtext=green 3 | oldtext=red 4 | diffstuff=darkcyan 5 | -------------------------------------------------------------------------------- /contrib/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ramnes/dotfiles/0d2ef8d9dc186aa69acc3723fa48b88e89db07e1/contrib/background.jpg -------------------------------------------------------------------------------- /contrib/diff-highlight: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | package DiffHighlight; 3 | 4 | use 5.008; 5 | use warnings FATAL => 'all'; 6 | use strict; 7 | 8 | # Highlight by reversing foreground and background. You could do 9 | # other things like bold or underline if you prefer. 10 | my @OLD_HIGHLIGHT = ( 11 | color_config('color.diff-highlight.oldnormal'), 12 | color_config('color.diff-highlight.oldhighlight', "\x1b[7m"), 13 | color_config('color.diff-highlight.oldreset', "\x1b[27m") 14 | ); 15 | my @NEW_HIGHLIGHT = ( 16 | color_config('color.diff-highlight.newnormal', $OLD_HIGHLIGHT[0]), 17 | color_config('color.diff-highlight.newhighlight', $OLD_HIGHLIGHT[1]), 18 | color_config('color.diff-highlight.newreset', $OLD_HIGHLIGHT[2]) 19 | ); 20 | 21 | my $RESET = "\x1b[m"; 22 | my $COLOR = qr/\x1b\[[0-9;]*m/; 23 | my $BORING = qr/$COLOR|\s/; 24 | 25 | my @removed; 26 | my @added; 27 | my $in_hunk; 28 | my $graph_indent = 0; 29 | 30 | our $line_cb = sub { print @_ }; 31 | our $flush_cb = sub { local $| = 1 }; 32 | 33 | # Count the visible width of a string, excluding any terminal color sequences. 34 | sub visible_width { 35 | local $_ = shift; 36 | my $ret = 0; 37 | while (length) { 38 | if (s/^$COLOR//) { 39 | # skip colors 40 | } elsif (s/^.//) { 41 | $ret++; 42 | } 43 | } 44 | return $ret; 45 | } 46 | 47 | # Return a substring of $str, omitting $len visible characters from the 48 | # beginning, where terminal color sequences do not count as visible. 49 | sub visible_substr { 50 | my ($str, $len) = @_; 51 | while ($len > 0) { 52 | if ($str =~ s/^$COLOR//) { 53 | next 54 | } 55 | $str =~ s/^.//; 56 | $len--; 57 | } 58 | return $str; 59 | } 60 | 61 | sub handle_line { 62 | my $orig = shift; 63 | local $_ = $orig; 64 | 65 | # match a graph line that begins a commit 66 | if (/^(?:$COLOR?\|$COLOR?[ ])* # zero or more leading "|" with space 67 | $COLOR?\*$COLOR?[ ] # a "*" with its trailing space 68 | (?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|" 69 | [ ]* # trailing whitespace for merges 70 | /x) { 71 | my $graph_prefix = $&; 72 | 73 | # We must flush before setting graph indent, since the 74 | # new commit may be indented differently from what we 75 | # queued. 76 | flush(); 77 | $graph_indent = visible_width($graph_prefix); 78 | 79 | } elsif ($graph_indent) { 80 | if (length($_) < $graph_indent) { 81 | $graph_indent = 0; 82 | } else { 83 | $_ = visible_substr($_, $graph_indent); 84 | } 85 | } 86 | 87 | if (!$in_hunk) { 88 | $line_cb->($orig); 89 | $in_hunk = /^$COLOR*\@\@ /; 90 | } 91 | elsif (/^$COLOR*-/) { 92 | push @removed, $orig; 93 | } 94 | elsif (/^$COLOR*\+/) { 95 | push @added, $orig; 96 | } 97 | else { 98 | flush(); 99 | $line_cb->($orig); 100 | $in_hunk = /^$COLOR*[\@ ]/; 101 | } 102 | 103 | # Most of the time there is enough output to keep things streaming, 104 | # but for something like "git log -Sfoo", you can get one early 105 | # commit and then many seconds of nothing. We want to show 106 | # that one commit as soon as possible. 107 | # 108 | # Since we can receive arbitrary input, there's no optimal 109 | # place to flush. Flushing on a blank line is a heuristic that 110 | # happens to match git-log output. 111 | if (!length) { 112 | $flush_cb->(); 113 | } 114 | } 115 | 116 | sub flush { 117 | # Flush any queued hunk (this can happen when there is no trailing 118 | # context in the final diff of the input). 119 | show_hunk(\@removed, \@added); 120 | @removed = (); 121 | @added = (); 122 | } 123 | 124 | sub highlight_stdin { 125 | while () { 126 | handle_line($_); 127 | } 128 | flush(); 129 | } 130 | 131 | # Ideally we would feed the default as a human-readable color to 132 | # git-config as the fallback value. But diff-highlight does 133 | # not otherwise depend on git at all, and there are reports 134 | # of it being used in other settings. Let's handle our own 135 | # fallback, which means we will work even if git can't be run. 136 | sub color_config { 137 | my ($key, $default) = @_; 138 | my $s = `git config --get-color $key 2>/dev/null`; 139 | return length($s) ? $s : $default; 140 | } 141 | 142 | sub show_hunk { 143 | my ($a, $b) = @_; 144 | 145 | # If one side is empty, then there is nothing to compare or highlight. 146 | if (!@$a || !@$b) { 147 | $line_cb->(@$a, @$b); 148 | return; 149 | } 150 | 151 | # If we have mismatched numbers of lines on each side, we could try to 152 | # be clever and match up similar lines. But for now we are simple and 153 | # stupid, and only handle multi-line hunks that remove and add the same 154 | # number of lines. 155 | if (@$a != @$b) { 156 | $line_cb->(@$a, @$b); 157 | return; 158 | } 159 | 160 | my @queue; 161 | for (my $i = 0; $i < @$a; $i++) { 162 | my ($rm, $add) = highlight_pair($a->[$i], $b->[$i]); 163 | $line_cb->($rm); 164 | push @queue, $add; 165 | } 166 | $line_cb->(@queue); 167 | } 168 | 169 | sub highlight_pair { 170 | my @a = split_line(shift); 171 | my @b = split_line(shift); 172 | 173 | # Find common prefix, taking care to skip any ansi 174 | # color codes. 175 | my $seen_plusminus; 176 | my ($pa, $pb) = (0, 0); 177 | while ($pa < @a && $pb < @b) { 178 | if ($a[$pa] =~ /$COLOR/) { 179 | $pa++; 180 | } 181 | elsif ($b[$pb] =~ /$COLOR/) { 182 | $pb++; 183 | } 184 | elsif ($a[$pa] eq $b[$pb]) { 185 | $pa++; 186 | $pb++; 187 | } 188 | elsif (!$seen_plusminus && $a[$pa] eq '-' && $b[$pb] eq '+') { 189 | $seen_plusminus = 1; 190 | $pa++; 191 | $pb++; 192 | } 193 | else { 194 | last; 195 | } 196 | } 197 | 198 | # Find common suffix, ignoring colors. 199 | my ($sa, $sb) = ($#a, $#b); 200 | while ($sa >= $pa && $sb >= $pb) { 201 | if ($a[$sa] =~ /$COLOR/) { 202 | $sa--; 203 | } 204 | elsif ($b[$sb] =~ /$COLOR/) { 205 | $sb--; 206 | } 207 | elsif ($a[$sa] eq $b[$sb]) { 208 | $sa--; 209 | $sb--; 210 | } 211 | else { 212 | last; 213 | } 214 | } 215 | 216 | if (is_pair_interesting(\@a, $pa, $sa, \@b, $pb, $sb)) { 217 | return highlight_line(\@a, $pa, $sa, \@OLD_HIGHLIGHT), 218 | highlight_line(\@b, $pb, $sb, \@NEW_HIGHLIGHT); 219 | } 220 | else { 221 | return join('', @a), 222 | join('', @b); 223 | } 224 | } 225 | 226 | # we split either by $COLOR or by character. This has the side effect of 227 | # leaving in graph cruft. It works because the graph cruft does not contain "-" 228 | # or "+" 229 | sub split_line { 230 | local $_ = shift; 231 | return utf8::decode($_) ? 232 | map { utf8::encode($_); $_ } 233 | map { /$COLOR/ ? $_ : (split //) } 234 | split /($COLOR+)/ : 235 | map { /$COLOR/ ? $_ : (split //) } 236 | split /($COLOR+)/; 237 | } 238 | 239 | sub highlight_line { 240 | my ($line, $prefix, $suffix, $theme) = @_; 241 | 242 | my $start = join('', @{$line}[0..($prefix-1)]); 243 | my $mid = join('', @{$line}[$prefix..$suffix]); 244 | my $end = join('', @{$line}[($suffix+1)..$#$line]); 245 | 246 | # If we have a "normal" color specified, then take over the whole line. 247 | # Otherwise, we try to just manipulate the highlighted bits. 248 | if (defined $theme->[0]) { 249 | s/$COLOR//g for ($start, $mid, $end); 250 | chomp $end; 251 | return join('', 252 | $theme->[0], $start, $RESET, 253 | $theme->[1], $mid, $RESET, 254 | $theme->[0], $end, $RESET, 255 | "\n" 256 | ); 257 | } else { 258 | return join('', 259 | $start, 260 | $theme->[1], $mid, $theme->[2], 261 | $end 262 | ); 263 | } 264 | } 265 | 266 | # Pairs are interesting to highlight only if we are going to end up 267 | # highlighting a subset (i.e., not the whole line). Otherwise, the highlighting 268 | # is just useless noise. We can detect this by finding either a matching prefix 269 | # or suffix (disregarding boring bits like whitespace and colorization). 270 | sub is_pair_interesting { 271 | my ($a, $pa, $sa, $b, $pb, $sb) = @_; 272 | my $prefix_a = join('', @$a[0..($pa-1)]); 273 | my $prefix_b = join('', @$b[0..($pb-1)]); 274 | my $suffix_a = join('', @$a[($sa+1)..$#$a]); 275 | my $suffix_b = join('', @$b[($sb+1)..$#$b]); 276 | 277 | return visible_substr($prefix_a, $graph_indent) !~ /^$COLOR*-$BORING*$/ || 278 | visible_substr($prefix_b, $graph_indent) !~ /^$COLOR*\+$BORING*$/ || 279 | $suffix_a !~ /^$BORING*$/ || 280 | $suffix_b !~ /^$BORING*$/; 281 | } 282 | 283 | package main; 284 | 285 | # Some scripts may not realize that SIGPIPE is being ignored when launching the 286 | # pager--for instance scripts written in Python. 287 | $SIG{PIPE} = 'DEFAULT'; 288 | 289 | DiffHighlight::highlight_stdin(); 290 | exit 0; 291 | -------------------------------------------------------------------------------- /contrib/mouserate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """xev output data parser to get mouse polling rate. 3 | 4 | Usage: 5 | $ chmod a+x mouserate 6 | $ xev | mouserate 7 | """ 8 | import sys 9 | import re 10 | 11 | previous = 0 12 | time_re = re.compile('time (\d+)') 13 | 14 | while True: 15 | line = sys.stdin.readline() 16 | match = time_re.search(line) 17 | if match: 18 | time = int(match.group(1)) 19 | if previous: 20 | try: 21 | rate = round(1000 / (time - previous), 2) 22 | print("{:.2f}Hz".format(rate)) 23 | sys.stdout.flush() 24 | except ZeroDivisionError: 25 | pass 26 | previous = time 27 | -------------------------------------------------------------------------------- /contrib/spotify-dbus.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Collect DBUS_SESSION_BUS_ADDRESS from running process 4 | function set_dbus_adress 5 | { 6 | USER=$1 7 | PROCESS=$2 8 | PID=`pgrep -o -u $USER $PROCESS` 9 | ENVIRON=/proc/$PID/environ 10 | 11 | if [ -e $ENVIRON ] 12 | then 13 | export `grep -z DBUS_SESSION_BUS_ADDRESS $ENVIRON` 14 | else 15 | echo "Unable to set DBUS_SESSION_BUS_ADDRESS." 16 | exit 1 17 | fi 18 | } 19 | 20 | function spotify_cmd 21 | { 22 | dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.$1 1> /dev/null 23 | } 24 | 25 | function spotify_query 26 | { 27 | qdbus org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player PlaybackStatus 28 | } 29 | 30 | function quit_message 31 | { 32 | echo "Usage: `basename $0` {play|pause|playpause|next|previous|stop|playstatus|}" 33 | exit 1 34 | } 35 | 36 | # Count arguments, must be 1 37 | if [ "$#" -ne "1" ] 38 | then 39 | echo -e "You must supply exactly one argument!\n" 40 | quit_message 41 | fi 42 | 43 | # Check if DBUS_SESSION is set 44 | if [ -z $DBUS_SESSION_BUS_ADDRESS ] 45 | then 46 | #echo "DBUS_SESSION_BUS_ADDRESS not set. Guessing." 47 | set_dbus_adress `whoami` spotify 48 | fi 49 | 50 | case "$1" in 51 | play) 52 | spotify_cmd Play 53 | ;; 54 | pause) 55 | spotify_cmd Pause 56 | ;; 57 | playpause) 58 | spotify_cmd PlayPause 59 | ;; 60 | next) 61 | spotify_cmd Next 62 | ;; 63 | previous) 64 | spotify_cmd Previous 65 | ;; 66 | stop) 67 | spotify_cmd Stop 68 | ;; 69 | spotify:user:*) 70 | spotify_cmd "OpenUri string:$1" 71 | spotify_cmd Play 72 | ;; 73 | spotify:*:*) 74 | spotify_cmd "OpenUri string:$1" 75 | ;; 76 | playstatus) 77 | spotify_query 78 | ;; 79 | *) 80 | echo -e "Bad argument.\n" 81 | quit_message 82 | ;; 83 | esac 84 | 85 | exit 0 86 | -------------------------------------------------------------------------------- /contrib/tm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2011, 2012, 2013, 2014 Joerg Jaspert 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions 7 | # are met: 8 | # . 9 | # 1. Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # 2. Redistributions in binary form must reproduce the above copyright 12 | # notice, this list of conditions and the following disclaimer in the 13 | # documentation and/or other materials provided with the distribution. 14 | # . 15 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | 26 | # Always exit on errors 27 | set -e 28 | # Undefined variables, we don't like you 29 | set -u 30 | # ERR traps are inherited by shell functions, command substitutions and 31 | # commands executed in a subshell environment. 32 | set -E 33 | 34 | ######################################################################## 35 | # The following variables can be overwritten outside the script. 36 | # 37 | 38 | # We want a useful tmpdir, so set one if it isn't already. Thats the 39 | # place where tmux puts its socket, so you want to ensure it doesn't 40 | # change under your feet - like for those with a daily-changing tmpdir 41 | # in their home... 42 | declare -r TMPDIR=${TMPDIR:-"/tmp"} 43 | 44 | # Do you want me to sort the arguments when opening an ssh/multi-ssh session? 45 | # The only use of the sorted list is for the session name, to allow you to 46 | # get the same session again no matter how you order the hosts on commandline. 47 | declare -r TMSORT=${TMSORT:-"true"} 48 | 49 | # Want some extra options given to tmux? Define TMOPTS in your environment. 50 | # Note, this is only used in the final tmux call where we actually 51 | # attach to the session! 52 | TMOPTS=${TMOPTS:-"-2"} 53 | 54 | # The following directory can hold session config for us, so you can use them 55 | # as a shortcut. 56 | declare -r TMDIR=${TMDIR:-"${HOME}/.tmux.d"} 57 | 58 | # Should we prepend the hostname to autogenerated session names? 59 | # Example: Call tm ms host1 host2. 60 | # TMSESSHOST=true -> session name is HOSTNAME_host1_host2 61 | # TMSESSHOST=false -> session name is host1_host2 62 | declare -r TMSESSHOST=${TMSESSHOST:-"true"} 63 | 64 | # Allow to globally define a custom ssh command line. 65 | TMSSHCMD=${TMSSHCMD:-"ssh"} 66 | 67 | # Save the last argument, it may be used (traditional style) for 68 | # replacing 69 | args=$# 70 | TMREPARG=${!args} 71 | 72 | # Where does your tmux starts numbering its windows? Mine does at 1, 73 | # default for tmux is 0. We try to find it out, but if we fail, (as we 74 | # only check $HOME/.tmux.conf you can set this variable to whatever it 75 | # is for your environment. 76 | if [[ -f ${HOME}/.tmux.conf ]]; then 77 | bindex=$(grep ' base-index ' ${HOME}/.tmux.conf || echo 0 ) 78 | bindex=${bindex//* } 79 | else 80 | bindex=0 81 | fi 82 | declare -r TMWIN=${TMWIN:-$bindex} 83 | unset bindex 84 | 85 | ######################################################################## 86 | # Nothing below here to configure 87 | 88 | # Should we open another session, even if we already have one with 89 | # this name? (Ie. second multisession to the same set of hosts) 90 | # This is either set by the getopts option -n or by having -n 91 | # as very first parameter after the tm command 92 | if [[ $# -ge 1 ]] && [[ "${1}" = "-n" ]]; then 93 | DOUBLENAME=true 94 | # And now get rid of it. getopts won't see it, as it was first and 95 | # we remove it - but it doesn't matter, we set it already. 96 | # getopts is only used if it appears somewhere else in the 97 | # commandline 98 | shift 99 | else 100 | DOUBLENAME=false 101 | fi 102 | 103 | # Store the first commandline parameter 104 | cmdline=${1:-""} 105 | 106 | # Get the tmux version and split it in major/minor 107 | TMUXVERS=$(tmux -V 2>/dev/null || echo "tmux 1.3") 108 | declare -r TMUXVERS=${TMUXVERS##* } 109 | declare -r TMUXMAJOR=${TMUXVERS%%.*} 110 | declare -r TMUXMINOR=${TMUXVERS##*.} 111 | 112 | # Save IFS 113 | declare -r OLDIFS=${IFS} 114 | 115 | # To save session file data 116 | TMDATA="" 117 | 118 | # Freeform .cfg file or other session file? 119 | TMSESCFG="" 120 | 121 | ######################################################################## 122 | function usage() { 123 | echo "tmux helper by Joerg Jaspert " 124 | echo "There are two ways to call it. Traditional and \"getopts\" style." 125 | echo "Traditional call as: $0 CMD [host]...[host]" 126 | echo "Getopts call as: $0 [-s host] [-m hostlist] [-l] [-n] [-h] [-c config] [-e]" 127 | echo "" 128 | echo "Traditional:" 129 | echo "CMD is one of" 130 | echo " ls List running sessions" 131 | echo " s Open ssh session to host" 132 | echo " ms Open multi ssh sessions to hosts, synchronizing input" 133 | echo " To open a second session to the same set of hosts put a" 134 | echo " -n in front of ms" 135 | echo " \$anything Either plain tmux session with name of \$anything or" 136 | echo " session according to TMDIR file" 137 | echo "" 138 | echo "Getopts style:" 139 | echo "-l List running sessions" 140 | echo "-s host Open ssh session to host" 141 | echo "-m hostlist Open multi ssh sessions to hosts, synchronizing input" 142 | echo " Due to the way getopts works, hostlist must be enclosed in \"\"" 143 | echo "-n Open a second session to the same set of hosts" 144 | echo "-c config Setup session according to TMDIR file" 145 | echo "-e SESSION Use existion session named SESSION" 146 | echo "-r REPLACE Value to use for replacing in session files" 147 | echo "" 148 | echo "TMDIR file:" 149 | echo "Each file in \$TMDIR defines a tmux session. There are two types of files," 150 | echo "those without an extension and those with the extension \".cfg\" (no \"\")." 151 | echo "The filename corresponds to the commandline \$anything (or -c)." 152 | echo "" 153 | echo "Content of extensionless files is defined as:" 154 | echo " First line: Session name" 155 | echo " Second line: extra tmux commandline options" 156 | echo " Any following line: A hostname to open a shell with in the normal" 157 | echo " ssh syntax. (ie [user@]hostname)" 158 | echo "" 159 | echo "Content of .cfg files is defined as:" 160 | echo " First line: Session name" 161 | echo " Second line: extra tmux commandline options" 162 | echo " Third line: The new-session command to use. Place NONE here if you want plain" 163 | echo " defaults, though that may mean just a shell. Otherwise put the full" 164 | echo " new-session command with all options you want here." 165 | echo " Any following line: Any tmux command you can find in the tmux manpage." 166 | echo " You should ensure that commands arrive at the right tmux session / window." 167 | echo " To help you with this, there are some variables available which you" 168 | echo " can use, they are replaced with values right before commands are executed:" 169 | echo " SESSION - replaced with the session name" 170 | echo " TMWIN - see below for explanation of TMWIN Environment variable" 171 | echo "" 172 | echo "NOTE: Both types of files accept external listings of hostnames." 173 | echo " That is, the output of any shell command given will be used as a list" 174 | echo " of hostnames to connect to (or a set of tmux commands to run)." 175 | echo "" 176 | echo "NOTE: Session files can include the Token ++TMREPLACETM++ at any point. This" 177 | echo " will be replaced by the value of the -r option (if you use getopts style) or" 178 | echo " by the LAST argument on the line if you use traditional calling." 179 | echo " Note that with traditional calling, the argument will also be tried as a hostname," 180 | echo " so it may not make much sense there, unless using a session file that contains" 181 | echo " solely of LIST commands." 182 | echo "" 183 | echo "Environment variables recognized by this script:" 184 | echo "TMPDIR - Where tmux stores its session information" 185 | echo " DEFAULT: If unset: /tmp" 186 | echo "TMSORT - Should ms sort the hostnames, so it always opens the same" 187 | echo " session, no matter in which order hostnames are presented" 188 | echo " DEFAULT: true" 189 | echo "TMOPTS - Extra options to give to the tmux call" 190 | echo " Note that this ONLY affects the final tmux call to attach" 191 | echo " to the session, not to the earlier ones creating it" 192 | echo " DEFAULT: -2" 193 | echo "TMDIR - Where are session information files stored" 194 | echo " DEFAULT: ${HOME}/.tmux.d" 195 | echo "TMWIN - Where does your tmux starts numbering its windows?" 196 | echo " This script tries to find the information in your config," 197 | echo " but as it only checks $HOME/.tmux.conf it might fail". 198 | echo " So if your window numbers start at anything different to 0," 199 | echo " like mine do at 1, then you can set TMWIN to 1" 200 | echo "TMSESSHOST - Should the hostname appear in session names?" 201 | echo " DEFAULT: true" 202 | echo "TMSSHCMD - Allow to globally define a custom ssh command line." 203 | echo " This can be just the command or any option one wishes to have" 204 | echo " everywhere." 205 | echo " DEFAULT: ssh" 206 | echo "" 207 | exit 42 208 | } 209 | 210 | # Simple "cleanup" of a variable, removing space and dots as we don't 211 | # want them in our tmux session name 212 | function clean_session() { 213 | local toclean=${*:-""} 214 | 215 | # Neither space nor dot nor : or " are friends in the SESSION name 216 | toclean=${toclean// /_} 217 | toclean=${toclean//:/_} 218 | toclean=${toclean//\"/} 219 | echo ${toclean//./_} 220 | } 221 | 222 | # Merge the commandline parameters (hosts) into a usable session name 223 | # for tmux 224 | function ssh_sessname() { 225 | if [[ ${TMSORT} = true ]]; then 226 | local one=$1 227 | # get rid of first argument (s|ms), we don't want to sort this 228 | shift 229 | local sess=$(for i in $*; do echo $i; done | sort | tr '\n' ' ') 230 | sess="${one} ${sess% *}" 231 | else 232 | # no sorting wanted 233 | local sess="${*}" 234 | fi 235 | clean_session ${sess} 236 | } 237 | 238 | # Setup functions for all tmux commands 239 | function setup_command_aliases() { 240 | local command 241 | local SESNAME 242 | SESNAME="tmlscm$$" 243 | # Debian Bug #718777 - tmux needs a session to have lscm work 244 | tmux new-session -d -s ${SESNAME} -n "check" "sleep 3" 245 | for command in $(tmux list-commands|awk '{print $1}'); do 246 | eval "$(echo "tm_$command() { tmux $command \"\$@\" >/dev/null; }")" 247 | done 248 | tmux kill-session -t ${SESNAME} || true 249 | } 250 | 251 | # Run a command (function) after replacing variables 252 | function do_cmd() { 253 | local cmd=$@ 254 | cmd=${cmd//SESSION/$SESSION} 255 | cmd=${cmd//TMWIN/$TMWIN} 256 | cmd1=${cmd%% *} 257 | cmd=${cmd/$cmd1 /} 258 | eval tm_$cmd1 $cmd 259 | } 260 | 261 | # Use a configuration file to setup the tmux parameters/session 262 | function own_config() { 263 | if [[ ${1} =~ .cfg$ ]]; then 264 | TMSESCFG="free" 265 | setup_command_aliases 266 | fi 267 | 268 | # Set IFS to be NEWLINE only, not also space/tab, as our input files 269 | # are \n seperated (one entry per line) and lines may well have spaces. 270 | local IFS=" 271 | " 272 | # Fill an array with our config 273 | TMDATA=( $(cat "${TMDIR}/$1" | sed -e "s/++TMREPLACETM++/${TMREPARG}/g") ) 274 | # Restore IFS 275 | IFS=${OLDIFS} 276 | 277 | SESSION=$(clean_session ${TMDATA[0]}) 278 | 279 | if [ "${TMDATA[1]}" != "NONE" ]; then 280 | TMOPTS=${TMDATA[1]} 281 | fi 282 | 283 | # Seperate the lines we work with 284 | local IFS="" 285 | local -a workdata=(${TMDATA[@]:2}) 286 | IFS=${OLDIFS} 287 | 288 | # Lines (starting with line 3) may start with LIST, then we get 289 | # the list of hosts from elsewhere. So if one does, we exec the 290 | # command given, then append the output to TMDATA - while deleting 291 | # the actual line with LIST in. 292 | 293 | local TMPDATA=$(mktemp -u -p ${TMPDIR} .tmux_tm_XXXXXXXXXX) 294 | trap "rm -f ${TMPDATA}" EXIT ERR HUP INT QUIT TERM 295 | 296 | local index=0 297 | while [[ ${index} -lt ${#workdata[@]} ]]; do 298 | if [[ "${workdata[${index}]}" =~ ^LIST\ (.*)$ ]]; then 299 | # printf -- 'workdata: %s\n' "${workdata[@]}" 300 | local cmd=${BASH_REMATCH[1]} 301 | echo "Line ${index}: Fetching hostnames using provided shell command '${cmd}', please stand by..." 302 | 303 | $( ${cmd} >| "${TMPDATA}" ) 304 | 305 | # Set IFS to be NEWLINE only, not also space/tab, the list may have ssh options 306 | # and what not, so \n is our seperator, not more. 307 | IFS=" 308 | " 309 | out=( $(cat "${TMPDATA}") ) 310 | # Restore IFS 311 | IFS=${OLDIFS} 312 | 313 | workdata=( "${workdata[@]}" "${out[@]}" ) 314 | unset workdata[${index}] 315 | unset out 316 | # printf -- 'workdata: %s\n' "${workdata[@]}" 317 | elif [[ "${workdata[${index}]}" =~ ^SSHCMD\ (.*)$ ]]; then 318 | TMSSHCMD=${BASH_REMATCH[1]} 319 | fi 320 | index=$(( index + 1 )) 321 | done 322 | rm -f "${TMPDATA}" 323 | trap - EXIT ERR HUP INT QUIT TERM 324 | TMDATA=( "${TMDATA[@]:0:2}" "${workdata[@]}" ) 325 | } 326 | 327 | # Simple overview of running sessions 328 | function list_sessions() { 329 | local IFS="" 330 | if output=$(tmux list-sessions 2>/dev/null); then 331 | echo $output 332 | else 333 | echo "No tmux sessions available" 334 | fi 335 | } 336 | 337 | ######################################################################## 338 | # MAIN work follows here 339 | # Check the first cmdline parameter, we might want to prepare something 340 | case ${cmdline} in 341 | ls) 342 | list_sessions 343 | exit 0 344 | ;; 345 | s|ms) 346 | # Yay, we want ssh to a remote host - or even a multi session setup 347 | # So we have to prepare our session name to fit in what tmux (and shell) 348 | # allow us to have. And so that we can reopen an existing session, if called 349 | # with the same hosts again. 350 | SESSION=$(ssh_sessname $@) 351 | declare -r cmdline 352 | shift 353 | ;; 354 | -*) 355 | while getopts "lnhs:m:c:e:r:" OPTION; do 356 | case ${OPTION} in 357 | l) # ls 358 | list_sessions 359 | exit 0 360 | ;; 361 | s) # ssh 362 | SESSION=$(ssh_sessname s ${OPTARG}) 363 | declare -r cmdline=s 364 | shift 365 | ;; 366 | m) # ms (needs hostnames in "") 367 | SESSION=$(ssh_sessname ms ${OPTARG}) 368 | declare -r cmdline=ms 369 | shift 370 | ;; 371 | c) # pre-defined config 372 | own_config ${OPTARG} 373 | ;; 374 | e) # existing session name 375 | SESSION=$(clean_session ${OPTARG}) 376 | ;; 377 | n) # new session even if same name one already exists 378 | DOUBLENAME=true 379 | ;; 380 | r) # replacement arg 381 | TMREPARG=${OPTARG} 382 | ;; 383 | h) 384 | usage 385 | ;; 386 | esac 387 | done 388 | ;; 389 | *) 390 | # Nothing special (or something in our tmux.d) 391 | if [ $# -lt 1 ]; then 392 | SESSION=${SESSION:-""} 393 | if [[ -n "${SESSION}" ]]; then 394 | # Environment has SESSION set, wherever from. So lets 395 | # see if its an actual tmux session 396 | if ! tmux has-session -t "${SESSION}" 2>/dev/null; then 397 | # It is not. And no argument. Show usage 398 | usage 399 | fi 400 | else 401 | usage 402 | fi 403 | elif [ -r "${TMDIR}/${cmdline}" ]; then 404 | own_config $1 405 | else 406 | # Not a config file, so just session name. 407 | SESSION=${cmdline} 408 | fi 409 | ;; 410 | esac 411 | 412 | # And now check if we would end up with a doubled session name. 413 | # If so add something "random" to the new name, like our pid. 414 | if [[ ${DOUBLENAME} == true ]] && tmux has-session -t ${SESSION} 2>/dev/null; then 415 | # Session exist but we are asked to open another one, 416 | # so adjust our session name 417 | if [[ ${#TMDATA} -eq 0 ]] && [[ ${SESSION} =~ ([ms]+)_(.*) ]]; then 418 | SESSION="${BASH_REMATCH[1]}_$$_${BASH_REMATCH[2]}" 419 | else 420 | SESSION="$$_${SESSION}" 421 | fi 422 | fi 423 | 424 | if [[ ${TMSESSHOST} = true ]]; then 425 | declare -r SESSION="$(uname -n|cut -d. -f1)_${SESSION}" 426 | else 427 | declare -r SESSION 428 | fi 429 | 430 | # We only do special work if the SESSION does not already exist. 431 | if ! tmux has-session -t ${SESSION} 2>/dev/null; then 432 | # In case we want some extra things... 433 | # Check stupid users 434 | if [ $# -lt 1 ]; then 435 | usage 436 | fi 437 | case ${cmdline} in 438 | s) 439 | # The user wants to open ssh to one or more hosts 440 | tmux new-session -d -s ${SESSION} -n "${1}" "${TMSSHCMD} ${1}" 441 | # We disable any automated renaming, as that lets tmux set 442 | # the pane title to the process running in the pane. Which 443 | # means you can end up with tons of "bash". With this 444 | # disabled you will have panes named after the host. 445 | tmux set-window-option -t ${SESSION} automatic-rename off >/dev/null 446 | # If we have at least tmux 1.7, allow-rename works, such also disabling 447 | # any rename based on shell escape codes. 448 | if [ ${TMUXMINOR//[!0-9]/} -ge 7 ] || [ ${TMUXMAJOR//[!0-9]/} -gt 1 ]; then 449 | tmux set-window-option -t ${SESSION} allow-rename off >/dev/null 450 | fi 451 | shift 452 | count=2 453 | while [ $# -gt 0 ]; do 454 | tmux new-window -d -t ${SESSION}:${count} -n "${1}" "${TMSSHCMD} ${1}" 455 | tmux set-window-option -t ${SESSION}:${count} automatic-rename off >/dev/null 456 | # If we have at least tmux 1.7, allow-rename works, such also disabling 457 | # any rename based on shell escape codes. 458 | if [ ${TMUXMINOR//[!0-9]/} -ge 7 ] || [ ${TMUXMAJOR//[!0-9]/} -gt 1 ]; then 459 | tmux set-window-option -t ${SESSION}:${count} allow-rename off >/dev/null 460 | fi 461 | count=$(( count + 1 )) 462 | shift 463 | done 464 | ;; 465 | ms) 466 | # We open a multisession window. That is, we tile the window as many times 467 | # as we have hosts, display them all and have the user input send to all 468 | # of them at once. 469 | tmux new-session -d -s ${SESSION} -n "Multisession" "${TMSSHCMD} ${1}" 470 | shift 471 | while [ $# -gt 0 ]; do 472 | tmux split-window -d -t ${SESSION}:${TMWIN} "${TMSSHCMD} ${1}" 473 | # Always have tmux redo the layout, so all windows are evenly sized. 474 | # Otherwise you quickly end up with tmux telling you there is no 475 | # more space available for tiling - and also very different amount 476 | # of visible space per host. 477 | tmux select-layout -t ${SESSION}:${TMWIN} main-horizontal >/dev/null 478 | shift 479 | done 480 | # Now synchronize them 481 | tmux set-window-option -t ${SESSION}:${TMWIN} synchronize-pane >/dev/null 482 | # And set a final layout which ensures they all have about the same size 483 | tmux select-layout -t ${SESSION}:${TMWIN} tiled >/dev/null 484 | ;; 485 | *) 486 | # Whatever string, so either a plain session or something from our tmux.d 487 | if [ -z "${TMDATA}" ]; then 488 | # the easy case, just a plain session name 489 | tmux new-session -d -s ${SESSION} 490 | else 491 | # data in our data array, the user wants his own config 492 | if [[ ${TMSESCFG} = free ]]; then 493 | if [[ ${TMDATA[2]} = NONE ]]; then 494 | # We have a free form config where we get the actual tmux commands 495 | # supplied by the user, so just issue them after creating the session. 496 | tmux new-session -d -s ${SESSION} -n "${TMDATA[0]}" 497 | else 498 | do_cmd ${TMDATA[2]} 499 | fi 500 | tmcount=${#TMDATA[@]} 501 | index=3 502 | while [ ${index} -lt ${tmcount} ]; do 503 | do_cmd ${TMDATA[$index]} 504 | (( index++ )) 505 | done 506 | else 507 | # So lets start with the "first" line, before dropping into a loop 508 | tmux new-session -d -s ${SESSION} -n "${TMDATA[0]}" "${TMSSHCMD} ${TMDATA[2]}" 509 | 510 | tmcount=${#TMDATA[@]} 511 | index=3 512 | while [ ${index} -lt ${tmcount} ]; do 513 | # List of hostnames, open a new connection per line 514 | tmux split-window -d -t ${SESSION}:${TMWIN} "${TMSSHCMD} ${TMDATA[$index]}" 515 | # Always have tmux redo the layout, so all windows are evenly sized. 516 | # Otherwise you quickly end up with tmux telling you there is no 517 | # more space available for tiling - and also very different amount 518 | # of visible space per host. 519 | tmux select-layout -t ${SESSION}:${TMWIN} main-horizontal >/dev/null 520 | (( index++ )) 521 | done 522 | # Now synchronize them 523 | tmux set-window-option -t ${SESSION}:${TMWIN} synchronize-pane >/dev/null 524 | # And set a final layout which ensures they all have about the same size 525 | tmux select-layout -t ${SESSION}:${TMWIN} tiled >/dev/null 526 | fi 527 | fi 528 | ;; 529 | esac 530 | # Build up new session, ensure we start in the first window 531 | tmux select-window -t ${SESSION}:${TMWIN} 532 | fi 533 | 534 | # And last, but not least, attach to it 535 | tmux ${TMOPTS} attach -t ${SESSION} 536 | -------------------------------------------------------------------------------- /contrib/user-dirs.dirs: -------------------------------------------------------------------------------- 1 | XDG_DESKTOP_DIR="$HOME/" 2 | XDG_DOWNLOAD_DIR="$HOME/dl/" 3 | -------------------------------------------------------------------------------- /curl: -------------------------------------------------------------------------------- 1 | -w "\n" 2 | -------------------------------------------------------------------------------- /cursor/keybindings.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "key": "cmd+a", 4 | "command": "cursorLineStart" 5 | }, 6 | { 7 | "key": "cmd+e", 8 | "command": "cursorLineEnd" 9 | }, 10 | { 11 | "key": "cmd+left", 12 | "command": "cursorWordAccessibilityLeft" 13 | }, 14 | { 15 | "key": "cmd+right", 16 | "command": "cursorWordAccessibilityRight" 17 | }, 18 | { 19 | "key": "cmd+space", 20 | "command": "emacs-mcx.setMarkCommand" 21 | }, 22 | { 23 | "key": "cmd+g", 24 | "command": "emacs-mcx.cancel" 25 | }, 26 | { 27 | "key": "cmd+/", 28 | "command": "undo" 29 | }, 30 | { 31 | "key": "cmd+r", 32 | "command": "emacs-mcx.isearchForward" 33 | }, 34 | { 35 | "key": "alt+s", 36 | "command": "workbench.action.quickTextSearch" 37 | }, 38 | { 39 | "key": "cmd+l", 40 | "command": "workbench.action.gotoLine" 41 | }, 42 | { 43 | "key": "alt+.", 44 | "command": "editor.action.revealDefinition" 45 | }, 46 | { 47 | "key": "alt+shift+/", 48 | "command": "editor.action.peekImplementation" 49 | }, 50 | { 51 | "key": "alt+f", 52 | "command": "workbench.action.quickOpen" 53 | }, 54 | { 55 | "key": "alt+r", 56 | "command": "editor.action.rename" 57 | }, 58 | { 59 | "key": "alt+backspace", 60 | "command": "workbench.action.closeEditorsInGroup" 61 | }, 62 | { 63 | "key": "alt+enter", 64 | "command": "workbench.action.splitEditor" 65 | }, 66 | { 67 | "key": "alt+left", 68 | "command": "workbench.action.focusLeftGroup" 69 | }, 70 | { 71 | "key": "alt+right", 72 | "command": "workbench.action.focusRightGroup" 73 | }, 74 | { 75 | "key": "alt+up", 76 | "command": "workbench.action.focusAboveGroup" 77 | }, 78 | { 79 | "key": "alt+down", 80 | "command": "workbench.action.focusBelowGroup" 81 | }, 82 | { 83 | "key": "cmd+down", 84 | "command": "cursorMove", 85 | "when": "editorTextFocus", 86 | "args": { 87 | "to": "nextBlankLine" 88 | } 89 | }, 90 | { 91 | "key": "cmd+up", 92 | "command": "cursorMove", 93 | "when": "editorTextFocus", 94 | "args": { 95 | "to": "prevBlankLine" 96 | } 97 | }, 98 | { 99 | "key": "cmd+shift+down", 100 | "command": "cursorMove", 101 | "when": "editorTextFocus", 102 | "args": { 103 | "to": "nextBlankLine", 104 | "select": true 105 | } 106 | }, 107 | { 108 | "key": "cmd+shift+up", 109 | "command": "cursorMove", 110 | "when": "editorTextFocus", 111 | "args": { 112 | "to": "prevBlankLine", 113 | "select": true 114 | } 115 | }, 116 | { 117 | "key": "ctrl+x shift+=", 118 | "command": "workbench.action.evenEditorWidths", 119 | "when": "!terminalFocus" 120 | } 121 | ] 122 | -------------------------------------------------------------------------------- /cursor/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "window.commandCenter": false, 3 | "window.title": "${activeEditorShort}${separator}${rootName}${separator}${profileName}", 4 | "emacs-mcx.strictEmacsMove": true, 5 | "workbench.colorCustomizations": { 6 | "editor.background": "#202020", 7 | "editorWidget.background": "#202020", 8 | "panel.background": "#202020", 9 | "sideBar.background": "#202020", 10 | "activityBar.background": "#202020", 11 | "statusBar.background": "#202020", 12 | "editorGutter.background": "#202020", 13 | "editor.lineHighlightBackground": "#242424", 14 | "editorIndentGuide.background1": "#262626", 15 | "editorIndentGuide.activeBackground1": "#303030", 16 | "panel.border": "#202020", 17 | "sideBar.border": "#262626", 18 | "activityBar.border": "#262626", 19 | "statusBar.border": "#262626", 20 | "editorGroup.border": "#262626", 21 | "editorGutter.modifiedBackground": "#202020", 22 | "editorOverviewRuler.addedForeground": "#202020", 23 | "editorOverviewRuler.modifiedForeground": "#202020", 24 | "editorOverviewRuler.deletedForeground": "#202020", 25 | "editorOverviewRuler.errorForeground": "#202020" 26 | }, 27 | "editor.minimap.enabled": false, 28 | "editor.hideCursorInOverviewRuler": true, 29 | "editor.scrollbar.horizontal": "hidden", 30 | "editor.scrollbar.vertical": "hidden", 31 | "workbench.activityBar.location": "hidden", 32 | "workbench.editor.alwaysShowEditorActions": false, 33 | "workbench.panel.defaultLocation": "top", 34 | "workbench.editor.showTabs": "single", 35 | "workbench.settings.applyToAllProfiles": [ 36 | "emacs-mcx.strictEmacsMove" 37 | ], 38 | "explorer.confirmDelete": false, 39 | "editor.cursorStyle": "block", 40 | "editor.cursorBlinking": "solid", 41 | "editor.cursorSmoothCaretAnimation": "off", 42 | "editor.wordWrap": "on", 43 | "editor.lineNumbers": "off", 44 | "editor.overviewRulerBorder": false, 45 | "terraform.languageServer.enable": true, 46 | } -------------------------------------------------------------------------------- /git/attributes: -------------------------------------------------------------------------------- 1 | *.svg text -diff 2 | *.pdf text -diff 3 | *.min.js text -diff 4 | *.min.css text -diff 5 | .yarn/releases/* text -diff 6 | **/gen/**/*.* text -diff 7 | *.ipynb text -diff 8 | go.sum text -diff 9 | *.lock text -diff 10 | -------------------------------------------------------------------------------- /git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | editor = emacs 3 | excludesfile = ~/.gitignore 4 | attributesfile = ~/.gitattributes 5 | [user] 6 | name = ramnes 7 | email = contact@ramnes.eu 8 | signingkey = 99CCA84E2C8C74F32E12AD538C1702070803487A 9 | [alias] 10 | aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort 11 | autosquash = !GIT_SEQUENCE_EDITOR=: git rebase --autosquash -i 12 | conflicts = diff --name-only --diff-filter=U --relative 13 | dc = !GIT_PAGER=cat git diff 14 | amend = commit --amend --no-edit 15 | df = diff HEAD 16 | dfc = !GIT_PAGER=cat git df 17 | ds = diff --cached 18 | dsc = !GIT_PAGER=cat git ds 19 | fixup = !sh -xc 'REV=$(git rev-parse \"${@: -1}\") && set -- "${@: 1: $#-1}" && git commit $@ --fixup $REV && GIT_SEQUENCE_EDITOR=: git rebase --autosquash -i $REV^' - 20 | force = push --force-with-lease 21 | lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr, %cd) %C(bold blue)<%an>%Creset' --abbrev-commit --date-order --date=short 22 | rh = !git stash && git reset --hard origin/`git symbolic-ref --short HEAD` 23 | st = fetch --prune origin +refs/tags/*:refs/tags/* 24 | sup = !git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` 25 | root = rev-parse --show-toplevel 26 | [push] 27 | default = current 28 | followTags = true 29 | recurseSubmodules = check 30 | [clean] 31 | requireForce = false 32 | [tag] 33 | sort = version:refname 34 | [help] 35 | autocorrect = -1 36 | [rebase] 37 | autosquash = true 38 | autostash = true 39 | [status] 40 | showUntrackedFiles = all 41 | [pager] 42 | diff = diff-highlight | less 43 | log = diff-highlight | less 44 | show = diff-highlight | less 45 | branch = false 46 | grep = false 47 | [color "diff"] 48 | old = "red bold" 49 | new = "green bold" 50 | whitespace = "red reverse" 51 | meta = yellow 52 | [color "diff-highlight"] 53 | oldNormal = "red bold dim" 54 | oldHighlight = "red bold 52" 55 | newNormal = "green bold dim" 56 | newHighlight = "green bold 22" 57 | [pull] 58 | ff = only 59 | [init] 60 | defaultBranch = main 61 | [advice] 62 | skippedCherryPicks = false 63 | [commit] 64 | gpgsign = true 65 | [fetch] 66 | writeCommitGraph = true 67 | -------------------------------------------------------------------------------- /git/ignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .#* 3 | *.diff 4 | *_flymake.* 5 | *.pyc 6 | *.elc 7 | .venv 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /gpg-agent: -------------------------------------------------------------------------------- 1 | pinentry-program pinentry-tty 2 | -------------------------------------------------------------------------------- /gtk/gtk3.css: -------------------------------------------------------------------------------- 1 | VteTerminal, 2 | TerminalScreen, 3 | vte-terminal { 4 | padding: 6px 8px 0px 8px; 5 | -VteTerminal-inner-border: 6px 8px 0px 8px; 6 | } 7 | -------------------------------------------------------------------------------- /htop: -------------------------------------------------------------------------------- 1 | # Beware! This file is rewritten by htop when settings are changed in the interface. 2 | # The parser is also very primitive, and not human-friendly. 3 | htop_version=3.2.2 4 | config_reader_min_version=3 5 | fields=0 48 17 18 38 39 40 2 46 47 49 1 6 | hide_kernel_threads=1 7 | hide_userland_threads=1 8 | hide_running_in_container=0 9 | shadow_other_users=1 10 | show_thread_names=0 11 | show_program_path=1 12 | highlight_base_name=0 13 | highlight_deleted_exe=1 14 | shadow_distribution_path_prefix=0 15 | highlight_megabytes=1 16 | highlight_threads=1 17 | highlight_changes=0 18 | highlight_changes_delay_secs=5 19 | find_comm_in_cmdline=1 20 | strip_exe_from_cmdline=1 21 | show_merged_command=0 22 | header_margin=1 23 | screen_tabs=0 24 | detailed_cpu_time=0 25 | cpu_count_from_one=1 26 | show_cpu_usage=1 27 | show_cpu_frequency=0 28 | update_process_names=0 29 | account_guest_in_cpu_meter=0 30 | color_scheme=0 31 | enable_mouse=1 32 | delay=15 33 | hide_function_bar=0 34 | header_layout=two_50_50 35 | column_meters_0=LeftCPUs Memory Tasks Uptime 36 | column_meter_modes_0=1 1 2 2 37 | column_meters_1=RightCPUs Swap LoadAverage CPU 38 | column_meter_modes_1=1 1 2 2 39 | tree_view=1 40 | sort_key=46 41 | tree_sort_key=38 42 | sort_direction=-1 43 | tree_sort_direction=-1 44 | tree_view_always_by_pid=0 45 | all_branches_collapsed=0 46 | screen:Main=PID USER PRIORITY NICE M_VIRT M_RESIDENT M_SHARE STATE PERCENT_CPU PERCENT_MEM TIME Command 47 | .sort_key=PERCENT_CPU 48 | .tree_sort_key=M_VIRT 49 | .tree_view=1 50 | .tree_view_always_by_pid=0 51 | .sort_direction=-1 52 | .tree_sort_direction=-1 53 | .all_branches_collapsed=0 54 | screen:I/O=PID USER IO_PRIORITY IO_RATE IO_READ_RATE IO_WRITE_RATE Command 55 | .sort_key=IO_RATE 56 | .tree_sort_key=PID 57 | .tree_view=0 58 | .tree_view_always_by_pid=0 59 | .sort_direction=-1 60 | .tree_sort_direction=1 61 | .all_branches_collapsed=0 62 | -------------------------------------------------------------------------------- /ipython: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | import IPython 5 | 6 | banner = 'IPython {} - Python {}\n' 7 | python_version = sys.version.split(' ', 1)[0] 8 | ipython_version = IPython.__version__ 9 | 10 | c = get_config() 11 | c.BaseIPythonApplication.extra_config_file = f"{os.getcwd()}/.ipython_config.py" 12 | c.TerminalInteractiveShell.separate_in = '' 13 | c.TerminalInteractiveShell.banner1 = banner.format(ipython_version, python_version) 14 | 15 | if int(ipython_version.split(".")[0]) >= 5: 16 | from IPython.terminal.prompts import Prompts, Token 17 | 18 | class MyPrompts(Prompts): 19 | 20 | def in_prompt_tokens(self, cli=None): 21 | return [(Token.Prompt, '>>> ')] 22 | 23 | def continuation_prompt_tokens(self, cli=None, width=None): 24 | if width is None: 25 | width = self._width() 26 | return [ 27 | (Token.Prompt, (' ' * (width - 5)) + '... '), 28 | ] 29 | 30 | def out_prompt_tokens(self): 31 | return [] 32 | 33 | c.TerminalInteractiveShell.prompts_class = MyPrompts 34 | else: 35 | c.PromptManager.out_template = '' 36 | c.PromptManager.in2_template = '... ' 37 | c.PromptManager.justify = False 38 | c.PromptManager.in_template = '>>> ' 39 | -------------------------------------------------------------------------------- /iterm2: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Actions 6 | 7 | AlternateMouseScroll 8 | 9 | AlternateMouseScrollStringForDown 10 | 11 | AlternateMouseScrollStringForUp 12 | 13 | Command 14 | 15 | Control 16 | 7 17 | Default Bookmark Guid 18 | 52F354FC-6C69-4740-B182-D9DBFBA2D14A 19 | DimBackgroundWindows 20 | 21 | DimInactiveSplitPanes 22 | 23 | DimOnlyText 24 | 25 | DisableFullscreenTransparency 26 | 27 | DoubleReportScrollWheel 28 | 29 | EnableDivisionView 30 | 31 | EnableProxyIcon 32 | 33 | FastTrackpad 34 | 35 | GlobalKeyMap 36 | 37 | 0x19-0x60000 38 | 39 | Action 40 | 39 41 | Text 42 | 43 | 44 | 0x9-0x40000 45 | 46 | Action 47 | 32 48 | Text 49 | 50 | 51 | 0xd-0x100000-0x24 52 | 53 | Action 54 | 13 55 | Label 56 | 57 | Text 58 | 59 | Version 60 | 1 61 | 62 | 0xf729-0x100000 63 | 64 | Action 65 | 5 66 | Text 67 | 68 | 69 | 0xf72b-0x100000 70 | 71 | Action 72 | 4 73 | Text 74 | 75 | 76 | 0xf72c-0x100000 77 | 78 | Action 79 | 9 80 | Text 81 | 82 | 83 | 0xf72c-0x20000 84 | 85 | Action 86 | 9 87 | Text 88 | 89 | 90 | 0xf72d-0x100000 91 | 92 | Action 93 | 8 94 | Text 95 | 96 | 97 | 0xf72d-0x20000 98 | 99 | Action 100 | 8 101 | Text 102 | 103 | 104 | 105 | HapticFeedbackForEsc 106 | 107 | HideActivityIndicator 108 | 109 | HideScrollbar 110 | 111 | HideTab 112 | 113 | HorizontalScrollingSensitivity 114 | 0.10000000149011612 115 | HotkeyMigratedFromSingleToMulti 116 | 117 | LeftCommand 118 | 1 119 | LeftOption 120 | 2 121 | NeverWarnAboutShortLivedSessions_52F354FC-6C69-4740-B182-D9DBFBA2D14A 122 | 123 | NeverWarnAboutShortLivedSessions_52F354FC-6C69-4740-B182-D9DBFBA2D14A_selection 124 | 0 125 | New Bookmarks 126 | 127 | 128 | ASCII Anti Aliased 129 | 130 | Allow modifyOtherKeys 131 | 132 | Ambiguous Double Width 133 | 134 | Ansi 0 Color 135 | 136 | Blue Component 137 | 0.0 138 | Green Component 139 | 0.0 140 | Red Component 141 | 0.0 142 | 143 | Ansi 1 Color 144 | 145 | Blue Component 146 | 0.0 147 | Green Component 148 | 0.0 149 | Red Component 150 | 0.73333334922790527 151 | 152 | Ansi 10 Color 153 | 154 | Alpha Component 155 | 1 156 | Blue Component 157 | 0.36860798421697016 158 | Color Space 159 | sRGB 160 | Green Component 161 | 0.939361572265625 162 | Red Component 163 | 0.33693805662915111 164 | 165 | Ansi 11 Color 166 | 167 | Blue Component 168 | 0.3333333432674408 169 | Green Component 170 | 1 171 | Red Component 172 | 1 173 | 174 | Ansi 12 Color 175 | 176 | Alpha Component 177 | 1 178 | Blue Component 179 | 1 180 | Color Space 181 | sRGB 182 | Green Component 183 | 0.54191832930078632 184 | Red Component 185 | 0.321746826171875 186 | 187 | Ansi 13 Color 188 | 189 | Alpha Component 190 | 1 191 | Blue Component 192 | 0.6771240234375 193 | Color Space 194 | sRGB 195 | Green Component 196 | 0.41374864988029003 197 | Red Component 198 | 0.6771240234375 199 | 200 | Ansi 14 Color 201 | 202 | Blue Component 203 | 1 204 | Green Component 205 | 1 206 | Red Component 207 | 0.3333333432674408 208 | 209 | Ansi 15 Color 210 | 211 | Blue Component 212 | 1 213 | Green Component 214 | 1 215 | Red Component 216 | 1 217 | 218 | Ansi 2 Color 219 | 220 | Alpha Component 221 | 1 222 | Blue Component 223 | 0.0 224 | Color Space 225 | sRGB 226 | Green Component 227 | 0.7716064453125 228 | Red Component 229 | 0.0 230 | 231 | Ansi 3 Color 232 | 233 | Blue Component 234 | 0.0 235 | Green Component 236 | 0.73333334922790527 237 | Red Component 238 | 0.73333334922790527 239 | 240 | Ansi 4 Color 241 | 242 | Alpha Component 243 | 1 244 | Blue Component 245 | 0.85699462890625 246 | Color Space 247 | sRGB 248 | Green Component 249 | 0.54538708060306451 250 | Red Component 251 | 0.28963583428412676 252 | 253 | Ansi 5 Color 254 | 255 | Blue Component 256 | 0.73333334922790527 257 | Green Component 258 | 0.0 259 | Red Component 260 | 0.73333334922790527 261 | 262 | Ansi 6 Color 263 | 264 | Blue Component 265 | 0.73333334922790527 266 | Green Component 267 | 0.73333334922790527 268 | Red Component 269 | 0.0 270 | 271 | Ansi 7 Color 272 | 273 | Blue Component 274 | 0.73333334922790527 275 | Green Component 276 | 0.73333334922790527 277 | Red Component 278 | 0.73333334922790527 279 | 280 | Ansi 8 Color 281 | 282 | Alpha Component 283 | 1 284 | Blue Component 285 | 0.41568627450980394 286 | Color Space 287 | sRGB 288 | Green Component 289 | 0.41568627450980394 290 | Red Component 291 | 0.41568627450980394 292 | 293 | Ansi 9 Color 294 | 295 | Blue Component 296 | 0.3333333432674408 297 | Green Component 298 | 0.3333333432674408 299 | Red Component 300 | 1 301 | 302 | BM Growl 303 | 304 | Background Color 305 | 306 | Alpha Component 307 | 1 308 | Blue Component 309 | 0.13333333333333333 310 | Color Space 311 | sRGB 312 | Green Component 313 | 0.13333333333333333 314 | Red Component 315 | 0.13333333333333333 316 | 317 | Background Image Location 318 | 319 | Blinking Cursor 320 | 321 | Blur 322 | 323 | Blur Radius 324 | 25.186627327127663 325 | Bold Color 326 | 327 | Blue Component 328 | 1 329 | Green Component 330 | 1 331 | Red Component 332 | 1 333 | 334 | Character Encoding 335 | 4 336 | Close Sessions On End 337 | 338 | Columns 339 | 80 340 | Command 341 | /opt/homebrew/bin/bash -i 342 | Cursor Boost 343 | 0.0 344 | Cursor Color 345 | 346 | Blue Component 347 | 0.73333334922790527 348 | Green Component 349 | 0.73333334922790527 350 | Red Component 351 | 0.73333334922790527 352 | 353 | Cursor Guide Color 354 | 355 | Alpha Component 356 | 0.25 357 | Blue Component 358 | 0.329620361328125 359 | Color Space 360 | sRGB 361 | Green Component 362 | 0.329620361328125 363 | Red Component 364 | 0.329620361328125 365 | 366 | Cursor Text Color 367 | 368 | Blue Component 369 | 1 370 | Green Component 371 | 1 372 | Red Component 373 | 1 374 | 375 | Custom Command 376 | No 377 | Custom Directory 378 | No 379 | Default Bookmark 380 | No 381 | Description 382 | Default 383 | Disable Window Resizing 384 | 385 | Flashing Bell 386 | 387 | Foreground Color 388 | 389 | Alpha Component 390 | 1 391 | Blue Component 392 | 0.90000000000000002 393 | Color Space 394 | sRGB 395 | Green Component 396 | 0.90000000000000002 397 | Red Component 398 | 0.90000000000000002 399 | 400 | Guid 401 | 52F354FC-6C69-4740-B182-D9DBFBA2D14A 402 | Horizontal Spacing 403 | 1 404 | Idle Code 405 | 0 406 | Initial Text 407 | 408 | Initial Use Transparency 409 | 410 | Jobs to Ignore 411 | 412 | rlogin 413 | ssh 414 | slogin 415 | telnet 416 | 417 | Keyboard Map 418 | 419 | 0x2a-0x200000-0x0 420 | 421 | Action 422 | 12 423 | Text 424 | * 425 | 426 | 0x2b-0x200000-0x0 427 | 428 | Action 429 | 12 430 | Text 431 | + 432 | 433 | 0x2d-0x200000-0x0 434 | 435 | Action 436 | 12 437 | Text 438 | - 439 | 440 | 0x2d-0x40000-0x0 441 | 442 | Action 443 | 11 444 | Text 445 | 0x1f 446 | 447 | 0x2e-0x200000-0x0 448 | 449 | Action 450 | 12 451 | Text 452 | . 453 | 454 | 0x2f-0x200000-0x0 455 | 456 | Action 457 | 12 458 | Text 459 | / 460 | 461 | 0x3-0x200000-0x0 462 | 463 | Action 464 | 11 465 | Text 466 | 0xd 467 | 468 | 0x30-0x200000-0x0 469 | 470 | Action 471 | 12 472 | Text 473 | 0 474 | 475 | 0x31-0x200000-0x0 476 | 477 | Action 478 | 12 479 | Text 480 | 1 481 | 482 | 0x32-0x200000-0x0 483 | 484 | Action 485 | 12 486 | Text 487 | 2 488 | 489 | 0x32-0x40000-0x0 490 | 491 | Action 492 | 11 493 | Text 494 | 0x00 495 | 496 | 0x33-0x200000-0x0 497 | 498 | Action 499 | 12 500 | Text 501 | 3 502 | 503 | 0x33-0x40000-0x0 504 | 505 | Action 506 | 11 507 | Text 508 | 0x1b 509 | 510 | 0x34-0x200000-0x0 511 | 512 | Action 513 | 12 514 | Text 515 | 4 516 | 517 | 0x34-0x40000-0x0 518 | 519 | Action 520 | 11 521 | Text 522 | 0x1c 523 | 524 | 0x35-0x200000-0x0 525 | 526 | Action 527 | 12 528 | Text 529 | 5 530 | 531 | 0x35-0x40000-0x0 532 | 533 | Action 534 | 11 535 | Text 536 | 0x1d 537 | 538 | 0x36-0x200000-0x0 539 | 540 | Action 541 | 12 542 | Text 543 | 6 544 | 545 | 0x36-0x40000-0x0 546 | 547 | Action 548 | 11 549 | Text 550 | 0x1e 551 | 552 | 0x37-0x200000-0x0 553 | 554 | Action 555 | 12 556 | Text 557 | 7 558 | 559 | 0x37-0x40000-0x0 560 | 561 | Action 562 | 11 563 | Text 564 | 0x1f 565 | 566 | 0x38-0x200000-0x0 567 | 568 | Action 569 | 12 570 | Text 571 | 8 572 | 573 | 0x38-0x40000-0x0 574 | 575 | Action 576 | 11 577 | Text 578 | 0x7f 579 | 580 | 0x39-0x200000-0x0 581 | 582 | Action 583 | 12 584 | Text 585 | 9 586 | 587 | 0xf700-0x220000-0x0 588 | 589 | Action 590 | 10 591 | Text 592 | [1;2A 593 | 594 | 0xf700-0x240000-0x0 595 | 596 | Action 597 | 10 598 | Text 599 | [1;5A 600 | 601 | 0xf700-0x260000-0x0 602 | 603 | Action 604 | 10 605 | Text 606 | [1;6A 607 | 608 | 0xf701-0x220000-0x0 609 | 610 | Action 611 | 10 612 | Text 613 | [1;2B 614 | 615 | 0xf701-0x240000-0x0 616 | 617 | Action 618 | 10 619 | Text 620 | [1;5B 621 | 622 | 0xf701-0x260000-0x0 623 | 624 | Action 625 | 10 626 | Text 627 | [1;6B 628 | 629 | 0xf702-0x220000-0x0 630 | 631 | Action 632 | 10 633 | Text 634 | [1;2D 635 | 636 | 0xf702-0x240000-0x0 637 | 638 | Action 639 | 10 640 | Text 641 | [1;5D 642 | 643 | 0xf702-0x260000-0x0 644 | 645 | Action 646 | 10 647 | Text 648 | [1;6D 649 | 650 | 0xf702-0x300000-0x0 651 | 652 | Action 653 | 11 654 | Text 655 | 0x1 656 | 657 | 0xf703-0x220000-0x0 658 | 659 | Action 660 | 10 661 | Text 662 | [1;2C 663 | 664 | 0xf703-0x240000-0x0 665 | 666 | Action 667 | 10 668 | Text 669 | [1;5C 670 | 671 | 0xf703-0x260000-0x0 672 | 673 | Action 674 | 10 675 | Text 676 | [1;6C 677 | 678 | 0xf703-0x300000-0x0 679 | 680 | Action 681 | 11 682 | Text 683 | 0x5 684 | 685 | 0xf704-0x20000-0x0 686 | 687 | Action 688 | 10 689 | Text 690 | [1;2P 691 | 692 | 0xf705-0x20000-0x0 693 | 694 | Action 695 | 10 696 | Text 697 | [1;2Q 698 | 699 | 0xf706-0x20000-0x0 700 | 701 | Action 702 | 10 703 | Text 704 | [1;2R 705 | 706 | 0xf707-0x20000-0x0 707 | 708 | Action 709 | 10 710 | Text 711 | [1;2S 712 | 713 | 0xf708-0x20000-0x0 714 | 715 | Action 716 | 10 717 | Text 718 | [15;2~ 719 | 720 | 0xf709-0x20000-0x0 721 | 722 | Action 723 | 10 724 | Text 725 | [17;2~ 726 | 727 | 0xf70a-0x20000-0x0 728 | 729 | Action 730 | 10 731 | Text 732 | [18;2~ 733 | 734 | 0xf70b-0x20000-0x0 735 | 736 | Action 737 | 10 738 | Text 739 | [19;2~ 740 | 741 | 0xf70c-0x20000-0x0 742 | 743 | Action 744 | 10 745 | Text 746 | [20;2~ 747 | 748 | 0xf70d-0x20000-0x0 749 | 750 | Action 751 | 10 752 | Text 753 | [21;2~ 754 | 755 | 0xf70e-0x20000-0x0 756 | 757 | Action 758 | 10 759 | Text 760 | [23;2~ 761 | 762 | 0xf70f-0x20000-0x0 763 | 764 | Action 765 | 10 766 | Text 767 | [24;2~ 768 | 769 | 0xf728-0x0-0x0 770 | 771 | Action 772 | 11 773 | Text 774 | 0x4 775 | 776 | 0xf729-0x20000-0x0 777 | 778 | Action 779 | 10 780 | Text 781 | [1;2H 782 | 783 | 0xf729-0x40000-0x0 784 | 785 | Action 786 | 10 787 | Text 788 | [1;5H 789 | 790 | 0xf72b-0x20000-0x0 791 | 792 | Action 793 | 10 794 | Text 795 | [1;2F 796 | 797 | 0xf72b-0x40000-0x0 798 | 799 | Action 800 | 10 801 | Text 802 | [1;5F 803 | 804 | 0xf739-0x0-0x0 805 | 806 | Action 807 | 13 808 | Text 809 | 810 | 811 | 812 | Left Option Key Changeable 813 | 814 | Minimum Contrast 815 | 0.0 816 | Mouse Reporting 817 | 818 | Movement Keys Scroll Outside Interactive Apps 819 | 820 | Name 821 | Default 822 | Non Ascii Font 823 | Monaco 12 824 | Non-ASCII Anti Aliased 825 | 826 | Normal Font 827 | Monaco 12 828 | Only The Default BG Color Uses Transparency 829 | 830 | Option Key Sends 831 | 2 832 | Prompt Before Closing 2 833 | 834 | Right Option Key Sends 835 | 2 836 | Rows 837 | 25 838 | Screen 839 | -1 840 | Scrollback Lines 841 | 10000 842 | Selected Text Color 843 | 844 | Blue Component 845 | 0.0 846 | Green Component 847 | 0.0 848 | Red Component 849 | 0.0 850 | 851 | Selection Color 852 | 853 | Blue Component 854 | 1 855 | Green Component 856 | 0.8353000283241272 857 | Red Component 858 | 0.70980000495910645 859 | 860 | Send Code When Idle 861 | 862 | Shortcut 863 | 864 | Silence Bell 865 | 866 | Smart Cursor Color 867 | 868 | Sync Title 869 | 870 | Tags 871 | 872 | Terminal Type 873 | xterm-256color 874 | Transparency 875 | 0.095270944148936165 876 | Unlimited Scrollback 877 | 878 | Use Bold Font 879 | 880 | Use Bright Bold 881 | 882 | Use Cursor Guide 883 | 884 | Use Italic Font 885 | 886 | Use Non-ASCII Font 887 | 888 | Use Tab Color 889 | 890 | Use libtickit protocol 891 | 892 | Vertical Spacing 893 | 1 894 | Visual Bell 895 | 896 | Window Type 897 | 0 898 | Working Directory 899 | /Users/ramnes 900 | 901 | 902 | OnlyWhenMoreTabs 903 | 904 | OptionIsMetaForSpecialChars 905 | 906 | PMPrintingExpandedStateForPrint2 907 | 908 | PasteTabToStringTabStopSize 909 | 4 910 | PointerActions 911 | 912 | Button,1,1,, 913 | 914 | Action 915 | kContextMenuPointerAction 916 | 917 | Button,2,1,, 918 | 919 | Action 920 | kPasteFromClipboardPointerAction 921 | 922 | Gesture,ThreeFingerSwipeDown,, 923 | 924 | Action 925 | kPrevWindowPointerAction 926 | 927 | Gesture,ThreeFingerSwipeLeft,, 928 | 929 | Action 930 | kPrevTabPointerAction 931 | 932 | Gesture,ThreeFingerSwipeRight,, 933 | 934 | Action 935 | kNextTabPointerAction 936 | 937 | Gesture,ThreeFingerSwipeUp,, 938 | 939 | Action 940 | kNextWindowPointerAction 941 | 942 | 943 | Print In Black And White 944 | 945 | ProportionalScrollWheelReporting 946 | 947 | RemapModifiersWithoutEventTap 948 | 949 | RightCommand 950 | 1 951 | RightOption 952 | 3 953 | ScrollWheelAcceleration 954 | 2 955 | SensitiveScrollWheel 956 | 957 | SoundForEsc 958 | 959 | SplitPaneDimmingAmount 960 | 0.09860740291262135 961 | StatusBarPosition 962 | 0 963 | TabStyleWithAutomaticOption 964 | 5 965 | UseBorder 966 | 967 | UseModernScrollWheelAccumulator 968 | 969 | VisualIndicatorForEsc 970 | 971 | WindowNumber 972 | 973 | findMode_iTerm 974 | 0 975 | kCPKSelectionViewPreferredModeKey 976 | 0 977 | kCPKSelectionViewShowHSBTextFieldsKey 978 | 979 | 980 | 981 | -------------------------------------------------------------------------------- /linearmouse: -------------------------------------------------------------------------------- 1 | { 2 | "$schema" : "https:\/\/schema.linearmouse.app\/0.10.0", 3 | "schemes" : [ 4 | { 5 | "scrolling" : { 6 | "reverse" : { 7 | "vertical" : true 8 | }, 9 | "distance" : "auto", 10 | "acceleration" : 0.75, 11 | "speed" : 20 12 | }, 13 | "if" : { 14 | "device" : { 15 | "vendorID" : "0x1af3", 16 | "category" : "mouse", 17 | "productName" : "ZOWIE Gaming mouse", 18 | "productID" : "0x1" 19 | } 20 | }, 21 | "buttons" : { 22 | "clickDebouncing" : { 23 | "timeout" : 140, 24 | "buttons" : [ 25 | 1, 26 | 2 27 | ] 28 | } 29 | }, 30 | "pointer" : { 31 | "disableAcceleration" : true, 32 | "acceleration" : 1 33 | } 34 | }, 35 | { 36 | "scrolling" : { 37 | "acceleration" : 0.75, 38 | "reverse" : { 39 | "vertical" : true 40 | }, 41 | "distance" : "auto", 42 | "speed" : 20 43 | }, 44 | "buttons" : { 45 | "clickDebouncing" : { 46 | "timeout" : 150, 47 | "buttons" : [ 48 | 1, 49 | 2 50 | ] 51 | } 52 | }, 53 | "if" : { 54 | "device" : { 55 | "productID" : "0x1710", 56 | "vendorID" : "0x1038", 57 | "productName" : "SteelSeries Rival 300 Gaming Mouse", 58 | "category" : "mouse" 59 | } 60 | }, 61 | "pointer" : { 62 | "acceleration" : 1, 63 | "disableAcceleration" : true 64 | } 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /pip: -------------------------------------------------------------------------------- 1 | [global] 2 | break-system-packages = true 3 | -------------------------------------------------------------------------------- /readline: -------------------------------------------------------------------------------- 1 | $include /etc/inputrc 2 | 3 | set blink-matching-paren on 4 | set colored-completion-prefix on 5 | set colored-stats on 6 | set completion-ignore-case on 7 | set completion-query-items 1000 8 | set history-preserve-point on 9 | set mark-symlinked-directories on 10 | set show-all-if-ambiguous on 11 | set show-all-if-unmodified on 12 | set skip-completed-text on 13 | set visible-stats on 14 | 15 | # urxvt 16 | "\e[8~": end-of-line 17 | "\eOc": forward-word 18 | "\eOd": backward-word 19 | 20 | # iTerm2 21 | "\e[1;9C": end-of-line 22 | "\e[1;9D": beginning-of-line 23 | "\e[1;5C": forward-word 24 | "\e[1;5D": backward-word 25 | -------------------------------------------------------------------------------- /rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | modi: "run"; 3 | terminal: "roxterm"; 4 | ssh-client: "mosh"; 5 | run-command: "bash -c \"{cmd}\""; 6 | run-shell-command: "{terminal} -e bash -c '{cmd}; read -n 1 -s'"; 7 | matching: "normal"; 8 | separator-style: "none"; 9 | fake-transparency: true; 10 | display-run: "run: "; 11 | display-ssh: "ssh: "; 12 | display-drun: "drun: "; 13 | display-combi: "combi: "; 14 | display-keys: "keys: "; 15 | kb-primary-paste: "Shift+Insert"; 16 | kb-secondary-paste: "Control+y"; 17 | kb-clear-line: ""; 18 | kb-remove-word-back: "Control+w,Control+BackSpace"; 19 | kb-select-1: "Ctrl+1"; 20 | kb-select-2: "Ctrl+2"; 21 | kb-select-3: "Ctrl+3"; 22 | kb-select-4: "Ctrl+4"; 23 | kb-select-5: "Ctrl+5"; 24 | kb-select-6: "Ctrl+6"; 25 | kb-select-7: "Ctrl+7"; 26 | kb-select-8: "Ctrl+8"; 27 | kb-select-9: "Ctrl+9"; 28 | kb-select-10: "Ctrl+0"; 29 | } 30 | 31 | @theme "~/.config/rofi/theme.rasi" 32 | -------------------------------------------------------------------------------- /rofi/theme.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | theme-grey: #222222; 3 | theme-dark-grey: #111111; 4 | theme-light-grey: #666666; 5 | theme-white: #ffffff; 6 | 7 | font: "DejaVu Sans Mono 9"; 8 | width: 25em; 9 | background-color: @theme-dark-grey; 10 | text-color: @theme-white; 11 | } 12 | 13 | #mainbox { 14 | spacing: 4; 15 | } 16 | 17 | #inputbar, entry, prompt, case-indicator { 18 | background-color: @theme-grey; 19 | color: @theme-white; 20 | } 21 | 22 | #inputbar { 23 | padding: 8; 24 | } 25 | 26 | #listview { 27 | background-color: @theme-dark-grey; 28 | lines: 10; 29 | } 30 | 31 | #element-text { 32 | margin: 0 8 4 8; 33 | text-color: @theme-light-grey; 34 | } 35 | 36 | #element-text selected { 37 | text-color: @theme-white; 38 | } 39 | -------------------------------------------------------------------------------- /roxterm/Colours/Tango: -------------------------------------------------------------------------------- 1 | [roxterm colour scheme] 2 | foreground=#ffffffffffff 3 | background=#222222222222 4 | 0=#2e2e34343636 5 | 1=#cccc00000000 6 | 2=#2e2ec2c27e7e 7 | 3=#c4c4a0a00000 8 | 4=#34346565a4a4 9 | 5=#757550507b7b 10 | 6=#060698989a9a 11 | 7=#d3d3d7d7cfcf 12 | 8=#555557575353 13 | 9=#efef29292929 14 | 10=#8a8ae2e23434 15 | 11=#fcfce9e94f4f 16 | 12=#72729f9fcfcf 17 | 13=#adad7f7fa8a8 18 | 14=#3434e2e2e2e2 19 | 15=#eeeeeeeeecec 20 | 16=#4c4c4c4c4c4c 21 | 17=#a8a830303030 22 | 18=#202088882020 23 | 19=#a8a888880000 24 | 20=#555555559898 25 | 21=#888830308888 26 | 22=#303088888888 27 | 23=#d8d8d8d8d8d8 28 | cursor=#88888a8a8585 29 | palette_size=16 30 | cursorfg=#000000000000 31 | bold=#ffffffffffff 32 | -------------------------------------------------------------------------------- /roxterm/Global: -------------------------------------------------------------------------------- 1 | [roxterm options] 2 | warn_close=1 3 | only_warn_running=1 4 | colour_scheme=Tango 5 | encoding=UTF-8 6 | prefer_dark_theme=0 7 | profile=Default 8 | shortcut_scheme=Custom 9 | -------------------------------------------------------------------------------- /roxterm/Profiles/Default: -------------------------------------------------------------------------------- 1 | [roxterm profile] 2 | scrollback_lines=100000 3 | background_type=2 4 | saturation=1.000000 5 | always_show_tabs=0 6 | audible_bell=0 7 | scrollbar_pos=0 8 | hide_menubar=1 9 | font=DejaVu Sans Mono 8 10 | colour_scheme=Tango 11 | browser=chromium-browser 12 | scroll_on_output=0 13 | scroll_on_keystroke=1 14 | disable_tab_menu_shortcuts=1 15 | bold_is_bright=1 16 | hspacing=0 17 | vspacing=10 18 | limit_scrollback=1 19 | -------------------------------------------------------------------------------- /roxterm/Shortcuts/Custom: -------------------------------------------------------------------------------- 1 | [roxterm shortcuts scheme] 2 | File/New Window= 3 | File/New Tab= 4 | File/Close Window= 5 | File/Close Tab= 6 | Tabs/Previous Tab= 7 | Tabs/Next Tab= 8 | Edit/Copy= 9 | Edit/Paste= 10 | View/Zoom In=plus 11 | View/Zoom Out=minus 12 | View/Normal Size=0 13 | View/Full Screen= 14 | View/Scroll Up One Line= 15 | View/Scroll Down One Line= 16 | View/Scroll To Bottom=Return 17 | Help/Help= 18 | Edit/Copy & Paste= 19 | Search/Find...= 20 | Search/Find Next= 21 | Search/Find Previous= 22 | File/New Window With Profile/Default= 23 | File/New Tab With Profile/Default= 24 | -------------------------------------------------------------------------------- /roxterm/Shortcuts/Default: -------------------------------------------------------------------------------- 1 | [roxterm shortcuts scheme] 2 | File/New Window=n 3 | File/New Tab=t 4 | File/Close Window=q 5 | File/Close Tab=w 6 | Tabs/Previous Tab=Page_Up 7 | Tabs/Next Tab=Page_Down 8 | Edit/Copy=c 9 | Edit/Paste=v 10 | View/Zoom In=plus 11 | View/Zoom Out=minus 12 | View/Normal Size=0 13 | View/Full Screen=F12 14 | View/Scroll Up One Line=Up 15 | View/Scroll Down One Line=Down 16 | Help/Help=F1 17 | Edit/Copy & Paste=y 18 | Search/Find...=f 19 | Search/Find Next=n 20 | Search/Find Previous=p 21 | File/New Window With Profile/Default= 22 | File/New Tab With Profile/Default= 23 | -------------------------------------------------------------------------------- /skhd/scripts/chrome.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! pgrep -f "Chrome" 4 | then 5 | open -na "Google Chrome" 6 | else 7 | osascript -e 'tell application "Google Chrome" to make new window' 8 | fi 9 | -------------------------------------------------------------------------------- /skhd/scripts/iterm2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! pgrep -f "iTerm" 4 | then 5 | open -na "iTerm" 6 | else 7 | osascript -e 'tell application "iTerm2" to create window with default profile' 8 | fi 9 | -------------------------------------------------------------------------------- /skhd/skhdrc: -------------------------------------------------------------------------------- 1 | ctrl + cmd - r : yabai --restart-service; skhd --restart-service 2 | ctrl + shift - r : skhd --restart-service 3 | 4 | ctrl - return : bash ${HOME}/.config/skhd/scripts/iterm2.sh > /dev/null 5 | ctrl - u : bash ${HOME}/.config/skhd/scripts/chrome.sh > /dev/null 6 | 7 | ctrl - backspace : yabai -m window --close 8 | ctrl - space : yabai -m window --toggle zoom-fullscreen; yabai -m window --focus "$(yabai -m query --windows --window | jq -er .id)" 9 | ctrl - s : yabai -m window --toggle zoom-parent; yabai -m window --focus "$(yabai -m query --windows --window | jq -er .id)" 10 | ctrl - f : yabai -m window --toggle float; yabai -m window --grid 5:5:1:1:3:3; yabai -m window --focus "$(yabai -m query --windows --window | jq -er .id)" 11 | 12 | ctrl - up : yabai -m window --focus "$(yabai -m query --windows | jq -re "sort_by(.display, .frame.x, .frame.y, .id) | map(select(.\"is-visible\" and .subrole != \"AXUnknown\")) | nth(index(map(select(.\"has-focus\"))) - 1).id")" 13 | ctrl - down : yabai -m window --focus "$(yabai -m query --windows | jq -re "sort_by(.display, .frame.x, .frame.y, .id) | map(select(.\"is-visible\" and .subrole != \"AXUnknown\")) | reverse | nth(index(map(select(.\"has-focus\"))) - 1).id")" 14 | 15 | ctrl + shift - up : yabai -m window --warp north 16 | ctrl + shift - down : yabai -m window --warp south 17 | 18 | ctrl + shift - left : yabai -m window --warp west || yabai -m window --space prev && yabai -m space --focus prev 19 | ctrl + shift - right : yabai -m window --warp east || yabai -m window --space next && yabai -m space --focus next 20 | 21 | ctrl + cmd - up : yabai -m window --resize top:0:-50 2&> /dev/null || yabai -m window --resize bottom:0:-50 22 | ctrl + cmd - down : yabai -m window --resize top:0:50 2&> /dev/null || yabai -m window --resize bottom:0:50 23 | ctrl + cmd - left : yabai -m window --resize right:-50:0 2&> /dev/null || yabai -m window --resize left:-50:0 24 | ctrl + cmd - right : yabai -m window --resize right:50:0 2&> /dev/null || yabai -m window --resize left:50:0 25 | 26 | ctrl - insert : spotify pause 27 | ctrl - delete : [[ "Vol, is mute: false" == $(m volume ismute) ]] && m volume mute || m volume unmute 28 | ctrl - home : spotify prev 29 | ctrl - end : spotify next 30 | ctrl - pageup : m volume up 31 | ctrl - pagedown : m volume down 32 | 33 | f14 : pmset sleepnow 34 | -------------------------------------------------------------------------------- /splatmoji: -------------------------------------------------------------------------------- 1 | rofi_command=rofi -dmenu -p 'type: ' -i -sort 2 | xsel_command=xsel -i -p 3 | paste_command=xdotool click 2 4 | -------------------------------------------------------------------------------- /ssh: -------------------------------------------------------------------------------- 1 | Host * 2 | AddKeysToAgent yes 3 | ServerAliveInterval 30 4 | ControlMaster auto 5 | ControlPath ~/.ssh/connections/%C 6 | -------------------------------------------------------------------------------- /tmux: -------------------------------------------------------------------------------- 1 | set -g display-time 3000 2 | set -g pane-active-border-style bg="#222222",fg="#87d7ff" 3 | set -g pane-border-style bg="#222222",fg="#222222" 4 | set -g status-style bg="#222222",fg="#87d7ff" 5 | set -g history-limit 10000 6 | set -g window-status-current-style bright 7 | -------------------------------------------------------------------------------- /urxvt: -------------------------------------------------------------------------------- 1 | URxvt.perl-ext-common: default,matcher 2 | URxvt.matcher.button: 1 3 | 4 | URxvt.cursorBlink: true 5 | URxvt.saveLines: 99999 6 | URxvt.scrollBar: false 7 | 8 | URxvt.font: xft:DejaVu Sans Mono:pixelsize=11 9 | URxvt.letterSpace: -1 10 | URxvt.boldFont: xft:DejaVu Sans Mono:style=Bold:pixelsize=11 11 | 12 | URxvt.depth: 32 13 | URxvt.foreground: #FFFFFF 14 | URxvt.background: [90]#1a1a1a 15 | 16 | URxvt.cursorColor: #888888 17 | URxvt.cursorColor2: #FFFFFF 18 | 19 | ! dark black red green yellow blue magenta cyan white 20 | URxvt.color0: #2e3436 21 | URxvt.color1: #cc0000 22 | URxvt.color2: #4e9a06 23 | URxvt.color3: #c4a000 24 | URxvt.color4: #3465a4 25 | URxvt.color5: #75507b 26 | URxvt.color6: #06989a 27 | URxvt.color7: #d3d7cf 28 | 29 | ! light black red green yellow blue magenta cyan white 30 | URxvt.color8: #555753 31 | URxvt.color9: #ef2929 32 | URxvt.color10: #8ae234 33 | URxvt.color11: #fce94f 34 | URxvt.color12: #729fcf 35 | URxvt.color13: #ad7fa8 36 | URxvt.color14: #34e2e2 37 | URxvt.color15: #ffffff 38 | 39 | Xft.antialias: true 40 | Xft.dpi: 96 41 | Xft.hinting: true 42 | Xft.hintstyle: hintslight 43 | Xft.rgba: none 44 | -------------------------------------------------------------------------------- /xinitrc: -------------------------------------------------------------------------------- 1 | qtile/xinitrc -------------------------------------------------------------------------------- /xprofile: -------------------------------------------------------------------------------- 1 | xsetroot -cursor_name left_ptr & 2 | xrandr --dpi 96x96 & 3 | autorandr --change & 4 | redshift -l 48.8:2.32 -t 5500:4500 -l manual & 5 | xrdb ~/.Xresources & 6 | nm-applet & 7 | eval `ssh-agent -t 300` 8 | feh --bg-tile ~/.background.jpg & 9 | -------------------------------------------------------------------------------- /yabai/yabairc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Layout 4 | yabai -m config layout bsp 5 | yabai -m config auto_balance off 6 | yabai -m config top_padding 10 7 | yabai -m config bottom_padding 10 8 | yabai -m config left_padding 10 9 | yabai -m config right_padding 10 10 | yabai -m config window_gap 10 11 | 12 | # Mouse and floating windows 13 | yabai -m config focus_follows_mouse autofocus 14 | yabai -m config mouse_follows_focus on 15 | yabai -m config mouse_modifier ctrl 16 | yabai -m config mouse_action1 move 17 | yabai -m config mouse_action2 resize 18 | yabai -m config window_shadow float 19 | 20 | # Signals 21 | yabai -m signal --add event=window_destroyed active=yes action="yabai -m query --windows --window &> /dev/null || yabai -m window --focus mouse &> /dev/null || yabai -m window --focus \$(yabai -m query --windows --space | jq .[0].id) &> /dev/null" 22 | 23 | # Rules 24 | yabai -m rule --add app="^Spotify$" display=^2 25 | yabai -m rule --add app='^System Preferences$' manage=off 26 | yabai -m rule --add app='^System Settings$' manage=off 27 | yabai -m rule --add app='^Docker Desktop$' manage=off 28 | yabai -m rule --add app='^SteelSeries GG Client$' manage=off 29 | yabai -m rule --add app='^GIMP' title!='(^GNU|GIMP$)' manage=off 30 | yabai -m rule --add app='^Google' title='Bitwarden' manage=off 31 | --------------------------------------------------------------------------------