├── default ├── bin │ ├── vup │ ├── vdown │ ├── term │ ├── xdg-open │ ├── x-terminal-emulator │ ├── add_rss_feed │ ├── open_terminal_with_nvim │ ├── git-fork │ ├── ff │ ├── menu-run │ ├── update-gh │ ├── x-www-browser │ ├── hibernate │ ├── menu-music │ ├── vcontrol │ ├── remote-backup │ ├── backup │ ├── add-magnet │ ├── bdown │ ├── bup │ ├── bandcamp │ └── check-pool ├── .config │ ├── user-dirs.locale │ ├── mako │ │ └── config │ ├── linux-console │ │ └── keymap │ ├── xorg │ │ ├── xinitrc.x250 │ │ ├── xinitrc.r4 │ │ └── Xdefaults │ ├── zsh │ │ ├── .zlogout │ │ ├── ps1.zsh │ │ ├── .zlogin │ │ ├── zsh_ileum.zsh │ │ ├── zsh_syncwd.zsh │ │ ├── vi-mode-color-prompt.zsh │ │ ├── zsh_auto_suggestions.zsh │ │ ├── history.zsh │ │ ├── command_time.zsh │ │ ├── completion.zsh │ │ ├── vi-mode-x-paste.zsh │ │ ├── vi-mode.zsh │ │ ├── .zshrc │ │ └── aliases.zsh │ ├── gtk-3.0 │ │ └── bookmarks │ ├── i3 │ │ ├── i3-startup │ │ ├── i3-startup.x250 │ │ ├── i3-startup.r4 │ │ ├── layout-ff.json │ │ ├── layout-mail.json │ │ ├── i3-startup.lacambre-Precision-7540 │ │ └── config │ ├── kitty │ │ └── kitty.conf │ ├── nvim │ │ ├── custom_snippets │ │ │ ├── java.snip │ │ │ └── tex.snip │ │ ├── autocommands.vim │ │ ├── init.lua │ │ ├── keymap.vim │ │ ├── settings.vim │ │ ├── plugins.vim │ │ ├── colors │ │ │ └── colors.vim │ │ └── functions.vim │ ├── user-dirs.dirs │ ├── htop │ │ └── htoprc │ ├── mpv │ │ ├── mpv.conf │ │ └── scripts │ │ │ └── applesubs.lua │ ├── mimeapps.list │ ├── git │ │ └── config │ ├── sway │ │ ├── r4.config │ │ └── config │ ├── newsboat │ │ └── config │ ├── gdb │ │ ├── .gdbinit │ │ ├── .gdbinit.lacambre-Precision-7540 │ │ └── nvim.py │ ├── pulse │ │ └── default.pa │ ├── tridactyl │ │ └── tridactylrc │ └── mpd │ │ └── mpd.conf ├── .gdbinit ├── .gnupg │ └── gpg-agent.conf ├── .ssh │ └── authorized_keys ├── .local │ └── share │ │ └── applications │ │ └── nvim_in_term.desktop ├── .xinitrc ├── .gtkrc-2.0 ├── .inputrc ├── .zshenv ├── .rtorrent.rc └── .XCompose ├── misc ├── ergodox │ ├── rules.mk │ ├── config.h │ └── keymap.c └── udev │ └── rules.d │ ├── u2f.rules │ └── automount.rules ├── install.sh └── .gitignore /default/bin/vup: -------------------------------------------------------------------------------- 1 | vcontrol -------------------------------------------------------------------------------- /default/bin/vdown: -------------------------------------------------------------------------------- 1 | vcontrol -------------------------------------------------------------------------------- /default/.config/user-dirs.locale: -------------------------------------------------------------------------------- 1 | en_US -------------------------------------------------------------------------------- /default/.gdbinit: -------------------------------------------------------------------------------- 1 | .config/gdb/.gdbinit -------------------------------------------------------------------------------- /default/bin/term: -------------------------------------------------------------------------------- 1 | ./x-terminal-emulator -------------------------------------------------------------------------------- /default/bin/xdg-open: -------------------------------------------------------------------------------- 1 | ./x-www-browser -------------------------------------------------------------------------------- /default/bin/x-terminal-emulator: -------------------------------------------------------------------------------- 1 | /usr/bin/kitty -------------------------------------------------------------------------------- /default/.config/mako/config: -------------------------------------------------------------------------------- 1 | default-timeout=10000 2 | -------------------------------------------------------------------------------- /default/.config/linux-console/keymap: -------------------------------------------------------------------------------- 1 | keycode 58 = Escape 2 | -------------------------------------------------------------------------------- /default/.config/xorg/xinitrc.x250: -------------------------------------------------------------------------------- 1 | xrandr --screen 0 --dpi 110 2 | -------------------------------------------------------------------------------- /misc/ergodox/rules.mk: -------------------------------------------------------------------------------- 1 | COMMAND_ENABLE = no 2 | COMBO_ENABLE = yes 3 | -------------------------------------------------------------------------------- /default/.config/zsh/.zlogout: -------------------------------------------------------------------------------- 1 | [[ $(tty) = "/dev/tty1" ]] && mpc pause 2 | -------------------------------------------------------------------------------- /misc/ergodox/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define COMBO_COUNT 1 4 | 5 | 6 | -------------------------------------------------------------------------------- /default/.gnupg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | enable-ssh-support 2 | pinentry-program /usr/bin/pinentry 3 | default-cache-ttl 600 4 | max-cache-ttl 600 5 | -------------------------------------------------------------------------------- /default/bin/add_rss_feed: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Small script called from firefox 3 | 4 | echo "$@" | sed 's/^feed://' >> ~/.config/newsboat/urls 5 | -------------------------------------------------------------------------------- /default/.config/gtk-3.0/bookmarks: -------------------------------------------------------------------------------- 1 | file:///home/me/prog/firenvim/target/firefox 2 | file:///home/me/prog/tridactyl/build 3 | file:///home/me/prog 4 | file:///tmp 5 | -------------------------------------------------------------------------------- /default/.config/i3/i3-startup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILENAME="$HOME/.config/i3/i3-startup.$(hostname)" 4 | if [ -f "$FILENAME" ] ; then 5 | exec "$FILENAME" 6 | fi 7 | -------------------------------------------------------------------------------- /default/bin/open_terminal_with_nvim: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIRNAME="$(dirname "$0")" 4 | NVIM="nvim" 5 | 6 | if ! which "$NVIM"; then 7 | NVIM="$DIRNAME/nvim" 8 | fi 9 | 10 | exec "$DIRNAME/term" -e "$NVIM" "$@" 11 | -------------------------------------------------------------------------------- /default/.config/xorg/xinitrc.r4: -------------------------------------------------------------------------------- 1 | xrandr --output VGA-1 --mode 1920x1080 --pos 0x0 --rotate right --output HDMI-2 --off --output HDMI-1 --primary --mode 1920x1080 --pos 1080x420 --rotate normal 2 | xset -dpms 3 | xset s off 4 | xset noblank 5 | -------------------------------------------------------------------------------- /default/.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | enable_audio_bell no 2 | clear_all_shortcuts yes 3 | enable_audio_bell no 4 | map ctrl+shift+equal change_font_size all +2.0 5 | map ctrl+shift+minus change_font_size all -2.0 6 | background #FFFFFF 7 | foreground #222222 8 | -------------------------------------------------------------------------------- /default/bin/git-fork: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | upstream="$(git remote get-url origin)" 4 | origin="$(printf "%s" "$upstream" | sed 's@https\?://\([^/]\+\)/[^/]\+/\([^/]\+\)@https://\1/glacambre/\2@')" 5 | 6 | git remote set-url origin "$origin" 7 | git remote add upstream "$upstream" 8 | -------------------------------------------------------------------------------- /default/bin/ff: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | profile="$HOME/.mozilla/firefox/normal" 4 | backup="$profile.backup" 5 | 6 | if [ ! -d "$backup" ] ; then 7 | echo "$backup doesn't exist." 8 | fi 9 | 10 | rm -rf "$profile" 11 | cp -r "$backup" "$profile" 12 | exec firefox -profile "$profile" 13 | -------------------------------------------------------------------------------- /default/.config/i3/i3-startup.x250: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | i3-msg "workspace 2; exec x-terminal-emulator -e nvim term://zsh" 4 | 5 | # Make caps lock send hyper, make both shit press send caps lock 6 | (setxkbmap -layout fr-latin9 -option caps:hyper -option shift:both_capslock && 7 | # Make a single hyper press send escape 8 | xcape -e "Hyper_L=Escape") & 9 | -------------------------------------------------------------------------------- /default/bin/menu-run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MENU=dmenu 4 | 5 | if which wofi >/dev/null 2>/dev/null ; then 6 | MENU="wofi -d" 7 | fi 8 | 9 | if which bemenu >/dev/null 2>/dev/null ; then 10 | MENU="bemenu -i" 11 | fi 12 | 13 | $(find $(echo "$PATH" | sed 's@:@ @g') -maxdepth 1 -type f 2>/dev/null | sort -u | $MENU -p "$(date +%H:%M)") & 14 | -------------------------------------------------------------------------------- /default/.config/i3/i3-startup.r4: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #i3-msg "workspace 2; move workspace to output right; append_layout /home/me/.config/i3/layout-ff.json; exec x-www-browser" 4 | #i3-msg "workspace 1; move workspace to output left; split vertical; exec term -e newsboat" 5 | #i3-msg "workspace 1; exec term -e mutt" 6 | #i3-msg "exec i3lock --nofork --ignore-empty-password --show-failed-attempts --color=2d2d2d" 7 | 8 | -------------------------------------------------------------------------------- /default/.config/i3/layout-ff.json: -------------------------------------------------------------------------------- 1 | { 2 | "border": "pixel", 3 | "current_border_width": 1, 4 | "floating": "auto_off", 5 | "geometry": { 6 | "height": 1080, 7 | "width": 1080, 8 | "x": 0, 9 | "y": 0 10 | }, 11 | "percent": 1, 12 | "swallows": [ 13 | { 14 | "class": "*irefox*" 15 | } 16 | ], 17 | "type": "con" 18 | } 19 | 20 | -------------------------------------------------------------------------------- /default/.ssh/authorized_keys: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCfsl2sB8Iii2OpsKqqrhxjqV+wKoC+cPGvRxcDjMwkdyhQJqWy5NSbTTo4qyAUhdGqbgr3AWdDGAECjUnriuv/RALk/eUlaR77f+ExKTsV/KBRmKxftKbbDZJ+gOhACke8hN9Va9R9UYng2BHz+TYgpwX7zXV61imV5cHPRwCruvK2xEXNIvmEHdM3cQoaToTH/Jtwp9Y8JDEkuTS/2G8iyf+gzry4SiRZ2PmL8p/+t5zFQ9RV9Wi1OfN47k7jHgtZHzkRXmocZIY3PHzC+YZ6zfUcwl7ld9cb3bZ8p4uVG5+WzZovCXj+zaSZW5LfR7eamwAv9VltTR8POJZ0VMVv cardno:000606512789 2 | -------------------------------------------------------------------------------- /default/.config/nvim/custom_snippets/java.snip: -------------------------------------------------------------------------------- 1 | snippet class 2 | class `expand("%:t:r")` { 3 | 4 | ${1} 5 | 6 | public `expand("%:t:r")` (${2}) { 7 | ${3} 8 | } 9 | 10 | ${4} 11 | 12 | } 13 | 14 | snippet prop 15 | private ${1:type} ${2:name}; 16 | public void set$2 ($1 $2) { 17 | this.$2 = $2; 18 | } 19 | public $1 get$2 () { 20 | return this.$2; 21 | } 22 | ${3} 23 | 24 | snippet fun 25 | private ${1:type} ${2:name} (${3:args}) { 26 | ${4:body} 27 | } 28 | -------------------------------------------------------------------------------- /default/.config/zsh/ps1.zsh: -------------------------------------------------------------------------------- 1 | 2 | PS1="" 3 | if [[ "$USER" != 'me' ]] && [[ "$USER" != 'lacambre' ]]; then 4 | PS1="%n" 5 | fi 6 | 7 | # Needed to check for both ssh and recursion 8 | parentprocess="$(ps -o comm= -p $PPID)" 9 | 10 | if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then 11 | PS1="%n@%M" 12 | else 13 | case "$parentprocess" in 14 | sshd|*/sshd) PS1="%n@%M" ;; 15 | esac 16 | fi 17 | 18 | if [ "$SHLVL" -gt 1 ]; then 19 | PS1="${PS1}∞" 20 | fi 21 | 22 | PS1="$PS1>" 23 | -------------------------------------------------------------------------------- /default/bin/update-gh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$#" != "1" ] ; then 4 | echo "Usage: update-gh 1.2.34" 5 | exit 1 6 | fi 7 | 8 | set -e 9 | 10 | DOWNLOAD_DIR="$HOME/downloads" 11 | TARGET="$DOWNLOAD_DIR/gh.tar.gz" 12 | 13 | curl -L https://github.com/cli/cli/releases/download/v$1/gh_$1_linux_amd64.tar.gz -o "$TARGET" 14 | GH_DIR="$DOWNLOAD_DIR/gh" 15 | rm -rf "$GH_DIR" 16 | mkdir "$GH_DIR" 17 | tar --directory="$GH_DIR" -xvzf "$TARGET" 18 | mv "$GH_DIR/gh_$1_linux_amd64/bin/gh" "$HOME/bin/gh" 19 | rm -rf "$TARGET" "$GH_DIR" 20 | -------------------------------------------------------------------------------- /default/.local/share/applications/nvim_in_term.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Nvim_In_Term 3 | GenericName=Neovim 4 | Comment=Edit text files 5 | TryExec=/home/me/bin/nvim 6 | Exec=/home/me/bin/open_terminal_with_nvim %F 7 | Terminal=false 8 | Type=Application 9 | Keywords=Text;editor; 10 | Categories=Utility;TextEditor; 11 | StartupNotify=false 12 | MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; 13 | -------------------------------------------------------------------------------- /default/.config/zsh/.zlogin: -------------------------------------------------------------------------------- 1 | if [[ $(tty) = "/dev/tty1" ]] ; then 2 | # if running in the first tty, try running these daemons 3 | if command -v dbus-launch >/dev/null 2>/dev/null ; then 4 | if [ "$(pidof dbus-daemon)" = "" ] ; then 5 | export $(dbus-launch) 6 | fi 7 | fi 8 | if command -v sway >/dev/null 2>/dev/null; then 9 | # export WLR_DRM_DEVICES=/dev/dri/card1 10 | exec sway 11 | fi 12 | if command -v startx >/dev/null 2>/dev/null ; then 13 | exec startx -- :0 vt1 14 | fi 15 | fi 16 | -------------------------------------------------------------------------------- /default/bin/x-www-browser: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Choose whether to open urls with mpv or firefox. 3 | 4 | browser="firefox" 5 | 6 | if [ "$#" -eq "0" ] ; then 7 | $browser 2>/dev/null 1>&2 & 8 | exit 9 | fi 10 | 11 | for URL in "$@"; do 12 | case "$URL" in 13 | *youtube.com*|*youtu.be*|*vimeo.com*|*.webm|*.mkv|*.mp4|*www.franceinter.fr/emissions/*|*/videos/watch/*) 14 | nohup mpv --no-terminal --profile=protocol.http "$URL" & 15 | ;; 16 | *) 17 | nohup $browser "$URL" 2>/dev/null 1>&2 & 18 | esac 19 | done 20 | -------------------------------------------------------------------------------- /default/.config/i3/layout-mail.json: -------------------------------------------------------------------------------- 1 | // vim:ts=4:sw=4:et 2 | { 3 | "border": "pixel", 4 | "current_border_width": 3, 5 | "floating": "auto_off", 6 | "geometry": { 7 | "height": 364, 8 | "width": 564, 9 | "x": 0, 10 | "y": 0 11 | }, 12 | "name": "nvim", 13 | "percent": 1, 14 | "swallows": [ 15 | { 16 | // "class": "^URxvt$", 17 | // "instance": "^x\\-terminal\\-emulator$", 18 | // "title": "^nvim$", 19 | // "transient_for": "^$" 20 | } 21 | ], 22 | "type": "con" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /default/.config/zsh/zsh_ileum.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ZSH_ILEUM_DIR="$ZDOTDIR/zsh-ileum" 4 | ZSH_INTALL_FILE="/tmp/zsh_ileum_installation_error" 5 | if [[ ! -d "$ZSH_ILEUM_DIR" && ! -e "$ZSH_INSTALL_FILE" ]]; then 6 | echo "Trying to install zsh-ileum." 7 | mkdir -p "$(dirname "$ZSH_ILEUM_DIR")" 8 | git clone "https://github.com/glacambre/ileum.git" "$ZSH_ILEUM_DIR" > "$ZSH_INTALL_FILE" 9 | if [ "$?" != "0" ]; then 10 | echo "Failed to download zsh-ileum." 11 | fi 12 | fi 13 | if [[ -e "${ZSH_ILEUM_DIR}/ileum.sh" ]] ; then 14 | source "${ZSH_ILEUM_DIR}/ileum.sh" 15 | fi 16 | -------------------------------------------------------------------------------- /default/.xinitrc: -------------------------------------------------------------------------------- 1 | XORG_CONF_DIR="$HOME/.config/xorg" 2 | if [ -d "$XORG_CONF_DIR" ] ; then 3 | xrdb -merge "${XORG_CONF_DIR}/Xdefaults" & 4 | 5 | FILENAME="$XORG_CONF_DIR/xinitrc.$(hostname)" 6 | if [ -e "$FILENAME" ] ; then 7 | . "$FILENAME" 8 | fi 9 | fi 10 | 11 | 12 | # Use a custom compose key 13 | export GTK_IM_MODULE="xim" 14 | 15 | # Make caps lock send hyper, make both shit press send caps lock 16 | (setxkbmap -layout fr-latin9 -option caps:hyper -option shift:both_capslock && 17 | # Make a single hyper press send escape 18 | xcape -e "Hyper_L=Escape") & 19 | 20 | i3 21 | -------------------------------------------------------------------------------- /default/.gtkrc-2.0: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT! This file will be overwritten by LXAppearance. 2 | # Any customization should be done in ~/.gtkrc-2.0.mine instead. 3 | 4 | gtk-theme-name="" 5 | gtk-icon-theme-name="gnome" 6 | gtk-font-name="Sans 10" 7 | gtk-cursor-theme-name="" 8 | gtk-cursor-theme-size=0 9 | gtk-toolbar-style=GTK_TOOLBAR_TEXT 10 | gtk-toolbar-icon-size=GTK_ICON_SIZE_MENU 11 | gtk-button-images=0 12 | gtk-menu-images=0 13 | gtk-enable-event-sounds=0 14 | gtk-enable-input-feedback-sounds=0 15 | gtk-xft-antialias=1 16 | gtk-xft-hinting=1 17 | gtk-xft-hintstyle="hintfull" 18 | include "/home/me/.gtkrc-2.0.mine" 19 | -------------------------------------------------------------------------------- /default/.inputrc: -------------------------------------------------------------------------------- 1 | set bell-style none 2 | set colored-stats on 3 | set completion-ignore-case on 4 | set completion-map-case on 5 | set editing-mode vi 6 | set enable-keypad on 7 | set enable-keypad on 8 | set mark-directories on 9 | set mark-symlinked-directories on 10 | set match-hidden-files on 11 | set page-completions off 12 | set print-completions-horizontally on 13 | set revert-all-at-newline on 14 | set show-all-if-ambiguous on 15 | set show-all-if-unmodified on 16 | set show-mode-in-prompt on 17 | set skip-completed-text on 18 | TAB:menu-complete 19 | C-A:beginning-of-line 20 | C-E:end-of-line 21 | C-U:unix-line-discard 22 | -------------------------------------------------------------------------------- /default/bin/hibernate: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Locks the computer before hibernating. 3 | 4 | if [ ! "$(id -u)" = 0 ]; then 5 | echo "This script needs to be run as root." 6 | exit 7 | fi 8 | 9 | swap_partition="$(grep "none\\s\\+swap" /etc/fstab | cut '-d ' -f1)" 10 | case "$swap_partition" in 11 | "UUID="*) swap_partition="$(readlink -f "/dev/disk/by-uuid/$(echo "$swap_partition" | cut -d= -f2)")";; 12 | "/dev/sd"*);; # Old-style fstab 13 | *) echo "No swap? $swap_partition"; exit;; # No swap? 14 | esac 15 | 16 | # sudo -u me i3lock --ignore-empty-password --show-failed-attempts --color=2d2d2d & 17 | echo "$swap_partition" > /sys/power/resume 18 | echo "disk" > /sys/power/state 19 | -------------------------------------------------------------------------------- /default/bin/menu-music: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # menu-based music selection 3 | 4 | MENU="dmenu -i -l 20" 5 | 6 | if which wofi >/dev/null 2>/dev/null ; then 7 | MENU="wofi -i -d" 8 | fi 9 | 10 | if which bemenu >/dev/null 2>/dev/null ; then 11 | MENU="bemenu -i -l 20" 12 | fi 13 | 14 | status='⏸' 15 | if [ "$(mpc | grep -c '^\[playing]')" -eq 1 ]; then 16 | status="⏵" 17 | fi 18 | random="🡆" 19 | if [ "$(mpc | grep -c ' random: on ')" -eq 1 ]; then 20 | random='⤨' 21 | fi 22 | playlist=$(mpc playlist) 23 | song=$(echo "$playlist" | $MENU -p "$status $random $(mpc | head -n 1)") 24 | [ "$song" != "" ] && mpc play "$(echo "$playlist" | awk -v s="$song" '$0==s {print NR; exit;}')" 25 | -------------------------------------------------------------------------------- /default/bin/vcontrol: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Control the volume 3 | 4 | symbol="-" 5 | if [ "$(basename "$0")" = "vup" ]; then 6 | symbol="+" 7 | fi 8 | 9 | amount="3" 10 | if [ "$1" != "" ]; then 11 | amount="$1" 12 | fi 13 | 14 | # Try pulseaudio first 15 | if command -v pactl >/dev/null 2>/dev/null; then 16 | sink_name="$(pactl list | awk '/State: RUNNING/,/Description:/{if ($2 ~ /combined/) {print $2; exit}}')" 17 | if [ "$sink_name" != "" ]; then 18 | exec pactl set-sink-volume "$sink_name" "${symbol}${amount}%" 19 | fi 20 | fi 21 | 22 | # Try alsa 23 | if ! amixer -q sset Master "${amount}%${symbol}" ; then 24 | amixer -c 1 -q sset Master "${amount}%${symbol}" 25 | fi 26 | -------------------------------------------------------------------------------- /default/.config/user-dirs.dirs: -------------------------------------------------------------------------------- 1 | # This file is written by xdg-user-dirs-update 2 | # If you want to change or add directories, just edit the line you're 3 | # interested in. All local changes will be retained on the next run 4 | # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped 5 | # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an 6 | # absolute path. No other format is supported. 7 | # 8 | XDG_DOWNLOAD_DIR="$HOME/downloads" 9 | XDG_DOCUMENTS_DIR="$HOME/documents" 10 | XDG_MUSIC_DIR="$HOME/music" 11 | XDG_PICTURES_DIR="$HOME/pictures" 12 | XDG_VIDEOS_DIR="$HOME/videos" 13 | XDG_DESKTOP_DIR="$HOME/" 14 | XDG_TEMPLATES_DIR="$HOME/downloads" 15 | XDG_PUBLICSHARE_DIR="$HOME/downloads" 16 | -------------------------------------------------------------------------------- /misc/udev/rules.d/u2f.rules: -------------------------------------------------------------------------------- 1 | # this udev file should be used with udev 188 and newer 2 | ACTION!="add|change", GOTO="u2f_end" 3 | 4 | # Yubico YubiKey 5 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", MODE="664", TAG+="uaccess" 6 | 7 | # Happlink (formaly Plug-Up) Security KEY 8 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0", TAG+="uaccess" 9 | 10 | # Neowave Keydo 11 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1e0d", ATTRS{idProduct}=="f1d0", TAG+="uaccess" 12 | 13 | # HyperSecu HyperFIDO 14 | KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="096e", ATTRS{idProduct}=="0880", TAG+="uaccess" 15 | 16 | LABEL="u2f_end" 17 | -------------------------------------------------------------------------------- /default/.config/htop/htoprc: -------------------------------------------------------------------------------- 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 | fields=0 48 17 18 38 39 40 2 46 47 49 1 4 | sort_key=1 5 | sort_direction=1 6 | hide_threads=0 7 | hide_kernel_threads=1 8 | hide_userland_threads=1 9 | shadow_other_users=0 10 | show_thread_names=1 11 | highlight_base_name=0 12 | highlight_megabytes=1 13 | highlight_threads=0 14 | tree_view=1 15 | header_margin=1 16 | detailed_cpu_time=0 17 | cpu_count_from_zero=0 18 | update_process_names=0 19 | account_guest_in_cpu_meter=0 20 | color_scheme=1 21 | delay=15 22 | left_meters=AllCPUs Memory Swap 23 | left_meter_modes=1 1 1 24 | right_meters=Tasks LoadAverage Uptime Battery 25 | right_meter_modes=2 2 2 2 26 | -------------------------------------------------------------------------------- /misc/udev/rules.d/automount.rules: -------------------------------------------------------------------------------- 1 | KERNEL!="sd[b-z][1-9]", GOTO="media_by_label_auto_mount_end" 2 | 3 | # Global mount options 4 | ACTION=="add", ENV{mount_options}="relatime,users,sync" 5 | 6 | # Filesystem specific options 7 | ACTION=="add", PROGRAM=="/lib/initcpio/udev/vol_id -t %N", RESULT=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002" 8 | ACTION=="add", PROGRAM=="/lib/initcpio/udev/vol_id --label %N", ENV{dir_name}="%c" 9 | ACTION=="add", PROGRAM!="/lib/initcpio/udev/vol_id --label %N", ENV{dir_name}="usbhd-%k" 10 | ACTION=="add", RUN+="/bin/mkdir -p /mnt/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/%E{dir_name}" 11 | ACTION=="remove", ENV{dir_name}=="?*", RUN+="/bin/umount -l /mnt/%E{dir_name}", RUN+="/bin/rmdir /mnt/%E{dir_name}" 12 | LABEL="media_by_label_auto_mount_end" 13 | -------------------------------------------------------------------------------- /default/.config/zsh/zsh_syncwd.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | function print_osc7() { 4 | if [ "$ZSH_SUBSHELL" -eq 0 ] ; then 5 | printf "\033]7;file://$HOST/$PWD\033\\" 6 | fi 7 | } 8 | autoload -Uz add-zsh-hook 9 | add-zsh-hook -Uz chpwd print_osc7 10 | print_osc7 11 | 12 | # ZSH_SYNCWD_DIR="$ZDOTDIR/zsh-syncwd" 13 | # ZSH_INTALL_FILE="/tmp/zsh_syncwd_installation_error" 14 | # if [[ ! -d "$ZSH_SYNCWD_DIR" && ! -e "$ZSH_INSTALL_FILE" ]]; then 15 | # echo "Trying to install zsh-syncwd." 16 | # mkdir -p "$(dirname "$ZSH_SYNCWD_DIR")" 17 | # git clone "https://github.com/glacambre/syncwd.git" "$ZSH_SYNCWD_DIR" > "$ZSH_INTALL_FILE" 18 | # if [ "$?" != "0" ]; then 19 | # echo "Failed to download zsh-syncwd." 20 | # fi 21 | # fi 22 | # if [[ -e "${ZSH_SYNCWD_DIR}/syncwd.zsh" ]] ; then 23 | # source "${ZSH_SYNCWD_DIR}/syncwd.zsh" 24 | # fi 25 | -------------------------------------------------------------------------------- /default/bin/remote-backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Encrypt directory and upload to fastmail 3 | 4 | set -e 5 | 6 | if [ "$XDG_RUNTIME_DIR" = "" ]; then 7 | XDG_RUNTIME_DIR="/tmp" 8 | fi 9 | 10 | WORK_DIR="$XDG_RUNTIME_DIR/remote-backup" 11 | 12 | rm -rf "$WORK_DIR" 13 | mkdir -p "$WORK_DIR" 14 | 15 | CWD="$(pwd)" 16 | cd "$WORK_DIR" 17 | 18 | tar --directory "$HOME" -cf - "documents" \ 19 | | xz -0 --stdout \ 20 | | gpg --passphrase="$PASSPHRASE" --batch --yes -c -o - \ 21 | | split -d -b 200M - x 22 | 23 | if [ "$(ls x* | wc -l)" -gt 45 ] ; then 24 | echo "Too many files" 25 | exit 1 26 | fi 27 | 28 | if [ "$(ls x* | wc -l)" -lt 1 ] ; then 29 | echo "No file created" 30 | exit 1 31 | fi 32 | 33 | for i in x* ; do 34 | curl --silent --show-error --basic --user "$FASTMAIL_ID" 'https://myfiles.fastmail.com' -T "$i" 35 | done 36 | 37 | cd "$CWD" 38 | rm -rf "$WORK_DIR" 39 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | CUR_DIR="$(pwd)" 6 | DOT_DIR="$(dirname "$(pwd)"/"$0")/" 7 | DEF_DIR="$DOT_DIR/default" 8 | 9 | # Note: The parens are useful here! They mean the function should be executed 10 | # in a subshell, which protects us from the environment being modified in 11 | # recursive calls 12 | recurselink()( 13 | FROM="$1" 14 | TO="$2" 15 | cd "$FROM" 16 | for i in * .*; do 17 | if [ "$i" = "." ] || [ "$i" = ".." ]; then 18 | continue 19 | fi 20 | if [ ! -e "$TO/$i" ] ; then 21 | ln -s "$FROM/$i" "$TO/$i" 22 | elif [ -d "$FROM/$i" ] && [ ! -L "$TO/$i" ] ; then 23 | recurselink "$FROM/$i" "$TO/$i" 24 | fi 25 | done 26 | ) 27 | 28 | recurselink "$DEF_DIR" "$HOME" 29 | 30 | cd "$CUR_DIR" 31 | -------------------------------------------------------------------------------- /default/.config/i3/i3-startup.lacambre-Precision-7540: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | setxkbmap -layout fr-latin9 4 | xcape -e "Hyper_L=Escape" 5 | # xrandr --output eDP-1 --primary --mode 1920x1080 --pos 0x712 --rotate normal --output DP-1-1 --mode 2560x1440 --pos 1920x0 --rotate left 6 | left="move workspace to output left" 7 | right="split vertical; move workspace to output right" 8 | openterm="exec term -e nvim term://zsh" 9 | sleep 1 10 | i3-msg "\ 11 | workspace 5; $left; $openterm; \ 12 | workspace 4; $left; $openterm; \ 13 | workspace 3; $left; $openterm; \ 14 | workspace 2; $left; $openterm; \ 15 | workspace 1; $left; $openterm; \ 16 | workspace 0; $right; exec thunderbird;\ 17 | workspace 9; $right; exec x-www-browser; \ 18 | workspace 8; $right; $openterm; \ 19 | workspace 7; $right; $openterm; \ 20 | workspace 6; $right; $openterm; \ 21 | " 22 | -------------------------------------------------------------------------------- /default/bin/backup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! "$(id -u)" = 0 ]; then 4 | echo "This script needs to be run as root." 5 | exit 6 | fi 7 | 8 | most_recent_file() { 9 | find "$1" -maxdepth 1 -iname "$2" -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut '-d ' -f5- | head -n 1 10 | } 11 | 12 | dir_to_backup="/home" 13 | backup_dir="/data/backups/" 14 | backup_name="home.backup" 15 | 16 | if [ ! -e "$backup_dir" ] ; then 17 | mount /data 18 | fi 19 | 20 | old_snapshot=$(most_recent_file "$dir_to_backup" "$backup_name*") 21 | cur_snapshot="$dir_to_backup/$backup_name.$(date -Iseconds)" 22 | 23 | btrfs subvolume snapshot -r "$dir_to_backup" "$cur_snapshot" 24 | sync 25 | 26 | if [ ! -e "$old_snapshot" ]; then 27 | btrfs send "$cur_snapshot" | btrfs receive "$backup_dir" 28 | exit 29 | fi 30 | 31 | btrfs send -p "$old_snapshot" "$cur_snapshot" | btrfs receive "$backup_dir" 32 | btrfs subvolume delete "$old_snapshot" 33 | -------------------------------------------------------------------------------- /default/bin/add-magnet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script converts a magnet into a torrent file and drops it in a specific directory 3 | 4 | if [ "$#" -lt 1 ] ; then 5 | echo "Not enough arguments"; 6 | exit 7 | fi 8 | 9 | # Find which dir the torrent should be put in 10 | torrent_dir="/wd/torrents/films/" 11 | url="$1" 12 | 13 | if [[ ! "$url" =~ xt=urn:btih:([^&/]+) ]] ; then 14 | echo "url doesn't look like a magnet link" 15 | exit 16 | fi 17 | 18 | filename="$torrent_dir/meta-$(echo "$url" | grep -o 'xt=urn:btih:[a-zA-Z0-9]*' | sed 's/xt=urn:btih://').torrent" 19 | 20 | echo "d10:magnet-uri${#url}:${url}e" > "$filename" 21 | 22 | if [ ! -e "$filename" ] ; then 23 | filename="/tmp/$filename" 24 | if [ ! -e "$filename" ] ; then 25 | mkdir -p "$filename" 26 | fi 27 | rm -rf "$filename" 28 | echo "d10:magnet-uri${#url}:${url}e" > "$filename" 29 | echo "Failed to create torrent file. File is in /tmp instead." 30 | exit 1 31 | fi 32 | -------------------------------------------------------------------------------- /default/.config/zsh/vi-mode-color-prompt.zsh: -------------------------------------------------------------------------------- 1 | # Color PS1 2 | KEYTIMEOUT=20 3 | _PS1="$PS1" 4 | 5 | if [[ "$TERM" != "linux" ]]; then 6 | PRINTCHAR="q" 7 | fi 8 | 9 | set_insert_colors() { 10 | # 148 is ^Z 11 | if [[ $__prompt_status == 0 ]] || [[ $__prompt_status == 148 ]]; then 12 | PS1="%{%}$_PS1%{%}" 13 | else 14 | PS1="%{%}$_PS1%{%}" 15 | fi 16 | print -n -- "\033[6 $PRINTCHAR" 17 | } 18 | 19 | zle-keymap-select() { 20 | if [[ "$KEYMAP" = "vicmd" ]] ; then 21 | # Green, block cursor 22 | PS1="%{%}$_PS1%{%}" 23 | print -n -- "\033[2 $PRINTCHAR" 24 | else 25 | set_insert_colors 26 | fi 27 | zle reset-prompt 28 | } 29 | 30 | precmd_setup_colors() { 31 | typeset -g __prompt_status="$?" 32 | set_insert_colors 33 | } 34 | 35 | if [ -z "$precmd_functions" ]; then 36 | precmd_functions=() 37 | fi 38 | precmd_functions+=precmd_setup_colors 39 | 40 | zle -N zle-keymap-select 41 | -------------------------------------------------------------------------------- /default/.config/zsh/zsh_auto_suggestions.zsh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ZSH_AUTOSUGGESTIONS_DIR="$ZDOTDIR/zsh-autosuggestions" 4 | ZSH_INTALL_FILE="/tmp/zsh_autosuggestion_installation_error" 5 | if [[ ! -d "$ZSH_AUTOSUGGESTIONS_DIR" && ! -e "$ZSH_INSTALL_FILE" ]]; then 6 | echo "Trying to install zsh-autosuggestions." 7 | mkdir -p "$(dirname "$ZSH_AUTOSUGGESTIONS_DIR")" 8 | git clone "https://github.com/zsh-users/zsh-autosuggestions" "$ZSH_AUTOSUGGESTIONS_DIR" > "$ZSH_INTALL_FILE" 9 | if [ "$?" != "0" ]; then 10 | echo "Failed to download zsh-autosuggestions." 11 | fi 12 | fi 13 | if [[ -e "${ZSH_AUTOSUGGESTIONS_DIR}/zsh-autosuggestions.zsh" ]] ; then 14 | source "${ZSH_AUTOSUGGESTIONS_DIR}/zsh-autosuggestions.zsh" 15 | ZSH_AUTOSUGGEST_IGNORE_WIDGETS=(orig-\* beep run-help set-local-history which-command yank) 16 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=5' 17 | ZSH_AUTOSUGGEST_STRATEGY=match_prev_cmd 18 | bindkey -M viins '\t' autosuggest-accept 19 | bindkey -M viins '^[[Z' autosuggest-clear 20 | fi 21 | -------------------------------------------------------------------------------- /default/.config/zsh/history.zsh: -------------------------------------------------------------------------------- 1 | HISTFILE="$ZDOTDIR/zsh_history" 2 | HISTSIZE=1000000 3 | SAVEHIST=1000000 4 | 5 | unsetopt hist_beep # Don't beep when a widget tries to access an history entry which isn't there. 6 | setopt hist_fcntl_lock # Use the OS's locking mechanism instead of ZSH's 7 | setopt hist_find_no_dups # When searching in the history do not show dups multiple times 8 | setopt hist_ignore_space # Don't store lines that begin with a space in the history 9 | setopt hist_no_store # Don't add the "history" command to the history when it's called 10 | setopt hist_reduce_blanks # Don't store blank lines in the history 11 | setopt inc_append_history # Add commands to history ASAP, don't wait for shell exit 12 | 13 | # Can't use these two options with ZSH_AUTOSUGGEST_STRATEGY=match_prev_cmd 14 | # setopt hist_expire_dups_first # If history contains dups, remove them first 15 | # setopt hist_ignore_all_dups # When a new command which is a dup of another is added to the history, remove old dup 16 | -------------------------------------------------------------------------------- /default/bin/bdown: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Brightens the screen. Needs root. 3 | 4 | if [ "$(id -u)" -ne 0 ]; then 5 | echo "This script needs to be run as root." 6 | exit 7 | fi 8 | 9 | step=$(($(cat /sys/class/backlight/intel_backlight/max_brightness) / 20)) 10 | 11 | if [ -e /sys/class/backlight/intel_backlight/brightness ] ; then 12 | brightness=$(($(cat /sys/class/backlight/intel_backlight/brightness)-$step)) 13 | 14 | if [ $brightness -gt 0 ] 15 | then 16 | echo $brightness > /sys/class/backlight/intel_backlight/brightness 17 | fi 18 | 19 | elif command -v ddccontrol >/dev/null ; then 20 | devices="$(sudo ddccontrol -p 2>/dev/null | grep "dev:/dev/[a-z0-9-]\\+" -o | sort | uniq)" 21 | echo "$devices" | while read -r device ; do ( 22 | if [ "$device" = "" ]; then 23 | continue; 24 | fi 25 | current="$(ddccontrol -r 0x10 "$device" 2>/dev/null | grep "+/[0-9]\\+/100" -o | cut -d/ -f2)" 26 | if [ "$current" != "" ] ; then 27 | ddccontrol -r 0x10 -w "$((current-20))" "$device" >/dev/null 2>/dev/null 28 | fi 29 | ) & done 30 | 31 | else 32 | echo "No /sys/class or ddccontrol found." 33 | exit 34 | fi 35 | -------------------------------------------------------------------------------- /default/.config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | 2 | # General 3 | force-seekable=yes 4 | msg-color 5 | msg-module 6 | msg-time 7 | prefetch-playlist=yes 8 | really-quiet 9 | # Not needed thanks to applesubs.lua 10 | # sub-auto=fuzzy 11 | 12 | # Screenshots 13 | screenshot-directory=~/pictures/ 14 | screenshot-template="%F_%P" 15 | 16 | # Cache settings 17 | cache=yes 18 | cache-secs=10800 19 | 20 | # youtube-dl settings 21 | ytdl=yes 22 | ytdl-format=0/(bestvideo[vcodec=vp9]/bestvideo[height>720]/bestvideo[fps>30])[tbr<13000]+(bestaudio[acodec=opus]/bestaudio)/best 23 | 24 | # Default sub lang 25 | slang=eng,en,fr,fre 26 | alang=jpn,jp,eng,en,fr,fre 27 | 28 | # Show the window immediately 29 | [protocol.http] 30 | force-window=immediate 31 | ytdl-format=bestvideo[height<=?1080][fps<=30]+bestaudio/best[height<=?1080] 32 | demuxer-max-bytes=2048MiB 33 | demuxer-max-back-bytes=1024MiB 34 | 35 | [protocol.https] 36 | profile=protocol.http 37 | 38 | # Audio-only content 39 | [audio] 40 | force-window=no 41 | no-video 42 | ytdl-format=bestaudio/best 43 | 44 | # Image files (e.g. for using mpv as a pseudo image viewer) 45 | [extension.gif] 46 | loop-file=inf 47 | -------------------------------------------------------------------------------- /default/bin/bup: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Brightens the screen. Needs root. 3 | 4 | if [ "$(id -u)" -ne 0 ]; then 5 | echo "This script needs to be run as root." 6 | exit 7 | fi 8 | 9 | step=$(($(cat /sys/class/backlight/intel_backlight/max_brightness) / 20)) 10 | 11 | if [ -e /sys/class/backlight/intel_backlight/brightness ] ; then 12 | brightness=$(($(cat /sys/class/backlight/intel_backlight/brightness)+$step)) 13 | 14 | if [ $brightness -lt "$(cat /sys/class/backlight/intel_backlight/max_brightness)" ] 15 | then 16 | echo $brightness > /sys/class/backlight/intel_backlight/brightness 17 | fi 18 | 19 | elif command -v ddccontrol >/dev/null ; then 20 | devices="$(sudo ddccontrol -p 2>/dev/null | grep "dev:/dev/[a-z0-9-]\\+" -o | sort | uniq)" 21 | echo "$devices" | while read -r device ; do ( 22 | if [ "$device" = "" ]; then 23 | continue; 24 | fi 25 | current="$(ddccontrol -r 0x10 "$device" 2>/dev/null | grep "+/[0-9]\\+/100" -o | cut -d/ -f2)" 26 | if [ "$current" != "" ] ; then 27 | ddccontrol -r 0x10 -w "$((current+20))" "$device" >/dev/null 2>/dev/null 28 | fi 29 | ) & done 30 | 31 | else 32 | echo "No /sys/class or ddccontrol found." 33 | exit 34 | fi 35 | -------------------------------------------------------------------------------- /default/.config/mimeapps.list: -------------------------------------------------------------------------------- 1 | [Default Applications] 2 | x-scheme-handler/http=x-www-browser 3 | x-scheme-handler/https=x-www-browser 4 | x-scheme-handler/ftp=x-www-browser 5 | x-scheme-handler/chrome=x-www-browser 6 | text/html=x-www-browser 7 | application/x-extension-htm=x-www-browser 8 | application/x-extension-html=x-www-browser 9 | application/x-extension-shtml=x-www-browser 10 | application/xhtml+xml=x-www-browser 11 | application/x-extension-xhtml=x-www-browser 12 | application/x-extension-xht=x-www-browser 13 | 14 | [Added Associations] 15 | x-scheme-handler/http=x-www-browser; 16 | x-scheme-handler/https=x-www-browser; 17 | x-scheme-handler/ftp=x-www-browser; 18 | x-scheme-handler/chrome=x-www-browser; 19 | text/html=x-www-browser; 20 | application/x-extension-htm=x-www-browser; 21 | application/x-extension-html=x-www-browser; 22 | application/x-extension-shtml=x-www-browser; 23 | application/xhtml+xml=x-www-browser; 24 | application/x-extension-xhtml=x-www-browser; 25 | application/x-extension-xht=x-www-browser; 26 | application/pdf=mupdf.desktop; 27 | image/jpeg=feh.desktop; 28 | image/png=feh.desktop; 29 | text/csv=nvim_in_term.desktop; 30 | text/plain=nvim_in_term.desktop; 31 | -------------------------------------------------------------------------------- /default/bin/bandcamp: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | # Unpack all bandcamp archives, group them into artist/album directories, copy 3 | # to backup directory, convert to opus into $HOME/music 4 | 5 | backupdir="/wd/data/media/music" 6 | 7 | if [ "$1" != "-f" ] && ! [ -d "$backupdir" ] ; then 8 | echo "$backupdir does not exist, aborting." 9 | exit 1 10 | fi 11 | 12 | for i in *.zip ; do 13 | name="$(basename "$i" | sed s/.zip$//)" 14 | artist="$(echo "$name" | sed 's/ \?-.*//')" 15 | album="$(echo "$name" | sed 's/[^-]\+- //')" 16 | fullname="$artist/$album" 17 | homepath="$HOME/music/$fullname" 18 | backuppath="$backupdir/$fullname" 19 | 20 | mkdir -p "$fullname" 21 | mkdir -p "$homepath" 22 | mkdir -p "$backuppath" 23 | 24 | mv "$i" "$fullname" 25 | cd "$fullname" || exit 1 26 | 27 | unzip "$i" 28 | mv "$i" ../.. 29 | 30 | ( 31 | for j in **/*.flac ; do 32 | ( ffmpeg -y -i "$j" "$(echo "$homepath/$j" | sed s/.flac$/.opus/)" /dev/null ) & 33 | done 34 | ) & 35 | 36 | cd ../.. || exit 1 37 | 38 | cp -rf "$fullname"/* "$backuppath" 39 | done 40 | -------------------------------------------------------------------------------- /default/.config/git/config: -------------------------------------------------------------------------------- 1 | [alias] 2 | cb = !git branch --merged | egrep -v \"(^\\*|master|dev)\" | xargs git branch -d && git remote prune origin 3 | stats = !git ls-files | xargs -n1 git blame -w -M -C -C --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr 4 | find-merge = "!sh -c 'commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'" 5 | show-merge = "!sh -c 'merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge'" 6 | [branch] 7 | sort = committerdate 8 | [commit] 9 | verbose = true 10 | ; gpgsign = true 11 | [diff] 12 | algorithm = patience 13 | renames = copy 14 | colorMoved = dimmed-zebra 15 | [init] 16 | defaultBranch = master 17 | [log] 18 | decorate = short 19 | date = iso 20 | [merge] 21 | tool = fugitive 22 | [mergetool "fugitive"] 23 | cmd = nvim -f -c "Gvdiffsplit!" "$MERGED" 24 | [push] 25 | default = current 26 | [url "git@github.com:"] 27 | pushInsteadOf = "https://github.com/" 28 | pushInsteadOf = "git://github.com/" 29 | [user] 30 | name = glacambre 31 | email = code@lacamb.re 32 | signingkey = B9625DB1767553AC 33 | [rebase] 34 | updateRefs = true 35 | [rerere] 36 | enabled = false 37 | autoupdate = true 38 | -------------------------------------------------------------------------------- /default/.config/sway/r4.config: -------------------------------------------------------------------------------- 1 | output VGA-1 transform 90 2 | output VGA-1 position 0 0 3 | output HDMI-A-1 position 1080 420 4 | 5 | workspace $wp1 output VGA-1 6 | workspace $wp2 output VGA-1 7 | workspace $wp3 output VGA-1 8 | workspace $wp4 output VGA-1 9 | workspace $wp5 output VGA-1 10 | workspace $wp6 output HDMI-A-1 11 | workspace $wp7 output HDMI-A-1 12 | workspace $wp8 output HDMI-A-1 13 | workspace $wp9 output HDMI-A-1 14 | workspace $wp0 output HDMI-A-1 15 | 16 | exec swaymsg "workspace $wp2 ; layout splitv ; exec thunderbird" 17 | exec swaymsg "workspace $wp3 ; layout splitv ; exec open_terminal_with_nvim term://newsboat" 18 | exec swaymsg "workspace $wp4 ; layout splitv ; exec open_terminal_with_nvim term://zsh" 19 | exec swaymsg "workspace $wp5 ; layout splitv ; exec open_terminal_with_nvim term://zsh" 20 | exec swaymsg "workspace $wp7 ; exec open_terminal_with_nvim term://zsh" 21 | exec swaymsg "workspace $wp8 ; exec open_terminal_with_nvim term://zsh" 22 | exec swaymsg "workspace $wp9 ; exec open_terminal_with_nvim term://zsh" 23 | exec swaymsg "workspace $wp0 ; exec open_terminal_with_nvim term://zsh" 24 | 25 | # These are last because they are the ones we want to focus 26 | exec swaymsg "workspace $wp1 ; layout splitv ; exec firefox" 27 | exec swaymsg "workspace $wp6 ; exec open_terminal_with_nvim term://zsh" 28 | -------------------------------------------------------------------------------- /default/.config/nvim/autocommands.vim: -------------------------------------------------------------------------------- 1 | 2 | augroup MY_GENERAL_AUGROUP 3 | autocmd! 4 | au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") 5 | \| exe "normal! g`\"" | endif 6 | 7 | au BufUnload * wshada 8 | augroup END 9 | 10 | augroup MY_OCAML_AUGROUP 11 | autocmd! 12 | " Temporary, remove when https://github.com/vim/vim/issues/2428 is 13 | " closed 14 | au FileType ocaml setlocal commentstring=(*%s*) 15 | 16 | au BufWritePre *.ml if empty(v:lua.vim.lsp.get_clients()) && executable("ocamlformat") | execute "normal! m'" | silent! execute "%!ocamlformat --enable-outside-detected-project --name % -" | if v:shell_error | undo | else | execute "normal! ''" | end | end 17 | au BufWritePre *.mli if empty(v:lua.vim.lsp.get_clients()) && executable("ocamlformat") | execute "normal! m'" | silent! execute "%!ocamlformat --enable-outside-detected-project --name % -" | if v:shell_error | undo | else | execute "normal! ''" | end | end 18 | 19 | augroup END 20 | 21 | augroup MY_GIT_AUGROUP 22 | autocmd! 23 | au BufRead COMMIT_EDITMSG set ft=.gitcommit 24 | augroup END 25 | 26 | augroup MY_TERM_AUGROUP 27 | autocmd! 28 | au TermOpen * silent call OnTermOpen() 29 | au TermClose * nested silent call OnTermClose() 30 | augroup END 31 | 32 | augroup MY_GNUPLOT_AUGROUP 33 | autocmd! 34 | au FileType gnuplot setlocal commentstring=#%s 35 | augroup END 36 | -------------------------------------------------------------------------------- /default/.config/zsh/command_time.zsh: -------------------------------------------------------------------------------- 1 | 2 | function display_command_time() { 3 | cmd="$(history | tail -n 1 | cut -d' ' -f2-)" 4 | if [[ "$LAST_COMMAND_TIME" != "" ]]; then 5 | timespan="$(($(date '+%s') - $LAST_COMMAND_TIME))" 6 | if [[ "$timespan" -gt 120 ]]; then 7 | echo "Job took $timespan seconds." 8 | if command -v notify-send >/dev/null && (command -v dunst || command -v mako) >/dev/null 2>/dev/null; then 9 | notify="timeout 3 notify-send 'Command finished in $timespan seconds' '$cmd'" 10 | ( 11 | if ! eval "$notify" ; then 12 | if command -v dunst >/dev/null ; then 13 | dunst & 14 | elif command -v mako >/dev/null ; then 15 | mako & 16 | fi 17 | sleep 1 18 | eval $notify 19 | fi 20 | ) 2>/dev/null >/dev/null &| 21 | fi 22 | fi 23 | fi 24 | LAST_COMMAND_TIME="" 25 | } 26 | if [ -z "$precmd_functions" ]; then 27 | precmd_functions=() 28 | fi 29 | precmd_functions+=display_command_time 30 | 31 | function get_command_time() { 32 | LAST_COMMAND_TIME="$(date '+%s')" 33 | } 34 | if [ -z "$preexec_functions" ]; then 35 | preexec_functions=() 36 | fi 37 | preexec_functions+=get_command_time 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /default/.config/dconf 2 | 3 | /default/.config/gtk-2.0/gtkfilechooser.ini 4 | 5 | /default/.config/mutt/accounts/* 6 | 7 | /default/.config/newsbeuter/cache.db 8 | /default/.config/newsbeuter/history.cmdline 9 | /default/.config/newsbeuter/history.search 10 | /default/.config/newsbeuter/urls 11 | 12 | /default/.config/nvim/bundle/ 13 | /default/.config/nvim/spell/ 14 | 15 | /default/.config/pulse/* 16 | !/default/.config/pulse/default.pa 17 | 18 | /default/.config/qutebrowser/bookmarks/ 19 | /default/.config/qutebrowser/quickmarks 20 | 21 | /default/.config/syncthing/ 22 | 23 | /default/.config/gimp-2.8/ 24 | 25 | /default/.config/zsh/zsh-autosuggestions 26 | /default/.config/zsh/zsh-syntax-highlighting 27 | /default/.config/zsh/zsh_history 28 | /default/.config/zsh/.zcalc_history 29 | 30 | /default/.elinks/bookmarks 31 | /default/.elinks/cookies 32 | /default/.elinks/globhist 33 | /default/.elinks/gotohist 34 | /default/.elinks/searchhist 35 | 36 | /default/.fonts/* 37 | 38 | /default/.gnupg/* 39 | !/default/.gnupg/gpg-agent.conf 40 | 41 | /default/.local/share/* 42 | !/default/.local/share/applications/ 43 | /default/.local/share/applications/* 44 | !/default/.local/share/applications/nvim_in_term.desktop 45 | 46 | /default/.ssh/* 47 | !/default/.ssh/authorized_keys 48 | 49 | /default/.vim/spell/ 50 | /default/.vim/swapdir/ 51 | /default/.vim/undodir/ 52 | 53 | /default/.weechat/plugins 54 | /default/.weechat/plugins.conf 55 | /default/.weechat/script/plugins.xml.gz 56 | /default/.weechat/weechat-discord 57 | /default/.weechat/weechat.log 58 | 59 | /default/bin/hugo 60 | -------------------------------------------------------------------------------- /default/.config/zsh/completion.zsh: -------------------------------------------------------------------------------- 1 | autoload -Uz compinit promptinit 2 | compinit -d /tmp/zcompdump.me 3 | promptinit 4 | [ -e "/etc/gentoo-release" ] && prompt gentoo 5 | zstyle ':completion:*:*:*:*:*' menu select 6 | 7 | zstyle ':completion:*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' 'r:|=*' 'l:|=* r:|=*' 8 | zstyle ':completion::complete:*' use-cache 1 9 | zstyle ':completion::complete:*' cache-path /tmp 10 | zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 11 | zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' 12 | 13 | setopt auto_list # When requesting autocomp ambiguously, show list of options on first request 14 | setopt auto_menu # When autocompleting ambiguously, insert first match on second autocomp request 15 | setopt auto_remove_slash # When the last autocompleted char is a slash and a space is typed next, remove the slash 16 | setopt no_complete_aliases # Complete aliases instead of expanding them 17 | setopt complete_in_word # When autocompleting, cursor should stay at pos instead of going to end of word 18 | setopt glob_complete # When requesting autocomp for glob (.e.g. *), don't replace with matches, instead offer autocomp 19 | setopt list_ambiguous # Don't show completion list when requesting unambiguous autocompletion 20 | unsetopt list_beep # Don't beep on ambiguous completion 21 | setopt list_packed # Make autocompletion columns smaller 22 | unsetopt list_rows_first # Don't sort autocompletion in rows (sort in columns) 23 | setopt menu_complete # When autocompleting, insert the whole first match directly 24 | -------------------------------------------------------------------------------- /default/.zshenv: -------------------------------------------------------------------------------- 1 | export ZDOTDIR="$HOME/.config/zsh/" 2 | 3 | ##### MISC VARIABLES 4 | export PATH="$PATH:/usr/bin:/usr/sbin:/bin:/sbin" 5 | export SYSTEMD_EDITOR="vi" 6 | export EDITOR="nvim" 7 | export GIMP2_DIRECTORY="$HOME/.config/gimp-2.8" 8 | export NODE_REPL_HISTORY="" 9 | export VISUAL="$EDITOR" 10 | export XDG_CONFIG_HOME="$HOME/.config/" 11 | export XDG_DATA_HOME="$HOME/.local/share/" 12 | export DEBUGINFOD_URLS="https://debuginfod.debian.net" 13 | 14 | ##### LESS VARIABLES 15 | # Standout 16 | export LESS_TERMCAP_so=$'\E[01;35;74m' 17 | export LESS_TERMCAP_se=$'\E[0m' 18 | # Underline 19 | export LESS_TERMCAP_us=$'\E[03;135;146m' 20 | export LESS_TERMCAP_ue=$'\E[0m' 21 | # Make blink 22 | export LESS_TERMCAP_mb=$'\E[01;31m' 23 | # Make bold 24 | export LESS_TERMCAP_md=$'\E[01;38;5;74m' 25 | # Turn off bold, blink, underline 26 | export LESS_TERMCAP_me=$'\E[0m' 27 | # Don't create a .lesshst file 28 | export LESSHISTFILE="-" 29 | # Disable a few useless features 30 | export LESSSECURE=1 31 | # Set default command line options 32 | export LESS="--ignore-case --SILENT -R" 33 | 34 | ##### LS_COLORS 35 | LS_COLORS=''; 36 | LS_COLORS="${LS_COLORS}:no=00" # normal text 37 | LS_COLORS="${LS_COLORS}:fi=00" # regular file 38 | LS_COLORS="${LS_COLORS}:di=01;34" # directory 39 | LS_COLORS="${LS_COLORS}:ex=01;32" # executable file 40 | LS_COLORS="${LS_COLORS}:ln=01;36" # symlink 41 | LS_COLORS="${LS_COLORS}:or=40;31" # orphaned link 42 | LS_COLORS="${LS_COLORS}:pi=40;33" # named pipe 43 | LS_COLORS="${LS_COLORS}:so=01;35" # socket 44 | LS_COLORS="${LS_COLORS}:bd=33;01" # block device 45 | LS_COLORS="${LS_COLORS}:cd=33;01" # character device 46 | export LS_COLORS="$LS_COLORS" 47 | export ZLS_COLORS="$LS_COLORS" 48 | -------------------------------------------------------------------------------- /default/.rtorrent.rc: -------------------------------------------------------------------------------- 1 | # rtorrent conf 2 | # LEGAL torrents only ;) 3 | 4 | # Maximum and minimum number of peers to connect to per torrent. 5 | max_peers = 75 6 | 7 | # Mac number of peers to connect to in order to seed. -1 = same as max_peers 8 | max_peers_seed = 5 9 | 10 | # Maximum number of simultanious uploads per torrent. 11 | max_uploads = 5 12 | 13 | # Upload/download rate in KBps 14 | #download_rate = 750 15 | #upload_rate = 50 16 | 17 | # Default directory to save the downloaded torrents. 18 | directory = /wd/torrents/ 19 | session = /wd/rtorrent.session 20 | 21 | # Watch a directory for new torrents, and stop those that have been 22 | # deleted. 23 | schedule = watch_directory,5,5,load.start=/wd/torrents/films/*.torrent 24 | # */ 25 | schedule = untied_directory,5,5,stop_untied= 26 | schedule = tied_directory,5,5,start_tied= 27 | 28 | # Sort torrents per ratio 29 | view.sort_current = main,greater=d.ratio= 30 | view.sort_new = main,less=d.ratio= 31 | view.sort = main 32 | 33 | # Seed to a ratio of at least 2 and then stop. 34 | ratio.enable = 35 | ratio.min.set = 200 36 | 37 | # Port range to use for listening. 38 | port_range = 49153-49153 39 | port_random = no 40 | 41 | # Don't check hash for finished torrents. The raspberry pi doesn't 42 | # handle it well. 43 | check_hash = no 44 | 45 | trackers.use_udp.set = 1 46 | 47 | # Allow incoming encrypted connections, try encrypting outgoing 48 | # connections, if trying o start an encrypted connection fails 49 | # retry without encryption 50 | encryption = allow_incoming,try_outgoing,enable_retry 51 | 52 | # Enable DHT use. 53 | dht = on 54 | dht_port = 6881 55 | 56 | # Enable peer exchange (for torrents not marked private) 57 | protocol.pex.set = 1 58 | -------------------------------------------------------------------------------- /default/.config/mpv/scripts/applesubs.lua: -------------------------------------------------------------------------------- 1 | -- Script to load sub files when they're stored like this: 2 | -- - directory/ 3 | -- episode1.mp4 4 | -- episode2.mp4 5 | -- Subs/ 6 | -- episode1/ 7 | -- 2_English.srt 8 | -- 16_French.srt 9 | -- episode2/ 10 | -- 2_English.srt 11 | -- 16_French.srt 12 | -- For some reason MPV is unable to deal with this by default. 13 | -- Copyright glacambre donut steal (but feel free to copy/paste) 14 | local msg = require "mp.msg" 15 | local utils = require "mp.utils" 16 | mp.add_hook("on_load", 50, function() 17 | local path = mp.get_property_native("path") 18 | local info = utils.file_info(path) 19 | if info.is_dir then 20 | return 21 | end 22 | local dir, file = utils.split_path(path) 23 | local basename = file:match("(.+)%..+$") 24 | if basename == nil then 25 | basename = file 26 | end 27 | local subs_parent_dir = utils.join_path(dir, "Subs") 28 | local subs_dir = utils.join_path(subs_parent_dir, basename) 29 | local sub_files = utils.readdir(subs_dir, "files") 30 | local slangs = mp.get_property_native("slang") 31 | local sub_paths = {} 32 | for _, sub_file in pairs(sub_files) do 33 | for _, slang in pairs(slangs) do 34 | if sub_file:lower():find('%d_' .. slang) then 35 | local sub_path = utils.join_path(subs_dir, sub_file) 36 | table.insert(sub_paths, sub_path) 37 | break 38 | end 39 | end 40 | end 41 | mp.set_property_native("options/sub-files", sub_paths) 42 | end) 43 | -------------------------------------------------------------------------------- /default/.config/newsboat/config: -------------------------------------------------------------------------------- 1 | unbind-key j 2 | bind-key j down 3 | unbind-key k 4 | bind-key k up 5 | unbind-key D 6 | bind-key d delete-article 7 | unbind-key g 8 | bind-key g home 9 | unbind-key G 10 | bind-key G end 11 | unbind-key s 12 | bind-key s sort 13 | unbind-key S 14 | bind-key S rev-sort 15 | unbind-key f 16 | bind-key f goto-url 17 | 18 | always-display-description false 19 | article-sort-order date desc 20 | auto-reload yes 21 | browser "(x-www-browser %u >/dev/null 2>&1) &" 22 | # browser "elinks -remote %u" 23 | confirm-exit no 24 | datetime-format "%F, %T" 25 | delete-read-articles-on-quit no 26 | download-full-page yes 27 | feedlist-format "%4i %n %11u %t" 28 | goto-first-unread yes 29 | goto-next-feed yes 30 | history-limit 0 31 | mark-as-read-on-hover yes 32 | max-download-speed 0 33 | max-items 0 34 | notify-format "newsbeuter: finished reload, %f unread feeds (%n unread articles total)" 35 | notify-program "notify-send" 36 | notify-always no 37 | notify-screen no 38 | notify-xterm yes 39 | notify-beep no 40 | refresh-on-startup yes 41 | reload-only-visible-feeds no 42 | reload-time 60 43 | reload-threads 4 44 | show-keymap-hint yes 45 | show-read-feeds yes 46 | show-read-articles yes 47 | suppress-first-reload no 48 | swap-title-and-hints yes 49 | 50 | color background default default 51 | color listnormal default default 52 | color listfocus color16 color145 53 | color listnormal_unread color111 default 54 | color listfocus_unread color16 color145 55 | color info color250 color237 56 | color article default default 57 | 58 | download-path ~/downloads 59 | max-downloads 10 60 | player mpv 61 | bind-key d pb-delete 62 | bind-key O pb-download 63 | -------------------------------------------------------------------------------- /default/.config/gdb/.gdbinit: -------------------------------------------------------------------------------- 1 | set debuginfod enabled on 2 | 3 | python 4 | import os 5 | import subprocess 6 | from datetime import datetime 7 | end 8 | 9 | source /home/lacambre/.dotfiles/default/.config/gdb/nvim.gdb/nvim.py 10 | set auto-load safe-path / 11 | 12 | set disassembly-flavor intel 13 | 14 | set print elements 0 15 | set print pretty 16 | set print demangle on 17 | set print asm-demangle on 18 | set print frame-arguments all 19 | set print object 20 | set pagination off 21 | set breakpoint pending on 22 | 23 | shell if [ ! -d ~/.local/share/gdb ] ; then rm -rf ~/.local/share/gdb/history ; mkdir -p ~/.local/share/gdb ; fi 24 | set history filename ~/.local/share/gdb/history 25 | set history save on 26 | set history expansion on 27 | set history size unlimited 28 | set history remove-duplicates 1 29 | 30 | set confirm off 31 | 32 | # winheight src 15 33 | 34 | define rf 35 | reverse-finish 36 | end 37 | 38 | # Alert when long-running commands finish 39 | define set_running_since 40 | python 41 | running_since=datetime.now() 42 | end 43 | end 44 | set_running_since 45 | define hook-run 46 | set_running_since 47 | end 48 | define hook-continue 49 | set_running_since 50 | end 51 | define hook-finish 52 | set_running_since 53 | end 54 | define hook-next 55 | set_running_since 56 | end 57 | define hook-step 58 | set_running_since 59 | end 60 | define hook-stop 61 | python 62 | now=datetime.now() 63 | if (now - running_since).seconds > 10: 64 | subprocess.run(["notify-send", "GDB", "Finished running command."]) 65 | end 66 | end 67 | 68 | define printwrite 69 | python 70 | print(gdb.parse_and_eval("(char*)buf").string(length=int(gdb.parse_and_eval("nbytes")))) 71 | end 72 | 73 | shell if test -f "$HOME/.config/gdb/.gdbinit.$HOST"; then echo source "$HOME/.config/gdb/.gdbinit.$HOST"; fi > /tmp/gdbinit.tmp 74 | source /tmp/gdbinit.tmp 75 | -------------------------------------------------------------------------------- /default/.config/zsh/vi-mode-x-paste.zsh: -------------------------------------------------------------------------------- 1 | GET_PRIMARY="wl-paste --primary /dev/null 5 | GUI_CLIPBOARD_AVAILABLE=$? 6 | if ! [ "$GUI_CLIPBOARD_AVAILABLE" = 0 ]; then 7 | command -v "xsel" >/dev/null 8 | GUI_CLIPBOARD_AVAILABLE=$? 9 | GET_PRIMARY="xsel -o -p /dev/null 14 | GUI_CLIPBOARD_AVAILABLE=$? 15 | GET_PRIMARY="xclip -o -selection p :p:h') 2 | vim.cmd.source(config_dir .. '/functions.vim') 3 | vim.cmd.source(config_dir .. '/settings.vim') 4 | vim.cmd.source(config_dir .. '/keymap.vim') 5 | vim.cmd.source(config_dir .. '/autocommands.vim') 6 | vim.cmd.source(config_dir .. '/plugins.vim') 7 | vim.opt.rtp:append('/home/me/prog/firenvim/') 8 | 9 | if vim.g.started_by_firenvim then 10 | vim.g.firenvim_config = { 11 | localSettings = { 12 | ['app.element.io'] = { 13 | takeover = 'never', 14 | }, 15 | ['slack.com'] = { 16 | takeover = 'never', 17 | }, 18 | ['sheets.google.com'] = { 19 | takeover = 'never', 20 | }, 21 | ['docs.google.com'] = { 22 | takeover = 'never', 23 | }, 24 | ['slides.google.com'] = { 25 | takeover = 'never', 26 | }, 27 | }, 28 | } 29 | local max_height = 10 30 | local id = vim.api.nvim_create_augroup("ExpandLinesOnTextChanged", { clear = true }) 31 | vim.api.nvim_create_autocmd({"TextChanged", "TextChangedI"}, { 32 | group = id, 33 | callback = function(ev) 34 | local height = vim.api.nvim_win_text_height(0, {}).all 35 | if height > vim.o.lines and height < max_height then 36 | vim.o.lines = height 37 | end 38 | end 39 | }) 40 | end 41 | 42 | function onTermRequest(e) 43 | if string.sub(vim.v.termrequest, 1, 4) == "\x1b]7;" then 44 | local dir = string.gsub(vim.v.termrequest, "\x1b]7;file://[^/]*", "") 45 | if vim.fn.isdirectory(dir) == 0 then 46 | return 47 | end 48 | vim.api.nvim_buf_set_var(e.buf, "last_osc7_payload", dir) 49 | if vim.o.autochdir and vim.api.nvim_get_current_buf() == e.buf then 50 | vim.cmd.cd(vim.fn.fnameescape(dir)) 51 | end 52 | end 53 | end 54 | 55 | function triggerTermAutochdir(e) 56 | if vim.o.autochdir 57 | and vim.b.last_osc7_payload ~= nil 58 | and vim.fn.isdirectory(vim.b.last_osc7_payload) == 1 59 | then 60 | vim.cmd.cd(vim.fn.fnameescape(vim.b.last_osc7_payload)) 61 | end 62 | end 63 | 64 | vim.api.nvim_create_autocmd({ 'TermRequest' }, { callback = onTermRequest }) 65 | vim.api.nvim_create_autocmd({ 'BufEnter', 'WinEnter', 'DirChanged' }, { callback = triggerTermAutochdir }) 66 | -------------------------------------------------------------------------------- /default/bin/check-pool: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Store cookies in /tmp 4 | COOKIES="/tmp/pool-cookies" 5 | 6 | # Cleanup cookie jar, to get fresh runs every time 7 | rm -f "$COOKIES" 8 | 9 | # Pretend to navigate website 10 | curl -s -c "$COOKIES" -b "$COOKIES" 'http://www.piscine-baker.fr/' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -o /dev/null 11 | curl -s -c "$COOKIES" -b "$COOKIES" 'https://moncentreaquatique.com/module-inscriptions/?centre=135' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Upgrade-Insecure-Requests: 1' -o /dev/null 12 | curl -s -c "$COOKIES" -b "$COOKIES" 'https://moncentreaquatique.com/module-inscriptions/activites/' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Referer: https://moncentreaquatique.com/module-inscriptions/residence/' -H 'Upgrade-Insecure-Requests: 1' -o /dev/null 13 | curl -s -c "$COOKIES" -b "$COOKIES" 'https://moncentreaquatique.com/module-inscriptions/activite/?activite=12' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Referer: https://moncentreaquatique.com/module-inscriptions/activites/' -H 'Upgrade-Insecure-Requests: 1' | grep Semaine > /tmp/pool-new 14 | 15 | if ! [ -e /tmp/pool ] ; then 16 | touch /tmp/pool 17 | fi 18 | 19 | # Compare with previous run 20 | if ! diff /tmp/pool /tmp/pool-new ; then 21 | notify='notify-send "Swimming pool" "New week available"' 22 | if which swaymsg > /dev/null 2>/dev/null ; then 23 | for sock in /run/user/"$(id -u)"/sway-ipc.*.*.sock; do 24 | [ -S "${sock}" ] || continue; 25 | swaymsg -s "${sock}" exec "$notify"; 26 | done; 27 | else 28 | for sock in /run/user/"$(id -u)"/i3/ipc-socket.*; do 29 | [ -S "${sock}" ] || continue; 30 | i3-msg -s "${sock}" exec "$notify"; 31 | done; 32 | fi 33 | fi 34 | -------------------------------------------------------------------------------- /default/.config/zsh/vi-mode.zsh: -------------------------------------------------------------------------------- 1 | bindkey -v 2 | 3 | visual-mode-eol () { 4 | zle visual-mode; 5 | CURSOR=${#BUFFER}; 6 | } 7 | 8 | prev-line-with-sudo () { 9 | BUFFER="sudo $(fc -lnrm "$1*" 1 2>/dev/null | head -n 1)" 10 | CURSOR=${#BUFFER}; 11 | } 12 | 13 | vi-join-prev-history-line () { 14 | BUFFER="$(fc -lnrm "$1*" 1 2>/dev/null | head -n 1) && $BUFFER" 15 | } 16 | 17 | accept-twice () { 18 | accept-line 19 | accept-line 20 | } 21 | 22 | zle -N visual-mode-eol 23 | zle -N prev-line-with-sudo 24 | zle -N vi-join-prev-history-line 25 | zle -N accept-twice 26 | 27 | #todo: find a good binding for spell-word 28 | #todo: find a good binding for quote-region 29 | #Bindings left: ^Z^T^Y^O 30 | bindkey -M viins '^?' backward-delete-char 31 | bindkey -M viins '^H' backward-delete-char 32 | bindkey -M viins '^U' backward-kill-line 33 | bindkey -M viins '^K' insert-last-word 34 | bindkey -M viins '^S' prev-line-with-sudo 35 | bindkey -M viins '^J' vi-join-prev-history-line 36 | bindkey -M viins '^F' emacs-forward-word 37 | bindkey -M viins '^B' emacs-backward-word 38 | bindkey -M viins '^A' beginning-of-line 39 | bindkey -M viins '^[[H' beginning-of-line 40 | bindkey -M viins '^E' end-of-line 41 | bindkey -M viins '^[[F' end-of-line 42 | bindkey -M viins "^N" expand-or-complete 43 | bindkey -M viins "^P" reverse-menu-complete 44 | bindkey -M vicmd 'gg' beginning-of-buffer-or-history 45 | bindkey -M vicmd 'g~' vi-oper-swap-case 46 | bindkey -M vicmd 'G' end-of-buffer-or-history 47 | bindkey -M vicmd 'Y' vi-yank-eol 48 | bindkey -M vicmd 'vv' visual-line-mode 49 | bindkey -M vicmd 'V' visual-mode-eol 50 | bindkey -M vicmd 'u' undo 51 | bindkey -M vicmd 'U' redo 52 | bindkey -M vicmd 'H' run-help 53 | bindkey -M vicmd 'dl' delete-char 54 | bindkey -M vicmd "^[[A" up-line-or-search 55 | bindkey -M vicmd "^[[B" down-line-or-search 56 | bindkey -M viins "^[[A" up-line-or-search 57 | bindkey -M viins "^[[B" down-line-or-search 58 | # / can't be in WORDCHARS otherwise backward-kill-word will kill whole paths 59 | WORDCHARS=${WORDCHARS//\/} 60 | bindkey -M viins "^W" backward-kill-word 61 | # ^[[3~ is the "del" key 62 | bindkey -M viins '^[[3~' delete-char 63 | bindkey -M vicmd '^[[3~' delete-char 64 | bindkey -M menuselect "^Y" accept-and-menu-complete 65 | bindkey -M menuselect "^E" send-break 66 | bindkey -M menuselect "^[" vi-cmd-mode 67 | bindkey -M menuselect "^M" accept-twice 68 | 69 | # Surrouding operators ! 70 | autoload -U select-quoted select-bracketed surround 71 | zle -N select-quoted 72 | zle -N select-bracketed 73 | zle -N delete-surround surround 74 | zle -N add-surround surround 75 | zle -N change-surround surround 76 | 77 | for m in visual viopp; do 78 | for c in {a,i}{\',\",\`}; do 79 | bindkey -M $m $c select-quoted 80 | done 81 | for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do 82 | bindkey -M $m $c select-bracketed 83 | done 84 | done 85 | 86 | bindkey -a cs change-surround 87 | bindkey -a ds delete-surround 88 | bindkey -a ys add-surround 89 | bindkey -M visual S add-surround 90 | -------------------------------------------------------------------------------- /default/.config/gdb/.gdbinit.lacambre-Precision-7540: -------------------------------------------------------------------------------- 1 | 2 | define pl 3 | p expand_location($arg0).file 4 | p expand_location($arg0).line 5 | end 6 | 7 | define pvr 8 | call debug_value_range ($arg0) 9 | end 10 | 11 | define bsa 12 | b if (id = $arg0) 13 | end 14 | 15 | define pui 16 | call pid ($arg0) 17 | end 18 | 19 | define bse 20 | b if (id = $arg0) 21 | end 22 | 23 | define bsr 24 | b if (id = $arg0) 25 | end 26 | 27 | define blt 28 | b if (e = $arg0) 29 | end 30 | 31 | define bgge 32 | b gnat_to_gnu_entity if (gnat_entity == $arg0) 33 | end 34 | 35 | define bgg 36 | b gnat_to_gnu if (gnat_node == $arg0) 37 | end 38 | 39 | define btt 40 | b tree_transform if (gnat_node == $arg0) 41 | end 42 | 43 | define bsgt 44 | b save_gnu_tree if (gnat_entity == $arg0) 45 | end 46 | 47 | define pas 48 | call debug_alias_sets () 49 | end 50 | 51 | define pbb 52 | call debug_bb ($arg0) 53 | end 54 | 55 | define pbm 56 | call debug_bitmap ($arg0) 57 | end 58 | 59 | define pbbn 60 | call debug_bb_n ($arg0) 61 | end 62 | 63 | define pt 64 | call debug_tree ($arg0) 65 | end 66 | 67 | define pr 68 | call debug_rtx ($arg0) 69 | end 70 | 71 | define prli 72 | call debug_rli ($arg0) 73 | end 74 | 75 | define pri 76 | call debug_rtx_find (get_insns(), $arg0) 77 | set $insn = $ 78 | end 79 | 80 | define prl 81 | call debug_rtx_list ($arg0, $arg1) 82 | end 83 | 84 | define pdn 85 | p $arg0.decl.name->identifier.id.str 86 | end 87 | 88 | define xpdn 89 | p $arg0.decl.name->identifier.pointer 90 | end 91 | 92 | define bic 93 | cond $arg0 ($arg1->common.code == $arg2) 94 | end 95 | 96 | define pg 97 | call pn ($arg0) 98 | end 99 | 100 | define pgn 101 | call pn ($arg0) 102 | end 103 | 104 | define pdw 105 | call debug_dwarf_die ($arg0) 106 | end 107 | 108 | define ssi 109 | si 110 | x /i $pc 111 | end 112 | 113 | define nni 114 | ni 115 | x /i $pc 116 | end 117 | 118 | define bmr 119 | break gen_raw_REG if (regno == (int)$arg0) 120 | end 121 | 122 | define bmi 123 | break make_insn_raw if (cfun->emit->x_cur_insn_uid == (int)$arg0) 124 | end 125 | 126 | define xbmi 127 | break make_insn_raw if (cur_insn_uid == (int)$arg0) 128 | end 129 | 130 | define bai 131 | break add_insn if (cfun->emit->x_cur_insn_uid-1 == (int)$arg0) 132 | end 133 | 134 | define bas 135 | break new_alias_set if (last_alias_set == ((int)$arg0 - 1)) 136 | end 137 | 138 | define bba 139 | break ggc-page.c:961 if (result == $arg0) 140 | end 141 | 142 | define cogn 143 | cond $arg0 (gnat_node == $arg1) 144 | end 145 | 146 | define coge 147 | cond $arg0 (gnat_entity == $arg1) 148 | end 149 | 150 | define coix 151 | cond $arg0 ($arg1->u.fld[0].rt_int == $arg2) 152 | end 153 | 154 | define coi 155 | cond $arg0 (insn->u.fld[0].rt_int == $arg1) 156 | end 157 | 158 | define coii 159 | cond $arg0 ((insn->fld[0].rtint == $arg1) || (insn->fld[0].rtint == $arg2)) 160 | end 161 | 162 | define watchflag 163 | watch atree.atree_private_part.nodes.table (1234+2).Field11 164 | end 165 | -------------------------------------------------------------------------------- /default/.config/nvim/custom_snippets/tex.snip: -------------------------------------------------------------------------------- 1 | snippet \article 2 | alias article 3 | \documentclass[12pt,a4paper]{article} 4 | \usepackage[margin=0.75in]{geometry} 5 | \usepackage{utopia} 6 | \usepackage[T1]{fontenc} 7 | \usepackage[utf8]{inputenc} 8 | \usepackage[francais]{babel} 9 | \author{${1:author}} 10 | \title{${2:title}} 11 | \date{\today} 12 | \begin{document} 13 | \maketitle 14 | ${3} 15 | \end{document} 16 | 17 | snippet \letter 18 | alias letter 19 | \documentclass[pdftex,11pt,a4paper]{article} 20 | \usepackage[utf8]{inputenc} 21 | \usepackage[T1]{fontenc} 22 | \usepackage[francais]{babel} 23 | \usepackage[lmargin=20mm, rmargin=20mm]{geometry} 24 | \usepackage{utopia} 25 | \author{${1:author}} 26 | \pagenumbering{gobble} 27 | \makeatletter 28 | \begin{document} 29 | \begin{flushleft} 30 | \@author\\\\ 31 | ${2:address} 32 | \end{flushleft} 33 | \noindent 34 | \hangafter=0 35 | \hangindent=10cm 36 | ${3:recipient} 37 | \paragraph{} 38 | \paragraph{} 39 | \paragraph{Objet:}${4:subject} 40 | \paragraph{}${5:content} 41 | \begin{flushright} 42 | \today \\\\ 43 | \@author 44 | \end{flushright} 45 | \vfill 46 | \end{document} 47 | 48 | snippet \presentation 49 | alias presentation 50 | \documentclass[10pt,xcolor={usenames,dvipsnames}]{beamer} 51 | \usetheme{CambridgeUS} 52 | \usecolortheme{beaver} 53 | \usepackage[utf8]{inputenc} 54 | \usepackage[french]{babel} 55 | \usepackage[T1]{fontenc} 56 | \usepackage[dvipsnames]{xcolor} 57 | \usepackage{listings} 58 | \usepackage{multirow} 59 | \usepackage{colortbl} 60 | \usepackage{hhline} 61 | \author[]{${1:author}} 62 | \title[]{${2:subject}} 63 | \institute[]{${3:institute}} 64 | \date{\today} 65 | \lstset{ % 66 | backgroundcolor=\color{white}, % bg color 67 | basicstyle=\footnotesize, % the size of the fonts that are used for the code 68 | frame=single, % adds a frame around the code 69 | keepspaces=true, % useful for space indents 70 | keywordstyle=\color{BrickRed}, % keyword style 71 | language=C, % the language of the code 72 | numbers=left, % values are (none, left, right) 73 | numberstyle=\tiny\color{gray}, % the style that is used for the line-numbers 74 | } 75 | \definecolor{RowColor}{RGB}{216,216,216} 76 | \setbeamertemplate{sections/subsections in toc}[circle] 77 | \setbeamerfont{section number projected}{% 78 | family=\rmfamily,series=\bfseries,size=\normalsize} 79 | \setbeamercolor{section number projected}{bg=White,fg=BrickRed} 80 | \setbeamertemplate{navigation symbols}{} 81 | \setbeamertemplate{itemize items}{\color{BrickRed}$\blacktriangleright$} 82 | \setbeamertemplate{enumerate items}{\color{BrickRed}$\blacktriangleright$} 83 | \begin{document} 84 | \maketitle 85 | \section{${4:section}} 86 | \begin{frame} 87 | \frametitle{${4:section}} 88 | \tableofcontents 89 | \end{frame} 90 | \section{${5:section}} 91 | \begin{frame} 92 | \frametitle{${5:section}} 93 | \end{frame} 94 | \end{document} 95 | -------------------------------------------------------------------------------- /default/.config/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | ##### ZSH MODULES 2 | zmodload zsh/complete # Basic completion code 3 | zmodload zsh/complist # Completion listing extension 4 | zmodload zsh/zpty # Enables starting commands in pseudo terminals 5 | 6 | ##### PATH 7 | # This is here instead of zshenv because I'm overriding default binaries. 8 | # I don't want binaries to be overriden in scripts and while zshenv is sourced 9 | # for scripts, zshrc isn't. 10 | export PATH="$HOME/bin/:$HOME/.cargo/bin/:$PATH" 11 | 12 | source "$ZDOTDIR/completion.zsh" 13 | source "$ZDOTDIR/history.zsh" 14 | source "$ZDOTDIR/ps1.zsh" 15 | source "$ZDOTDIR/vi-mode-color-prompt.zsh" 16 | source "$ZDOTDIR/vi-mode-x-paste.zsh" 17 | source "$ZDOTDIR/vi-mode.zsh" 18 | source "$ZDOTDIR/command_time.zsh" 19 | # aliases are defined after syntax_highlighting because '=' isn't legal 20 | source "$ZDOTDIR/aliases.zsh" 21 | source "$ZDOTDIR/zsh_auto_suggestions.zsh" 22 | source "$ZDOTDIR/zsh_ileum.zsh" 23 | source "$ZDOTDIR/zsh_syncwd.zsh" 24 | 25 | ### VARIOUS OPTIONS 26 | setopt auto_cd # Cd when a dirname has been given instead of a program 27 | setopt auto_param_keys # Remove automatically inserted chars (' ', ','...) when special chars are typed 28 | setopt auto_param_slash # When completing a dir name, add a trailing slash 29 | setopt auto_pushd # Cd pushes directories on the pushd stack 30 | unsetopt beep # Don't beep. Ever. 31 | unsetopt bg_nice # Don't nice background jobs 32 | setopt cdable_vars # If dirname given to cd isn't a dir, try acting like a ~ is in front of it 33 | #setopt correct_all # Try to correct typos in bin/dir names 34 | unsetopt flow_control # Disable scroll-lock in shell editor 35 | setopt glob_dots # Do not require a leading '.' in order to match files 36 | setopt hash_cmds # Hash command locations for faster invocations 37 | setopt hash_dirs # Hash directories containing invocked commands 38 | setopt hash_list_all # Hash completions/spelling corrections to go faster on second completion/correction 39 | setopt hup # Send hup to running jobs when the shell exits 40 | setopt interactive_comments # Recognize comments as comments in the shell 41 | unsetopt list_types # Don't show a trailing character to show filetype (colors are enough) 42 | setopt local_options # Save options before fn exec and restore after 43 | setopt local_traps # Save traps before fn exec and restore after 44 | setopt magic_equal_subst # Perform expansion on ~ even when using --arg=~/blah 45 | setopt mail_warning # Warn if a mail file has been accessed since the shell last checked 46 | setopt mark_dirs # Append a / on dir names created from globbing 47 | setopt monitor # Allow job control 48 | setopt multios # Do implicit tee/cat when trying to redir output multiple times 49 | unsetopt notify # Wait for a new prompt to be displayed before printing jobs status 50 | setopt numeric_glob_sort # On {01..XX} expansions, sort numerically instead of lexicographically 51 | setopt pushd_ignore_dups # Don't duplicate directories in the pushd stack 52 | setopt pushd_silent # Don't print directory stack after pushd/popd 53 | 54 | export NVM_DIR="$HOME/.config//nvm" 55 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm 56 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion 57 | -------------------------------------------------------------------------------- /default/.config/nvim/keymap.vim: -------------------------------------------------------------------------------- 1 | " twice disables highlighting of currently matched search pattern 2 | nnoremap nohlsearch 3 | " Close quickfix/location list 4 | nnoremap qc ccl 5 | nnoremap lc lcl 6 | " Next/previous item in the quickfix list 7 | nnoremap qn cnext 8 | nnoremap qp cprev 9 | " Next/previous item in the location list 10 | nnoremap ln lnext 11 | nnoremap lp lprev 12 | " Earlier/later item in the undo list 13 | nnoremap ue earlier 14 | nnoremap ul later 15 | 16 | " wrapped lines: go to next row instead of next line 17 | nnoremap j gj 18 | nnoremap k gk 19 | nnoremap gj j 20 | nnoremap gk k 21 | 22 | " Y yanks to the end of the line instead of the whole line (like D) 23 | nnoremap Y y$ 24 | " vv selects the whole line, just like dd deletes the whole line 25 | nnoremap vv V 26 | " V selects till the end of the line just like D deletes till eol 27 | nnoremap V v$h 28 | " Yanking in visual mode doesn't move the cursor back to where it was 29 | vnoremap y "my\"" . v:register . "y`y" 30 | 31 | " s saves current buffer 32 | nnoremap s w 33 | " S saves with sudo 34 | nnoremap S set nomodifiedw !sudo tee > /dev/null % 35 | 36 | " x closes the current buffer 37 | nnoremap x call WipeButKeepOpen(0) 38 | " X closes the current window 39 | nnoremap X close 40 | 41 | " R reloads the current buffer 42 | nnoremap R e! 43 | 44 | " . repeats the last action on a visual block 45 | vnoremap . normal . 46 | 47 | " Move between splits with alt+mov key 48 | for i in ['h', 'j', 'k', 'l', 'H', 'J', 'K', 'L'] 49 | execute('noremap wincmd ' . i . '') 50 | execute('inoremap wincmd ' . i . '') 51 | execute('tnoremap wincmd ' . i . '') 52 | endfor 53 | function! OnAltSpace() abort 54 | let b:should_insert = 0 55 | stopinsert 56 | endfunction 57 | tnoremap call OnAltSpace() 58 | 59 | " Move in command line mode using hjkl 60 | for b in [["", ""], 61 | \ ["", ""], 62 | \ ["", ""], 63 | \ ["", ""], 64 | \ ["", ""], 65 | \ ["", ""]] 66 | execute('lnoremap ' . b[0] . ' ' . b[1]) 67 | execute('cnoremap ' . b[0] . ' ' . b[1]) 68 | " Warning: Unexpected behavior might ensue when it comes to closing 69 | " completion menu because of 70 | execute('inoremap ' . b[0] . ' (pumvisible() ? "\" : "") . "\' . b[1] . '"') 71 | endfor 72 | 73 | " Go to a tab by using alt+colnum 74 | noremap 1gt 75 | noremap 2gt 76 | noremap 3gt 77 | noremap 4gt 78 | noremap 5gt 79 | noremap 6gt 80 | noremap 7gt 81 | noremap 8gt 82 | noremap 9gt 83 | noremap 10gt 84 | 85 | " Move tabs by using alt+shift+colnum 86 | let i = 1 87 | while i < 10 88 | execute('noremap tabm ' . i . '') 89 | execute('inoremap tabm ' . i . '') 90 | let i = i + 1 91 | endwhile 92 | 93 | " Create a new tab 94 | nnoremap t tabnew 95 | 96 | " Redo with U 97 | nnoremap U 98 | 99 | " This is needed because of mathchpairs+=<:> in settings.vim 100 | nnoremap << < 101 | " Do not exit Visual mode when shift-indenting 102 | vnoremap < >gv 104 | " Do not exit Visual mode when incrementing 105 | vnoremap gv 106 | vnoremap gv 107 | " Do not exit Visual mode after changing case 108 | vnoremap ~ ~gv 109 | 110 | " Call a function that checks whether we can suspend or not 111 | nnoremap call SuspendIfInShell() 112 | vnoremap call SuspendIfInShell()gv 113 | 114 | " Insert mode: go to beginning of word 115 | inoremap b 116 | " Insert mode: go to end of word 117 | inoremap el 118 | " Insert mode: delete following word 119 | inoremap strcharpart(getline('.')[col('.') - 1:], 0, 1) == ' ' ? "\d2w" : "\dw" 120 | 121 | " Open current url/file (same as Netrw, without the awful file browser) 122 | nnoremap gx execute('silent! !xdg-open ' . expand('')) 123 | -------------------------------------------------------------------------------- /default/.config/nvim/settings.vim: -------------------------------------------------------------------------------- 1 | set encoding=utf-8 2 | 3 | if $TERM == "linux" || exists("g:started_by_nwin") || exists("g:started_by_firenvim") 4 | set bg=light 5 | endif 6 | 7 | set mouse= 8 | 9 | set autochdir 10 | 11 | " Choose what should be saved in the Shada file 12 | " We use a very small number ('10) to make neovim startup faster and try to be 13 | " smart about what files we keep. 14 | set shada='10,:10,/10,f0,r/home/me/zsh:,r/tmp,r/run/user/1000/firenvim 15 | 16 | set tabpagemax=9 " Have a maximum of 9 tabs open at all time 17 | set showtabline=1 " Show tabline when there are at least two 18 | set tabline=%!MyTabLine() " MyTabLine is defined in functions.vim 19 | 20 | set wildignorecase " Ignore case when completing filenames 21 | set wildmenu " Adds the menu at the bottom of the screen 22 | set wildoptions+=pum,fuzzy " Cool popup menu 23 | set wildchar= 24 | set wildignore+=*.o,*.class " Ignore certain filetypes 25 | set wildignore+=*.cmi,*.cmo 26 | set wildignore+=*.jpg,*.jpeg,*.png,*.gif,*.ico,*.svg,*.xcf 27 | set wildignore+=*.mp3,*.ogg,*.opus,*.wav,*.flac, 28 | set wildignore+=*.avi,*.mp4,*.mpg,*.mov,*.flv,*.webm 29 | set wildignore+=*.pdf,*.doc,*.docx,*.xls,*.xlsx,*.odt,*.ods 30 | set wildignore+=*.min.js 31 | set wildignore+=*.pem 32 | set wildignore+=*.tar,*.zip,*.rar,*.7z,*.tgz 33 | set wildignore+=*.swp,*.swp.*,*.bak 34 | set wildignore+=*.toc,*.nav,*.aux,*.log,*.dvi,*.cls,*.sty,*.bib 35 | 36 | set completeopt=menu,menuone,noinsert,noselect,fuzzy 37 | 38 | set showcmd " Show commands at the bottom of the screen 39 | set noruler " Don't show cursor position at the bottom 40 | set noshowmode " Don't show the mode in the line at the bottom 41 | set laststatus=1 " Always show the statusline 42 | set statusline=%!MyStatusLine() " Defined in functions.vim 43 | set splitbelow " Open horizontal splits below 44 | set splitright " Open vertical splits on the right 45 | 46 | set list 47 | set listchars=tab:►\ 48 | 49 | set lazyredraw " Redraw the screen only when it's needed 50 | set autoread " Periodically check if the file changed 51 | 52 | set hlsearch " Shows the last search pattern 53 | set incsearch " Highlight searches as the regex is typed 54 | set inccommand=nosplit " Display changes as they are made 55 | set ignorecase " Ignore case when searching 56 | set smartcase " Don't ignore case when uppercase in search pattern 57 | set gdefault " Patterns match all matches on same line by default 58 | 59 | set hidden " Do not unload buffers when leaving them 60 | 61 | set backspace=indent,eol,start " backspace deletes indent, eol and stat 62 | set matchpairs+=<:> 63 | 64 | set foldmethod=indent " Block folding is done with syntax 65 | set foldnestmax=10 " Fold a maximum of 10 blocks 66 | set nofoldenable " Don't fold on file opening 67 | 68 | set undofile " Enable persistent undo 69 | set undolevels=1000 " Maximum number of changes that can be undone 70 | set undoreload=10000 " Maximum number lines to save for undo on a buffer reload 71 | 72 | set so=1 " Number of lines between the cursor and the top/bottom of the screen 73 | 74 | set noerrorbells " No error bells 75 | set novisualbell 76 | 77 | set modeline " Execute vim commands that are at the end of a file 78 | set modelines=5 " Maximum number of lines that are checked for modeline 79 | 80 | set sidescroll=1 " When scrolling horizontally, move col by col 81 | 82 | set nojoinspaces " Don't put 2 spaces when joining lines 83 | 84 | set expandtab 85 | 86 | set cino+=#1 " Make >> be able to shift lines that start with '#' in C 87 | 88 | let g:loaded_netrwPlugin = 1 " Netrw is rather annoying, diable it 89 | " let g:loaded_netrw = 1 " But fugitive needs some of it 90 | let g:netrw_dirhistmax=0 " Do not write to ~/.vim/netrwist 91 | let g:netrw_banner=0 " Hide the filebrowser banner 92 | let g:netrw_browsex_viewer= "xdg-open" " Open files with xdg-open 93 | 94 | let g:tex_flavor = "latex" " Sets which kind of latex I use 95 | 96 | let g:neovide_cursor_animation_length = 0.05 " Neovide cursor animation duration 97 | let g:neovide_scroll_animation_length = 0.04 " Neovide scroll animation duration 98 | -------------------------------------------------------------------------------- /default/.config/pulse/default.pa: -------------------------------------------------------------------------------- 1 | #!/usr/bin/pulseaudio -nF 2 | # 3 | # This file is part of PulseAudio. 4 | # 5 | # PulseAudio is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # PulseAudio is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public License 16 | # along with PulseAudio; if not, see . 17 | 18 | # This startup script is used only if PulseAudio is started per-user 19 | # (i.e. not in system mode) 20 | 21 | .fail 22 | 23 | ### Automatically restore the volume of streams and devices 24 | load-module module-device-restore 25 | load-module module-stream-restore 26 | load-module module-card-restore 27 | 28 | ### Automatically augment property information from .desktop files 29 | ### stored in /usr/share/application 30 | load-module module-augment-properties 31 | 32 | ### Should be after module-*-restore but before module-*-detect 33 | load-module module-switch-on-port-available 34 | 35 | ### Automatically load driver modules depending on the hardware available 36 | .ifexists module-udev-detect.so 37 | load-module module-udev-detect 38 | .else 39 | ### Use the static hardware detection module (for systems that lack udev support) 40 | load-module module-detect 41 | .endif 42 | 43 | ### Automatically connect sink and source if JACK server is present 44 | .ifexists module-jackdbus-detect.so 45 | .nofail 46 | load-module module-jackdbus-detect channels=2 47 | .fail 48 | .endif 49 | 50 | ### Automatically load driver modules for Bluetooth hardware 51 | .ifexists module-bluetooth-policy.so 52 | load-module module-bluetooth-policy 53 | .endif 54 | 55 | .ifexists module-bluetooth-discover.so 56 | load-module module-bluetooth-discover 57 | .endif 58 | 59 | ### Load several protocols 60 | .ifexists module-esound-protocol-unix.so 61 | load-module module-esound-protocol-unix 62 | .endif 63 | load-module module-native-protocol-unix 64 | load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 65 | 66 | ### Load additional modules from GConf settings. This can be configured with the paprefs tool. 67 | ### Please keep in mind that the modules configured by paprefs might conflict with manually 68 | ### loaded modules. 69 | .ifexists module-gconf.so 70 | .nofail 71 | load-module module-gconf 72 | .fail 73 | .endif 74 | 75 | ### Automatically restore the default sink/source when changed by the user 76 | ### during runtime 77 | ### NOTE: This should be loaded as early as possible so that subsequent modules 78 | ### that look up the default sink/source get the right value 79 | load-module module-default-device-restore 80 | 81 | ### Automatically move streams to the default sink if the sink they are 82 | ### connected to dies, similar for sources 83 | load-module module-rescue-streams 84 | 85 | ### Make sure we always have a sink around, even if it is a null sink. 86 | load-module module-always-sink 87 | 88 | ### Honour intended role device property 89 | load-module module-intended-roles 90 | 91 | ### Automatically suspend sinks/sources that become idle for too long 92 | load-module module-suspend-on-idle 93 | 94 | ### If autoexit on idle is enabled we want to make sure we only quit 95 | ### when no local session needs us anymore. 96 | .ifexists module-console-kit.so 97 | load-module module-console-kit 98 | .endif 99 | .ifexists module-systemd-login.so 100 | load-module module-systemd-login 101 | .endif 102 | 103 | ### Enable positioned event sounds 104 | load-module module-position-event-sounds 105 | 106 | ### Cork music/video streams when a phone stream is active 107 | load-module module-role-cork 108 | 109 | ### Modules to allow autoloading of filters (such as echo cancellation) 110 | ### on demand. module-filter-heuristics tries to determine what filters 111 | ### make sense, and module-filter-apply does the heavy-lifting of 112 | ### loading modules and rerouting streams. 113 | load-module module-filter-heuristics 114 | load-module module-filter-apply 115 | 116 | ### Make some devices default 117 | #set-default-sink output 118 | #set-default-source input 119 | -------------------------------------------------------------------------------- /default/.config/xorg/Xdefaults: -------------------------------------------------------------------------------- 1 | /* #include "/etc/X11/app-defaults/XTerm-color" */ 2 | 3 | !BLK Cursor 4 | #define _color0 #000000 5 | #define _color8 #5C6370 6 | !RED Tag 7 | #define _color1 #E45649 8 | #define _color9 #e06c75 9 | !GRN SpecialKey 10 | #define _color2 #50A14F 11 | #define _color10 #50A14F 12 | !YEL Keyword 13 | #define _color3 #986801 14 | #define _color11 #986801 15 | !BLU Number 16 | #define _color4 #4078F2 17 | #define _color12 #4078F2 18 | !MAG Precondit 19 | #define _color5 #A626A4 20 | #define _color13 #A626A4 21 | !CYN Float 22 | #define _color6 #0184BC 23 | #define _color14 #0184BC 24 | !WHT Search 25 | #define _color7 #A0A1A7 26 | #define _color15 #FFFFFF 27 | !FMT Include, StatusLine, ErrorMsg 28 | #define _colorBD #ffcfaf 29 | #define _colorUL #ccdc90 30 | #define _colorIT #80d4aa 31 | !TXT Normal, Normal, Cursor 32 | #define _foreground #383A42 33 | #define _background #FFFFFF 34 | #define _cursorColor #D0D0D0 35 | !Font attributes 36 | #define _font_name NotoMono 37 | #define _font_size 11 38 | 39 | xft*antialias : true 40 | 41 | *xterm*termName : xterm-256color 42 | *xterm*faceName : _font_name 43 | *xterm*faceSize : _font_size 44 | *xterm*altIsNotMeta : true 45 | *xterm*metaSendsEscape : true 46 | *xTerm*color0 : _color0 47 | *xTerm*color1 : _color1 48 | *xTerm*color2 : _color2 49 | *xTerm*color3 : _color3 50 | *xTerm*color4 : _color4 51 | *xTerm*color5 : _color5 52 | *xTerm*color6 : _color6 53 | *xTerm*color7 : _color7 54 | *xTerm*color8 : _color8 55 | *xTerm*color9 : _color9 56 | *xTerm*color10 : _color10 57 | *xTerm*color11 : _color11 58 | *xTerm*color12 : _color12 59 | *xTerm*color13 : _color13 60 | *xTerm*color14 : _color14 61 | *xTerm*color15 : _color15 62 | *xTerm*foreground : _foreground 63 | *xTerm*background : _background 64 | *xTerm*cursorColor : _cursorColor 65 | 66 | *URxvt*font : xft:_font_name:size=_font_size 67 | *URxvt*letterSpace : -1 68 | *URxvt*scrollBar : false 69 | *URxvt*termName : rxvt-unicode-256color 70 | *URxvt*color0 : _color0 71 | *URxvt*color1 : _color1 72 | *URxvt*color2 : _color2 73 | *URxvt*color3 : _color3 74 | *URxvt*color4 : _color4 75 | *URxvt*color5 : _color5 76 | *URxvt*color6 : _color6 77 | *URxvt*color7 : _color7 78 | *URxvt*color8 : _color8 79 | *URxvt*color9 : _color9 80 | *URxvt*color10 : _color10 81 | *URxvt*color11 : _color11 82 | *URxvt*color12 : _color12 83 | *URxvt*color13 : _color13 84 | *URxvt*color14 : _color14 85 | *URxvt*color15 : _color15 86 | *URxvt*foreground : _foreground 87 | *URxvt*background : _background 88 | *URxvt*cursorColor : _cursorColor 89 | *URxvt*perl-ext : 90 | *URxvt*perl-ext-common : 91 | *URxvt*iso14755 : False 92 | 93 | *VT100*colorMode : on 94 | *VT100*boldColors : on 95 | *VT100*dynamicColors : on 96 | *VT100*color0 : _color0 97 | *VT100*color1 : _color1 98 | *VT100*color2 : _color2 99 | *VT100*color3 : _color3 100 | *VT100*color4 : _color4 101 | *VT100*color5 : _color5 102 | *VT100*color6 : _color6 103 | *VT100*color7 : _color7 104 | *VT100*color8 : _color8 105 | *VT100*color9 : _color9 106 | *VT100*color10 : _color10 107 | *VT100*color11 : _color11 108 | *VT100*color12 : _color12 109 | *VT100*color13 : _color13 110 | *VT100*color14 : _color14 111 | *VT100*color15 : _color15 112 | *VT100*foreground : _foreground 113 | *VT100*background : _background 114 | *VT100*cursorColor : _cursorColor 115 | 116 | #if PLANES > 8 117 | *SimpleMenu*background : _background 118 | *SimpleMenu*foreground : _foreground 119 | 120 | *Form.menubar.background : _background 121 | *Form.menubar*background : _background 122 | *Form.menubar.foreground : _foreground 123 | *Form.menubar*foreground : _foreground 124 | *Form.background : _background 125 | 126 | *mainMenu*background : _background 127 | *mainMenu*foreground : _foreground 128 | *vtMenu*background : _background 129 | *vtMenu*foreground : _foreground 130 | *fontMenu*background : _background 131 | *fontMenu*foreground : _foreground 132 | *tekMenu*background : _background 133 | *tekMenu*foreground : _foreground 134 | 135 | *VT100.scrollbar.thumb : vlines2 136 | *VT100.scrollbar.width : 0 137 | *VT100.scrollbar.background : _background 138 | *VT100.scrollbar.foreground : _foreground 139 | *VT100.scrollbar.borderWidth : 0 140 | *VT100.scrollbar.displayList :\ 141 | foreground gray90;\ 142 | lines 1,-1,-1,-1,-1,1;\ 143 | foreground gray60;\ 144 | lines -1,0,0,0,0,-1 145 | #endif 146 | -------------------------------------------------------------------------------- /default/.XCompose: -------------------------------------------------------------------------------- 1 | # Use xev to discover the name of the keys 2 | : "Â" 3 | : "Ê" 4 | : "Î" 5 | : "Ô" 6 | : "Û" 7 | : "Ŷ" 8 | : "â" 9 | : "ê" 10 | : "î" 11 | : "ô" 12 | : "û" 13 | : "ŷ" 14 | : "^" 15 | : "^" 16 | : "Ä" 17 | : "Ë" 18 | : "Ï" 19 | : "Ö" 20 | : "Ü" 21 | : "Ÿ" 22 | : "ä" 23 | : "ë" 24 | : "ï" 25 | : "ö" 26 | : "ü" 27 | : "ÿ" 28 | : "¨" 29 | : "¨" 30 | : "À" 31 | : "È" 32 | : "Ì" 33 | : "Ò" 34 | : "Ù" 35 | : "à" 36 | : "è" 37 | : "ì" 38 | : "ò" 39 | : "ù" 40 | : "`" 41 | : "`" 42 | # Somehow AltGr+o sends ocircumflex but I want œ instead 43 | : "œ" 44 | : "Œ" 45 | # Change AltGr+a from â to æ 46 | : "æ" 47 | : "Æ" 48 | # Change AltGR+l from Ô to λ 49 | : "λ" 50 | : "Λ" 51 | # Change AltGR+B from ’ to Β 52 | : "Β" 53 | # Change AltGR+g from ae to γ 54 | : "γ" 55 | : "Γ" 56 | # Change AltGR+d from Ê to Δ 57 | : "Δ" 58 | : "δ" 59 | # Change AltGR+z from å to ζ 60 | : "ζ" 61 | : "Ζ" 62 | # Change AltGR+t from þ to τ 63 | : "τ" 64 | : "Τ" 65 | # Change AltGR+p from ¶ to π 66 | : "π" 67 | : "Π" 68 | # Change AltGR+n from ¬ to ν 69 | : "ν" 70 | # Change AltGR+k from Î to κ 71 | : "κ" 72 | : "Κ" 73 | # Change AltGR+h from ð to η 74 | : "η" 75 | : "Η" 76 | # Change AltGr+m from ¹ to μ 77 | : "μ" 78 | : "Μ" 79 | # Change AltGr+i from î to ι 80 | : "ι" 81 | : "Ι" 82 | # Change AltGr+u from û to υ 83 | : "υ" 84 | : "Υ" 85 | # Change AltGr+? 86 | : "⸮" 87 | 88 | : "→" U2192 89 | : "←" U2190 90 | : "↔" U2194 91 | : "⇒" U21D2 92 | : "⇐" U21D0 93 | : "⇔" U21D4 94 | : "…" U2026 95 | : "™" U2122 96 | <0>: "⁰" U2070 97 | <1>: "¹" U00B9 98 | <2>: "²" U20B2 99 | <3>: "³" U00B3 100 | <4>: "⁴" U2074 101 | <5>: "⁵" U2075 102 | <6>: "⁶" U2076 103 | <7>: "⁷" U2077 104 | <8>: "⁸" U2078 105 | <9>: "⁹" U2079 106 | : "☺" U263A # WHITE SMILING FACE 107 | : "☹" U2639 # WHITE FROWNING FACE 108 | <3>: "❤" U2764 # HEAVY BLACK HEART 109 |

: "🤦" U0001f926 114 | : "🤷" U0001f937 115 | : "😉" U0001f609 116 | : "🤔" U0001f914 117 | -------------------------------------------------------------------------------- /default/.config/gdb/nvim.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import os 3 | 4 | class Nvim(): 5 | def __enter__(self): 6 | from pynvim import attach 7 | addr = os.environ.get("NVIM_LISTEN_ADDRESS", None) 8 | self.nvim = attach("socket", path=addr) 9 | return self.nvim 10 | def __exit__(self, type, value, traceback): 11 | self.nvim.stop_loop() 12 | 13 | def find_buf_for(n, name): 14 | bufs = [buf for buf in n.api.list_bufs() if n.api.buf_get_name(buf) == name] 15 | if len(bufs) < 1: 16 | return None 17 | return bufs[0] 18 | 19 | def get_buf_named(n, name): 20 | buf = find_buf_for(n, name) 21 | if buf is None: 22 | buf = n.api.call_function("bufadd", name) 23 | return buf 24 | 25 | def find_window_for(n, file): 26 | buf = find_buf_for(n, file) 27 | if buf is None: 28 | return None 29 | wins = [win for win in n.api.list_wins() if n.api.win_get_buf(win) == buf] 30 | if len(wins) < 1: 31 | return None 32 | return wins[0] 33 | 34 | def get_window_for(n, file): 35 | win = find_window_for(n, file) 36 | if win is None: 37 | n.command(f"split {file}") 38 | win = [win for win in n.api.list_wins() if n.api.win_get_buf(win) == buf][0] 39 | return win 40 | 41 | frame_group = "gdb/frames" 42 | frame_sign = "gdb/frame_sign" 43 | focused_frame_sign = "gdb/focused_frame_sign" 44 | 45 | def gather_frames(gdb): 46 | frame = gdb.newest_frame() 47 | result = [] 48 | while frame: 49 | result.append(frame) 50 | frame = frame.older() 51 | return reversed(result) 52 | 53 | def gather_usable_frames(gdb): 54 | result = [] 55 | for frame in gather_frames(gdb): 56 | sal = frame.find_sal() 57 | if sal is None: 58 | continue 59 | if sal.symtab is not None and os.path.exists(sal.symtab.fullname()): 60 | result.append(frame) 61 | return result 62 | 63 | def gather_old_signs(n): 64 | result = {} 65 | for buf in n.api.list_bufs(): 66 | name = n.api.buf_get_name(buf) 67 | result[buf] = n.api.call_function("sign_getplaced", [name, {'group': frame_group}]) 68 | return result 69 | 70 | def place_signs(n, frames): 71 | for frame in frames: 72 | sal = frame.find_sal() 73 | name = sal.symtab.fullname() 74 | if not os.path.exists(name): 75 | continue 76 | if get_buf_named(n, name) is None: 77 | continue 78 | line = sal.line 79 | n.api.call_function("sign_place", [0, frame_group, frame_sign, name, {'lnum': line}]) 80 | win = find_window_for(n, name) 81 | if win is None: 82 | continue 83 | n.api.win_set_cursor(win, [line, 0]) 84 | 85 | def place_focused_sign(n, gdb): 86 | selected_frame = gdb.selected_frame() 87 | sal = selected_frame.find_sal() 88 | if sal is None or sal.symtab is None: 89 | return 90 | filename = sal.symtab.fullname() 91 | if not os.path.exists(filename): 92 | return 93 | line = sal.line 94 | win = find_window_for(n, filename) 95 | if win is not None: 96 | n.api.win_set_cursor(win, [line, 0]) 97 | else: 98 | if get_buf_named(n, filename) is None: 99 | return 100 | n.api.call_function("sign_define", [focused_frame_sign, {'text': '»', 'texthl': 'String'}]) 101 | n.api.call_function("sign_place", [0, frame_group, focused_frame_sign, filename, {'lnum': line}]) 102 | 103 | def on_stopped(event): 104 | with Nvim() as n: 105 | n.api.call_function("sign_define", [frame_sign, {'text': '»'}]) 106 | oldsigns = gather_old_signs(n) 107 | place_signs(n, gather_usable_frames(gdb)) 108 | for buf in oldsigns: 109 | for sign in oldsigns[buf][0]['signs']: 110 | n.api.call_function("sign_unplace", [frame_group, sign]) 111 | place_focused_sign(n, gdb) 112 | 113 | breakpoint_group = "gdb/breakpoints" 114 | breakpoint_sign = "gdb/breakpoint_sign" 115 | 116 | def place_breakpoints(id, sals): 117 | with Nvim() as n: 118 | n.api.call_function("sign_define", [breakpoint_sign, {'text': '●'}]) 119 | for sal in sals: 120 | if sal.symtab is None: 121 | continue 122 | name = sal.symtab.fullname() 123 | if not os.path.exists(name): 124 | continue 125 | if get_buf_named(n, name) is None: 126 | continue 127 | n.api.call_function("sign_place", [id, breakpoint_group, breakpoint_sign, name, {'lnum': sal.line}]) 128 | 129 | def on_breakpoint_created(breakpoint): 130 | if breakpoint.location is None: 131 | return 132 | try: 133 | (_, locs) = gdb.decode_line(breakpoint.location) 134 | except: 135 | return 136 | place_breakpoints(breakpoint.number, locs) 137 | 138 | def on_breakpoint_deleted(breakpoint): 139 | if breakpoint.location is None: 140 | return 141 | with Nvim() as n: 142 | n.api.call_function("sign_unplace", [breakpoint_group, {'id': breakpoint.number}]) 143 | 144 | def on_breakpoint_modified(breakpoint): 145 | if breakpoint.enabled: 146 | on_breakpoint_created(breakpoint) 147 | else: 148 | on_breakpoint_deleted(breakpoint) 149 | 150 | gdb.events.stop.connect(on_stopped) 151 | gdb.events.breakpoint_created.connect(on_breakpoint_created) 152 | gdb.events.breakpoint_deleted.connect(on_breakpoint_deleted) 153 | -------------------------------------------------------------------------------- /default/.config/nvim/plugins.vim: -------------------------------------------------------------------------------- 1 | 2 | let s:do_update = v:false 3 | try 4 | packadd minpac 5 | catch 6 | exe '!git clone https://github.com/k-takata/minpac.git ' . stdpath('config') . '/pack/minpac/opt/minpac' 7 | packadd minpac 8 | let s:do_update = v:true 9 | endtry 10 | 11 | call minpac#init() 12 | 13 | call minpac#add('https://github.com/k-takata/minpac') 14 | 15 | " To be used everywhere, even in terminal 16 | call minpac#add('https://github.com/kana/vim-submode') 17 | function SetupResizeSubmode() abort 18 | let g:submode_timeout = 0 19 | let g:submode_always_show_submode = 1 20 | call submode#enter_with('resize', 'n', '', 'r', '') 21 | call submode#map('resize', 'n', '', 'h', '<') 22 | call submode#map('resize', 'n', '', 'j', '+') 23 | call submode#map('resize', 'n', '', 'k', '-') 24 | call submode#map('resize', 'n', '', 'l', '>') 25 | call nvim_input('r') 26 | endfunction 27 | nnoremap r call SetupResizeSubmode() 28 | 29 | call minpac#add('https://github.com/chrisbra/Recover.vim') 30 | 31 | " New pending operators, functions and motions 32 | call minpac#add('https://github.com/tommcdo/vim-exchange') 33 | call minpac#add('https://github.com/tpope/vim-repeat') 34 | call minpac#add('https://github.com/tpope/vim-surround') 35 | call minpac#add('https://github.com/wellle/targets.vim') 36 | call minpac#add('https://github.com/junegunn/vim-easy-align') 37 | nmap ga (EasyAlign) 38 | vmap ga (EasyAlign) 39 | 40 | " New text objects 41 | call minpac#add('https://github.com/kana/vim-textobj-user') 42 | call minpac#add('https://github.com/glts/vim-textobj-comment') 43 | call minpac#add('https://github.com/kana/vim-textobj-entire') 44 | call minpac#add('https://github.com/Julian/vim-textobj-variable-segment', {'branch':'main'}) 45 | 46 | " Vim-polyglot 47 | let g:polyglot_disabled = ["graphql"] 48 | let g:LatexBox_no_mappings = 1 49 | call minpac#add('https://github.com/sheerun/vim-polyglot') 50 | call minpac#add('https://github.com/shiracamus/vim-syntax-x86-objdump-d') 51 | 52 | " Completes 'if' with 'endif', opening brackets with closing brackets... 53 | call minpac#add('https://github.com/rstacruz/vim-closer.git') 54 | call minpac#add('https://github.com/tpope/vim-endwise') 55 | 56 | " Configures indentation settings 57 | call minpac#add('https://github.com/tpope/vim-sleuth.git') 58 | 59 | " Git gud 60 | call minpac#add('https://github.com/tpope/vim-fugitive') 61 | call minpac#add('https://github.com/shumphrey/fugitive-gitlab.vim') 62 | let g:fugitive_gitlab_domains = {'ssh://git@ssh.gitlab.adacore-it.com': 'https://gitlab.adacore-it.com'} 63 | 64 | " Default LSP configs 65 | call minpac#add('https://github.com/neovim/nvim-lspconfig') 66 | packadd nvim-lspconfig 67 | lua << END 68 | local l = require("lspconfig") 69 | local function nnoremap(keys, command) 70 | vim.api.nvim_command("nnoremap " .. keys 71 | .. " lua " .. command .. "()") 72 | end 73 | local function setup_lsp_settings(client, buf) 74 | local opts = { noremap=true, silent=true } 75 | vim.api.nvim_buf_set_keymap(buf, "n", "gd", "lua vim.lsp.buf.declaration()", opts) 76 | vim.api.nvim_buf_set_keymap(buf, "n", "", "lua vim.lsp.buf.definition()", opts) 77 | vim.api.nvim_buf_set_keymap(buf, "n", "K", "lua vim.lsp.buf.hover()", opts) 78 | vim.api.nvim_buf_set_keymap(buf, "n", "gD", "lua vim.lsp.buf.implementation()", opts) 79 | vim.api.nvim_buf_set_keymap(buf, "n", "", "lua vim.lsp.buf.signature_help()", opts) 80 | vim.api.nvim_buf_set_keymap(buf, "n", "1gD", "lua vim.lsp.buf.type_definition()", opts) 81 | vim.api.nvim_buf_set_keymap(buf, "n", "gr", "lua vim.lsp.buf.references()", opts) 82 | vim.api.nvim_buf_set_keymap(buf, "n", "g0", "lua vim.lsp.buf.document_symbol()", opts) 83 | vim.api.nvim_buf_set_keymap(buf, "n", "ld", "lua vim.lsp.diagnostic.set_loclist()", opts) 84 | vim.api.nvim_buf_set_keymap(buf, "n", "", ":lua vim.lsp.buf.rename('')", opts) 85 | vim.api.nvim_buf_set_keymap(buf, "n", "", "", opts) 86 | vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc") 87 | end 88 | 89 | function setup_autoformat (client, buf) 90 | if not client:supports_method('textDocument/willSaveWaitUntil') 91 | and client:supports_method('textDocument/formatting') then 92 | vim.api.nvim_create_autocmd('BufWritePre', { 93 | group = vim.api.nvim_create_augroup('my.lsp', {clear=false}), 94 | buffer = buf, 95 | callback = function() 96 | vim.lsp.buf.format({ bufnr = buf, id = client.id, timeout_ms = 1000 }) 97 | end, 98 | }) 99 | end 100 | end 101 | 102 | l.clangd.setup{ on_attach = setup_lsp_settings } 103 | l.ada_ls.setup{ on_attach = setup_lsp_settings, cmd = { "/home/me/prog/ada_language_server/.obj/server/ada_language_server" } } 104 | vim.api.nvim_create_user_command('Gpr', function(opts) vim.lsp.buf_notify(0, "workspace/didChangeConfiguration", { settings = { ada = { projectFile = table.concat(opts.fargs) } } } ) end, { nargs = 1 }) 105 | l.rust_analyzer.setup{ on_attach = setup_lsp_settings } 106 | l.ocamllsp.setup{ on_attach = function (client, buf) 107 | setup_autoformat(client, buf) 108 | setup_lsp_settings(client, buf) 109 | end } 110 | 111 | vim.diagnostic.config({ virtual_lines = true }) 112 | 113 | END 114 | 115 | if s:do_update 116 | call minpac#update() 117 | end 118 | -------------------------------------------------------------------------------- /default/.config/nvim/colors/colors.vim: -------------------------------------------------------------------------------- 1 | hi Normal guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 2 | 3 | hi Cursor guibg=#af5fd7 ctermbg=134 guifg=#4E4E4E ctermfg=239 4 | hi Comment guifg=#A8A8A8 ctermfg=248 gui=italic 5 | 6 | hi Constant guifg=#af5fd7 ctermfg=134 7 | hi! link Character Constant 8 | hi! link Number Constant 9 | hi! link Boolean Constant 10 | hi! link Float Constant 11 | hi! link String Constant 12 | 13 | hi! link Identifier Normal 14 | hi! link Function Identifier 15 | 16 | hi Statement guifg=#767676 ctermfg=243 17 | hi! link Conditonal Statement 18 | hi! link Repeat Statement 19 | hi! link Label Statement 20 | hi! link Keyword Statement 21 | hi! link Exception Statement 22 | 23 | hi Operator guifg=#4E4E4E ctermfg=239 cterm=bold gui=bold 24 | 25 | hi PreProc guifg=#767676 ctermfg=243 26 | hi! link Include PreProc 27 | hi! link Define PreProc 28 | hi! link Macro PreProc 29 | hi! link PreCondit PreProc 30 | 31 | hi Type guifg=#4E4E4E ctermfg=239 32 | hi! link StorageClass Type 33 | hi! link Structure Type 34 | hi! link Typedef Type 35 | 36 | hi Special guifg=#767676 ctermfg=243 gui=italic 37 | hi! link SpecialChar Special 38 | hi! link Tag Special 39 | hi! link Delimiter Special 40 | hi! link SpecialComment Special 41 | hi! link Debug Special 42 | 43 | hi Underlined guifg=#4E4E4E ctermfg=239 gui=underline cterm=underline 44 | hi Ignore guifg=#FFFFFF ctermfg=231 45 | hi Error guifg=#FFFFFF ctermfg=231 guibg=#C30771 ctermbg=1 cterm=bold 46 | hi NvimInternalErrorMsg guifg=#FFFFFF ctermfg=231 guibg=#C30771 ctermbg=1 cterm=bold 47 | hi Todo guifg=#af5fd7 ctermfg=134 gui=underline cterm=underline ctermbg=none guibg=none 48 | hi SpecialKey guifg=#606060 ctermfg=241 49 | hi NonText guifg=#767676 ctermfg=243 50 | hi Directory guifg=#008EC4 ctermfg=4 51 | hi ErrorMsg guifg=#fb007a ctermfg=9 guibg=NONE ctermbg=NONE 52 | hi IncSearch guibg=#F3E430 ctermbg=11 guifg=#4E4E4E ctermfg=239 gui=NONE cterm=NONE 53 | hi Search guibg=#A8A8A8 ctermbg=248 guifg=#F1F1F1 ctermfg=15 54 | hi MoreMsg guifg=#767676 ctermfg=243 cterm=bold gui=bold 55 | hi! link ModeMsg MoreMsg 56 | hi LineNr guifg=#A8A8A8 ctermfg=248 57 | hi CursorLineNr guifg=#af5fd7 ctermfg=134 guibg=#EEEEEE ctermbg=255 58 | hi Question guifg=#C30771 ctermfg=1 59 | hi StatusLine guibg=#EEEEEE ctermbg=255 gui=bold cterm=bold 60 | hi StatusLineNC guibg=#EEEEEE ctermbg=255 gui=NONE cterm=NONE 61 | hi VertSplit guibg=#EEEEEE ctermbg=255 guifg=#EEEEEE ctermfg=255 62 | hi WinSeparator guibg=#EEEEEE ctermbg=255 guifg=#EEEEEE ctermfg=255 63 | hi Title guifg=#008EC4 ctermfg=4 64 | hi Visual guifg=#4E4E4E ctermfg=239 guibg=#af5fd7 ctermbg=134 cterm=none gui=none 65 | hi VisualNOS guibg=#A8A8A8 ctermbg=248 cterm=none gui=none 66 | hi WarningMsg guifg=#C30771 ctermfg=1 cterm=none gui=none 67 | hi WildMenu guifg=#FFFFFF ctermfg=231 guibg=#4E4E4E ctermbg=239 68 | hi Folded guifg=#767676 ctermfg=243 guibg=none ctermbg=none 69 | hi FoldColumn guibg=#EEEEEE ctermbg=255 guifg=none ctermfg=none gui=none cterm=none 70 | hi DiffAdd guifg=#10A778 ctermfg=2 guibg=none ctermbg=none 71 | hi diffAdded guifg=#10A778 ctermfg=2 guibg=none ctermbg=none 72 | hi DiffDelete guifg=#C30771 ctermfg=1 guibg=none ctermbg=none 73 | hi diffRemoved guifg=#C30771 ctermfg=1 guibg=none ctermbg=none 74 | hi DiffChange guifg=#A89C14 ctermfg=3 guibg=none ctermbg=none 75 | hi DiffText guifg=#008EC4 ctermfg=4 guibg=none ctermbg=none 76 | 77 | hi SpellBad cterm=underline guifg=#C30771 ctermfg=1 78 | hi SpellCap cterm=underline guifg=#5FD7A7 ctermfg=10 79 | hi SpellRare cterm=underline guifg=#fb007a ctermfg=9 80 | hi SpellLocal cterm=underline guifg=#10A778 ctermfg=2 81 | 82 | hi Pmenu guifg=#4E4E4E ctermfg=239 guibg=#A8A8A8 ctermbg=248 83 | hi PmenuSel guifg=#4E4E4E ctermfg=239 guibg=#af5fd7 ctermbg=134 84 | hi PmenuSbar guifg=#4E4E4E ctermfg=239 guibg=#A8A8A8 ctermbg=248 85 | hi PmenuThumb guifg=#4E4E4E ctermfg=239 guibg=#A8A8A8 ctermbg=248 86 | hi TabLine guifg=#4E4E4E ctermfg=239 guibg=#EEEEEE ctermbg=255 87 | hi TabLineSel guifg=#af5fd7 ctermfg=134 guibg=#A8A8A8 ctermbg=248 gui=bold cterm=bold 88 | hi TabLineFill guifg=#4E4E4E ctermfg=239 guibg=#EEEEEE ctermbg=255 89 | hi CursorColumn guibg=#EEEEEE ctermbg=255 90 | hi CursorLine guibg=#EEEEEE ctermbg=255 91 | hi ColorColumn guibg=#A8A8A8 ctermbg=248 92 | 93 | hi MatchParen guibg=#A8A8A8 ctermbg=248 guifg=#4E4E4E ctermfg=239 94 | hi qfLineNr guifg=#767676 ctermfg=243 95 | 96 | hi htmlH1 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 97 | hi htmlH2 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 98 | hi htmlH3 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 99 | hi htmlH4 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 100 | hi htmlH5 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 101 | hi htmlH6 guibg=#FFFFFF ctermbg=231 guifg=#4E4E4E ctermfg=239 102 | 103 | " Signify, git-gutter 104 | hi link SignifySignAdd LineNr 105 | hi link SignifySignDelete LineNr 106 | hi link SignifySignChange LineNr 107 | hi link GitGutterAdd LineNr 108 | hi link GitGutterDelete LineNr 109 | hi link GitGutterChange LineNr 110 | hi link GitGutterChangeDelete LineNr 111 | hi NeomakeErrorSign ctermfg=1 ctermbg=none cterm=none 112 | hi NeomakeWarningSign ctermfg=5 ctermbg=none cterm=none 113 | 114 | " Signcolumn 115 | hi SignColumn guibg=#EEEEEE ctermbg=255 guifg=none ctermfg=none gui=none cterm=none 116 | hi LspDiagnosticsErrorSign guifg=#C30771 ctermfg=1 guibg=#EEEEEE ctermbg=255 117 | hi LspDiagnosticsWarningSign guifg=#af5fd7 ctermfg=134 guibg=#EEEEEE ctermbg=255 118 | hi LspDiagnosticsInformationSign guifg=#20A5BA ctermfg=6 guibg=#EEEEEE ctermbg=255 119 | hi LspDiagnosticsHintSign guifg=#4E4E4E ctermfg=239 guibg=#EEEEEE ctermbg=255 120 | -------------------------------------------------------------------------------- /default/.config/zsh/aliases.zsh: -------------------------------------------------------------------------------- 1 | 2 | # Simple dc wrapper. $1 is input base, $2 is output base, $3 is value 3 | function baseXtoY () { 4 | dc -e "${1}i${2}o${3}p" 5 | } 6 | 7 | function asciichar () { 8 | [ "$1" -lt 256 ] || return 1 9 | printf "\\$(printf '%03o' "$1")" 10 | } 11 | 12 | function asciinum () { 13 | LC_CTYPE=C printf '%d' "'$1" 14 | } 15 | 16 | # Try to guess input base and convert to base 2 17 | function base2 () { 18 | for i in "$@:u" 19 | do 20 | case "$i[0,2]" in 21 | "0X") 22 | baseXtoY 16 2 "$i[3,-1]" 23 | ;; 24 | "0B") 25 | baseXtoY 2 2 "$i[3,-1]" 26 | ;; 27 | 0*) 28 | baseXtoY 8 2 "$i[2,-1]" 29 | ;; 30 | *) 31 | baseXtoY 10 2 "$i" 32 | esac 33 | done 34 | } 35 | 36 | # Try to guess input base and convert to base 8 37 | function base8 () { 38 | for i in "$@:u" 39 | do 40 | case "$i[0,2]" in 41 | "0X") 42 | baseXtoY 16 8 "$i[3,-1]" 43 | ;; 44 | "0B") 45 | baseXtoY 2 8 "$i[3,-1]" 46 | ;; 47 | 0*) 48 | baseXtoY 8 8 "$i[2,-1]" 49 | ;; 50 | *) 51 | baseXtoY 10 8 "$i" 52 | esac 53 | done 54 | } 55 | 56 | # Try to guess input base and convert to base 10 57 | function base10 () { 58 | for i in "$@:u" 59 | do 60 | case "$i[0,2]" in 61 | "0X") 62 | printf "%i\n" "$i" 63 | ;; 64 | "0B") 65 | printf "%i\n" "$i" 66 | ;; 67 | 0*) 68 | echo $((8#$i[2,-1])) 69 | ;; 70 | *) 71 | printf "%i\n" "$i" 72 | esac 73 | done 74 | } 75 | 76 | # Try to guess input base and convert to base 16 77 | function base16 () { 78 | for i in "$@:u" 79 | do 80 | case "$i[0,2]" in 81 | "0X") 82 | printf "%x\n" "$i" 83 | ;; 84 | "0B") 85 | printf "%x\n" "$i" 86 | ;; 87 | 0*) 88 | baseXtoY 8 16 "$i[2,-1]" 89 | ;; 90 | *) 91 | printf "%x\n" "$i" 92 | esac 93 | done 94 | } 95 | 96 | # = alias that works as calculator 97 | autoload -U zcalc 98 | function __calc_plugin { 99 | zcalc -e "$*" 100 | } 101 | aliases[=]='noglob __calc_plugin' 102 | 103 | # zmv enables stuff like 'zmv *.jpg *.jpeg' to rename every jpg into jpeg 104 | autoload -U zmv 105 | alias zmv='noglob zmv' 106 | 107 | # Prints ssh keys. Useful to check if new host has the right key 108 | function print_keys () { 109 | echo "SSH keys:" 110 | for i in /etc/ssh/*.pub ; do 111 | ssh-keygen -l -f $i 112 | done 113 | echo "Root certs:" 114 | for i in /etc/letsencrypt/live/*/cert.pem ; do 115 | sudo openssl x509 -noout $i -in -fingerprint -sha1 116 | done 117 | } 118 | 119 | # Prints history statistics 120 | function hist_stats () { 121 | fc -l 1 | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 122 | } 123 | 124 | # Basic utilities 125 | alias _='sudo' 126 | alias cleantex='rm *.{aux,idx,log,nav,out,snm,toc,vrb,bbl,blg}(.N) 2>/dev/null' 127 | alias cp='cp -i' 128 | alias dd='dd status=progress' 129 | alias gdb='gdb -q' 130 | alias l='ls -lAh --color=auto' 131 | alias ls='ls --color=auto' 132 | alias ln='nocorrect ln' 133 | alias mkdir='nocorrect mkdir' 134 | alias mv='nocorrect mv -i' 135 | alias nrb='npm run build' 136 | alias nrt='npm run test' 137 | alias nrp='npm run pretty' 138 | 139 | # Grep 140 | grepcmd='LC_ALL=C grep --color=auto --exclude-dir=.nyc_output --exclude-dir=build --exclude-dir=_build --exclude-dir=bin --exclude-dir=generated --exclude-dir=node_modules --exclude-dir=.svn --exclude-dir=.git --exclude-dir=.hg --exclude=package.json --exclude=package-lock.json --exclude=yarn.lock --exclude=bundle.js.map --exclude-dir=obj-x86_64-pc-linux-gnu --exclude-dir=target --exclude=.ali --binary-files=without-match --line-number --exclude=searchindex.js' 141 | alias grep="$grepcmd" 142 | alias gri="$grepcmd -ri" 143 | 144 | # Git 145 | alias ga='git add' 146 | alias gb='git branch' 147 | alias gbb='git bisect bad' 148 | alias gbg='git bisect good' 149 | alias gbs='git bisect start' 150 | alias gbr='git bisect reset' 151 | alias gc='git commit --edit' 152 | alias gca='git commit --amend' 153 | alias gch='git checkout' 154 | alias gchm='git checkout master' 155 | alias gcl='git clone' 156 | alias gd='git diff' 157 | alias gdc='git diff --cached' 158 | alias gf='git fetch -p' 159 | alias gfom='git fetch -p origin master' 160 | alias gfum='git fetch -p upstream master' 161 | alias glog='git log --first-parent --graph --abbrev-commit --decorate --date=relative --format=format:'\''%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %s - %an%C(bold yellow)%d%C(reset)'\'' --all' 162 | alias gm='git merge' 163 | alias gmom='git merge origin/master' 164 | alias gmum='git merge upstream/master' 165 | alias gp='git push' 166 | alias gpf='git push --force' 167 | alias gr='git reset' 168 | alias gre='git rebase' 169 | alias grea='git rebase --abort' 170 | alias grec='git rebase --continue' 171 | alias greom='git rebase origin/master --autostash' 172 | alias greum='git rebase upstream/master --autostash' 173 | alias grm='git rm' 174 | alias gs='git show' 175 | 176 | alias update-nvim='curl -L https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.appimage -o ~/downloads/nvim && chmod +x ~/downloads/nvim && mv ~/downloads/nvim ~/bin/nvim' 177 | alias patchfox='rm -rf ~/.cache/mozilla ; find "$(dirname "$(realpath "$(which firefox)")")" -iname omni.ja -exec perl -i -pne "s/reserved=.true./ /g" "{}" ";"' 178 | 179 | # Health log 180 | alias logactivity="sp $HOME/documents/logs/activity.csv" 181 | alias logbreakfast="sp $HOME/documents/logs/breakfast.csv" 182 | alias logdinner="sp $HOME/documents/logs/dinner.csv" 183 | alias loglunch="sp $HOME/documents/logs/lunch.csv" 184 | alias logmood="sp $HOME/documents/logs/mood.csv" 185 | alias logsleep="sp $HOME/documents/logs/sleep.csv" 186 | 187 | # Fancy stuff 188 | if [ -x "/usr/share/nvim/runtime/macros/less.sh" ] ; then 189 | alias less='/usr/share/nvim/runtime/macros/less.sh' 190 | fi 191 | 192 | case "$(uname -a)" in 193 | *gentoo*) alias i="sudo emerge --ask"; 194 | alias u="sudo emerge --unmerge"; 195 | alias s="emerge --search";; 196 | *) alias i="sudo apt install"; 197 | alias u="sudo apt remove"; 198 | alias s="apt search";; 199 | esac 200 | 201 | -------------------------------------------------------------------------------- /default/.config/nvim/functions.vim: -------------------------------------------------------------------------------- 1 | " Generates the tabline 2 | function! MyTabLine() 3 | let s = '' 4 | for i in range(tabpagenr('$')) 5 | " select the highlighting 6 | if i + 1 == tabpagenr() 7 | let s .= '%#TabLineSel#' 8 | else 9 | let s .= '%#TabLine#' 10 | endif 11 | " set the tab page number (for mouse clicks) 12 | let s .= '%' . (i + 1) . 'T' 13 | " the label is made by MyTabLabel() 14 | let s .= ' %{MyTabLabel(' . (i + 1) . ')} ' 15 | endfor 16 | " after the last tab fill with TabLineFill and reset tab page nr 17 | let s .= '%#TabLineFill#%T' 18 | return s 19 | endfunction 20 | 21 | " Generates the labels for the tab line 22 | function! MyTabLabel(n) 23 | " Insert Tab Number 24 | let s = '[' . a:n . ']' 25 | let maxtabwidth = 20 26 | let buflist = tabpagebuflist(a:n) 27 | let winnr = tabpagewinnr(a:n) 28 | " If modified, add '[+]' 29 | if getbufvar(buflist[winnr - 1], '&modified') == 1 30 | let s = s . '[+]' 31 | endif 32 | " If in terminal, display only term://name 33 | if getbufvar(buflist[winnr - 1], '&buftype') == 'terminal' 34 | let n = substitute(matchstr(bufname(buflist[winnr - 1]), ":[^:]*$"), ":", "", "") 35 | else 36 | let n = bufname(buflist[winnr - 1]) 37 | if n == "" 38 | let n = "No Name" 39 | else 40 | let n = fnamemodify(n, ":p") 41 | endif 42 | endif 43 | let namewidth = strwidth(n) 44 | let curwidth = strwidth(s) 45 | if namewidth + curwidth > maxtabwidth 46 | let n = "..." . strpart(n, namewidth - maxtabwidth + curwidth + 3) 47 | endif 48 | return s . "[" . n . "]" 49 | endfunction 50 | 51 | " Generates the wanted format for the statusline 52 | function! MyStatusLine () 53 | let l:line = '' 54 | if &ft == 'qf' 55 | return '%q' 56 | endif 57 | 58 | let l:mode = mode() 59 | if l:mode == 'n' 60 | let l:line .= '[NORMAL]' 61 | elseif l:mode == 'i' || l:mode == 't' 62 | let l:line .= '[INSERT]' 63 | elseif l:mode == 'v' 64 | let l:line .= '[VISUAL]' 65 | endif 66 | let l:line .= '%y[%f]%m%r%=' 67 | return l:line . '[%l,%c:%b][%P]' 68 | endfunction 69 | 70 | " Called when a new term is created 71 | function! OnTermOpen() 72 | " When leaving a term buffer, remember whether it was in insert or normal 73 | " mode. When entering a terminal window/buffer, go in insert mode if the 74 | " term was in insert mode. 75 | au TermEnter let b:should_insert = 1 76 | au BufEnter if b:should_insert == 1 | startinsert | endif 77 | 78 | " When there is a single window and it's a terminal, don't display the 79 | " statusline in terminal mode. This saves a line of space. 80 | au TermEnter if len(nvim_list_wins()) == 1 | set laststatus=1 | endif 81 | au TermLeave set laststatus=2 82 | 83 | " Get max scrollback 84 | setlocal scrollback=-1 85 | 86 | " Disable scrolloffset because it doesn't work nicely when the cursor is 87 | " in a row < to scrolloffset while in terminal mode 88 | setlocal scrolloff=0 89 | 90 | " When opening a new term, go in insert mode 91 | startinsert 92 | let b:should_insert = 1 93 | endfunction 94 | 95 | "When closing a terminal, feed enter to close the buffer or leave nvim if it 96 | "was the only buffer 97 | function! OnTermClose() 98 | if len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 99 | :quit! 100 | else 101 | call feedkeys(" ") 102 | endif 103 | endfunction 104 | 105 | " Converts encoding to utf8 106 | function! FixEncoding() 107 | :update 108 | :setlocal fileencoding=utf8 109 | :e ++ff=dos 110 | :setlocal ff=unix 111 | endfunction 112 | 113 | " Called on . If nvim is running directly in a terminal (e.g. not in a 114 | " shell), prevent it from being suspended. 115 | function! SuspendIfInShell() 116 | let parent_name=substitute(system("ps -o comm= $(ps -p '" . getpid() . "' -o ppid=)"), '\n$', '\1', '') 117 | if (match(['Eterm', 'alacritty', 'aterm', 'gnome-terminal', 'kitty', 118 | \ 'konsole', 'login', 'lxterminal', 'mate-terminal', 119 | \ 'mlterm', 'nvim-gtk', 'qterminal', 'roxterm', 'rxvt', 120 | \ 'rxvtc', 'rxvtcd', 'st', 'terminator', 'terminology', 121 | \ 'terminte', 'termit', 'urxvt', 'urxvtc', 'urxvtcd', 122 | \ 'urxvtd', 'uxterm', 'x-terminal-emulator', 'xfce4-terminal', 123 | \ 'xterm'], parent_name) != -1) 124 | echo "Suspend: Not suspended because running in " . parent_name 125 | else 126 | :suspend 127 | endif 128 | endfunction 129 | 130 | " Iterates over a list of buffers, if a loaded but non-displayed buffer 131 | " exists, switches to it and returns 1, 0 otherwise 132 | function! SwitchToBuf(buflist) 133 | for idx in a:buflist 134 | if len(win_findbuf(idx)) == 0 135 | execute "buffer " . idx 136 | return 1 137 | endif 138 | endfor 139 | return 0 140 | endfunction 141 | 142 | " Closes a buffer while keeping its window open. 143 | function! WipeButKeepOpen(force) 144 | " btarget is the id of the current buffer 145 | let btarget = bufnr("%") 146 | " allbufs is a list of all listed buffers 147 | let allbufs = filter(range(1, bufnr('$')), 'buflisted(v:val)') 148 | let nbbufs = len(allbufs) 149 | 150 | let closebuf = "bw" 151 | " Choose whether to force wipe the buffer or not 152 | if a:force == 1 || &buftype == "terminal" 153 | let closebuf = closebuf . "!" 154 | endif 155 | let closebuf = closebuf . " " . btarget 156 | 157 | let idx = index(allbufs, btarget) 158 | let nextbufs = allbufs[idx:] 159 | " If switching to the next unloaded buf fails, try to swith to a prev 160 | if SwitchToBuf(nextbufs) != 1 161 | let prevbufs = reverse(allbufs[:idx]) 162 | " Try to switch to the previous undisplayed buffer 163 | call SwitchToBuf(prevbufs) 164 | endif 165 | 166 | try 167 | " Close the buffer 168 | execute closebuf 169 | catch 170 | " Closing didn't work, go back to the target 171 | execute "buffer " . btarget 172 | echoerr "Couldn't wipe buffer. Unsaved changes?" 173 | endtry 174 | 175 | 176 | " If the current buffer is now an empty buffer 177 | if (bufname('%') == '' && line('$') == 1 && getline(1) == '') || &ft == "netrw" 178 | " If the buffer we just closed was the last 179 | if nbbufs <= 1 180 | quit 181 | else 182 | call WipeButKeepOpen(0) 183 | endif 184 | endif 185 | 186 | endfunction 187 | 188 | " Function called when running $VIMRUNTIME/macros/less.sh 189 | function! LessInitFunc() 190 | set nolist 191 | set nocursorcolumn nocursorline 192 | set laststatus=0 193 | set readonly 194 | endfunction 195 | -------------------------------------------------------------------------------- /misc/ergodox/keymap.c: -------------------------------------------------------------------------------- 1 | #include QMK_KEYBOARD_H 2 | #include "debug.h" 3 | #include "action_layer.h" 4 | #include "version.h" 5 | #include "keymap_french.h" 6 | 7 | const uint16_t PROGMEM caps_combo[] = {KC_LSFT, KC_RSFT, COMBO_END}; 8 | 9 | combo_t key_combos[COMBO_COUNT] = { COMBO(caps_combo, KC_CAPSLOCK) }; 10 | 11 | #define BASE 0 // default layer 12 | #define SYMB 1 // symbols 13 | #define QWER 2 // symbols 14 | #define QWSY 3 // symbols 15 | 16 | enum custom_keycodes { 17 | PLACEHOLDER = SAFE_RANGE, // can always be here 18 | EPRM, 19 | VRSN, 20 | RGB_SLD, 21 | MY_BACKTICK 22 | }; 23 | 24 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 25 | [BASE] = LAYOUT_ergodox( 26 | // DEFAULT 27 | // left hand 28 | FR_CIRC, FR_AMP, FR_EACU, FR_DQUO, FR_APOS, FR_LPRN, KC_HOME, 29 | KC_DELT, FR_A, FR_Z, KC_E, KC_R, KC_T, TG(QWER), 30 | KC_ESC, FR_Q, KC_S, KC_D, KC_F, KC_G, 31 | KC_LSFT, FR_W, KC_X, KC_C, KC_V, KC_B, TG(SYMB), 32 | MO(SYMB), FR_LESS, KC_LALT, KC_LCTRL, KC_LGUI, 33 | KC_LEFT, KC_RIGHT, 34 | KC_PSCREEN, 35 | KC_SPC, KC_TAB, KC_RALT, 36 | // right hand 37 | KC_END, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, 38 | TG(QWER), KC_Y, KC_U, KC_I, KC_O, KC_P, FR_EQL, 39 | KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, 40 | TG(SYMB), KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, KC_RSFT, 41 | KC_RGUI, KC_RCTRL, KC_LALT, FR_DLR, MO(SYMB), 42 | KC_DOWN, KC_UP, 43 | KC_PSCREEN, 44 | KC_RALT, KC_BSPC, KC_ENT 45 | ), 46 | // SYMBOLS 47 | [SYMB] = LAYOUT_ergodox( 48 | // left hand 49 | VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, 50 | KC_TRNS, FR_EXLM, FR_AT, FR_LCBR, FR_RCBR, FR_PIPE, KC_TRNS, 51 | KC_TRNS, FR_HASH, FR_DLR, FR_LPRN, FR_RPRN, MY_BACKTICK, 52 | KC_TRNS, FR_PERC, RALT(FR_CCED), FR_LBRC, FR_RBRC, FR_TILD, KC_TRNS, 53 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 54 | KC_TRNS, KC_TRNS, 55 | KC_TRNS, 56 | KC_TRNS, KC_TRNS, KC_TRNS, 57 | // right hand 58 | KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, 59 | KC_TRNS, FR_EQL, FR_7, FR_8, FR_9, FR_ASTR, KC_F12, 60 | FR_0, FR_4, FR_5, FR_6, FR_PLUS, KC_TRNS, 61 | KC_TRNS, FR_DOT, FR_1, FR_2, FR_3, FR_BSLS, KC_TRNS, 62 | KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 63 | KC_TRNS, KC_TRNS, 64 | KC_TRNS, 65 | KC_TRNS, KC_TRNS, KC_TRNS 66 | ), 67 | // QWERTY 68 | [QWER] = LAYOUT_ergodox( 69 | // left hand 70 | KC_EQL, KC_1, KC_HASH, KC_QUOT, LSFT(KC_QUOT), KC_LPRN, KC_LEFT, 71 | KC_DELT, KC_A, KC_Z, KC_E, KC_R, KC_T, TG(QWER), 72 | KC_ESC, KC_Q, KC_S, KC_D, KC_F, KC_G, 73 | KC_LSFT, KC_W, KC_X, KC_C, KC_V, KC_B, TG(QWSY), 74 | KC_FN3, KC_NUBS, KC_LALT, KC_LCTRL, KC_LGUI, 75 | KC_APP, KC_HOME, 76 | KC_END, 77 | KC_SPC, KC_TAB, KC_RALT, 78 | // right hand 79 | KC_RGHT, KC_MINS, KC_GRV, KC_UNDS, KC_CIRC, KC_AT, KC_RPRN, 80 | TG(QWER), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, 81 | KC_H, KC_J, KC_K, KC_L, KC_M, KC_PERC, 82 | TG(QWSY), KC_N, KC_COMM, KC_SCLN, KC_COLN, KC_EXLM, KC_RSFT, 83 | KC_RGUI, KC_RCTRL, KC_LALT, KC_DLR, KC_FN3, 84 | KC_PGUP, KC_PSCREEN, 85 | KC_PGDN, 86 | KC_RALT, KC_BSPC, KC_ENT 87 | ), 88 | // QWERTY Symbols 89 | [QWSY] = LAYOUT_ergodox( 90 | // left hand 91 | VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, 92 | KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, 93 | KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, 94 | KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, 95 | KC_TRNS, KC_RGHT, KC_UP, KC_DOWN, KC_LEFT, 96 | RGB_MOD, KC_TRNS, 97 | KC_TRNS, 98 | RGB_VAD, RGB_VAI, KC_TRNS, 99 | // right hand 100 | KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, 101 | KC_TRNS, KC_EQL, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, 102 | KC_0, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, 103 | KC_TRNS, KC_DOT, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, 104 | KC_LEFT,KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, 105 | RGB_TOG, RGB_SLD, 106 | KC_TRNS, 107 | KC_TRNS, RGB_HUD, RGB_HUI 108 | ), 109 | }; 110 | 111 | const uint16_t PROGMEM fn_actions[] = { 112 | [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) 113 | [3] = ACTION_LAYER_TAP_TOGGLE(QWSY) // FN1 - Momentary Layer 1 (Symbols) 114 | }; 115 | 116 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) 117 | { 118 | // MACRODOWN only works in this function 119 | switch(id) { 120 | case 0: 121 | if (record->event.pressed) { 122 | SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); 123 | } 124 | break; 125 | case 1: 126 | if (record->event.pressed) { // For resetting EEPROM 127 | eeconfig_init(); 128 | } 129 | break; 130 | } 131 | return MACRO_NONE; 132 | }; 133 | 134 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { 135 | switch (keycode) { 136 | // dynamically generate these. 137 | case EPRM: 138 | if (record->event.pressed) { 139 | eeconfig_init(); 140 | } 141 | return false; 142 | break; 143 | case VRSN: 144 | if (record->event.pressed) { 145 | SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); 146 | } 147 | return false; 148 | break; 149 | case RGB_SLD: 150 | if (record->event.pressed) { 151 | #ifdef RGBLIGHT_ENABLE 152 | rgblight_mode(1); 153 | #endif 154 | } 155 | return false; 156 | break; 157 | case MY_BACKTICK: 158 | SEND_STRING(SS_RALT("7")); 159 | } 160 | return true; 161 | } 162 | 163 | // Runs just one time when the keyboard initializes. 164 | void matrix_init_user(void) { 165 | 166 | }; 167 | 168 | 169 | // Runs constantly in the background, in a loop. 170 | void matrix_scan_user(void) { 171 | 172 | uint8_t layer = biton32(layer_state); 173 | 174 | ergodox_board_led_off(); 175 | ergodox_right_led_1_off(); 176 | ergodox_right_led_2_off(); 177 | ergodox_right_led_3_off(); 178 | switch (layer) { 179 | // TODO: Make this relevant to the ErgoDox EZ. 180 | case 1: 181 | ergodox_right_led_1_on(); 182 | break; 183 | case 2: 184 | ergodox_right_led_2_on(); 185 | break; 186 | case 3: 187 | ergodox_right_led_3_on(); 188 | break; 189 | default: 190 | // none 191 | break; 192 | } 193 | 194 | }; 195 | -------------------------------------------------------------------------------- /default/.config/sway/config: -------------------------------------------------------------------------------- 1 | 2 | input type:keyboard { 3 | xkb_layout fr 4 | xkb_variant latin9 5 | } 6 | 7 | default_border pixel 2 8 | gaps inner 0 9 | default_orientation horizontal 10 | focus_follows_mouse no 11 | smart_gaps on 12 | smart_borders on 13 | 14 | # class border backgr. text indicator child_border 15 | client.focused #22CCFF #22CCFF #000000 #CC22FF #22CCFF 16 | client.focused_inactive #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 17 | client.unfocused #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 18 | client.urgent #a78bc3 #a78bc3 #2d2d2d #3a3a3a #aa2222 19 | client.placeholder #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 20 | client.background #FFFFFF 21 | 22 | # Available letters: aygcv SZTYFGMWXVDQ 23 | set $mod Mod4 24 | set $mod2 Mod1 25 | 26 | # Use Mouse+$mod to drag floating windows to their wanted position 27 | floating_modifier $mod 28 | 29 | # start a terminal 30 | bindsym $mod+Return exec open_terminal_with_nvim term://zsh 31 | 32 | # kill focused window 33 | bindsym $mod+Shift+A kill 34 | 35 | # start dmenu (a program launcher) 36 | bindsym $mod+d exec sh -c menu-run 37 | 38 | # change focus 39 | bindsym $mod+h focus left 40 | bindsym $mod+j focus down 41 | bindsym $mod+k focus up 42 | bindsym $mod+l focus right 43 | 44 | # move focused window 45 | bindsym $mod+Shift+h move left 46 | bindsym $mod+Shift+j move down 47 | bindsym $mod+Shift+k move up 48 | bindsym $mod+Shift+l move right 49 | 50 | # enter fullscreen mode for the focused container 51 | bindsym $mod+f fullscreen 52 | 53 | # change container layout (tabbed, toggle split) 54 | bindsym $mod+t layout tabbed 55 | bindsym $mod+s layout toggle split 56 | 57 | # split vertical 58 | bindsym $mod+e split v 59 | # split horizontal 60 | bindsym $mod+Shift+e split h 61 | 62 | # send to scratchpad 63 | bindsym $mod+x move scratchpad 64 | # show scratchpad 65 | bindsym $mod+w scratchpad show 66 | 67 | # toggle tiling / floating 68 | bindsym $mod+Shift+space floating toggle 69 | 70 | # change focus between tiling / floating windows 71 | bindsym $mod+space focus mode_toggle 72 | 73 | # focus the parent container using ; 74 | bindcode $mod+59 focus parent 75 | 76 | # focus the child container using , 77 | bindcode $mod+58 focus child 78 | 79 | # define workspaces 80 | set $wp1 1 81 | set $wp2 2 82 | set $wp3 3 83 | set $wp4 4 84 | set $wp5 5 85 | set $wp6 6 86 | set $wp7 7 87 | set $wp8 8 88 | set $wp9 9 89 | set $wp0 0 90 | 91 | # switch to workspace 92 | bindsym $mod+ampersand workspace $wp1 93 | bindsym $mod+eacute workspace $wp2 94 | bindsym $mod+quotedbl workspace $wp3 95 | bindsym $mod+apostrophe workspace $wp4 96 | bindsym $mod+parenleft workspace $wp5 97 | bindsym $mod+minus workspace $wp6 98 | bindsym $mod+egrave workspace $wp7 99 | bindsym $mod+underscore workspace $wp8 100 | bindsym $mod+ccedilla workspace $wp9 101 | bindsym $mod+agrave workspace $wp0 102 | 103 | # move focused container to workspace 104 | bindsym $mod+Shift+ampersand move container to workspace $wp1 105 | bindsym $mod+Shift+eacute move container to workspace $wp2 106 | bindsym $mod+Shift+quotedbl move container to workspace $wp3 107 | bindsym $mod+Shift+apostrophe move container to workspace $wp4 108 | bindsym $mod+Shift+parenleft move container to workspace $wp5 109 | bindsym $mod+Shift+minus move container to workspace $wp6 110 | bindsym $mod+Shift+egrave move container to workspace $wp7 111 | bindsym $mod+Shift+underscore move container to workspace $wp8 112 | bindsym $mod+Shift+ccedilla move container to workspace $wp9 113 | bindsym $mod+Shift+agrave move container to workspace $wp0 114 | 115 | # move workspaces around 116 | bindsym $mod+$mod2+h move workspace to output right 117 | bindsym $mod+$mod2+j move workspace to output bottom 118 | bindsym $mod+$mod2+k move workspace to output top 119 | bindsym $mod+$mod2+l move workspace to output left 120 | 121 | # reload the configuration file 122 | bindsym $mod+Shift+c reload 123 | # restart sway inplace (preserves your layout/session, can be used to upgrade sway) 124 | bindsym $mod+Shift+r restart 125 | 126 | # Lock the computer 127 | bindsym $mod+q exec swaylock --ignore-empty-password --show-failed-attempts 128 | 129 | # Next song with $mod+n, previous song with $mod+N 130 | set $mediaprev exec mpc next 131 | set $medianext exec mpc prev 132 | bindsym XF86AudioPrev $mediaprev 133 | bindsym XF86AudioNext $medianext 134 | bindsym $mod+n $mediaprev 135 | bindsym $mod+Shift+n $medianext 136 | 137 | # Play/pause with $mod+p 138 | set $mediatoggle exec mpc toggle 139 | bindsym $mod+p $mediatoggle 140 | bindsym XF86AudioPlay $mediatoggle 141 | # Select specific song to play with $mod+P 142 | bindsym $mod+Shift+p exec menu-music 143 | 144 | # Toggle random/non random music playing with $mod+o 145 | bindsym $mod+o exec mpc random 146 | # Switch audio output with $mod+O 147 | # bindsym $mod+Shift+o exec /home/me/bin/saoutput 148 | 149 | # Lower volume with $mod+i, increase with $mod+I 150 | set $volup exec ~/bin/vup 151 | set $voldown exec ~/bin/vdown 152 | bindsym $mod+i $voldown 153 | bindsym $mod+Shift+i $volup 154 | bindsym XF86AudioLowerVolume $voldown 155 | bindsym XF86AudioRaiseVolume $volup 156 | 157 | # Decrease brightness with $mod+u, increase with $mod+U 158 | set $brightdown exec sudo -A ~/bin/bdown 159 | set $brightup exec sudo -A ~/bin/bup 160 | bindsym $mod+u $brightdown 161 | bindsym $mod+Shift+u $brightup 162 | bindsym XF86MonBrightnessDown $brightdown 163 | bindsym XF86MonBrightnessUp $brightup 164 | 165 | # Open browser with $mod+b 166 | bindsym $mod+b exec x-www-browser 167 | # Open m with $mod+B 168 | bindsym $mod+Shift+b exec thunderbird 169 | 170 | # Take a screenshot with the PrintScreen key 171 | bindsym --release Print "exec scrot -s ~/pictures/screenshot_%Y-%m-%d-%T.png" 172 | 173 | # create resize mode, lets you resize with hjkl 174 | set $resize_mode "resize" 175 | mode $resize_mode { 176 | set $notify_resize_mode exec notify-send 'Resize Mode is active.' 177 | bindsym a $notify_resize_mode 178 | bindsym z $notify_resize_mode 179 | bindsym e $notify_resize_mode 180 | bindsym t $notify_resize_mode 181 | bindsym q $notify_resize_mode 182 | bindsym s $notify_resize_mode 183 | bindsym f $notify_resize_mode 184 | bindsym g $notify_resize_mode 185 | bindsym m $notify_resize_mode 186 | bindsym w $notify_resize_mode 187 | bindsym x $notify_resize_mode 188 | bindsym c $notify_resize_mode 189 | bindsym v $notify_resize_mode 190 | bindsym b $notify_resize_mode 191 | bindsym n $notify_resize_mode 192 | bindsym Shift+a $notify_resize_mode 193 | bindsym Shift+z $notify_resize_mode 194 | bindsym Shift+e $notify_resize_mode 195 | bindsym Shift+t $notify_resize_mode 196 | bindsym Shift+q $notify_resize_mode 197 | bindsym Shift+s $notify_resize_mode 198 | bindsym Shift+f $notify_resize_mode 199 | bindsym Shift+g $notify_resize_mode 200 | bindsym Shift+m $notify_resize_mode 201 | bindsym Shift+w $notify_resize_mode 202 | bindsym Shift+x $notify_resize_mode 203 | bindsym Shift+c $notify_resize_mode 204 | bindsym Shift+v $notify_resize_mode 205 | bindsym Shift+b $notify_resize_mode 206 | bindsym Shift+n $notify_resize_mode 207 | 208 | bindsym u resize shrink width 20 px or 20 ppt 209 | bindsym i resize grow height 20 px or 20 ppt 210 | bindsym o resize shrink height 20 px or 20 ppt 211 | bindsym p resize grow width 20 px or 20 ppt 212 | 213 | bindsym h resize shrink width 10 px or 10 ppt 214 | bindsym j resize grow height 10 px or 10 ppt 215 | bindsym k resize shrink height 10 px or 10 ppt 216 | bindsym l resize grow width 10 px or 10 ppt 217 | 218 | bindsym Return mode "default" 219 | bindsym Escape mode "default" 220 | } 221 | bindsym $mod+r mode $resize_mode 222 | 223 | exec mako 224 | bindsym $mod+z exec makoctl dismiss 225 | 226 | for_window [app_id="mpv"] floating enable 227 | 228 | include $HOME/.config/sway/$(hostname).config 229 | -------------------------------------------------------------------------------- /default/.config/i3/config: -------------------------------------------------------------------------------- 1 | new_window pixel 1 2 | # hide_edge_borders both 3 | default_orientation horizontal 4 | focus_follows_mouse no 5 | 6 | # class border backgr. text indicator child_border 7 | client.focused #22CCFF #22CCFF #000000 #CC22FF #22CCFF 8 | client.focused_inactive #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 9 | client.unfocused #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 10 | client.urgent #a78bc3 #a78bc3 #2d2d2d #3a3a3a #aa2222 11 | client.placeholder #FFFFFF #FFFFFF #000000 #FFFFFF #FFFFFF 12 | client.background #FFFFFF 13 | 14 | # Available letters: zaygcv SZTYFGMWXV 15 | set $mod Mod4 16 | set $mod2 Mod1 17 | 18 | font pango:Cousine 9 19 | 20 | # Use Mouse+$mod to drag floating windows to their wanted position 21 | floating_modifier $mod 22 | 23 | # start a terminal 24 | bindsym $mod+Return "exec $HOME/bin/x-terminal-emulator -e $HOME/bin/nvim term://zsh &" 25 | 26 | # kill focused window 27 | bindsym $mod+Shift+A kill 28 | 29 | # start dmenu (a program launcher) 30 | bindsym $mod+d "exec dmenu_run -p \"$(date +%H:%M) $(acpi | grep -o '[0-9]*%' | tr '\n' ' ')\" -i &" 31 | # start dopen (file browser based on dmenu) 32 | bindsym $mod+Shift+d exec ~/bin/dopen 33 | 34 | # change focus 35 | bindsym $mod+h focus left 36 | bindsym $mod+j focus down 37 | bindsym $mod+k focus up 38 | bindsym $mod+l focus right 39 | 40 | # move focused window 41 | bindsym $mod+Shift+h move left 42 | bindsym $mod+Shift+j move down 43 | bindsym $mod+Shift+k move up 44 | bindsym $mod+Shift+l move right 45 | 46 | # enter fullscreen mode for the focused container 47 | bindsym $mod+f fullscreen 48 | 49 | # change container layout (tabbed, toggle split) 50 | bindsym $mod+t layout tabbed 51 | bindsym $mod+s layout toggle split 52 | 53 | # split vertical 54 | bindsym $mod+e split v 55 | # split horizontal 56 | bindsym $mod+Shift+e split h 57 | 58 | # send to scratchpad 59 | bindsym $mod+x move scratchpad 60 | # show scratchpad 61 | bindsym $mod+w scratchpad show 62 | 63 | # toggle tiling / floating 64 | bindsym $mod+Shift+space floating toggle 65 | 66 | # change focus between tiling / floating windows 67 | bindsym $mod+space focus mode_toggle 68 | 69 | # focus the parent container using ; 70 | bindcode $mod+59 focus parent 71 | 72 | # focus the child container using , 73 | bindcode $mod+58 focus child 74 | 75 | # define workspaces 76 | set $wp1 1 77 | set $wp2 2 78 | set $wp3 3 79 | set $wp4 4 80 | set $wp5 5 81 | set $wp6 6 82 | set $wp7 7 83 | set $wp8 8 84 | set $wp9 9 85 | set $wp0 0 86 | 87 | # switch to workspace 88 | bindsym $mod+ampersand workspace $wp1 89 | bindsym $mod+eacute workspace $wp2 90 | bindsym $mod+quotedbl workspace $wp3 91 | bindsym $mod+apostrophe workspace $wp4 92 | bindsym $mod+parenleft workspace $wp5 93 | bindsym $mod+minus workspace $wp6 94 | bindsym $mod+egrave workspace $wp7 95 | bindsym $mod+underscore workspace $wp8 96 | bindsym $mod+ccedilla workspace $wp9 97 | bindsym $mod+agrave workspace $wp0 98 | 99 | # move focused container to workspace 100 | bindsym $mod+Shift+1 move container to workspace $wp1 101 | bindsym $mod+Shift+eacute move container to workspace $wp2 102 | bindsym $mod+Shift+3 move container to workspace $wp3 103 | bindsym $mod+Shift+4 move container to workspace $wp4 104 | bindsym $mod+Shift+5 move container to workspace $wp5 105 | bindsym $mod+Shift+6 move container to workspace $wp6 106 | bindsym $mod+Shift+egrave move container to workspace $wp7 107 | bindsym $mod+Shift+8 move container to workspace $wp8 108 | bindsym $mod+Shift+ccedilla move container to workspace $wp9 109 | bindsym $mod+Shift+agrave move container to workspace $wp0 110 | 111 | # move workspaces around 112 | bindsym $mod+$mod2+h move workspace to output right 113 | bindsym $mod+$mod2+j move workspace to output bottom 114 | bindsym $mod+$mod2+k move workspace to output top 115 | bindsym $mod+$mod2+l move workspace to output left 116 | 117 | # reload the configuration file 118 | bindsym $mod+Shift+c reload 119 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 120 | bindsym $mod+Shift+r restart 121 | 122 | # Lock the computer 123 | bindsym $mod+q exec i3lock --ignore-empty-password --show-failed-attempts 124 | # exit i3 (logs you out of your X session) 125 | bindsym $mod+Shift+q "exec \"i3-nagbar -t warning -m '' -b 'Exit i3' 'i3-msg exit'\"" 126 | 127 | # Next song with $mod+n, previous song with $mod+N 128 | set $mediaprev "exec mpc next &" 129 | set $medianext "exec mpc prev &" 130 | bindsym XF86AudioPrev $mediaprev 131 | bindsym XF86AudioNext $medianext 132 | bindsym $mod+n $mediaprev 133 | bindsym $mod+Shift+n $medianext 134 | 135 | # Play/pause with $mod+p 136 | set $mediatoggle "exec mpc toggle &" 137 | bindsym $mod+p $mediatoggle 138 | bindsym XF86AudioPlay $mediatoggle 139 | # Select specific song to play with $mod+P 140 | bindsym $mod+Shift+p exec ~/bin/dmusic 141 | 142 | # Toggle random/non random music playing with $mod+o 143 | bindsym $mod+o exec mpc random 144 | # Switch audio output with $mod+O 145 | # bindsym $mod+Shift+o exec /home/me/bin/saoutput 146 | 147 | # Lower volume with $mod+i, increase with $mod+I 148 | set $volup "exec ~/bin/vup" 149 | set $voldown "exec ~/bin/vdown" 150 | bindsym $mod+i $voldown 151 | bindsym $mod+Shift+i $volup 152 | bindsym XF86AudioLowerVolume $voldown 153 | bindsym XF86AudioRaiseVolume $volup 154 | 155 | # Decrease brightness with $mod+u, increase with $mod+U 156 | set $brightdown "exec sudo -A ~/bin/bdown" 157 | set $brightup "exec sudo -A ~/bin/bup" 158 | bindsym $mod+u $brightdown 159 | bindsym $mod+Shift+u $brightup 160 | bindsym XF86MonBrightnessDown $brightdown 161 | bindsym XF86MonBrightnessUp $brightup 162 | 163 | # Open browser with $mod+b 164 | bindsym $mod+b exec x-www-browser 165 | # Open m with $mod+B 166 | bindsym $mod+Shift+b exec term -e mutt 167 | 168 | # Take a screenshot with the PrintScreen key 169 | bindsym --release Print "exec scrot -s ~/pictures/screenshot_%Y-%m-%d-%T.png" 170 | 171 | # create resize mode, lets you resize with hjkl 172 | set $resize_mode "resize" 173 | mode $resize_mode { 174 | set $notify_resize_mode "exec notify-send 'Resize Mode is active.'" 175 | bindsym a $notify_resize_mode 176 | bindsym z $notify_resize_mode 177 | bindsym e $notify_resize_mode 178 | bindsym t $notify_resize_mode 179 | bindsym q $notify_resize_mode 180 | bindsym s $notify_resize_mode 181 | bindsym f $notify_resize_mode 182 | bindsym g $notify_resize_mode 183 | bindsym m $notify_resize_mode 184 | bindsym w $notify_resize_mode 185 | bindsym x $notify_resize_mode 186 | bindsym c $notify_resize_mode 187 | bindsym v $notify_resize_mode 188 | bindsym b $notify_resize_mode 189 | bindsym n $notify_resize_mode 190 | bindsym A $notify_resize_mode 191 | bindsym Z $notify_resize_mode 192 | bindsym E $notify_resize_mode 193 | bindsym T $notify_resize_mode 194 | bindsym Q $notify_resize_mode 195 | bindsym S $notify_resize_mode 196 | bindsym F $notify_resize_mode 197 | bindsym G $notify_resize_mode 198 | bindsym M $notify_resize_mode 199 | bindsym W $notify_resize_mode 200 | bindsym X $notify_resize_mode 201 | bindsym C $notify_resize_mode 202 | bindsym V $notify_resize_mode 203 | bindsym B $notify_resize_mode 204 | bindsym N $notify_resize_mode 205 | 206 | bindsym u resize shrink width 20 px or 20 ppt 207 | bindsym i resize grow height 20 px or 20 ppt 208 | bindsym o resize shrink height 20 px or 20 ppt 209 | bindsym p resize grow width 20 px or 20 ppt 210 | 211 | bindsym h resize shrink width 10 px or 10 ppt 212 | bindsym j resize grow height 10 px or 10 ppt 213 | bindsym k resize shrink height 10 px or 10 ppt 214 | bindsym l resize grow width 10 px or 10 ppt 215 | 216 | bindsym Return mode "default" 217 | bindsym Escape mode "default" 218 | } 219 | bindsym $mod+r mode $resize_mode 220 | 221 | for_window [class="feh"] floating enable 222 | for_window [class="mpv"] floating enable 223 | for_window [class="arandr"] floating enable 224 | for_window [class="Arandr"] floating enable 225 | for_window [class="Screenkey"] floating enable 226 | for_window [class="Lxappearance"] floating enable 227 | for_window [class="Floating Xterm"] floating enable 228 | for_window [title="Terminator Preferences"] floating enable 229 | 230 | exec --no-startup-id ~/.config/i3/i3-startup 231 | -------------------------------------------------------------------------------- /default/.config/tridactyl/tridactylrc: -------------------------------------------------------------------------------- 1 | alias tabsort jsb browser.tabs.query({}).then(tabs => tabs.sort((t1, t2) => t1.url.localeCompare(t2.url)).forEach((tab, index) => browser.tabs.move(tab.id, {index}))) 2 | alias tabuniq jsb browser.tabs.query({}).then(tabs => browser.tabs.remove(tabs.filter((tab, index) => tabs.slice(index + 1).find(t => t.url == tab.url)).map(tab => tab.id))) 3 | alias slideshow js tri.excmds.tabqueue(Array.from(new Set(Array.from(document.querySelectorAll("a")).map(e=>e.href).filter(h=>/\.(jpe?g)|(png)|(webp)$/i.test(h))))) 4 | alias playAllVideos js tri.native.run("mpv --really-quiet --ontop --keepaspect-window --profile=protocol.http " + Array.from(document.querySelectorAll("a, iframe, video")).reduce((s, e) => {let r=(/^https?:\/\/((www.)?youtu((\.be\/)|(be\.com\/((embed\/)|(watch\?v=))))[^ ]+)|(.+\.webm)$/);let l="";if(e.tagName=="IFRAME")l=e.src.match(r);else if(e.tagName=="A")l=e.href.match(r)||e.innerText.match(r);else if(e.tagName=="VIDEO")l=[e.currentSrc?e.currentSrc:e.src];console.log(l);return s+(l && l.length > 0 && s.indexOf(l[0])<0?"'"+l[0]+"' ":"")},"")) 5 | alias gitclone jsb -p tri.native.run("git clone --depth=1 '" + JS_ARG + "' /home/me/prog/" + JS_ARG.split("/").slice(-1)) 6 | alias rsssave jsb -p tri.native.run('cat >> ~/.config/newsboat/urls', JS_ARG + "\n") 7 | alias bandcampprofiles js Array.from(document.querySelectorAll("a.fan.pic")).forEach(a => tri.excmds.tabopen(a.href)) 8 | alias bandcampclose js if (parseInt(document.querySelectorAll("li.genre-wrapper")[0].innerText.match(/([0-9]*) items? in common/)[1]) < 15) { tri.webext.ownTabId().then(id => browserBg.tabs.remove(id)) } 9 | alias bandcampcloseall jsb tri.messaging.messageAllTabs("excmd_content", "composite", ["bandcampclose"]) 10 | 11 | bind O composite url2args | fillcmdline open 12 | bind gh followpage prev 13 | bind gl followpage next 14 | bind gc composite js window.location.href | gitclone 15 | bind ;gc hint -qW gitclone 16 | bind H tabprev 17 | bind L tabnext 18 | bind K forward 19 | bind J back 20 | bind y clipboard yankshort 21 | bind Y hint -p 22 | bind v composite hint -pipe a href | js -p tri.excmds.shellescape(JS_ARG) | exclaim_quiet mpv --ontop --keepaspect-window --profile=protocol.http 23 | bind V js tri.excmds.shellescape(document.location.href).then(url => tri.native.run(`mpv --ontop --keepaspect-window --profile=protocol.http '${url}'`)) 24 | bind ;v composite hint -qpipe a href | js -p JS_ARG.map(h => `'${h}'`).join(" ") | ! mpv 25 | bind e hint -W js -p tri.native.run(`$HOME/bin/add-magnet '${JS_ARG}'`) 26 | bind u undo tab 27 | bind U undo window 28 | bind s fillcmdline saveas 29 | bind S saveas 30 | bind ;s hint -a 31 | bind ;S hint -s 32 | bind playAllVideos 33 | " Bind to `buffer 1..$` and to `tabmove 1..$` 34 | jsb ["&", "é", '"', "'", "(", "-", "è", "_", "ç", "à"].forEach((l, i) => { i = (i == 9 ? 0 : (i + 1)); ["--mode=insert", "--mode=input", "--mode=normal"].forEach(mode => { tri.excmds.bind(mode, ``, `buffer ${i}`) ; tri.excmds.bind(mode, ``, `tabmove ${i}`) })}) 35 | jsb ["--mode=insert", "--mode=input", "--mode=normal"].forEach(mode => { tri.excmds.bind(mode, ``, `tabmove -1`) ; tri.excmds.bind(mode, ``, `tabmove +1`) ; }) 36 | bind --mode=normal winopen -private 37 | bind --mode=ex text.beginning_of_line 38 | bind --mode=insert text.beginning_of_line 39 | bind --mode=input text.beginning_of_line 40 | bind --mode=ex text.end_of_line 41 | bind --mode=insert text.end_of_line 42 | bind --mode=input text.end_of_line 43 | bind --mode=ex text.forward_word 44 | bind --mode=insert text.forward_word 45 | bind --mode=input text.forward_word 46 | bind --mode=ex text.kill_line 47 | bind --mode=insert text.kill_line 48 | bind --mode=input text.kill_line 49 | bind --mode=ex text.backward_kill_line 50 | bind --mode=insert text.backward_kill_line 51 | bind --mode=input text.backward_kill_line 52 | bind --mode=ex composite getclip selection | text.insert_text 53 | bind --mode=insert composite getclip selection | text.insert_text 54 | bind --mode=input composite getclip selection | text.insert_text 55 | bind --mode=ex text.backward_kill_word 56 | bind --mode=insert text.backward_kill_word 57 | bind --mode=input text.backward_kill_word 58 | 59 | " Requires custom firefox build: https://github.com/glacambre/firefox-patches 60 | bind --mode=ex ex.next_completion 61 | bind --mode=ex ex.prev_completion 62 | bind --mode=ex ex.insert_completion 63 | bind --mode=ex ex.deselect_completion 64 | bind --mode=ex ex.complete 65 | bind --mode=ex composite text.beginning_of_line ; text.forward_word ; text.kill_word 66 | 67 | " Disable 68 | bind --mode=insert js alert(" is for quitters.") 69 | bind --mode=input js alert(" is for quitters.") 70 | bind --mode=normal js alert(" is for quitters.") 71 | bind --mode=ex js alert(" is for quitters.") 72 | bind --mode=hint js alert(" is for quitters.") 73 | 74 | unbind yy 75 | unbind ys 76 | unbind yc 77 | unbind ym 78 | unbind yt 79 | unbind --mode=ex 80 | unbind --mode=ex 81 | unbind ba 82 | 83 | bindurl reddit.com urlmodify -t www old 84 | bindurl https://github.com/.*/.*/blob f hint -c .blob-num,a 85 | bindurl https://github.com/notifications openGithubNotifications 86 | bindurl youtu((\.be)|(be\.com)) f hint -J 87 | bindurl google(\.[a-zA-Z0-9]+){1,2}/search f hint -Jc #top_nav a, #search a, .card-section a, a.fl, #pnnext, #pnprev 88 | bindurl google(\.[a-zA-Z0-9]+){1,2}/search F hint -Jbc #top_nav a, #search a, .card-section a, a.fl, #pnnext, #pnprev 89 | bindurl google(\.[a-zA-Z0-9]+){1,2}/search gF hint -Jqbc #top_nav a, #search a, .card-section a, a.fl, #pnnext, #pnprev 90 | bindurl lkml.org/lkml gl js let lis = Array.from(document.querySelectorAll(".threadlist:nth-of-type(1)")[0].querySelectorAll("li")); document.location.href = lis[lis.findIndex(li => li.className.match("origin")) + 1].querySelector("a").href 91 | bindurl lkml.org/lkml gh js let lis = Array.from(document.querySelectorAll(".threadlist:nth-of-type(1)")[0].querySelectorAll("li")); document.location.href = lis[lis.findIndex(li => li.className.match("origin")) - 1].querySelector("a").href 92 | 93 | set allowautofocus false 94 | set hintchars fdsqjklmrezauiopwxcvghtybn 95 | set searchengine g 96 | set tabopencontaineraware true 97 | set rsscmd rsssave %u 98 | set visualenterauto false 99 | set wordpattern [^\s\/]+ 100 | 101 | " Disable all searchurls 102 | jsb Object.keys(tri.config.get("searchurls")).reduce((prev, u) => prev.catch(()=>{}).then(_ => tri.excmds.setnull("searchurls." + u)), Promise.resolve()) 103 | " Add our own 104 | set searchurls.amazon https://www.amazon.fr/s/ref=nb_sb_noss?field-keywords=%s 105 | set searchurls.bandcamp https://bandcamp.com/search?q=%s 106 | set searchurls.cnrtl http://www.cnrtl.fr/lexicographie/%s 107 | set searchurls.conj http://www.les-verbes.com/conjuguer.php?verbe=%s 108 | set searchurls.crates https://crates.io/search?q=%s 109 | set searchurls.ddg https://duckduckgo.com/html?q=%s 110 | set searchurls.deb https://packages.debian.org/search?keywords=%s&searchon=names&suite=all§ion=all 111 | set searchurls.fdroid https://search.f-droid.org/?q=%s 112 | set searchurls.g https://www.google.com/search?q=%s 113 | set searchurls.gh https://github.com/search?utf8=%E2%9C%93&q=%s&ref=simplesearch 114 | set searchurls.gi https://www.google.com/search?q=%s&tbm=isch 115 | set searchurls.gmaps https://www.google.com/maps/search/%s 116 | set searchurls.gw https://wiki.gentoo.org/index.php?title=Special%3ASearch&profile=default&search=%s&fulltext=Search 117 | set searchurls.imdb https://www.imdb.com/find?q=%s 118 | set searchurls.lqwant https://lite.qwant.com/?q=%s 119 | set searchurls.mdn https://developer.mozilla.org/en-US/search?q=%s&topic=api&topic=js 120 | set searchurls.monova https://monova.to/search?term=%s 121 | set searchurls.npm https://www.npmjs.com/search?q=%s 122 | set searchurls.osm https://www.openstreetmap.org/search?query=%s 123 | set searchurls.pydoc https://docs.python.org/3/search.html?q=%s 124 | set searchurls.qwant https://www.qwant.com/?q=%s 125 | set searchurls.ratp https://www.ratp.fr/itineraires?start=%s1&end=%s2&lieu_depart=&lieu_arrivee=&modes[rail]=rail&modes[metro]=metro&modes[bus]=bus&modes[tram]=tram&itinerary_profile=fastest&op=C%27est+parti 126 | set searchurls.r https://old.reddit.com/r/%s 127 | set searchurls.rustdoc https://doc.rust-lang.org/std/index.html?search=%s 128 | set searchurls.searxme https://searx.me/?q=%s&categories=general&language=en-US 129 | set searchurls.skyt https://www.skytorrents.to/?search=%s 130 | set searchurls.steam https://store.steampowered.com/search/?term=%s 131 | set searchurls.torrentz https://torrentz2.eu/search?f=%s 132 | set searchurls.tpb https://thepiratebay.org/s/?q=%s&=on&page=0&orderby=99 133 | set searchurls.tre http://www.wordreference.com/redirect/translation.aspx?w=%s&dict=enfr 134 | set searchurls.trf http://www.wordreference.com/redirect/translation.aspx?w=%s&dict=fren 135 | set searchurls.w https://en.wikipedia.org/w/index.php?search=%s&title=Special%3ASearch 136 | set searchurls.wfr https://fr.wikipedia.org/w/index.php?search=%s&title=Sp%E9cial%3ARecherche 137 | set searchurls.y https://www.youtube.com/results?search_query=%s 138 | set customthemes.custom html, body { -moz-font-feature-settings: "dlig" 0 !important; } span.TridactylHint { font-family: monospace !important; background: transparent !important; color: black !important; text-shadow: cyan -1px -1px 0px, cyan -1px 0px 0px, cyan -1px 1px 0px, cyan 1px -1px 0px, cyan 1px 0px 0px, cyan 1px 1px 0px, cyan 0px 1px 0px, cyan 0px -1px 0px !important; } 139 | set theme custom 140 | -------------------------------------------------------------------------------- /default/.config/mpd/mpd.conf: -------------------------------------------------------------------------------- 1 | # An example configuration file for MPD. 2 | # Read the user manual for documentation: http://www.musicpd.org/doc/user/ 3 | # or /usr/share/doc/mpd/html/user.html 4 | 5 | 6 | # Files and directories ####################################################### 7 | # 8 | # This setting controls the top directory which MPD will search to discover the 9 | # available audio files and add them to the daemon's online database. This 10 | # setting defaults to the XDG directory, otherwise the music directory will be 11 | # be disabled and audio files will only be accepted over ipc socket (using 12 | # file:// protocol) or streaming files over an accepted protocol. 13 | # 14 | music_directory "/home/me/music" 15 | # 16 | # This setting sets the MPD internal playlist directory. The purpose of this 17 | # directory is storage for playlists created by MPD. The server will use 18 | # playlist files not created by the server but only if they are in the MPD 19 | # format. This setting defaults to playlist saving being disabled. 20 | # 21 | playlist_directory "/home/me/.local/share/mpd/playlists" 22 | # 23 | # This setting sets the location of the MPD database. This file is used to 24 | # load the database at server start up and store the database while the 25 | # server is not up. This setting defaults to disabled which will allow 26 | # MPD to accept files over ipc socket (using file:// protocol) or streaming 27 | # files over an accepted protocol. 28 | # 29 | db_file "/home/me/.local/share/mpd/tag_cache" 30 | # 31 | # These settings are the locations for the daemon log files for the daemon. 32 | # These logs are great for troubleshooting, depending on your log_level 33 | # settings. 34 | # 35 | # The special value "syslog" makes MPD use the local syslog daemon. This 36 | # setting defaults to logging to syslog, or to journal if mpd was started as 37 | # a systemd service. 38 | # 39 | log_file "/var/run/user/1000/mpd.log" 40 | # 41 | # This setting sets the location of the file which stores the process ID 42 | # for use of mpd --kill and some init scripts. This setting is disabled by 43 | # default and the pid file will not be stored. 44 | # 45 | pid_file "/var/run/user/1000/mpd.pid" 46 | # 47 | # This setting sets the location of the file which contains information about 48 | # most variables to get MPD back into the same general shape it was in before 49 | # it was brought down. This setting is disabled by default and the server 50 | # state will be reset on server start up. 51 | # 52 | state_file "/home/me/.local/share/mpd/state" 53 | # 54 | # The location of the sticker database. This is a database which 55 | # manages dynamic information attached to songs. 56 | # 57 | sticker_file "/home/me/.local/share/mpd/sticker.sql" 58 | # 59 | ############################################################################### 60 | 61 | 62 | # General music daemon options ################################################ 63 | # 64 | # This setting specifies the user that MPD will run as. MPD should never run as 65 | # root and you may use this setting to make MPD change its user ID after 66 | # initialization. This setting is disabled by default and MPD is run as the 67 | # current user. 68 | # 69 | user "me" 70 | # 71 | # This setting specifies the group that MPD will run as. If not specified 72 | # primary group of user specified with "user" setting will be used (if set). 73 | # This is useful if MPD needs to be a member of group such as "audio" to 74 | # have permission to use sound card. 75 | # 76 | #group "nogroup" 77 | # 78 | # This setting sets the address for the daemon to listen on. Careful attention 79 | # should be paid if this is assigned to anything other then the default, any. 80 | # This setting can deny access to control of the daemon. Choose any if you want 81 | # to have mpd listen on every address. Not effective if systemd socket 82 | # activation is in use. 83 | # 84 | # For network 85 | bind_to_address "localhost" 86 | # 87 | # And for Unix Socket 88 | #bind_to_address "/run/mpd/socket" 89 | # 90 | # This setting is the TCP port that is desired for the daemon to get assigned 91 | # to. 92 | # 93 | #port "6600" 94 | # 95 | # This setting controls the type of information which is logged. Available 96 | # setting arguments are "default", "secure" or "verbose". The "verbose" setting 97 | # argument is recommended for troubleshooting, though can quickly stretch 98 | # available resources on limited hardware storage. 99 | # 100 | #log_level "default" 101 | # 102 | # Setting "restore_paused" to "yes" puts MPD into pause mode instead 103 | # of starting playback after startup. 104 | # 105 | #restore_paused "no" 106 | # 107 | # This setting enables MPD to create playlists in a format usable by other 108 | # music players. 109 | # 110 | #save_absolute_paths_in_playlists "no" 111 | # 112 | # This setting defines a list of tag types that will be extracted during the 113 | # audio file discovery process. The complete list of possible values can be 114 | # found in the user manual. 115 | #metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" 116 | # 117 | # This example just enables the "comment" tag without disabling all 118 | # the other supported tags: 119 | #metadata_to_use "+comment" 120 | # 121 | # This setting enables automatic update of MPD's database when files in 122 | # music_directory are changed. 123 | # 124 | #auto_update "yes" 125 | # 126 | # Limit the depth of the directories being watched, 0 means only watch 127 | # the music directory itself. There is no limit by default. 128 | # 129 | #auto_update_depth "3" 130 | # 131 | ############################################################################### 132 | 133 | 134 | # Symbolic link behavior ###################################################### 135 | # 136 | # If this setting is set to "yes", MPD will discover audio files by following 137 | # symbolic links outside of the configured music_directory. 138 | # 139 | #follow_outside_symlinks "yes" 140 | # 141 | # If this setting is set to "yes", MPD will discover audio files by following 142 | # symbolic links inside of the configured music_directory. 143 | # 144 | #follow_inside_symlinks "yes" 145 | # 146 | ############################################################################### 147 | 148 | 149 | # Zeroconf / Avahi Service Discovery ########################################## 150 | # 151 | # If this setting is set to "yes", service information will be published with 152 | # Zeroconf / Avahi. 153 | # 154 | #zeroconf_enabled "yes" 155 | # 156 | # The argument to this setting will be the Zeroconf / Avahi unique name for 157 | # this MPD server on the network. %h will be replaced with the hostname. 158 | # 159 | #zeroconf_name "Music Player @ %h" 160 | # 161 | ############################################################################### 162 | 163 | 164 | # Permissions ################################################################# 165 | # 166 | # If this setting is set, MPD will require password authorization. The password 167 | # setting can be specified multiple times for different password profiles. 168 | # 169 | #password "password@read,add,control,admin" 170 | # 171 | # This setting specifies the permissions a user has who has not yet logged in. 172 | # 173 | #default_permissions "read,add,control,admin" 174 | # 175 | ############################################################################### 176 | 177 | 178 | # Database ####################################################################### 179 | # 180 | 181 | #database { 182 | # plugin "proxy" 183 | # host "other.mpd.host" 184 | # port "6600" 185 | #} 186 | 187 | # Input ####################################################################### 188 | # 189 | 190 | # input { 191 | # plugin "curl" 192 | # proxy "proxy.isp.com:8080" 193 | # proxy_user "user" 194 | # proxy_password "password" 195 | # } 196 | 197 | # QOBUZ input plugin 198 | input { 199 | enabled "no" 200 | plugin "qobuz" 201 | # app_id "ID" 202 | # app_secret "SECRET" 203 | # username "USERNAME" 204 | # password "PASSWORD" 205 | # format_id "N" 206 | } 207 | 208 | # TIDAL input plugin 209 | input { 210 | enabled "no" 211 | plugin "tidal" 212 | # token "TOKEN" 213 | # username "USERNAME" 214 | # password "PASSWORD" 215 | # audioquality "Q" 216 | } 217 | 218 | # Decoder ##################################################################### 219 | # 220 | 221 | decoder { 222 | plugin "hybrid_dsd" 223 | enabled "no" 224 | # gapless "no" 225 | } 226 | 227 | # 228 | ############################################################################### 229 | 230 | # Audio Output ################################################################ 231 | # 232 | # MPD supports various audio output types, as well as playing through multiple 233 | # audio outputs at the same time, through multiple audio_output settings 234 | # blocks. Setting this block is optional, though the server will only attempt 235 | # autodetection for one sound card. 236 | # 237 | # An example of an ALSA output: 238 | # 239 | # audio_output { 240 | # type "alsa" 241 | # name "My ALSA Device" 242 | # device "hw:0,0" # optional 243 | # mixer_type "hardware" # optional 244 | # mixer_device "default" # optional 245 | # mixer_control "PCM" # optional 246 | # mixer_index "0" # optional 247 | # } 248 | # 249 | # An example of an OSS output: 250 | # 251 | #audio_output { 252 | # type "oss" 253 | # name "My OSS Device" 254 | # device "/dev/dsp" # optional 255 | # mixer_type "hardware" # optional 256 | # mixer_device "/dev/mixer" # optional 257 | # mixer_control "PCM" # optional 258 | #} 259 | # 260 | # An example of a shout output (for streaming to Icecast): 261 | # 262 | #audio_output { 263 | # type "shout" 264 | # encoder "vorbis" # optional 265 | # name "My Shout Stream" 266 | # host "localhost" 267 | # port "8000" 268 | # mount "/mpd.ogg" 269 | # password "hackme" 270 | # quality "5.0" 271 | # bitrate "128" 272 | # format "44100:16:1" 273 | # protocol "icecast2" # optional 274 | # user "source" # optional 275 | # description "My Stream Description" # optional 276 | # url "http://example.com" # optional 277 | # genre "jazz" # optional 278 | # public "no" # optional 279 | # timeout "2" # optional 280 | # mixer_type "software" # optional 281 | #} 282 | # 283 | # An example of a recorder output: 284 | # 285 | #audio_output { 286 | # type "recorder" 287 | # name "My recorder" 288 | # encoder "vorbis" # optional, vorbis or lame 289 | # path "/var/lib/mpd/recorder/mpd.ogg" 290 | ## quality "5.0" # do not define if bitrate is defined 291 | # bitrate "128" # do not define if quality is defined 292 | # format "44100:16:1" 293 | #} 294 | # 295 | # An example of a httpd output (built-in HTTP streaming server): 296 | # 297 | #audio_output { 298 | # type "httpd" 299 | # name "My HTTP Stream" 300 | # encoder "vorbis" # optional, vorbis or lame 301 | # port "8000" 302 | # bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 303 | # quality "5.0" # do not define if bitrate is defined 304 | # bitrate "128" # do not define if quality is defined 305 | # format "44100:16:1" 306 | # max_clients "0" # optional 0=no limit 307 | #} 308 | # 309 | # An example of a pulseaudio output (streaming to a remote pulseaudio server) 310 | # Please see README.Debian if you want mpd to play through the pulseaudio 311 | # daemon started as part of your graphical desktop session! 312 | # 313 | audio_output { 314 | type "pulse" 315 | name "My Pulse Output" 316 | # server "remote_server" # optional 317 | # sink "remote_server_sink" # optional 318 | } 319 | # 320 | # An example of a winmm output (Windows multimedia API). 321 | # 322 | #audio_output { 323 | # type "winmm" 324 | # name "My WinMM output" 325 | # device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional 326 | # or 327 | # device "0" # optional 328 | # mixer_type "hardware" # optional 329 | #} 330 | # 331 | # An example of an openal output. 332 | # 333 | #audio_output { 334 | # type "openal" 335 | # name "My OpenAL output" 336 | # device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional 337 | #} 338 | # 339 | ## Example "pipe" output: 340 | # 341 | #audio_output { 342 | # type "pipe" 343 | # name "my pipe" 344 | # command "aplay -f cd 2>/dev/null" 345 | ## Or if you're want to use AudioCompress 346 | # command "AudioCompress -m | aplay -f cd 2>/dev/null" 347 | ## Or to send raw PCM stream through PCM: 348 | # command "nc example.org 8765" 349 | # format "44100:16:2" 350 | #} 351 | # 352 | ## An example of a null output (for no audio output): 353 | # 354 | #audio_output { 355 | # type "null" 356 | # name "My Null Output" 357 | # mixer_type "none" # optional 358 | #} 359 | # 360 | ############################################################################### 361 | 362 | 363 | # Normalization automatic volume adjustments ################################## 364 | # 365 | # This setting specifies the type of ReplayGain to use. This setting can have 366 | # the argument "off", "album", "track" or "auto". "auto" is a special mode that 367 | # chooses between "track" and "album" depending on the current state of 368 | # random playback. If random playback is enabled then "track" mode is used. 369 | # See for more details about ReplayGain. 370 | # This setting is off by default. 371 | # 372 | #replaygain "album" 373 | # 374 | # This setting sets the pre-amp used for files that have ReplayGain tags. By 375 | # default this setting is disabled. 376 | # 377 | #replaygain_preamp "0" 378 | # 379 | # This setting sets the pre-amp used for files that do NOT have ReplayGain tags. 380 | # By default this setting is disabled. 381 | # 382 | #replaygain_missing_preamp "0" 383 | # 384 | # This setting enables or disables ReplayGain limiting. 385 | # MPD calculates actual amplification based on the ReplayGain tags 386 | # and replaygain_preamp / replaygain_missing_preamp setting. 387 | # If replaygain_limit is enabled MPD will never amplify audio signal 388 | # above its original level. If replaygain_limit is disabled such amplification 389 | # might occur. By default this setting is enabled. 390 | # 391 | #replaygain_limit "yes" 392 | # 393 | # This setting enables on-the-fly normalization volume adjustment. This will 394 | # result in the volume of all playing audio to be adjusted so the output has 395 | # equal "loudness". This setting is disabled by default. 396 | # 397 | #volume_normalization "no" 398 | # 399 | ############################################################################### 400 | 401 | # Character Encoding ########################################################## 402 | # 403 | # If file or directory names do not display correctly for your locale then you 404 | # may need to modify this setting. 405 | # 406 | filesystem_charset "UTF-8" 407 | # 408 | ############################################################################### 409 | --------------------------------------------------------------------------------

: "💩" U0001f4a9 # PILE OF POO 110 | : "😆" U0001f606 # SMILING FACE WITH OPEN MOUTH AND TIGHTLY-CLOSED EYES 111 | : "😤" U0001f624 # FACE WITH LOOK OF TRIUMPH 112 | : "​" U200b 113 |