├── .config ├── chromium-flags.conf ├── pycodestyle ├── mpv │ └── mpv.conf ├── rofi │ └── config.rasi ├── nvim │ ├── ftplugin │ │ ├── python.vim │ │ ├── rust.vim │ │ ├── javascript.vim │ │ ├── typescript.vim │ │ ├── PKGBUILD.vim │ │ └── vimwiki.vim │ ├── lua │ │ └── jelle │ │ │ ├── tree.lua │ │ │ ├── plug.lua │ │ │ ├── treesitter.lua │ │ │ ├── statusline.lua │ │ │ ├── test.lua │ │ │ ├── cov.lua │ │ │ ├── vimwiki.lua │ │ │ ├── opts.lua │ │ │ ├── cmp.lua │ │ │ ├── search.lua │ │ │ ├── git.lua │ │ │ ├── dap.lua │ │ │ └── lsp.lua │ ├── snippets │ │ └── PKGBUILD │ │ │ ├── package.json │ │ │ └── PKGBUILD.json │ ├── init.lua │ └── plugins.vim ├── systemd │ └── user │ │ ├── weechat-rotate.service │ │ └── mopidy.service ├── ncspot │ └── config.toml ├── alacritty │ └── color.toml ├── newsboat │ ├── urls │ └── config ├── cower │ └── config ├── alacritty.toml ├── i3status │ └── config ├── termite │ └── config ├── htop │ └── htoprc └── i3 │ └── config ├── bin ├── ytsearch ├── cleanup-cockpit-test-failures ├── newsboat-bookmark ├── wifiindetrein.sh ├── switch-cockpit-symlink ├── list-outdated-packages ├── newsboat-open-link ├── package-depends ├── gwt-add ├── youtube-rss-feed ├── cockpit-list-images ├── generate-release-note-links ├── gwt-pr ├── updategitfork ├── dnsmasq-blocklist ├── add-outdated-packages ├── start-work ├── version-diff-link ├── arch-git-repo-search ├── gen-python-weekly-feed ├── generate-vimwiki-diary-template ├── verify-file-ownership ├── fix-aoe2-mp ├── xandikos2json ├── tiktok2rss └── arch-spdx-statistics ├── .globalgitignore ├── .zprofile ├── .gnupg └── gpg-agent.conf ├── .Xmodmap ├── .local └── share │ └── logrotate.d │ └── irc ├── .vim ├── ftplugin │ ├── vimwiki.vim │ ├── python.vim │ ├── javascript.vim │ ├── PKGBUILD.vim │ └── rust.vim ├── coc-settings.json └── colors │ ├── wombat256mod.vim │ ├── candycode.vim │ └── jellybeans.vim ├── .ipython └── profile_default │ ├── startup │ └── 10-zarafa.py │ └── ipython_config.py ├── .xinitrc ├── .ncmpcpp ├── bindings └── config ├── .xmonad ├── autostart.sh └── xmonad.hs ├── .pentadactylrc ├── .taskrc ├── .mplayer └── config ├── README.markdown ├── .pam_environment ├── .mutt ├── open_ml_url.py ├── security_tracker.py ├── crypto ├── colors ├── muttrc └── mailcap ├── .zcompletions └── _check_application ├── .zshcompletions └── _check_application ├── .urlwatch ├── urls.yaml └── hooks.py ├── .xmobarrc ├── .vimperatorrc ├── .tmux.conf ├── .Xdefaults ├── .vimperator └── colors │ └── zenburn.vimp ├── .ycm_extra_conf.py ├── .vimrc └── .zshrc /.config/chromium-flags.conf: -------------------------------------------------------------------------------- 1 | --ignore-gpu-blocklist 2 | -------------------------------------------------------------------------------- /.config/pycodestyle: -------------------------------------------------------------------------------- 1 | [pycodestyle] 2 | max-line-length = 200 3 | -------------------------------------------------------------------------------- /bin/ytsearch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mpv --no-video ytdl://ytsearch:"$*" 4 | -------------------------------------------------------------------------------- /.config/mpv/mpv.conf: -------------------------------------------------------------------------------- 1 | hwdec=auto 2 | script-opts=ytdl_hook-ytdl_path="yt-dlp" 3 | -------------------------------------------------------------------------------- /.globalgitignore: -------------------------------------------------------------------------------- 1 | taskell.md 2 | run.sh 3 | # ccls language server cache 4 | .ccls-cache/ 5 | -------------------------------------------------------------------------------- /.zprofile: -------------------------------------------------------------------------------- 1 | typeset -U path 2 | path=(~/bin ~/.gem/ruby/2.4.0/bin ~/.local/bin $path[@]) 3 | -------------------------------------------------------------------------------- /bin/cleanup-cockpit-test-failures: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo TestApplication-* 4 | rm -I TestApplication-* 5 | -------------------------------------------------------------------------------- /.config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | modi: "window,run,ssh,calc"; 3 | } 4 | 5 | @theme "Arc-Dark" 6 | -------------------------------------------------------------------------------- /.gnupg/gpg-agent.conf: -------------------------------------------------------------------------------- 1 | # Enable SSH support 2 | enable-ssh-support 3 | pinentry-program /usr/bin/pinentry-gnome3 4 | -------------------------------------------------------------------------------- /.Xmodmap: -------------------------------------------------------------------------------- 1 | clear lock 2 | remove mod4 = Super_L 3 | keysym Caps_Lock = Super_L 4 | add mod4 = Super_L 5 | keycode 108 = Multi_key 6 | -------------------------------------------------------------------------------- /bin/newsboat-bookmark: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PROJECTDIR=~/projects/readlater 4 | 5 | ${PROJECTDIR}/target/debug/readlater newsboat "$@" 6 | -------------------------------------------------------------------------------- /.local/share/logrotate.d/irc: -------------------------------------------------------------------------------- 1 | # weechat logrorate file 2 | 3 | compress 4 | missingok 5 | notifempty 6 | copytruncate 7 | 8 | "~/.weechat/logs/**log" {} 9 | -------------------------------------------------------------------------------- /.vim/ftplugin/vimwiki.vim: -------------------------------------------------------------------------------- 1 | " notes 2 | nnoremap :terminal make serve 3 | nnoremap :!make rsync_upload 4 | nnoremap :!make commit_push 5 | -------------------------------------------------------------------------------- /bin/wifiindetrein.sh: -------------------------------------------------------------------------------- 1 | curl -H "Host: www.nstrein.ns.nl" $(host www.nstrein.ns.nl | head -n 1 | grep -oE '[0-9.]{7,}')/?action=nstrein:main.internet >/dev/null 2 | -------------------------------------------------------------------------------- /.vim/ftplugin/python.vim: -------------------------------------------------------------------------------- 1 | let python_highlight_all = 1 2 | let python_slow_sync = 1 3 | 4 | set expandtab shiftwidth=4 softtabstop=4 5 | set completeopt=preview 6 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/python.vim: -------------------------------------------------------------------------------- 1 | let python_highlight_all = 1 2 | let python_slow_sync = 1 3 | 4 | set expandtab shiftwidth=4 softtabstop=4 5 | set completeopt=preview 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/tree.lua: -------------------------------------------------------------------------------- 1 | require'nvim-tree'.setup { 2 | } 3 | 4 | vim.api.nvim_set_keymap('n', '', ':NvimTreeToggle', { noremap = true, silent = true }) 5 | -------------------------------------------------------------------------------- /bin/switch-cockpit-symlink: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR=$PWD/dist 4 | SYMLINK=$HOME/.local/share/cockpit 5 | 6 | rm $SYMLINK 7 | ln -s $DIR $SYMLINK 8 | 9 | ls -lh $SYMLINK 10 | -------------------------------------------------------------------------------- /bin/list-outdated-packages: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | user=jelle 4 | 5 | curl -s "https://archlinux.org/packages/search/json/?maintainer=${user}&flagged=Flagged" | jq -r '.results[].pkgbase' 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/plug.lua: -------------------------------------------------------------------------------- 1 | vim.call('plug#begin', '~/.config/nvim/plugged') 2 | 3 | Plug 'kyazdani42/nvim-web-devicons' 4 | Plug 'kyazdani42/nvim-tree.lua' 5 | 6 | vim.call('plug#end') 7 | -------------------------------------------------------------------------------- /bin/newsboat-open-link: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | url=$1 4 | 5 | if [[ $url == *"youtube.com"* || $url == *"tiktok.com"* ]];then 6 | mpv $url 7 | else 8 | chromium $url 2> /dev/null 9 | fi 10 | -------------------------------------------------------------------------------- /bin/package-depends: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | name=$1 4 | thing=${2:depends} 5 | curl -s "https://archlinux.org/packages/search/json/?q=${name}" | jq ".results[] | select(.pkgbase == \"${name}\") | .${thing}" 6 | -------------------------------------------------------------------------------- /bin/gwt-add: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | name=$1 4 | 5 | cd ~/projects/cockpit || exit 1 6 | git worktree add "$name" -b "$name" main 7 | cd "$name" 8 | 9 | ./test/common/make-bots 10 | ./tools/node-modules checkout 11 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/rust.vim: -------------------------------------------------------------------------------- 1 | nmap x :Cargo run 2 | nmap c :Cargo clippy 3 | 4 | let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'] } 5 | let g:rustfmt_autosave = 1 6 | -------------------------------------------------------------------------------- /.vim/ftplugin/javascript.vim: -------------------------------------------------------------------------------- 1 | " Auto expand tabs to spaces (use space rather than tab) 2 | setlocal expandtab 3 | setlocal shiftwidth=2 4 | setlocal tabstop=2 5 | 6 | " Auto indent after a { 7 | setlocal autoindent 8 | setlocal smartindent 9 | -------------------------------------------------------------------------------- /bin/youtube-rss-feed: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | url=$1 4 | 5 | channelid=${url##*/} 6 | echo "https://www.youtube.com/feeds/videos.xml?channel_id=$channelid" 7 | echo "https://www.youtube.com/feeds/videos.xml?channel_id=$channelid" | xclip -i 8 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/javascript.vim: -------------------------------------------------------------------------------- 1 | " Auto expand tabs to spaces (use space rather than tab) 2 | setlocal expandtab 3 | setlocal shiftwidth=2 4 | setlocal tabstop=2 5 | 6 | " Auto indent after a { 7 | setlocal autoindent 8 | setlocal smartindent 9 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/typescript.vim: -------------------------------------------------------------------------------- 1 | " Auto expand tabs to spaces (use space rather than tab) 2 | setlocal expandtab 3 | setlocal shiftwidth=2 4 | setlocal tabstop=2 5 | 6 | " Auto indent after a { 7 | setlocal autoindent 8 | setlocal smartindent 9 | -------------------------------------------------------------------------------- /.config/systemd/user/weechat-rotate.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Logrotate weechat's logs 3 | 4 | [Service] 5 | Type=simple 6 | ExecStart=/usr/bin/logrotate -s %t/logrotate.state %h/.local/share/logrotate.d/irc -v 7 | 8 | [Install] 9 | WantedBy=default.target 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/treesitter.lua: -------------------------------------------------------------------------------- 1 | require'nvim-treesitter.configs'.setup { 2 | -- A list of parser names, or "all" 3 | ensure_installed = { "c", "javascript", "rust", "python" }, 4 | 5 | -- Install parsers synchronously (only applied to `ensure_installed`) 6 | sync_install = false, 7 | } 8 | -------------------------------------------------------------------------------- /.config/nvim/snippets/PKGBUILD/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PKGBUILD", 3 | "version": "1.0.0", 4 | "description": "PKGBUILD snippets", 5 | "contributes": { 6 | "snippets": [ 7 | { 8 | "language": "PKGBUILD", 9 | "path": "./PKGBUILD.json" 10 | } 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.ipython/profile_default/startup/10-zarafa.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | if sys.version_info.major == 2: 4 | import zarafa 5 | import MAPI 6 | from MAPI.Util import * 7 | from MAPI.Tags import * 8 | 9 | server = zarafa.Server() 10 | bob = server.user('bob') 11 | alice = server.user('alice') 12 | -------------------------------------------------------------------------------- /.vim/ftplugin/PKGBUILD.vim: -------------------------------------------------------------------------------- 1 | function! Pkgrel() 2 | " Bump pkgrel 3 | let save_pos = getpos(".") 4 | let pattern = 'pkgrel=' 5 | if search(pattern) is 0 6 | return 7 | endif 8 | exe "normal \\" 9 | call setpos(".", save_pos) 10 | endfunction 11 | 12 | nmap :call Pkgrel() 13 | nmap :!updpkgsums 14 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/PKGBUILD.vim: -------------------------------------------------------------------------------- 1 | function! Pkgrel() 2 | " Bump pkgrel 3 | let save_pos = getpos(".") 4 | let pattern = 'pkgrel=' 5 | if search(pattern) is 0 6 | return 7 | endif 8 | exe "normal \\" 9 | call setpos(".", save_pos) 10 | endfunction 11 | 12 | nmap :call Pkgrel() 13 | nmap :!updpkgsums 14 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # ~/.xinitrc 4 | # 5 | # Executed by startx (run your window manager from here) 6 | 7 | # https://bugs.archlinux.org/task/58368 8 | dbus-update-activation-environment DISPLAY XAUTHORITY 9 | 10 | # set keyboard layout 11 | setxkbmap -layout us -option compose:ralt -option caps:hyper & 12 | 13 | exec i3 14 | -------------------------------------------------------------------------------- /.vim/coc-settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "languageserver": { 3 | "go": { 4 | "command": "gopls", 5 | "rootPatterns": ["go.mod"], 6 | "trace.server": "verbose", 7 | "filetypes": ["go"] 8 | }, 9 | "rust": { 10 | "command": "rust-analyzer", 11 | "filetypes": ["rust"], 12 | "rootPatterns": ["Cargo.toml"] 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /bin/cockpit-list-images: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://cockpit-images.us-east-1.linodeobjects.com/ 4 | if [ -z "$1" ] 5 | then 6 | LOC=https://cockpit-images.eu-central-1.linodeobjects.com/ 7 | else 8 | LOC=$1 9 | fi 10 | 11 | WD=${PWD} 12 | 13 | 14 | cd ~/projects/cockpit-bots/ || exit 1 15 | python3 -m lib.s3 ls ${LOC} 16 | cd "$WD" || exit 1 17 | -------------------------------------------------------------------------------- /.config/systemd/user/mopidy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Mopidy music server 3 | After=avahi-daemon.service 4 | After=dbus.service 5 | After=network.target 6 | After=nss-lookup.target 7 | After=pulseaudio.service 8 | After=remote-fs.target 9 | After=sound.target 10 | 11 | [Service] 12 | ExecStart=/usr/bin/mopidy 13 | 14 | [Install] 15 | WantedBy=default.target 16 | -------------------------------------------------------------------------------- /.ncmpcpp/bindings: -------------------------------------------------------------------------------- 1 | def_key "j" 2 | scroll_down 3 | def_key "k" 4 | scroll_up 5 | 6 | def_key "ctrl-j" 7 | move_selected_items_down 8 | def_key "ctrl-k" 9 | move_selected_items_up 10 | 11 | def_key "l" 12 | next_column 13 | def_key "l" 14 | slave_screen 15 | def_key "h" 16 | previous_column 17 | def_key "h" 18 | master_screen 19 | -------------------------------------------------------------------------------- /.xmonad/autostart.sh: -------------------------------------------------------------------------------- 1 | /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1& 2 | if pgrep -u jelle nm-applet &> /dev/null; 3 | then 4 | echo alive &> /dev/null 5 | else 6 | nm-applet& 7 | fi 8 | if pgrep -u jelle trayer &> /dev/null; 9 | then 10 | echo alive &> /dev/null 11 | else 12 | trayer --edge top --align left --SetDockType true --SetPartialStrut true --widthtype percent --width 4 --height 14 13 | # stalonetray 14 | fi 15 | -------------------------------------------------------------------------------- /.config/ncspot/config.toml: -------------------------------------------------------------------------------- 1 | [theme] 2 | background = "#181818" 3 | primary = "#F1F1F1" 4 | secondary = "#DCDCDC" 5 | title = "#1ED760" 6 | playing = "#1ED760" 7 | playing_selected = "#1ED760" 8 | playing_bg = "#181818" 9 | highlight = "#1DB954" 10 | highlight_bg = "#000000" 11 | error = "#FFE4E4" 12 | error_bg = "#A50000" 13 | statusbar = "#000000" 14 | statusbar_progress = "#00AC4C" 15 | statusbar_bg = "#00AC4C" 16 | cmdline = "#CBFFDE" 17 | cmdline_bg = "#444444" 18 | -------------------------------------------------------------------------------- /bin/generate-release-note-links: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# != 1 ]]; then 4 | echo "Missing project name [cockpit|cockpit-ostree|cockpit-machines|cockpit-podman|cockpit-files]" 5 | exit 1 6 | fi 7 | 8 | pkgname=$1 9 | 10 | curl -s "https://bodhi.fedoraproject.org/updates/?packages=${pkgname}" | jq -r '.updates[] | select(.user.name == "packit") | "["+(.title | match("[a-z]+(-[a-z]+)?") | .string)+" Fedora "+(.release.version)+"](https://bodhi.fedoraproject.org/updates/"+(.alias)+")"' 11 | -------------------------------------------------------------------------------- /bin/gwt-pr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ref=$1 4 | branch=$2 5 | origin=${3:-origin} 6 | 7 | github="pull/${ref}/head" 8 | 9 | if [[ $# != 2 && $# != 3 ]]; then 10 | echo usage: gitpr id branchname \[remote\]; 11 | exit 1 12 | fi 13 | 14 | if git rev-parse --git-dir &> /dev/null; then 15 | git fetch $origin $github 16 | git worktree add $branch -b $branch FETCH_HEAD 17 | cd $branch && ./test/common/make-bots 18 | cd $branch && ./tools/node-modules checkout 19 | else 20 | echo 'error: not in git repo' 21 | fi 22 | -------------------------------------------------------------------------------- /.config/alacritty/color.toml: -------------------------------------------------------------------------------- 1 | [colors.bright] 2 | black = "0x696969" 3 | blue = "0x007FFF" 4 | cyan = "0x00CCCC" 5 | green = "0x03C03C" 6 | magenta = "0xFF1493" 7 | red = "0xFF2400" 8 | white = "0xFFFAFA" 9 | yellow = "0xFDFF00" 10 | 11 | [colors.normal] 12 | black = "0x10100E" 13 | blue = "0x0087BD" 14 | cyan = "0x20B2AA" 15 | green = "0x009F6B" 16 | magenta = "0x9A4EAE" 17 | red = "0xC40233" 18 | white = "0xC6C6C4" 19 | yellow = "0xFFD700" 20 | 21 | [colors.primary] 22 | background = "0x10100E" 23 | foreground = "0xC6C6C4" 24 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | vim.cmd("source ~/.config/nvim/plugins.vim") 2 | 3 | require("jelle.opts") 4 | require("jelle.tree") 5 | require("jelle.search") 6 | require("jelle.git") 7 | require("jelle.lsp") 8 | require("jelle.cmp") 9 | require("jelle.treesitter") 10 | require("jelle.statusline") 11 | require("jelle.vimwiki") 12 | require("jelle.dap") 13 | require("jelle.cov") 14 | require("jelle.test") 15 | 16 | vim.g.loaded_ruby_provider = 0 17 | vim.g.loaded_node_provider = 0 18 | vim.g.loaded_perl_provider = 0 19 | vim.g.loaded_python3_provider = 0 20 | -------------------------------------------------------------------------------- /.pentadactylrc: -------------------------------------------------------------------------------- 1 | "" ==================== Settings ==================== " 2 | loadplugins 3 | set guioptions=Cs 4 | set titlestring=Firefox 5 | set history=900 6 | set showmode 7 | set activate=quickmark,paste 8 | set editor="gvim -f" 9 | set followhints=0 10 | set newtab=all 11 | set visualbell 12 | "set complete=ltSsf 13 | set wildmode=list:longest,full 14 | autocmd LocationChange ^https?://(docs|mail)\.google\.com/ :normal! 15 | autocmd LocationChange ^http://www\.google\.com/reader/ :normal! 16 | set middlemouse.contentLoadURL=false 17 | set middlemouse.paste=false 18 | -------------------------------------------------------------------------------- /.vim/ftplugin/rust.vim: -------------------------------------------------------------------------------- 1 | " Inspiration: 2 | " https://github.com/togglebyte/nvim/blob/a1e540af9ee591e5a9003a0230ecc8cea8fed1e3/after/ftplugin/rust.vim 3 | 4 | nmap :Compile 5 | nmap x :Cargo run 6 | nmap b :Cargo test -- --nocapture 7 | nmap c :Cargo clippy 8 | 9 | nmap :call RunDebugger() 10 | nmap d :Break 11 | nmap r :Run 12 | 13 | nmap :Run 14 | nmap :Step 15 | nmap :Over 16 | nmap :Stop 17 | 18 | let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'] } 19 | -------------------------------------------------------------------------------- /.taskrc: -------------------------------------------------------------------------------- 1 | # Files 2 | data.location=~/.task 3 | 4 | # secrets 5 | include ~/.task/secrets 6 | 7 | # theme 8 | include /usr/share/doc/task/rc/dark-256.theme 9 | 10 | news.version=2.6.0 11 | 12 | context.personal.read=project:personal 13 | context.personal.write=project:personal 14 | context.work.read=project:work 15 | context.work.write=project:work 16 | context.archlinux.read=project:archlinux 17 | context.archlinux.write=project:archlinux 18 | 19 | # aliases 20 | alias.@=context 21 | alias.dailystatus=status:completed end.after:today all 22 | 23 | # uda 24 | uda.pkgname.type=string 25 | uda.pkgname.label=Package name 26 | -------------------------------------------------------------------------------- /bin/updategitfork: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -d test/reference ]; then 4 | ./test/common/pixel-tests pull 5 | fi 6 | 7 | # check if the git working directory is clean 8 | if [ -n "$(git status --untracked-files=no --porcelain)" ]; then 9 | echo "git working directory not clean, aborting..." 10 | git status 11 | exit 1 12 | fi 13 | 14 | git fetch --prune --all 15 | branch="master" 16 | if ! git rev-parse --quiet --verify $branch > /dev/null; then 17 | branch="main" 18 | fi 19 | git checkout $branch 20 | git merge --ff-only upstream/$branch 21 | git push origin $branch 22 | 23 | if [ -f tools/node_modules ]; then 24 | ./tools/node_modules checkout 25 | fi 26 | -------------------------------------------------------------------------------- /.mplayer/config: -------------------------------------------------------------------------------- 1 | [default] 2 | gapless-audio=yes 3 | key-fifo-size=3 4 | ao=pulse 5 | fixed-vo=no 6 | #vo=vdpau:hqscaling=1:queuetime_fs=500:output_surfaces=10:denoise=1,xvmc,gl,xv 7 | #vc=ffmpeg12vdpau,ffwmv3vdpau,ffvc1vdpau,ffh264vdpau,ffodivx,ffodivxvdpau, 8 | ontop=yes 9 | aspect=1.77 10 | lavdopts="threads=9:idct=99" 11 | slices=no 12 | cache=32768 13 | cache-min=20 14 | idx=yes 15 | stop-xscreensaver=yes 16 | nomouseinput=yes 17 | sub-fuzziness=2 18 | lirc=no 19 | use-pts-title=yes 20 | joystick=no 21 | subfont-text-scale=3 22 | fstype=none 23 | 24 | 25 | [live] 26 | profile-desc="Prevent A/V desync during live streams" 27 | mc=0 28 | autosync=4 29 | stop-xscreensaver=yes 30 | 31 | -------------------------------------------------------------------------------- /bin/dnsmasq-blocklist: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # dnsmasq addn-hosts config files 4 | 5 | trap 'rm -rf $TMPDIR' EXIT INT TERM QUIT 6 | TMPDIR=$(mktemp -d --tmpdir dnsmasq-blocklist.XXXXXXXX) 7 | 8 | cd "$TMPDIR" 9 | 10 | curl -so host1.txt "https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/hosts.txt" 11 | curl -so host3.txt "https://hostsfile.mine.nu/Hosts" 12 | curl -so host4.txt "https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext" 13 | curl -so host5.txt "http://sysctl.org/cameleon/hosts" 14 | curl -so host6.txt "https://hosts.oisd.nl" 15 | 16 | cat *.txt | sed -e '/^\s*#/d' | uniq | sort | uniq > /tmp/dnsmasq_blocklist.conf 17 | -------------------------------------------------------------------------------- /.config/newsboat/urls: -------------------------------------------------------------------------------- 1 | http://feeds.arstechnica.com/arstechnica/index 2 | http://news.ycombinator.com/rss 3 | http://feeds.guardian.co.uk/theguardian/rss news 4 | https://lwn.net/headlines/newrss linux 5 | https://archlinux.org/feeds/planet/ 6 | http://feeds.feedburner.com/tweakers/mixed 7 | https://lobste.rs/rss 8 | https://www.cronweekly.com/feed/ 9 | https://this-week-in-rust.org/atom.xml 10 | http://feed.dilbert.com/dilbert/daily_strip?format=xml comic 11 | http://xkcd.com/rss.xml comic 12 | https://dodgy.download/pythonweekly.xml 13 | https://www.phoronix.com/rss.php 14 | http://feeds.nos.nl/nosnieuwsalgemeen 15 | https://reproducible-builds.org/blog/index.rss 16 | https://dodgy.download/webpages.rss 17 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # Jelly's Dotfiles 2 | This git repo contains my dotfiles for popular software like mpv, vim, i3, newsbeuter and alacritty. 3 | 4 | ## Desktop 5 | 6 | ### Window Manager setup 7 | 8 | * [i3](https://github.com/i3/i3/) 9 | * [i3lock](https://github.com/i3/i3lock) 10 | * [i3status](https://github.com/i3/i3status) 11 | * [alacritty](https://github.com/alacritty/alacritty/) 12 | * [rofi](https://github.com/davatorium/rofi) 13 | * acpilight 14 | * libpulse (for pactl) 15 | * network-manager-applet (for nm-applet) 16 | * zoxide 17 | 18 | ### Git setup 19 | 20 | Global git ignore for taskell/custom run project scripts: 21 | 22 | ```sh 23 | git config --global core.excludesfile ~/.globalgitignore 24 | ``` 25 | -------------------------------------------------------------------------------- /.pam_environment: -------------------------------------------------------------------------------- 1 | # locale 2 | LANG=en_GB.utf8 3 | 4 | # Ruby PATH 5 | #PATH DEFAULT=${HOME}/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl OVERRIDE=${HOME}/.gem/ruby/1.9.1/bin:${HOME}/bin:${PATH} 6 | 7 | # default applications 8 | BROWSER=firefox 9 | EDITOR=vim 10 | VISUAL=vim 11 | PAGER=less 12 | 13 | LESS=FRSX 14 | GREP_COLOR='mt=4;1;31' 15 | 16 | # use clang 17 | #CC=clang 18 | #CXX=clang++ 19 | 20 | # sdl fix 21 | SDL_VIDEO_X11_DGAMOUSE=0 22 | SDL_VIDEO_FULLSCREEN_HEAD=2 23 | 24 | # Compress ccache 25 | CCACHE_COMPRESS=1 26 | 27 | # ccache + clang 28 | CCACHE_CPP2=1 29 | 30 | # wine settings 31 | WINEARCH=win32 32 | WINDEBUG=-all 33 | WINEDLLOVERRIDES=winemenubuilder.exe=d 34 | 35 | # vim: ft=conf 36 | -------------------------------------------------------------------------------- /.mutt/open_ml_url.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import subprocess 5 | from email.parser import Parser 6 | 7 | import requests 8 | 9 | 10 | URLS = ['https://www.mail-archive.com/search?l=mid&q={}', 'http://marc.info/?i={}', 'http://mid.gmane.org/{}'] 11 | 12 | 13 | if __name__ == "__main__": 14 | headers = Parser().parse(sys.stdin) 15 | if 'message-id' in headers: 16 | for base_url in URLS: 17 | message_id = headers['message-id'].replace('<', '').replace('>', '') 18 | url = base_url.format(message_id) 19 | r = requests.get(url) 20 | if r.status_code == 200 and b'NOT FOUND' not in r.content: 21 | subprocess.call(['xdg-open', url], stdout=subprocess.DEVNULL) 22 | break 23 | -------------------------------------------------------------------------------- /bin/add-outdated-packages: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | user=jelle 4 | twproject=archlinux.packaging 5 | 6 | # Depends on UDA 7 | # task uda.pkgname.type=string 8 | # task uda.pkgname.label=Package name 9 | 10 | # Reset task context, as filtering does not work without it 11 | task context none 12 | 13 | curl -s "https://archlinux.org/packages/search/json/?maintainer=${user}&flagged=Flagged" | jq -r '.results[]|[.pkgname, .flag_date, .url] | @tsv' | 14 | while IFS=$'\t' read -r pkgname date url; do 15 | if ! task "project:$twproject" "pkgname:$pkgname" &> /dev/null; then 16 | task add "project:$twproject" "pkgname:$pkgname" "update $pkgname" due:30d 17 | # taskwarrior does not allow an add and annotation 18 | ID=$(task +LATEST ids) 19 | task "$ID" annotate "upstream $url" 20 | fi 21 | done 22 | -------------------------------------------------------------------------------- /.config/cower/config: -------------------------------------------------------------------------------- 1 | # 2 | # example cower config file 3 | # 4 | # All options here can be overriden with flags on the command line. All options 5 | # are case sensitive. This file will be read per user, and should be located at 6 | # $XDG_CONFIG_HOME/cower/config or $HOME/.config/cower/config. 7 | # 8 | 9 | # Use color in the output. This takes an optional arg of auto/never/always, 10 | # identical to the command line arg --color. If no arg is specified, this is 11 | # assumed to mean auto. 12 | Color = always 13 | 14 | # Ignore the specified binary repos when checking for updates. Multiple arguments 15 | # to this option should be space delimited. 16 | IgnoreRepo = jelle 17 | 18 | # Max number of threads cower will use. This is synonymous with the max number 19 | # of concurrent connections that will be opened to the AUR. 20 | MaxThreads = 4 21 | -------------------------------------------------------------------------------- /bin/start-work: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SESSION=work 4 | PROJECTS=/home/jelle/projects 5 | 6 | tmux new-session -d -s ${SESSION} -n notes 7 | tmux send-keys "notes" C-m 8 | 9 | tmux new-window -t ${SESSION}:1 -n cockpit "cd ${PROJECTS}/cockpit/main; zsh" 10 | tmux new-window -t ${SESSION}:2 -n files "cd ${PROJECTS}/cockpit-files; zsh" 11 | tmux new-window -t ${SESSION}:3 -n podman "cd ${PROJECTS}/cockpit-podman; zsh" 12 | tmux new-window -t ${SESSION}:4 -n machines "cd ${PROJECTS}/cockpit-machines; zsh" 13 | tmux new-window -t ${SESSION}:5 -n bots "cd ${PROJECTS}/cockpit-bots; zsh" 14 | tmux new-window -t ${SESSION}:6 -n varlink "cd ${PROJECTS}/python-varlink; zsh" 15 | tmux new-window -t ${SESSION}:7 -n systemd "cd ${PROJECTS}/systemd; zsh" 16 | 17 | # Set default window 18 | tmux select-window -t $SESSION:+1 19 | 20 | # Attach to session 21 | tmux attach-session -t $SESSION 22 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/statusline.lua: -------------------------------------------------------------------------------- 1 | local navic = require("nvim-navic") 2 | 3 | require('lualine').setup { 4 | options = { 5 | icons_enabled = true, 6 | theme = 'auto', 7 | component_separators = { left = '', right = ''}, 8 | section_separators = { left = '', right = ''}, 9 | disabled_filetypes = {}, 10 | always_divide_middle = true, 11 | }, 12 | sections = { 13 | lualine_a = {'mode'}, 14 | lualine_b = {'branch', 'diff', 'diagnostics'}, 15 | lualine_c = { 16 | "navic", 17 | color_correction = nil, 18 | navic_opts = nil 19 | }, 20 | lualine_x = {'filetype'}, 21 | lualine_y = {'progress'}, 22 | lualine_z = {'location'} 23 | }, 24 | inactive_sections = { 25 | lualine_a = {}, 26 | lualine_b = {}, 27 | lualine_c = {'filename'}, 28 | lualine_x = {'location'}, 29 | lualine_y = {}, 30 | lualine_z = {} 31 | }, 32 | tabline = {}, 33 | extensions = {} 34 | } 35 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/test.lua: -------------------------------------------------------------------------------- 1 | local opts = { noremap=true, silent=true } 2 | function keymap(key, fun, desc) 3 | opts.desc = desc 4 | vim.keymap.set('n', key, fun, opts) 5 | end 6 | 7 | local neotest = require("neotest") 8 | neotest.setup({ 9 | adapters = { 10 | require("neotest-python")({ 11 | dap = { 12 | justMyCode = false, 13 | console = "integratedTerminal", 14 | }, 15 | args = { "--log-level", "DEBUG", "--quiet" }, 16 | runner = "pytest", 17 | }), 18 | -- Requires: cargo-nextest 19 | require("neotest-rust")({ 20 | dap_adapter = "rust_gdb", 21 | }), 22 | } 23 | }) 24 | 25 | keymap("dm", neotest.run.run, "Test method") 26 | keymap("dM", function() neotest.run.run({ strategy = 'dap' }) end, "Test method (with debugging)") 27 | keymap("dF", function() neotest.run.run(vim.fn.expand("%")) end, "Run all tests in the current file") 28 | keymap("ds", neotest.summary.toggle, "Test Summary") 29 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/vimwiki.vim: -------------------------------------------------------------------------------- 1 | " notes 2 | nnoremap :terminal make serve 3 | nnoremap :!make rsync_upload 4 | nnoremap :!make commit_push 5 | nnoremap :VimwikiTabMakeDiaryNote 6 | nnoremap :tabnew \| :VimwikiDiaryIndex 7 | nnoremap :VimwikiDiaryPrevDay 8 | nnoremap :VimwikiDiaryNextDay 9 | nnoremap :VimwikiTabDropLink 10 | nnoremap tl :VimwikiTabDropLink 11 | 12 | command! Diary VimwikiDiaryIndex 13 | autocmd BufRead,BufNewFile ~/Notes/diary/diary.md VimwikiDiaryGenerateLinks 14 | 15 | au BufNewFile ~/Notes/diary/*.md :silent 0r !~/bin/generate-vimwiki-diary-template '%' 16 | au BufRead,BufNewFile ~/Notes/diary/*.md Gwrite 17 | 18 | function g:LocalIndex() 19 | let route=substitute(expand("%:h"), '^.*/', '', '') . "/*.md" 20 | execute "VimwikiGenerateLinks" . " " . route 21 | endfun 22 | 23 | let g:auto_generate_links=1 24 | autocmd BufEnter *index.md :call LocalIndex() 25 | 26 | filetype plugin on 27 | syntax on 28 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/cov.lua: -------------------------------------------------------------------------------- 1 | local coverage = require("coverage") 2 | 3 | local opts = { noremap=true, silent=true } 4 | function keymap(key, fun) 5 | vim.keymap.set('n', key, fun, opts) 6 | end 7 | 8 | coverage.setup({ 9 | auto_reload = true, 10 | commands = true, 11 | highlights = { 12 | -- customize highlight groups created by the plugin 13 | covered = { fg = "#C3E88D" }, -- supports style, fg, bg, sp (see :h highlight-gui) 14 | uncovered = { fg = "#F07178" }, 15 | }, 16 | signs = { 17 | -- use your own highlight groups or text markers 18 | covered = { hl = "CoverageCovered", text = "▎" }, 19 | uncovered = { hl = "CoverageUncovered", text = "▎" }, 20 | }, 21 | summary = { 22 | min_coverage = 80.0 23 | }, 24 | lang = { 25 | } 26 | }) 27 | 28 | local loaded_covergae = false 29 | local toggle_coverage = function() 30 | if not loaded_coverage then 31 | coverage.load(true) 32 | loaded_coverage = true 33 | end 34 | coverage.toggle() 35 | end 36 | 37 | keymap("dc", toggle_coverage) 38 | -------------------------------------------------------------------------------- /.ncmpcpp/config: -------------------------------------------------------------------------------- 1 | # 2 | # ~/.ncmpcpp/config - My ncmpcpp preferences 3 | # 4 | 5 | mpd_host = "127.0.0.1" 6 | mpd_port = "6600" 7 | now_playing_prefix = "$4" 8 | now_playing_suffix = "$9" 9 | song_columns_list_format = "(34)[green]{t} (34)[]{a|f} (32)[cyan]{b}" 10 | playlist_display_mode = "columns" 11 | browser_display_mode = "columns" 12 | search_engine_display_mode = "columns" 13 | autocenter_mode = "yes" 14 | centered_cursor = "yes" 15 | progressbar_look = " " 16 | user_interface = "alternative" 17 | header_visibility = "no" 18 | statusbar_visibility = "no" 19 | titles_visibility = "no" 20 | follow_now_playing_lyrics = "yes" 21 | store_lyrics_in_song_dir = "yes" 22 | ignore_leading_the = "yes" 23 | empty_tag_marker = "[empty]" 24 | main_window_color = "default" 25 | current_item_prefix = "$(default)$r" 26 | visualizer_color = "default" 27 | -------------------------------------------------------------------------------- /.zcompletions/_check_application: -------------------------------------------------------------------------------- 1 | #compdef check-application 2 | 3 | 4 | _completions_all_tests() { 5 | typeset -U tests 6 | tests=($(_call_program tests $words[1] -l)) 7 | compadd - "${(@)tests}" 8 | } 9 | 10 | _args=( 11 | '(-h --help)'{-h,--help}'[Show this help message and exit]' 12 | '(-v --verbose)'{-v,--verbose}'[Verbose output]' 13 | '(-t --trace)'{-t,--trace}'[Trace machine boot and commands]' 14 | '(-q --quiet)'{-q,--quiet}'[Quiet output]' 15 | '(-s --sit)'{-s,--sit}'[Sit and wait after test failure]' 16 | '(-l --list)'{-l,--list}'[Print the list of tests that would be executed]' 17 | '--nonet[Do not go online to download images or data]' 18 | '--enable-network[Enable network access for tests]' 19 | '--coverage[Collect code coverage data]' 20 | '--machine=[Run this test against an already running machine]' 21 | '--browser=[When using --machine, use this cockpit web address]' 22 | '*:tests:_completions_all_tests' 23 | ) 24 | 25 | _check-application() { 26 | _arguments -s "${_args[@]}" 27 | } 28 | 29 | _check-application "$@" 30 | -------------------------------------------------------------------------------- /.zshcompletions/_check_application: -------------------------------------------------------------------------------- 1 | #compdef check-application 2 | 3 | _completions_all_tests() { 4 | typeset -U tests 5 | tests=($(_call_program tests $words[1] -l)) 6 | compadd - "${(@)tests}" 7 | } 8 | 9 | _args=( 10 | '(-h --help)'{-h,--help}'[Show this help message and exit]' 11 | '(-v --verbose)'{-v,--verbose}'[Verbose output]' 12 | '(-t --trace)'{-t,--trace}'[Trace machine boot and commands]' 13 | '(-q --quiet)'{-q,--quiet}'[Quiet output]' 14 | '(-s --sit)'{-s,--sit}'[Sit and wait after test failure]' 15 | '(-l --list)'{-l,--list}'[Print the list of tests that would be executed]' 16 | '--nonet[Do not go online to download images or data]' 17 | '--enable-network[Enable network access for tests]' 18 | '--coverage[Collect code coverage data]' 19 | '--machine=[Run this test against an already running machine]' 20 | '--browser=[When using --machine, use this cockpit web address]' 21 | '*:tests:_completions_all_tests' 22 | ) 23 | 24 | _check-application() { 25 | _arguments -s "${_args[@]}" 26 | } 27 | 28 | _check-application "$@" 29 | -------------------------------------------------------------------------------- /.config/alacritty.toml: -------------------------------------------------------------------------------- 1 | 2 | [env] 3 | TERM = "xterm-256color" 4 | 5 | [font] 6 | size = 13 7 | 8 | [font.bold] 9 | family = "Source Code Pro" 10 | 11 | [font.italic] 12 | family = "Source Code Pro" 13 | 14 | [font.normal] 15 | family = "Source Code Pro" 16 | 17 | [[hints.enabled]] 18 | command = "chromium" 19 | post_processing = true 20 | regex = "(https:|http:|file:)[^\u0000-\u001F\u007F-Ÿ<>\"\\s{-}\\^⟨⟩`]+" 21 | 22 | [hints.enabled.binding] 23 | key = "O" 24 | mods = "Control|Shift" 25 | 26 | [hints.enabled.mouse] 27 | enabled = true 28 | 29 | [[hints.enabled]] 30 | action = "Copy" 31 | post_processing = false 32 | regex = '([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})|([0-9a-f]{12,128})|([[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3})' 33 | 34 | [hints.enabled.binding] 35 | key = "I" 36 | mods = "Control|Shift" 37 | 38 | [[keyboard.bindings]] 39 | action = "Paste" 40 | key = "P" 41 | mods = "Control|Shift" 42 | 43 | [window] 44 | decorations = "none" 45 | 46 | [general] 47 | live_config_reload = true 48 | import = ["/home/jelle/.config/alacritty/color.toml"] 49 | -------------------------------------------------------------------------------- /.config/i3status/config: -------------------------------------------------------------------------------- 1 | # i3status configuration file. 2 | # see "man i3status" for documentation. 3 | 4 | # It is important that this file is edited as UTF-8. 5 | # The following line should contain a sharp s: 6 | # ß 7 | # If the above line is not correctly displayed, fix your editor first! 8 | 9 | general { 10 | colors = true 11 | interval = 10 12 | markup = "pango" 13 | } 14 | 15 | order += "disk /" 16 | order += "wireless wlo1" 17 | order += "ethernet enp0s25" 18 | order += "battery 0" 19 | order += "volume master" 20 | order += "load" 21 | order += "time" 22 | 23 | disk "/" { 24 | format = "/ %free" 25 | } 26 | 27 | wireless wlo1 { 28 | format_up = "W: (%quality at %essid) %ip" 29 | format_down = "W: down" 30 | } 31 | 32 | ethernet enp0s25 { 33 | format_up = "E: %ip" 34 | format_down = "E: down" 35 | } 36 | 37 | battery 0 { 38 | format = "%status %percentage %remaining" 39 | } 40 | 41 | load { 42 | format = "%1min %5min %15min" 43 | } 44 | 45 | time { 46 | format = "%Y-%m-%d %H:%M:%S" 47 | } 48 | 49 | volume master { 50 | device = "pulse" 51 | } 52 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/vimwiki.lua: -------------------------------------------------------------------------------- 1 | local telescope = require('telescope') 2 | telescope.load_extension('vimwiki') 3 | 4 | local opts = { noremap=true, silent=true } 5 | function keymap(key, fun) 6 | vim.keymap.set('n', key, fun, opts) 7 | end 8 | 9 | keymap('fw', require('telescope').extensions.vimwiki.vimwiki) 10 | keymap('fv', require('telescope').extensions.vimwiki.live_grep) 11 | 12 | local main_wiki = { 13 | path = '~/Notes/', 14 | path_html = '~/.cache/vimwiki/main/html', 15 | automatic_nested_syntaxes = 1, 16 | list_margin = 0, 17 | ext = '.md', 18 | syntax = 'markdown', 19 | -- TODO: https://cristianpb.github.io/blog/vimwiki-hugo 20 | custom_wiki2html = '$HOME/bin/wiki2html.sh', 21 | template_ext = '.html', 22 | } 23 | 24 | local blog_wiki = { 25 | path = '~/projects/website/', 26 | automatic_nested_syntaxes = 1, 27 | list_margin = 0, 28 | ext = '.md', 29 | syntax = 'markdown', 30 | } 31 | 32 | vim.g['vimwiki_hl_headers'] = 1 33 | vim.g['vimwiki_hl_cb_checked'] = 1 34 | vim.g['vimwiki_use_calendar'] = 1 35 | vim.g['vimwiki_listsyms'] = ' x' 36 | vim.g['vimwiki_folding'] = '' 37 | vim.g['vimwiki_list'] = {main_wiki, blog_wiki} 38 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/opts.lua: -------------------------------------------------------------------------------- 1 | require("tokyonight").setup({ 2 | style = "night", 3 | styles = { 4 | comments = { italic = true }, 5 | keywords = { italic = true }, 6 | functions = { italic = true}, 7 | }, 8 | on_colors = function(colors) 9 | colors.hint = colors.orange 10 | colors.error = "#ff0000" 11 | end 12 | }) 13 | 14 | -- Leader 15 | vim.api.nvim_set_keymap('', '', '', { noremap = true, silent = true }) 16 | vim.g.mapleader = ' ' 17 | vim.g.maplocalleader = ' ' 18 | 19 | -- 24 bit colors 20 | vim.o.termguicolors = true 21 | 22 | -- Clipboard 23 | vim.opt.clipboard = 'unnamedplus' 24 | 25 | -- Theme 26 | vim.cmd.colorscheme('tokyonight') 27 | 28 | local function update_theme() 29 | vim.fn.jobstart({ 'gsettings', 'get', 'org.gnome.desktop.interface', 'color-scheme'}, { 30 | stdout_buffered = true, 31 | on_stdout = function(_, data) 32 | if data then 33 | theme = table.concat(data) 34 | if theme == "'prefer-dark'" then 35 | vim.opt.background = 'dark' 36 | else 37 | vim.opt.background = 'light' 38 | end 39 | end 40 | end 41 | }) 42 | end 43 | 44 | update_theme() 45 | 46 | vim.api.nvim_create_autocmd("Signal", { pattern = { "*" }, callback = update_theme }) 47 | -------------------------------------------------------------------------------- /.urlwatch/urls.yaml: -------------------------------------------------------------------------------- 1 | url: https://www.tarsnap.com/download/ 2 | --- 3 | url: http://s3tools.org/s3tools 4 | --- 5 | url: http://www.scipy.org/Download 6 | --- 7 | url: https://github.com/seb-m/pyinotify/tags 8 | filter: github 9 | --- 10 | url: http://bundles.openttdcoop.org/opengfx/releases/LATEST/ 11 | --- 12 | url: http://mathema.tician.de/software/pyopencl 13 | --- 14 | url: https://github.com/scipy/scipy/releases 15 | filter: github 16 | --- 17 | url: https://github.com/dateutil/dateutil/releases 18 | filter: github 19 | --- 20 | url: http://jwilk.net/software/pdf2djvu 21 | --- 22 | url: https://github.com/html5lib/html5lib-python/releases 23 | filter: github 24 | --- 25 | url: https://github.com/rogerbinns/apsw/releases 26 | filter: github 27 | --- 28 | url: https://github.com/jamesturk/jellyfish/releases 29 | filter: github 30 | --- 31 | url: https://pypi.python.org/pypi/selenium 32 | filter: pypi 33 | --- 34 | url: https://github.com/giampaolo/psutil/releases 35 | filter: github 36 | --- 37 | url: https://pypi.python.org/pypi/Sphinx 38 | filter: pypi 39 | --- 40 | url: https://pypi.python.org/pypi/pytz/ 41 | filter: pypi 42 | --- 43 | url: https://github.com/cherrypy/cherrypy/releases 44 | filter: github 45 | --- 46 | url: https://github.com/jstasiak/python-zeroconf/releases 47 | filter: github 48 | -------------------------------------------------------------------------------- /.config/newsboat/config: -------------------------------------------------------------------------------- 1 | browser /home/jelle/bin/newsboat-open-link 2 | player mpv 3 | max-items 100 4 | reload-time 30 5 | reload-threads 3 6 | refresh-on-startup yes 7 | show-read-feeds no 8 | auto-reload yes 9 | reload-time 120 10 | notify-format "RSS - %d new/%n unread articles" 11 | notify-xterm yes 12 | bind-key j down 13 | bind-key k up 14 | bind-key g home 15 | bind-key G end 16 | bind-key BACKSPACE quit 17 | bind-key i quit 18 | article-sort-order date-asc 19 | highlight feedlist "^(N)" yellow default 20 | highlight articlelist "^(N)" yellow default 21 | highlight article "^Link[s:]|http[s:]//.*" magenta default 22 | highlight article "^Title:.*" green default bold 23 | highlight article ".*URL:" magenta default bold 24 | highlight article "^Feed:.*" green default 25 | 26 | urls-source "miniflux" 27 | miniflux-url "https://miniflux.vdwaa.nl" 28 | 29 | miniflux-login "jelle" 30 | miniflux-passwordeval "pass show internet/miniflux | head -n1" 31 | 32 | bind-key b bookmark 33 | bookmark-cmd "newsboat-bookmark" 34 | bookmark-autopilot yes 35 | 36 | color listnormal_unread white black 37 | color listfocus magenta black 38 | color listfocus_unread magenta black 39 | color info black green 40 | color background white black 41 | color article white black 42 | -------------------------------------------------------------------------------- /bin/version-diff-link: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import json 4 | import sys 5 | import subprocess 6 | import tomllib 7 | 8 | 9 | def main(): 10 | with open(".nvchecker.toml", "rb") as f: 11 | data = tomllib.load(f) 12 | assert len(data.keys()) == 1 13 | key = list(data.keys())[0] 14 | 15 | if data[key]['source'] != 'git': 16 | print('Only git sources are supported') 17 | sys.exit(1) 18 | return 19 | 20 | url = data[key]['git'] 21 | if 'github' not in url: 22 | print('Only GitHub sources are supported') 23 | sys.exit(1) 24 | return 25 | 26 | prefix = data[key].get('prefix', '') 27 | url = url.replace('.git', '') 28 | update_infos = json.loads(subprocess.check_output(["pkgctl", "version", "check", "--json"])) 29 | assert len(update_infos) == 1 30 | 31 | before = f'{prefix}{update_infos[0]["local_version"]}' 32 | after = f'{prefix}{update_infos[0]["upstream_version"]}' 33 | 34 | if before == after: 35 | print('Package already up to date') 36 | sys.exit(1) 37 | return 38 | 39 | print(f'{url}/compare/{before}...{after}') 40 | 41 | if __name__ == "__main__": 42 | main() 43 | -------------------------------------------------------------------------------- /.config/termite/config: -------------------------------------------------------------------------------- 1 | [options] 2 | resize_grip = false 3 | scroll_on_output = false 4 | scroll_on_keystroke = true 5 | audible_bell = false 6 | visible_bell = false 7 | mouse_autohide = true 8 | allow_bold = true 9 | dynamic_title = true 10 | urgent_on_bell = true 11 | clickable_url = false 12 | font = Terminus 12px 13 | scrollback_lines = 2000 14 | search_wrap = false 15 | #icon_name = terminal 16 | 17 | # 0.0: opaque, 1.0: transparent 18 | transparency = 0.0 19 | 20 | # SYSTEM, ON or OFF 21 | cursor_blink = system 22 | 23 | # BLOCK, UNDERLINE or IBEAM 24 | cursor_shape = block 25 | 26 | # vte-256color has the correct terminfo, but some applications (vim, weechat) 27 | # still need patches for mouse/title support 28 | term = screen-256color 29 | 30 | browser = chromium 31 | 32 | [colors] 33 | foreground = #bfbdc0 34 | foreground_bold = #ffffff 35 | background = #000000 36 | #cursor = #0000FF 37 | #cursor_foreground = #FF0000 38 | 39 | 40 | color0 = #000000 41 | color1 = #8a110e 42 | color2 = #669f3d 43 | color3 = #b3751e 44 | color4 = #493d9f 45 | color5 = #9216a3 46 | color6 = #198a9c 47 | color7 = #bfbdc0 48 | color8 = #686773 49 | color9 = #fc5166 50 | color10 = #63ff54 51 | color11 = #ffd75c 52 | color12 = #766eff 53 | color13 = #e151ff 54 | color14 = #57ffec 55 | color15 = #ffffff 56 | 57 | # vim: ft=dosini 58 | -------------------------------------------------------------------------------- /bin/arch-git-repo-search: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import argparse 4 | import os 5 | import os.path 6 | 7 | import appdirs 8 | import gitlab 9 | 10 | PACKAGING_GROUP = 11323 11 | 12 | def get_token(): 13 | config_dir = appdirs.user_config_dir('devtools') 14 | token = '' 15 | with open(os.path.join(config_dir, 'gitlab.conf')) as fp: 16 | token = fp.read() 17 | 18 | token = token.replace('GITLAB_TOKEN="', '').strip().strip('"') 19 | return token 20 | 21 | def search(gl, term): 22 | group = gl.groups.get(PACKAGING_GROUP) 23 | results = group.search('blobs', term, get_all=True) 24 | project_id_name_map = {} 25 | 26 | for result in results: 27 | project_id = result.get('project_id') 28 | project_name = project_id_name_map.get(project_id) 29 | if project_name is None: 30 | project = gl.projects.get(project_id) 31 | project_id_name_map[project_id] = project.name 32 | 33 | print(' '.join(project_id_name_map.values())) 34 | 35 | def main(): 36 | parser = argparse.ArgumentParser() 37 | parser.add_argument('term') 38 | args = parser.parse_args() 39 | 40 | gl = gitlab.Gitlab('https://gitlab.archlinux.org', private_token=get_token()) 41 | search(gl, args.term) 42 | 43 | 44 | if __name__ == "__main__": 45 | main() 46 | -------------------------------------------------------------------------------- /.xmobarrc: -------------------------------------------------------------------------------- 1 | Config { font = "-*-terminus-*-*-*-*-14-*-*-*-*-*-*-u" 2 | , bgColor = "#000000" 3 | , borderColor = "#000000" 4 | , fgColor = "#C9A34E" 5 | , position = TopW R 95 6 | , lowerOnStart = True 7 | , commands = [ 8 | Run Network "enp0s25" ["-L", "8", "-H", "32", "-l", "#C9A34E", "-n", "#429942" ,"-h", "#A36666", "-t", ": : "] 30 9 | , Run Network "wlo1" ["-L", "8", "-H", "32", "-l", "#C9A34E", "-n", "#429942" ,"-h", "#A36666", "-t", ": : "] 30 10 | , Run Cpu ["-L","3","-H","50","--normal","#429942","--high","#A36666"] 30 11 | -- , Run Mail [("new", "/home/jelle/Gmail/INBOX")] "mail" 12 | , Run Memory ["-t","Mem: %"] 30 13 | , Run Date "%a %_d %b %Y %H:%M" "date" 30 14 | , Run TopProc [] 30 15 | , Run BatteryP ["BAT0"] ["-L","31","-H","90","-l","orange","-n","red","-h","green"] 400 16 | , Run TopMem [] 30 17 | , Run StdinReader 18 | ] 19 | , sepChar = "%" 20 | , alignSep = "}{" 21 | , template = "%StdinReader% }{ %top%|%topmem%|%battery% |%cpu% | %memory% |%enp0s25%%wlo1%|%date%" 22 | } 23 | 24 | -------------------------------------------------------------------------------- /.mutt/security_tracker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import re 5 | import requests 6 | 7 | 8 | url_json = 'https://security.archlinux.org/{}/json' 9 | url= 'https://security.archlinux.org/{}' 10 | 11 | 12 | if __name__ == "__main__": 13 | matches = set(re.findall("CVE-\d{4}-\d*", sys.stdin.read())) 14 | for match in matches: 15 | r = requests.get(url_json.format(match)) 16 | if r.status_code == 200: 17 | cve = r.json() 18 | groups = cve["groups"] 19 | print("=======") 20 | print(url.format(match)) 21 | print("Packages: {}".format(" ".join(cve["packages"]))) 22 | for group in groups: 23 | r = requests.get(url_json.format(group)) 24 | if r.status_code == 200: 25 | group = r.json() 26 | print("Part of {}".format(group["name"])) 27 | print(url.format(group["name"])) 28 | print("Status: {}".format(group["status"])) 29 | if 'advisories' in group: 30 | for asa in group['advisories']: 31 | print("Published as part of {}".format(asa)) 32 | else: 33 | print("No published ASA for this CVE") 34 | print("=======") 35 | else: 36 | print("No CVE registered for: {}".format(match)) 37 | -------------------------------------------------------------------------------- /.config/nvim/snippets/PKGBUILD/PKGBUILD.json: -------------------------------------------------------------------------------- 1 | { 2 | "Python Version": { 3 | "prefix": "pyv", 4 | "body": "local python_version=$(python -c 'import sys; print(\"\".join(map(str, sys.version_info[:2])))')", 5 | "description": "Python Version" 6 | }, 7 | "Site Packages": { 8 | "prefix": "sitepkg", 9 | "body": "local site_packages=$(python -c \"import site; print(site.getsitepackages()[0])\")", 10 | "description": "Python Site Packages" 11 | }, 12 | "Python Build": { 13 | "prefix": "pybuild", 14 | "body": "python -m build --wheel --no-isolation", 15 | "description": "Python PEP517 build" 16 | }, 17 | "Python Install": { 18 | "prefix": "pyinst", 19 | "body": "python -m installer --destdir=\"$$pkgdir\" dist/*.whl", 20 | "description": "Python PEP517 install" 21 | }, 22 | "Python Makedepends": { 23 | "prefix": "pybdep", 24 | "body": "'python-build' 'python-installer' 'python-wheel'", 25 | "description": "Python PEP517 makedepends" 26 | }, 27 | "Prepare": { 28 | "prefix": "prep", 29 | "body": "prepare() {\n}\n", 30 | "description": "prepare function" 31 | }, 32 | "Python test": { 33 | "prefix": "pytc", 34 | "body": "PYTHONPATH=\"$$PWD/build/lib.linux-$$CARCH-cpython-$$python_version\" pytest", 35 | "description": "run pytests against a C module" 36 | }, 37 | "Python unittest test": { 38 | "prefix": "pyunit", 39 | "body": "python -m unittest discover -vs .", 40 | "description": "run python unittests" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /bin/gen-python-weekly-feed: -------------------------------------------------------------------------------- 1 | #!/bin/python 2 | 3 | ''' 4 | Small Python script to generate a RSS feed for the Python Weekly Newsletter. 5 | 6 | Dependencies: 7 | 8 | * python-requests 9 | * python-feedgen 10 | * python-beautifulSoup4 11 | ''' 12 | 13 | from datetime import datetime, timezone 14 | 15 | import requests 16 | 17 | from feedgen.feed import FeedGenerator 18 | from bs4 import BeautifulSoup 19 | 20 | 21 | URL = 'https://us2.campaign-archive.com/home/?u=e2e180baf855ac797ef407fc7&id=9e26887fc5' 22 | 23 | 24 | def create_feed(): 25 | fg = FeedGenerator() 26 | fg.id('https://dodgy.download/pythonweekly.rss') 27 | fg.title('Python Weekly') 28 | fg.description('Python Weekly') 29 | fg.link(href=URL, rel='alternate') 30 | fg.language('en') 31 | return fg 32 | 33 | 34 | def main(): 35 | fg = create_feed() 36 | r = requests.get(URL) 37 | soup = BeautifulSoup(r.text, features='lxml') 38 | episodes = soup.find_all("li", class_="campaign") 39 | for episode in episodes: 40 | datestr = episode.text[:10] 41 | pubdate = datetime.strptime(datestr, '%m/%d/%Y') 42 | pubdate = pubdate.replace(tzinfo=timezone.utc) 43 | link = episode.a.get('href') 44 | title = episode.a.get('title') 45 | 46 | fe = fg.add_entry() 47 | fe.id(link) 48 | fe.title(title) 49 | fe.description(title) 50 | fe.link(href=link) 51 | fe.pubDate(pubdate) 52 | 53 | fg.rss_file('pythonweekly.xml') 54 | 55 | 56 | if __name__ == "__main__": 57 | main() 58 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/cmp.lua: -------------------------------------------------------------------------------- 1 | -- nvim-cmp setup 2 | local cmp = require 'cmp' 3 | local luasnip = require 'luasnip' 4 | cmp.setup { 5 | snippet = { 6 | expand = function(args) 7 | luasnip.lsp_expand(args.body) 8 | end, 9 | }, 10 | mapping = { 11 | [''] = cmp.mapping.select_prev_item(), 12 | [''] = cmp.mapping.select_next_item(), 13 | [''] = cmp.mapping.scroll_docs(-4), 14 | [''] = cmp.mapping.scroll_docs(4), 15 | [''] = cmp.mapping.complete(), 16 | [''] = cmp.mapping.close(), 17 | [''] = cmp.mapping.confirm { 18 | behavior = cmp.ConfirmBehavior.Replace, 19 | select = true, 20 | }, 21 | [''] = function(fallback) 22 | if cmp.visible() then 23 | cmp.select_next_item() 24 | elseif luasnip.expand_or_jumpable() then 25 | luasnip.expand_or_jump() 26 | else 27 | fallback() 28 | end 29 | end, 30 | [''] = function(fallback) 31 | if cmp.visible() then 32 | cmp.select_prev_item() 33 | elseif luasnip.jumpable(-1) then 34 | luasnip.jump(-1) 35 | else 36 | fallback() 37 | end 38 | end, 39 | }, 40 | sources = { 41 | { name = 'path' }, 42 | { name = 'nvim_lsp', keyword_length = 4 }, 43 | { name = 'buffer', keyword_length = 3}, 44 | { name = 'luasnip', keyword_length = 2 }, 45 | 46 | { name = "crates" }, 47 | }, 48 | } 49 | 50 | -- require("luasnip").filetype_extend("PKGBUILD", {"shell"}) 51 | require("luasnip.loaders.from_vscode").lazy_load { paths = { "./snippets/PKGBUILD" } } 52 | -------------------------------------------------------------------------------- /bin/generate-vimwiki-diary-template: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | import os 5 | import os.path 6 | import datetime 7 | 8 | today = datetime.date.today() 9 | date = (today if len(sys.argv) < 2 10 | # Expecting filename in YYYY-MM-DD.foo format 11 | else os.path.basename(sys.argv[1].rsplit(".", 1)[0])) 12 | dateobj = datetime.datetime.strptime(date, '%Y-%m-%d') 13 | 14 | # Lazy algo 15 | for day in range(1, 8): 16 | monthday = dateobj.replace(day=day) 17 | if monthday.weekday() not in [4, 5]: 18 | break 19 | 20 | optional_checklists = "" 21 | if dateobj.weekday() == 0: 22 | optional_checklists += "* [ ] Review previous week notes" 23 | # Link previous week notes 24 | previous = dateobj - datetime.timedelta(days=7) 25 | while previous.weekday() != 5: 26 | date = previous.strftime('%Y-%m-%d') 27 | optional_checklists += f" [{date}](./{date}.md)" 28 | previous = previous + datetime.timedelta(days=1) 29 | 30 | prev_day= (dateobj - datetime.timedelta(days=1)).strftime('%Y-%m-%d') 31 | next_day = (dateobj + datetime.timedelta(days=1)).strftime('%Y-%m-%d') 32 | 33 | if dateobj.day == monthday.day: 34 | optional_checklists += "* [ ] Review previous month notes" 35 | 36 | print(f"""# {date} 37 | 38 | [Prev]({prev_day}) [Next]({next_day}) 39 | 40 | ## Daily checklist 41 | 42 | * [ ] Check Github notifications 43 | * [ ] Check [status of Github PR's](https://github.com/pulls) 44 | * [ ] [Review requests](https://github.com/pulls/review-requested) 45 | * [ ] Email 46 | {optional_checklists} 47 | ## Todo 48 | 49 | ## Notes""") 50 | -------------------------------------------------------------------------------- /bin/verify-file-ownership: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import argparse 4 | import glob 5 | import multiprocessing 6 | import os 7 | import os.path 8 | import sys 9 | 10 | import libarchive 11 | 12 | 13 | def read_package(filename): 14 | try: 15 | with libarchive.file_reader(filename) as pkg: 16 | for entry in pkg: 17 | if entry.uname != "root" or entry.gname != "root": 18 | uname = "" 19 | gname = "" 20 | if entry.uname == "": 21 | uname = str(entry.uid) 22 | else: 23 | uname = entry.uname 24 | if entry.gname == "": 25 | gname = str(entry.gid) 26 | else: 27 | gname = entry.gname 28 | print(f"incorrect-owner {entry.name} ({uname}:{gname})") 29 | return f"incorrect-owner {entry.name} ({uname}:{gname})" 30 | except libarchive.exception.ArchiveError as exc: 31 | print(f"{filename} {exc}", file=sys.stderr) 32 | 33 | 34 | 35 | def main(): 36 | parser = argparse.ArgumentParser() 37 | parser.add_argument(metavar="DIRECTORY", dest="directory") 38 | args = parser.parse_args() 39 | 40 | packages = glob.glob(os.path.join(args.directory, '*.pkg.tar.*')) 41 | packages = [pkg for pkg in packages if not pkg.endswith('.sig')] 42 | 43 | with multiprocessing.Pool(processes=os.process_cpu_count() // 2) as pool: 44 | pool.map(read_package, packages) 45 | 46 | if __name__ == "__main__": 47 | main() 48 | -------------------------------------------------------------------------------- /.vimperatorrc: -------------------------------------------------------------------------------- 1 | autocmd LocationChange .* js modes.passAllKeys = /.*(mail\.google\.com|www\.google\.com\/reader|codeschool\.com).*/.test(buffer.URL) 2 | autocmd LocationChange .* echo "" 3 | " remove the right and bottom scrollbars 4 | 5 | nnoremap K 30k 6 | nnoremap J 30j 7 | 8 | set noscrollbars 9 | colorscheme zenburn 10 | 11 | " Open current url as an argument to quvi 12 | nmap :js openwithquvi() 13 | nmap :js openwithytdl() 14 | 15 | " Custom url hints 16 | js < /dev/null 6 | then 7 | APPID=$(wget -qO- https://api.steampowered.com/ISteamApps/GetAppList/v2/ | jq '.applist.apps[] | select(.name=="Age of Empires II: Definitive Edition")' | jq ".appid") 8 | else 9 | APPID=813780 # The most recent App ID when this was written 10 | fi 11 | 12 | STEAM_LOCATION="/home/$USER/.steam/steam" 13 | 14 | # check if arguments are not empty 15 | if [ ! $# -eq 0 ]; then 16 | # set STEAM_LOCATION to the provided argument 17 | STEAM_LOCATION=$1 18 | fi 19 | 20 | libraries=$(grep 'path' $STEAM_LOCATION/steamapps/libraryfolders.vdf | sed -re 's/^(\s)+"path"(\s)+"(.*)"$/\3/g') 21 | 22 | echo "Found steam library locations:" 23 | for library in $libraries; do 24 | echo " * $library" 25 | done 26 | 27 | for library in $libraries; do 28 | SYSTEM32_LOCATION="$library/steamapps/compatdata/$APPID/pfx/drive_c/windows/system32" 29 | 30 | if [ -d "$SYSTEM32_LOCATION" ]; then 31 | echo "Found app in: $SYSTEM32_LOCATION" 32 | break 33 | fi 34 | done; 35 | 36 | # Check if the dll already exists and is not a symlink 37 | if [ -f "$SYSTEM32_LOCATION/ucrtbase.dll" ] && [ ! -L "$SYSTEM32_LOCATION/ucrtbase.dll" ]; then 38 | echo "ucrtbase.dll is already installed" 39 | exit 0 40 | fi 41 | 42 | rm -f $SYSTEM32_LOCATION/ucrtbase.dll # There might be a simlink to the "default" ucrtbase.dll, it needs to be deleted 43 | 44 | TEMP_FOLDER=$(mktemp --directory) 45 | cd $TEMP_FOLDER 46 | echo "Fetching vc_redist.x64.exe" 47 | wget https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe 48 | cabextract vc_redist.x64.exe --filter a10 49 | cabextract a10 --filter ucrtbase.dll 50 | cp ucrtbase.dll $SYSTEM32_LOCATION 51 | echo "Copied ucrtbase.dll" 52 | rmdir $TEMP_FOLDER 53 | 54 | exit 0 55 | -------------------------------------------------------------------------------- /.mutt/crypto: -------------------------------------------------------------------------------- 1 | set crypt_use_gpgme 2 | 3 | set pgp_decode_command="gpg %?p?--passphrase-fd 0? --no-verbose --batch --output - %f" 4 | set pgp_verify_command="gpg --no-verbose --batch --output - --verify %s %f" 5 | set pgp_decrypt_command="gpg --passphrase-fd 0 --no-verbose --batch --output - %f" 6 | set pgp_sign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f" 7 | set pgp_clearsign_command="gpg --no-verbose --batch --output - --passphrase-fd 0 --armor --textmode --clearsign %?a?-u %a? %f" 8 | set pgp_encrypt_only_command="pgpewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to 0xC9C40C31 -- -r %r -- %f" 9 | set pgp_encrypt_sign_command="pgpewrap gpg --passphrase-fd 0 --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to 0xC9C40C31 -- -r %r -- %f" 10 | set pgp_import_command="gpg --no-verbose --import -v %f" 11 | set pgp_export_command="gpg --no-verbose --export --armor %r" 12 | set pgp_verify_key_command="gpg --no-verbose --batch --fingerprint --check-sigs %r" 13 | set pgp_list_pubring_command="gpg --no-verbose --batch --with-colons --list-keys %r" 14 | set pgp_list_secring_command="gpg --no-verbose --batch --with-colons --list-secret-keys %r" 15 | 16 | 17 | # this set the number of seconds to keep in memory the passpharse used to encrypt/sign 18 | # the more the less secure it will be 19 | set pgp_timeout=60 20 | 21 | # it's a regexp used against the GPG output: if it matches some line of the output 22 | # then mutt considers the message a good signed one (ignoring the GPG exit code) 23 | set pgp_good_sign="^gpg: Good signature from" 24 | 25 | # mutt uses by default PGP/GPG to sign/encrypt messages 26 | # if you want to use S-mime instead set the smime_is_default variable to yes 27 | # set smime_is_default=yes 28 | 29 | # automatically sign all outgoing messages 30 | set crypt_autosign=no 31 | # sign only replies to signed messages 32 | set crypt_replysign=yes 33 | 34 | # automatically encrypt outgoing messages 35 | set crypt_autoencrypt=no 36 | # encrypt only replies to signed messages 37 | #set crypt_replyencrypt=yes 38 | # encrypt and sign replies to encrypted messages 39 | #set crypt_replysignencrypted=yes 40 | 41 | # automatically verify the sign of a message when opened 42 | set crypt_verify_sig=yes 43 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/search.lua: -------------------------------------------------------------------------------- 1 | -- Yanks the shown preview line 2 | local yank_selection = function(prompt_bufnr) 3 | local action_state = require "telescope.actions.state" 4 | local actions = require "telescope.actions" 5 | local content = action_state.get_selected_entry() 6 | if content == nil then 7 | return 8 | end 9 | vim.fn.setreg('', content["text"]) 10 | end 11 | 12 | local luasnip = require('telescope').load_extension('luasnip') 13 | local lga_actions = require("telescope-live-grep-args.actions") 14 | local actions = require "telescope.actions" 15 | 16 | require('telescope').setup({ 17 | defaults = { 18 | -- Default configuration for telescope goes here: 19 | -- config_key = value, 20 | file_ignore_patterns = { 21 | "node_modules/", 22 | "env" 23 | }, 24 | mappings = { 25 | i = { 26 | -- map actions.which_key to (default: ) 27 | -- actions.which_key shows the mappings for your picker, 28 | -- e.g. git_{create, delete, ...}_branch for the git_branches picker 29 | [""] = "which_key", 30 | [""] = yank_selection, 31 | [""] = actions.select_tab_drop, 32 | } 33 | } 34 | }, 35 | pickers = { 36 | -- Default configuration for builtin pickers goes here: 37 | -- picker_name = { 38 | -- picker_config_key = value, 39 | -- ... 40 | -- } 41 | -- Now the picker_config_key will be applied every time you call this 42 | -- builtin picker 43 | man_pages = { sections = { "2", "3" } } 44 | }, 45 | extensions = { 46 | live_grep_args = { 47 | auto_quoting = true, -- enable/disable auto-quoting 48 | mappings = { 49 | i = { 50 | [""] = lga_actions.quote_prompt(), 51 | ["g"] = lga_actions.quote_prompt({ postfix = ' --iglob ' }), 52 | ["t"] = lga_actions.quote_prompt({ postfix = ' -t' }), 53 | } 54 | } 55 | } 56 | } 57 | }) 58 | 59 | local telescope = require('telescope.builtin') 60 | local opts = { noremap=true, silent=true, buffer=bufnr } 61 | local function keymap(key, fun) 62 | vim.keymap.set('n', key, fun, opts) 63 | end 64 | 65 | keymap('ff', telescope.find_files) 66 | keymap('fg', require("telescope").extensions.live_grep_args.live_grep_args) 67 | keymap('fb', telescope.buffers) 68 | keymap('fh', telescope.help_tags) 69 | keymap('fm', telescope.man_pages) 70 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | # command prefix (like screen) 2 | unbind C-b 3 | set -g prefix C-a 4 | bind-key S split-window 5 | bind-key -r tab select-pane -t:.+ 6 | 7 | # Reload key 8 | bind r source-file ~/.tmux.conf 9 | 10 | set -g default-terminal "screen-256color" 11 | set -g history-limit 2000 12 | 13 | # set visual bell on 14 | set -g bell-action any 15 | set -g visual-bell off 16 | 17 | # nvim 18 | set-option -sg escape-time 10 19 | set-option -g focus-events on 20 | 21 | # Fix Terminfo 22 | set-option -g set-titles on 23 | set-option -g set-titles-string '[#S:#I #H] #W' 24 | 25 | 26 | # moving between panes 27 | bind h select-pane -L 28 | bind j select-pane -D 29 | bind k select-pane -U 30 | bind l select-pane -R 31 | 32 | # Pane resizing 33 | bind -r H resize-pane -L 5 34 | bind -r J resize-pane -D 5 35 | bind -r K resize-pane -U 5 36 | bind -r L resize-pane -R 5 37 | 38 | # Fuzzy search tmux panes 39 | # Rename panes with ctrl+a , 40 | bind f split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t" 41 | 42 | set -g status-interval 60 43 | 44 | set -g mode-style "fg=#7aa2f7,bg=#3b4261" 45 | 46 | set -g message-style "fg=#7aa2f7,bg=#3b4261" 47 | set -g message-command-style "fg=#7aa2f7,bg=#3b4261" 48 | 49 | set -g pane-border-style "fg=#3b4261" 50 | set -g pane-active-border-style "fg=#7aa2f7" 51 | 52 | set -g status "on" 53 | set -g status-justify "left" 54 | 55 | set -g status-style "fg=#7aa2f7,bg=#1f2335" 56 | 57 | set -g status-left-length "100" 58 | set -g status-right-length "100" 59 | 60 | set -g status-left-style NONE 61 | set -g status-right-style NONE 62 | 63 | set -g status-left "#[fg=#15161E,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#1f2335,nobold,nounderscore,noitalics]" 64 | set -g status-right "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#1f2335] #{prefix_highlight} #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] #(cut -d ' ' -f 1-3 /proc/loadavg) #[default]#[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161E,bg=#7aa2f7,bold] #h " 65 | 66 | setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#1f2335" 67 | setw -g window-status-separator "" 68 | setw -g window-status-style "NONE,fg=#a9b1d6,bg=#1f2335" 69 | setw -g window-status-format "#[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#1f2335,bg=#1f2335,nobold,nounderscore,noitalics]" 70 | setw -g window-status-current-format "#[fg=#1f2335,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#1f2335,nobold,nounderscore,noitalics]" 71 | -------------------------------------------------------------------------------- /bin/xandikos2json: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import json 4 | import os 5 | from datetime import datetime, timedelta, timezone 6 | from glob import glob 7 | 8 | from dateutil.rrule import rrulestr 9 | from icalendar import Calendar 10 | 11 | DAYS_AHEAD = os.getenv('DAYS_AHEAD', 30) 12 | OUTPUT_FILE = os.getenv('OUTPUT_FILE', 'calendar.json') 13 | 14 | 15 | def main(): 16 | events = [] 17 | now = datetime.now(timezone.utc) - timedelta(days=1) 18 | future = now + timedelta(days=DAYS_AHEAD) 19 | for event in glob('*.ics'): 20 | with open(event, 'r') as fp: 21 | cal = Calendar.from_ical(fp.read()) 22 | for component in cal.walk(): 23 | if component.name != "VEVENT": 24 | continue 25 | 26 | rrule = None 27 | start = component.decoded("dtstart") 28 | startdate = start 29 | end = component.decoded("dtend") 30 | enddate = end 31 | if isinstance(start, datetime): 32 | startdate = start.date() 33 | if isinstance(end, datetime): 34 | enddate = end.date() 35 | if component.get('rrule'): 36 | try: 37 | rules = component.get('rrule') 38 | if not isinstance(rules, list): 39 | rules = [rules] 40 | 41 | for rule in rules: 42 | rule = rule.to_ical().decode() 43 | rrule = rrulestr(rule, dtstart=start) 44 | for occur in rrule.between(now.replace(tzinfo=None), future.replace(tzinfo=None)): 45 | events.append({ 46 | 'start': occur.isoformat(), 47 | 'end': occur.isoformat(), 48 | 'title': str(component.get('summary')), 49 | }) 50 | except Exception as e: 51 | print("exc", e, component.get('rrule')) 52 | 53 | elif startdate > now.date() and enddate < future.date(): 54 | events.append({ 55 | 'start': start.isoformat(), 56 | 'end': start.isoformat(), 57 | 'title': str(component.get('summary')), 58 | }) 59 | 60 | open(OUTPUT_FILE, 'w').write(json.dumps(events, indent=4)) 61 | 62 | 63 | if __name__ == "__main__": 64 | main() 65 | -------------------------------------------------------------------------------- /bin/tiktok2rss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | Usage: 5 | 6 | USERS="@userb:@userc" python tiktok2rss.py 7 | ''' 8 | 9 | import os 10 | import re 11 | import sys 12 | from datetime import datetime, timedelta, timezone 13 | 14 | from feedgen.feed import FeedGenerator 15 | from playwright.sync_api import sync_playwright 16 | 17 | FEED_BASE_URL = 'https://dodgy.download/tiktok-{}.xml' 18 | 19 | 20 | def convert_datestr(datestr): 21 | now = datetime.now() 22 | match = re.match(r'(\d+)h ago', datestr) 23 | if match: 24 | hours = int(match.group(1)) 25 | return now - timedelta(hours=hours) 26 | 27 | match = re.match(r'(\d+)d ago', datestr) 28 | if match: 29 | days = int(match.group(1)) 30 | return now - timedelta(days=days) 31 | 32 | return datetime.strptime(datestr, '%Y-%m-%d') 33 | 34 | 35 | def create_feed(username, url, desc): 36 | fg = FeedGenerator() 37 | fg.id(FEED_BASE_URL.format(username)) 38 | fg.title(f'Tik Tok ({username}') 39 | fg.description(desc) 40 | fg.link(href=url, rel='alternate') 41 | fg.language('en') 42 | return fg 43 | 44 | 45 | def main(): 46 | users = os.getenv('USERS') 47 | if not users: 48 | print('error, no users') 49 | sys.exit(1) 50 | 51 | users = users.split(':') 52 | 53 | with sync_playwright() as p: 54 | browser = p.chromium.launch(executable_path='/usr/bin/chromium') 55 | page = browser.new_page() 56 | 57 | for user in users: 58 | url = f'https://tiktok.com/{user}?lang=en' 59 | page.goto(url) 60 | desc = page.query_selector('h2[data-e2e="user-bio"]').inner_text() 61 | 62 | username = user.replace('@', '') 63 | fg = create_feed(username, url, desc) 64 | 65 | videos = [v.get_attribute('href') for v in page.query_selector_all('div[data-e2e="user-post-item-list"] div[data-e2e="user-post-item"] a')] 66 | titles = [v.get_attribute('title') for v in page.query_selector_all('div[data-e2e="user-post-item-list"] div[data-e2e="user-post-item-desc"] a:first-of-type')] 67 | titles = [t for t in titles if t is not None] 68 | for index, video in enumerate(videos): 69 | title = titles[index] 70 | page.goto(video) 71 | 72 | pubdate = convert_datestr(page.query_selector('span[data-e2e="browser-nickname"] span:last-of-type').inner_text()) 73 | pubdate = pubdate.replace(tzinfo=timezone.utc) 74 | fe = fg.add_entry() 75 | fe.id(video) 76 | fe.title(title) 77 | fe.description(title) 78 | fe.link(href=video) 79 | fe.pubDate(pubdate) 80 | 81 | fg.rss_file(f'tiktok-{username}.xml') 82 | 83 | browser.close() 84 | 85 | 86 | if __name__ == "__main__": 87 | main() 88 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/git.lua: -------------------------------------------------------------------------------- 1 | -- fugitive git bindings 2 | -- http://www.reddit.com/r/vim/comments/21f4gm/best_workflow_when_using_fugitive/ 3 | local opts = { noremap=true, silent=true } 4 | function keymap(key, fun) 5 | vim.keymap.set('n', key, fun, opts) 6 | end 7 | 8 | local telescope = require('telescope.builtin') 9 | 10 | keymap("gb", ":Git blame") 11 | keymap("gt", ":Git commit -v -q %:p") 12 | keymap("gd", ":Gdiff") 13 | keymap("ge", ":Gedit") 14 | 15 | -- Rebase in le neovim 16 | -- TODO: don't hardcode main, but use git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' 17 | keymap("grm", ":Git rebase -i main") 18 | keymap("grc", ":Git rebase --continue") 19 | keymap("ga", ":Git commit --amend %:p") 20 | 21 | keymap("gw", ":Gwrite") 22 | keymap("gl", ":Gclog") 23 | keymap("gm", ":Gmove") 24 | keymap("go", ":Git checkout") 25 | keymap("gps", ":Git push") 26 | keymap("gpl", ":Git pull") 27 | keymap("", ":! updategitfork") 28 | keymap("gu", ":! updategitfork") 29 | 30 | keymap('gc', telescope.git_branches) 31 | keymap('gf', telescope.git_files) 32 | keymap('gl', telescope.git_commits) 33 | keymap("gs", telescope.git_status) 34 | 35 | 36 | require('gitsigns').setup{ 37 | on_attach = function(bufnr) 38 | local gs = package.loaded.gitsigns 39 | 40 | local function map(mode, l, r, opts) 41 | opts = opts or {} 42 | opts.buffer = bufnr 43 | vim.keymap.set(mode, l, r, opts) 44 | end 45 | 46 | -- Navigation 47 | map('n', ']c', function() 48 | if vim.wo.diff then return ']c' end 49 | vim.schedule(function() gs.next_hunk() end) 50 | return '' 51 | end, {expr=true}) 52 | 53 | map('n', '[c', function() 54 | if vim.wo.diff then return '[c' end 55 | vim.schedule(function() gs.prev_hunk() end) 56 | return '' 57 | end, {expr=true}) 58 | 59 | -- Actions 60 | map({'n', 'v'}, 'hs', ':Gitsigns stage_hunk') 61 | map({'n', 'v'}, 'hr', ':Gitsigns reset_hunk') 62 | map('n', 'hS', gs.stage_buffer) 63 | map('n', 'hu', gs.undo_stage_hunk) 64 | map('n', 'gR', gs.reset_buffer) 65 | map('n', 'hp', gs.preview_hunk) 66 | map('n', 'hb', function() gs.blame_line{full=true} end) 67 | map('n', 'tb', gs.toggle_current_line_blame) 68 | map('n', 'hd', gs.diffthis) 69 | map('n', 'hD', function() gs.diffthis('~') end) 70 | map('n', 'td', gs.toggle_deleted) 71 | 72 | -- Text object 73 | map({'o', 'x'}, 'ih', ':Gitsigns select_hunk') 74 | end 75 | } 76 | 77 | -- Set spelllang in git commit messages 78 | vim.cmd([[ 79 | autocmd FileType gitcommit setlocal spell 80 | ]]) 81 | -------------------------------------------------------------------------------- /.mutt/colors: -------------------------------------------------------------------------------- 1 | color attachment brightmagenta default 2 | color error color59 default 3 | color hdrdefault red default # headers 4 | color indicator color253 color241 # currently selected message 5 | 6 | color markers brightcyan default # the + for wrapped pager lines 7 | color message brightcyan default # informational messages, not mail 8 | 9 | color normal default default # plain text 10 | #color quoted green default # quoted text 11 | 12 | color search brightgreen default # hilite search patterns in the pager 13 | color signature red default # signature (after "-- ") is red 14 | 15 | color status color30 default 16 | 17 | color tilde blue default # ~'s after message body 18 | color tree red default # thread tree in index menu is magenta 19 | color signature brightred default 20 | color underline yellow default 21 | color header cyan default ^(From|Subject|To|Date|Delivered-To|X-Date): # Important headers 22 | color body magenta default "(ftp|http)://[^ ]+" # picks up URLs 23 | color body magenta default [-a-z_0-9.]+@[-a-z_0-9.]+ 24 | 25 | # http://www.jnrowe.ukfsn.org/articles/configs/mutt.html 26 | # Highlight qsf and SpamAssassin flagged mail 27 | #color index brightred brightblack "~h '^X-Spam: YES'" 28 | #color index brightmagenta brightblack "~h '^X-Spam-Status: Yes'" 29 | ## Match dates, both ISO-style and [YY]YY/MM/DD 30 | color body brightred black "\(19|20\)?[0-9][0-9][/-][01]?[0-9][/-][0123]?[0-9]" 31 | ## ISBNs 32 | color body yellow default "[-0-9]{9,12}[0-9X]" 33 | 34 | # http://wiki.softwarelivre.org/Blogs/BlogPostAntonioTerceiro20090423141108 35 | 36 | color body green default "^diff \-.*" 37 | color body green default "^index [a-f0-9].*" 38 | color body green default "^\-\-\- .*" 39 | color body green default "^[\+]{3} .*" 40 | color body cyan default "^[\+][^\+]+.*" 41 | color body blue default "^\-[^\-]+.*" 42 | color body brightblue default "^@@ .*" 43 | 44 | # Coloring quoted text - coloring the first 7 levels: 45 | color quoted cyan default 46 | color quoted1 yellow default 47 | color quoted2 red default 48 | color quoted3 green default 49 | color quoted4 cyan default 50 | color quoted5 yellow default 51 | color quoted6 red default 52 | color quoted7 green default 53 | 54 | # Colorize smileys: :-) ;-) :-/ :-( 55 | color body yellow default "[;:]-[)/(|]" 56 | color body yellow default "[;:][)/(|]" 57 | color body green default "[[:alpha:]]\+://[^ ]*" 58 | 59 | color sidebar_new color147 color235 60 | color index color250 color236 ~N # New 61 | #color index color45 color237 ~v # Part of a thread 62 | #color index color17 color109 ~p 63 | 64 | # http://www.mutt.org/doc/manual/manual-4.html#patterns 65 | color index color40 color235 '~d <1d ~N' 66 | #color index color45 color238 '~(~N)' # unread in a thread with leader read 67 | #color index color56 default '~R' # unread in a thread with leader read 68 | #color index color153 color239 '~p ~N' # To me 69 | color index color153 color239 "~(~U ~s TOME)" # Read 70 | #color index color151 default '~R' 71 | color index color31 default ~R # Read 72 | #color index color31 default '~p ~R' # Read 73 | 74 | 75 | #color index magenta default ~F # flagged messages 76 | color index color197 default ~D # To be deleted 77 | color index color253 color93 ~T # Tagged ones 78 | 79 | #color sidebar_new black color151 80 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/dap.lua: -------------------------------------------------------------------------------- 1 | local dap = require('dap') 2 | local dapui = require("dapui") 3 | local telescope = require('telescope') 4 | 5 | dapui.setup() 6 | telescope.load_extension('dap') 7 | 8 | -- Dap UI configuration 9 | dap.listeners.before.attach.dapui_config = function() 10 | dapui.open() 11 | end 12 | dap.listeners.before.launch.dapui_config = function() 13 | dapui.open() 14 | end 15 | dap.listeners.before.event_terminated.dapui_config = function() 16 | dapui.close() 17 | end 18 | dap.listeners.before.event_exited.dapui_config = function() 19 | dapui.close() 20 | end 21 | 22 | local function keymap(key, fun) 23 | vim.keymap.set('n', key, fun, opts) 24 | end 25 | 26 | keymap('', dap.continue) 27 | keymap('', dap.close) 28 | keymap('', dap.continue) 29 | keymap('', dap.step_over) 30 | keymap('', dap.step_out) 31 | keymap('b', dap.toggle_breakpoint) 32 | vim.keymap.set('n', 'B', ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))") 33 | keymap('dd', dap.continue) 34 | keymap('fB', telescope.extensions.dap.list_breakpoints) 35 | 36 | dap.adapters.gdb = { 37 | type = "executable", 38 | command = "gdb", 39 | args = { "-i", "dap" } 40 | } 41 | 42 | dap.configurations.c = { 43 | { 44 | name = "Launch", 45 | type = "gdb", 46 | request = "launch", 47 | program = function() 48 | return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') 49 | end, 50 | cwd = "${workspaceFolder}", 51 | stopAtBeginningOfMainSubprogram = false, 52 | }, 53 | } 54 | 55 | dap.adapters.rust_gdb = { 56 | type = "executable", 57 | command = "rust-gdb", 58 | args = { "-i", "dap" } 59 | } 60 | 61 | dap.configurations.rust = { 62 | { 63 | name = "Launch", 64 | type = "rust_gdb", 65 | request = "launch", 66 | program = function() 67 | -- cargo metadata --no-deps --format-version 1 | jq -r '[.packages[].targets[] | select(.kind | index("bin"))][0] | .name' 68 | -- cargo metadata --format-version 1 --no-deps | jq | jq .workspace_root 69 | local output = vim.fn.system("cargo metadata --no-deps --format-version 1 | jq -r '[.packages[].targets[] | select(.kind | index(\"bin\"))][0] | .name'") 70 | -- return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/target/debug/' .. output, 'file') 71 | return vim.fn.getcwd() .. '/target/debug/' .. output 72 | end, 73 | args = function() 74 | local args_string = vim.fn.input("Arguments: ") return vim.split(args_string, " ") 75 | end, 76 | cwd = "${workspaceFolder}", 77 | stopAtBeginningOfMainSubprogram = false, 78 | }, 79 | } 80 | 81 | dap.adapters.python = { 82 | type = 'executable'; 83 | command = "/usr/bin/python"; 84 | args = { '-m', 'debugpy.adapter' }; 85 | } 86 | 87 | 88 | dap.configurations.python = { 89 | { 90 | -- The first three options are required by nvim-dap 91 | type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python` 92 | request = 'launch'; 93 | name = "Launch file"; 94 | cwd = "${workspaceFolder}", 95 | 96 | program = "${file}"; -- This configuration will launch the current file if used. 97 | pythonPath = function() 98 | return '/usr/bin/python' 99 | end; 100 | }, 101 | } 102 | -------------------------------------------------------------------------------- /.config/nvim/lua/jelle/lsp.lua: -------------------------------------------------------------------------------- 1 | local lspconfig = require('lspconfig') 2 | local navic = require('nvim-navic') 3 | local telescope = require('telescope.builtin') 4 | 5 | local on_attach = function(client, bufnr) 6 | if client.server_capabilities.documentSymbolProvider then 7 | navic.attach(client, bufnr) 8 | end 9 | 10 | local opts = { noremap=true, silent=true, buffer=bufnr } 11 | local function keymap(key, fun, desc) 12 | opts.desc = desc 13 | vim.keymap.set('n', key, fun, opts) 14 | end 15 | 16 | vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') 17 | 18 | -- :Telescope keymaps 19 | keymap('gD', vim.lsp.buf.declaration, "[G]o to [D]eclaration") 20 | keymap('gd', vim.lsp.buf.definition, "[G]oto [D]efinition") 21 | keymap('D', vim.lsp.buf.type_definition, "Type [D]efinition") 22 | keymap('gi', vim.lsp.buf.implementation, "[G]oto [I]implementation") 23 | keymap('gr', vim.lsp.buf.references, "[G]oto [R]eferences") 24 | keymap('gs', telescope.lsp_dynamic_workspace_symbols, "[G]oto [S]ymbols show workspace symbols") 25 | keymap('ga', vim.lsp.buf.code_action, "[G]o [A]ction") 26 | keymap('gR', vim.lsp.buf.rename, "[G]o [R]ename") 27 | keymap('', vim.lsp.buf.signature_help, "Signature documentation") 28 | end 29 | 30 | -- Messes up function / JSX formatting in JSX. 31 | -- vim.api.nvim_create_autocmd("BufWritePre", { 32 | -- buffer = buffer, 33 | -- callback = function() 34 | -- vim.lsp.buf.format { async = false } 35 | -- end 36 | -- }) 37 | 38 | require('lspconfig.configs').oxlint = { 39 | default_config = { 40 | cmd = {"oxc_language_server"}, 41 | filetypes = {'ts_ls', 'javascript', 'javascriptreact'}, 42 | root_dir = lspconfig.util.root_pattern(".eslintrc.json"), 43 | settings = {}, 44 | }; 45 | } 46 | 47 | -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md 48 | local servers = {'clangd', 'rust_analyzer', 'ts_ls', 'gopls', 'marksman', 'ruff', 'bashls', 'oxlint'} 49 | for _, lsp in ipairs(servers) do 50 | lspconfig[lsp].setup { 51 | on_attach = on_attach, 52 | capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), 53 | } 54 | end 55 | 56 | lspconfig.eslint.setup { 57 | on_attach = function(client, bufnr) 58 | on_attach(client, bufnr) 59 | vim.api.nvim_create_autocmd("BufWritePre", { 60 | buffer = bufnr, 61 | command = "EslintFixAll", 62 | }) 63 | end, 64 | } 65 | 66 | lspconfig.pyright.setup { 67 | on_attach = on_attach, 68 | capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities()), 69 | root_dir = function() 70 | return vim.fn.getcwd() 71 | end, 72 | } 73 | 74 | vim.lsp.handlers['textDocument/codeAction'] = telescope.lsp_code_actions 75 | vim.lsp.handlers['textDocument/references'] = telescope.lsp_references 76 | vim.lsp.handlers['textDocument/definition'] = telescope.lsp_definitions 77 | vim.lsp.handlers['textDocument/typeDefinition'] = telescope.lsp_type_definitions 78 | vim.lsp.handlers['textDocument/implementation'] = telescope.lsp_implementations 79 | vim.lsp.handlers['textDocument/documentSymbol'] = telescope.lsp_document_symbols 80 | vim.lsp.handlers['workspace/symbol'] = telescope.lsp_workspace_symbols 81 | 82 | vim.keymap.set("n", "dl", function() vim.diagnostic.open_float(0, {scope='line'}) end) 83 | 84 | 85 | vim.diagnostic.config({ 86 | severity = { 87 | min = vim.diagnostic.severity.INFO, 88 | }, 89 | virtual_lines = { 90 | current_line = true, 91 | }, 92 | }) 93 | -------------------------------------------------------------------------------- /.vim/colors/wombat256mod.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Original Maintainer: Lars H. Nielsen (dengmao@gmail.com) 3 | " Last Change: 2010-07-23 4 | " 5 | " Modified version of wombat for 256-color terminals by 6 | " David Liang (bmdavll@gmail.com) 7 | " based on version by 8 | " Danila Bespalov (danila.bespalov@gmail.com) 9 | 10 | set background=dark 11 | 12 | if version > 580 13 | hi clear 14 | if exists("syntax_on") 15 | syntax reset 16 | endif 17 | endif 18 | 19 | let colors_name = "wombat256mod" 20 | 21 | 22 | " General colors 23 | hi Normal ctermfg=252 ctermbg=234 cterm=none guifg=#e3e0d7 guibg=#242424 gui=none 24 | hi Cursor ctermfg=234 ctermbg=228 cterm=none guifg=#242424 guibg=#eae788 gui=none 25 | hi Visual ctermfg=251 ctermbg=239 cterm=none guifg=#c3c6ca guibg=#554d4b gui=none 26 | hi VisualNOS ctermfg=251 ctermbg=236 cterm=none guifg=#c3c6ca guibg=#303030 gui=none 27 | hi Search ctermfg=177 ctermbg=241 cterm=none guifg=#d787ff guibg=#636066 gui=none 28 | hi Folded ctermfg=103 ctermbg=237 cterm=none guifg=#a0a8b0 guibg=#3a4046 gui=none 29 | hi Title ctermfg=230 cterm=bold guifg=#ffffd7 gui=bold 30 | hi StatusLine ctermfg=230 ctermbg=238 cterm=none guifg=#ffffd7 guibg=#444444 gui=italic 31 | hi VertSplit ctermfg=238 ctermbg=238 cterm=none guifg=#444444 guibg=#444444 gui=none 32 | hi StatusLineNC ctermfg=241 ctermbg=238 cterm=none guifg=#857b6f guibg=#444444 gui=none 33 | hi LineNr ctermfg=241 ctermbg=232 cterm=none guifg=#857b6f guibg=#080808 gui=none 34 | hi SpecialKey ctermfg=241 ctermbg=235 cterm=none guifg=#626262 guibg=#2b2b2b gui=none 35 | hi WarningMsg ctermfg=203 guifg=#ff5f55 36 | hi ErrorMsg ctermfg=196 ctermbg=236 cterm=bold guifg=#ff2026 guibg=#3a3a3a gui=bold 37 | 38 | " Vim >= 7.0 specific colors 39 | if version >= 700 40 | hi CursorLine ctermbg=236 cterm=none guibg=#32322f 41 | hi MatchParen ctermfg=228 ctermbg=101 cterm=bold guifg=#eae788 guibg=#857b6f gui=bold 42 | hi Pmenu ctermfg=230 ctermbg=238 guifg=#ffffd7 guibg=#444444 43 | hi PmenuSel ctermfg=232 ctermbg=192 guifg=#080808 guibg=#cae982 44 | endif 45 | 46 | " Diff highlighting 47 | hi DiffAdd ctermbg=17 guibg=#2a0d6a 48 | hi DiffDelete ctermfg=234 ctermbg=60 cterm=none guifg=#242424 guibg=#3e3969 gui=none 49 | hi DiffText ctermbg=53 cterm=none guibg=#73186e gui=none 50 | hi DiffChange ctermbg=237 guibg=#382a37 51 | 52 | "hi CursorIM 53 | "hi Directory 54 | "hi IncSearch 55 | "hi Menu 56 | "hi ModeMsg 57 | "hi MoreMsg 58 | "hi PmenuSbar 59 | "hi PmenuThumb 60 | "hi Question 61 | "hi Scrollbar 62 | "hi SignColumn 63 | "hi SpellBad 64 | "hi SpellCap 65 | "hi SpellLocal 66 | "hi SpellRare 67 | "hi TabLine 68 | "hi TabLineFill 69 | "hi TabLineSel 70 | "hi Tooltip 71 | "hi User1 72 | "hi User9 73 | "hi WildMenu 74 | 75 | 76 | " Syntax highlighting 77 | hi Keyword ctermfg=111 cterm=none guifg=#88b8f6 gui=none 78 | hi Statement ctermfg=111 cterm=none guifg=#88b8f6 gui=none 79 | hi Constant ctermfg=173 cterm=none guifg=#e5786d gui=none 80 | hi Number ctermfg=173 cterm=none guifg=#e5786d gui=none 81 | hi PreProc ctermfg=173 cterm=none guifg=#e5786d gui=none 82 | hi Function ctermfg=192 cterm=none guifg=#cae982 gui=none 83 | hi Identifier ctermfg=192 cterm=none guifg=#cae982 gui=none 84 | hi Type ctermfg=186 cterm=none guifg=#d4d987 gui=none 85 | hi Special ctermfg=229 cterm=none guifg=#eadead gui=none 86 | hi String ctermfg=113 cterm=none guifg=#95e454 gui=italic 87 | hi Comment ctermfg=246 cterm=none guifg=#9c998e gui=italic 88 | hi Todo ctermfg=101 cterm=none guifg=#857b6f gui=italic 89 | 90 | 91 | " Links 92 | hi! link FoldColumn Folded 93 | hi! link CursorColumn CursorLine 94 | hi! link NonText LineNr 95 | 96 | " vim:set ts=4 sw=4 noet: 97 | -------------------------------------------------------------------------------- /.Xdefaults: -------------------------------------------------------------------------------- 1 | ! urxvt settings 2 | 3 | 4 | !--[Title]--! 5 | 6 | URxvt*title: urxvt 7 | URxvt*termName: rxvt-256color 8 | URxvt*cursorBlink: true 9 | URxvt*urgentOnBell: true 10 | 11 | !--[URL Select]--! 12 | URxvt.perl-ext-common: default,url-select 13 | URxvt.keysym.M-u: perl:url-select:select_next 14 | URxvt.urlLauncher: aurora 15 | URxvt.underlineURLs: true 16 | 17 | !--[Fonts]--! 18 | 19 | !URxvt.font: -*-terminus-*-*-*-*-14-*-*-*-*-*-*-u 20 | !URxvt.font: -*-droid sans mono-*-*-*-*-14-*-*-*-*-*-*-u 21 | URxvt.font: xft:terminus:pixelsize=16:antialias=false 22 | ! 23 | URxvt.scrollBar: false 24 | URxvt.skipBuiltinGlyphs: true 25 | 26 | !--[Urxvt Options]--! 27 | 28 | URxvt.boldMode: false 29 | !URxvt.imLocale: en_US.UTF-8 30 | URxvt.loginShell: true 31 | URxvt.saveLines: 512 32 | !urxvt.geometry: 110x40 33 | URxvt.borderless: true 34 | !URxvt.xftAntialias: true 35 | URxvt.jumpScroll: true 36 | URxvt.tintColor: white 37 | URxvt.internalBorder: 0 38 | URxvt.cursorBlink: false 39 | URxvt.cursorColor: #dd9900 40 | URxvt.cursorColor2: #000000 41 | URxvt.background: #FFFFFF 42 | URxvt.foreground: #ddccbb 43 | URxvt.colorBD: #ffffff 44 | URxvt.colorIT: #bbbbbb 45 | URxvt.colorUL: #999999 46 | URxvt.underlineColor: #999999 47 | !Xcursor.theme: CG 48 | 49 | !## teh transparency stuff 50 | URxvt.inheritPixmap: true 51 | URxvt.tintColor: white 52 | URxvt.shading: 40 53 | 54 | 55 | ! xscreensaver --------------------------------------------------------------- 56 | 57 | xscreensaver.Dialog.headingFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* 58 | xscreensaver.Dialog.bodyFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* 59 | xscreensaver.Dialog.labelFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* 60 | xscreensaver.Dialog.unameFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* 61 | xscreensaver.Dialog.buttonFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* 62 | xscreensaver.Dialog.dateFont: -*-dina-medium-r-*-*-10-*-*-*-*-*-*-* 63 | xscreensaver.passwd.passwdFont: -*-dina-bold-r-*-*-10-*-*-*-*-*-*-* 64 | !general dialog box (affects main hostname, username, password text) 65 | 66 | xscreensaver.Dialog.foreground: #ffffff 67 | xscreensaver.Dialog.background: #000000 68 | xscreensaver.Dialog.topShadowColor: #000000 69 | xscreensaver.Dialog.bottomShadowColor: #000000 70 | xscreensaver.Dialog.Button.foreground: #666666 71 | xscreensaver.Dialog.Button.background: #ffffff 72 | !username/password input box and date text colour 73 | xscreensaver.Dialog.text.foreground: #666666 74 | xscreensaver.Dialog.text.background: #ffffff 75 | xscreensaver.Dialog.internalBorderWidth:24 76 | xscreensaver.Dialog.borderWidth: 20 77 | xscreensaver.Dialog.shadowThickness: 2 78 | !timeout bar (background is actually determined by Dialog.text.background) 79 | xscreensaver.passwd.thermometer.foreground: #666666 80 | xscreensaver.passwd.thermometer.background: #000000 81 | xscreensaver.passwd.thermometer.width: 8 82 | 83 | ! terminal colors ------------------------------------------------------------ 84 | 85 | 86 | URxvt*background: #000000 87 | URxvt*foreground: #bfbdc0 88 | 89 | URxvt*color0: #000000 90 | URxvt*color1: #8a110e 91 | URxvt*color2: #669f3d 92 | URxvt*color3: #b3751e 93 | URxvt*color4: #493d9f 94 | URxvt*color5: #9216a3 95 | URxvt*color6: #198a9c 96 | URxvt*color7: #bfbdc0 97 | 98 | URxvt*color8: #686773 99 | URxvt*color9: #fc5166 100 | URxvt*color10: #63ff54 101 | URxvt*color11: #ffd75c 102 | URxvt*color12: #766eff 103 | URxvt*color13: #e151ff 104 | URxvt*color14: #57ffec 105 | URxvt*color15: #ffffff 106 | -------------------------------------------------------------------------------- /.vimperator/colors/zenburn.vimp: -------------------------------------------------------------------------------- 1 | " == Zenburn color scheme == 2 | " name: Zenburn 3 | " file: zenburn.vimp 4 | " author: Adrian C. 5 | " license: GNU General Public License v2 6 | " == Zenburn color scheme settings == 7 | hi Bell border: 0 none; background-color: black; 8 | hi Boolean color: #CC9393; 9 | hi CmdLine color: #DCDCCD; font-family: terminus; padding: 1px; 10 | hi CmdLine>* font-family: terminus; 11 | hi CmdOutput white-space: pre; 12 | hi CompDesc color: #808080; width: 50%; 13 | " hi CompGroup 14 | " hi CompGroup:not(:first-of-type) margin-top: .5em; 15 | hi CompIcon width: 16px; min-width: 16px; display: inline-block; margin-right: .5ex; 16 | hi CompIcon>img max-width: 16px; max-height: 16px; vertical-align: middle; 17 | hi CompItem font-family: terminus; font-size: 11px; 18 | hi CompItem>* padding: 0 .5ex; 19 | hi CompItem[selected] color: #2E4340; background: #CCDC90; 20 | " hi CompLess text-align: center; height: 0; line-height: .5ex; padding-top: 1ex; 21 | " hi CompLess::after content: "\2303" /* Unicode up arrowhead */ 22 | " hi CompMore text-align: center; height: .5ex; line-height: .5ex; margin-bottom: -.5ex; 23 | " hi CompMore::after content: "\2304" /* Unicode down arrowhead */ 24 | hi CompMsg font-style: italic; margin-left: 16px; 25 | hi CompResult width: 45%; overfloaw: hidden; 26 | hi CompTitle color: #ACBC90; background: #3F3F3F; font-weight: bold; 27 | hi CompTitle>* padding: 0 .5ex; 28 | hi ErrorMsg color: #3F3F3F; background: #CC9393; font-weight: bold; 29 | hi Filter color: #2E4340; background: #CCDC90; font-weight: bold; 30 | hi FrameIndicator background-color: #CC9393; opacity: 0.5; z-index: 999; position: fixed; top: 0; bottom: 0; left: 0; right: 0; 31 | hi Function color: navy; 32 | " hi Gradient height: 1px; margin-bottom: -1px; margin-top: -1px; 33 | " hi GradientLeft background-color: #ACBC90; 34 | " hi GradientRight background-color: #3F3F3F; 35 | hi Hint font-family: monospace; font-size: 10px; font-weight: bold; color: #385F38; background-color: #F8F893; border-color: ButtonShadow; border-width: 0px; border-style: solid; padding 0px 1px 0px 1px; 36 | hi Hint::after content: attr(number); 37 | hi HintActive background: #F18C96; color: #333333; 38 | hi HintElem background-color: #8FAF9F; color: #000D18; 39 | hi HintImage opacity: .5; 40 | hi Indicator color: #94BFF3; 41 | hi InfoMsg color: #DCDCCD; background: #3F3F3F; 42 | hi LineNr color: orange; background: #3F3F3F; 43 | hi Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; 44 | hi ModeMsg color: #DCDCCD; background: #3F3F3F; 45 | hi MoreMsg color: #9ECE9E; background: #3F3F3F; 46 | hi NonText color: #94BFF3; min-height: 16px; padding-left: 2px; 47 | hi Normal color: #DCDCCD; background: #3F3F3F; font-family: terminus; 48 | hi Null color: #94BFF3; 49 | hi Number color: #94BFF3; 50 | hi Object color: maroon; 51 | hi Preview color: gray; 52 | hi Question color: #9ECE9E; background: #3F3F3F; font-weight: bold; 53 | hi Search font-size: inherit; padding: 0; color: #385F38; background-color: #F8F893; padding: 0; 54 | " hi StatusLine color: #ACBC90; background: #1E2320; 55 | " hi StatusLineBroken color: #CC9393; background: #1E2320; 56 | " hi StatusLineSecure color: #F0DFAF; background: #1E2320; 57 | hi String color: #9ECE9E; 58 | hi TabClose 59 | hi TabIcon 60 | " hi TabIconNumber font-weight: normal; color: #DCDCCD; text-align: center; text-shadow: black -1px 0 1px, black 0 1px 1px, black 1px 0 1px, black 0 -1px 1px; 61 | hi TabNumber font-weight: bold; margin: 0; padding-right: .3ex; 62 | hi TabText 63 | hi Tag color: #94BFF3; 64 | hi Title color: #ACBC90; background: #3F3F3F; font-weight: bold; 65 | hi URL text-decoration: none; color: #9ECE9E; background: inherit; 66 | hi URL:hover text-decoration: underline; cursor: pointer; 67 | hi WarningMsg color: #CC9393; background: #3F3F3F; 68 | 69 | style -name statusbar chrome://* < 'source ~/.mutt/account=INBOX' 5 | macro index 'source ~/.mutt/arch_account=INBOX' 6 | 7 | # urlscan 8 | macro index,pager \cb " urlscan -c -d" "call urlscan to extract URLs out of a message" 9 | macro attach,compose \cb " urlscan -c -d" "call urlscan to extract URLs out of a message" 10 | 11 | source ~/.mutt/account 12 | 13 | # cache 14 | set sleep_time = 0 15 | set alias_format = "%4n %t %-20a %r" 16 | set beep_new 17 | unset confirmappend 18 | set date_format = "%m/%d/%y at %I:%M%P" 19 | set delete = yes 20 | set edit_headers 21 | set editor = "vim +:silent+?^$" 22 | set fast_reply 23 | set forward_format = "Fwd: %s" 24 | set forward_quote 25 | set include 26 | set index_format = "%3C %Z %[!%m/%d] %-17.17F %s" 27 | set ispell = "aspell -e -c" 28 | set mailcap_path = ~/.mutt/mailcap 29 | set imap_check_subscribed = yes 30 | set mail_check = 120 31 | set timeout = 30 32 | set imap_keepalive = 120 33 | set move = no 34 | unset markers 35 | unset mark_old 36 | set menu_scroll 37 | set pager_context = 5 38 | set pager_index_lines = 10 39 | set pager_stop 40 | set print_command = "enscript -p - | psselect -r | lp" 41 | set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+" 42 | set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*" 43 | set reply_to 44 | set reverse_alias 45 | set reverse_name 46 | set sort = threads 47 | set sort_aux = reverse-last-date-received 48 | set thorough_search 49 | set thread_received 50 | set timeout = 10 51 | set tmpdir = ~/.mutt/temp 52 | 53 | # non-standard 54 | set sidebar_divider_char = '│'  55 | set sidebar_visible = yes 56 | set sidebar_width = 30 57 | 58 | auto_view text/html 59 | alternative_order text/plain text/enriched text/html 60 | 61 | ignore * 62 | unignore from: to: cc: date: subject: 63 | hdr_order from: to: cc: date: subject: 64 | 65 | bind index i noop 66 | bind index g noop 67 | bind index gg first-entry 68 | bind index G last-entry 69 | bind pager i exit 70 | bind pager q toggle-quoted 71 | bind pager / search 72 | bind pager j next-line 73 | bind pager k previous-line 74 | bind pager \ek previous-entry 75 | bind pager \ej next-entry 76 | bind pager g noop 77 | bind pager gg top 78 | bind pager G bottom 79 | bind index,pager \# noop 80 | bind index,pager \& noop 81 | bind index,pager R group-reply 82 | 83 | # non-standard, sidebar 84 | bind index,pager J sidebar-next 85 | bind index,pager K sidebar-prev 86 | bind index,pager O sidebar-open 87 | 88 | macro index ,i "!" "go to inbox" 89 | macro pager,index ,p "cat > /tmp/" "save message as" 90 | macro index ,s "~/Mail/patches" "Save tagged messages (if any) to ~/Mail/patches" 91 | macro pager,index ,g "unset wait_key~/.mutt/open_ml_url.pyset wait_key" "Open GMane URL" 92 | macro pager,index ,s "~/.mutt/security_tracker.py" "Open security.archlinux.org link" 93 | macro index ,r "allNall" "mark all as read" 94 | macro index ,R "allNall" "mark all as read (collapsed)" 95 | macro index ,v "" "collapse/uncollapse thread" 96 | macro index ,V "" "collapse/uncollapse all threads" 97 | 98 | color status green default 99 | color sidebar_indicator red default 100 | 101 | macro index gi " =INBOX" "Go to inbox" 102 | macro index go " =oss-security" "Go to oss-security" 103 | macro index gl " =linux-sunxi" "Go to linux-sunxi" 104 | 105 | source ~/.mutt/colors 106 | source ~/.mutt/crypto 107 | -------------------------------------------------------------------------------- /.ycm_extra_conf.py: -------------------------------------------------------------------------------- 1 | import os 2 | import ycm_core 3 | 4 | # These are the compilation flags that will be used in case there's no 5 | # compilation database set (by default, one is not set). 6 | # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. 7 | flags = [ 8 | '-Wall', 9 | '-Wextra', 10 | '-Werror', 11 | '-fexceptions', 12 | '-DNDEBUG', 13 | # THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which 14 | # language to use when compiling headers. So it will guess. Badly. So C++ 15 | # headers will be compiled as C headers. You don't want that so ALWAYS specify 16 | # a "-std=". 17 | # For a C project, you would set this to something like 'c99' instead of 18 | # 'c++11'. 19 | '-std=c++11', 20 | # ...and the same thing goes for the magic -x option which specifies the 21 | # language that the files to be compiled are written in. This is mostly 22 | # relevant for c++ headers. 23 | # For a C project, you would set this to 'c' instead of 'c++'. 24 | '-x', 25 | 'c++', 26 | '-I', 27 | '.', 28 | ] 29 | 30 | 31 | # Set this to the absolute path to the folder (NOT the file!) containing the 32 | # compile_commands.json file to use that instead of 'flags'. See here for 33 | # more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html 34 | # 35 | # Most projects will NOT need to set this to anything; you can just change the 36 | # 'flags' list of compilation flags. Notice that YCM itself uses that approach. 37 | compilation_database_folder = '' 38 | 39 | if os.path.exists( compilation_database_folder ): 40 | database = ycm_core.CompilationDatabase( compilation_database_folder ) 41 | else: 42 | database = None 43 | 44 | SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] 45 | 46 | def DirectoryOfThisScript(): 47 | return os.path.dirname( os.path.abspath( __file__ ) ) 48 | 49 | 50 | def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): 51 | if not working_directory: 52 | return list( flags ) 53 | new_flags = [] 54 | make_next_absolute = False 55 | path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] 56 | for flag in flags: 57 | new_flag = flag 58 | 59 | if make_next_absolute: 60 | make_next_absolute = False 61 | if not flag.startswith( '/' ): 62 | new_flag = os.path.join( working_directory, flag ) 63 | 64 | for path_flag in path_flags: 65 | if flag == path_flag: 66 | make_next_absolute = True 67 | break 68 | 69 | if flag.startswith( path_flag ): 70 | path = flag[ len( path_flag ): ] 71 | new_flag = path_flag + os.path.join( working_directory, path ) 72 | break 73 | 74 | if new_flag: 75 | new_flags.append( new_flag ) 76 | return new_flags 77 | 78 | 79 | def IsHeaderFile( filename ): 80 | extension = os.path.splitext( filename )[ 1 ] 81 | return extension in [ '.h', '.hxx', '.hpp', '.hh' ] 82 | 83 | 84 | def GetCompilationInfoForFile( filename ): 85 | # The compilation_commands.json file generated by CMake does not have entries 86 | # for header files. So we do our best by asking the db for flags for a 87 | # corresponding source file, if any. If one exists, the flags for that file 88 | # should be good enough. 89 | if IsHeaderFile( filename ): 90 | basename = os.path.splitext( filename )[ 0 ] 91 | for extension in SOURCE_EXTENSIONS: 92 | replacement_file = basename + extension 93 | if os.path.exists( replacement_file ): 94 | compilation_info = database.GetCompilationInfoForFile( 95 | replacement_file ) 96 | if compilation_info.compiler_flags_: 97 | return compilation_info 98 | return None 99 | return database.GetCompilationInfoForFile( filename ) 100 | 101 | 102 | def FlagsForFile( filename, **kwargs ): 103 | if database: 104 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a 105 | # python list, but a "list-like" StringVec object 106 | compilation_info = GetCompilationInfoForFile( filename ) 107 | if not compilation_info: 108 | return None 109 | 110 | final_flags = MakeRelativePathsInFlagsAbsolute( 111 | compilation_info.compiler_flags_, 112 | compilation_info.compiler_working_dir_ ) 113 | 114 | else: 115 | relative_to = DirectoryOfThisScript() 116 | final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) 117 | 118 | return { 119 | 'flags': final_flags, 120 | 'do_cache': True 121 | } 122 | -------------------------------------------------------------------------------- /.urlwatch/hooks.py: -------------------------------------------------------------------------------- 1 | # 2 | # Example hooks file for urlwatch 3 | # 4 | # Copyright (c) 2008-2016 Thomas Perl 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions 9 | # are met: 10 | # 1. Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # 2. Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # 3. The name of the author may not be used to endorse or promote products 16 | # derived from this software without specific prior written permission. 17 | # 18 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 | # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 | # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 | # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | import re 31 | 32 | from urlwatch import filters 33 | from urlwatch import jobs 34 | from urlwatch import reporters 35 | 36 | from bs4 import BeautifulSoup 37 | 38 | #class CustomLoginJob(jobs.UrlJob): 39 | # """Custom login for my webpage""" 40 | # 41 | # __kind__ = 'custom-login' 42 | # __required__ = ('username', 'password') 43 | # 44 | # def retrieve(self, job_state): 45 | # return 'Would log in to {} with {} and {}\n'.format(self.url, self.username, self.password) 46 | 47 | 48 | #class CaseFilter(filters.FilterBase): 49 | # """Custom filter for changing case, needs to be selected manually""" 50 | # 51 | # __kind__ = 'case' 52 | # 53 | # def filter(self, data, subfilter=None): 54 | # # The subfilter is specified using a colon, for example the "case" 55 | # # filter here can be specified as "case:upper" and "case:lower" 56 | # 57 | # if subfilter is None: 58 | # subfilter = 'upper' 59 | # 60 | # if subfilter == 'upper': 61 | # return data.upper() 62 | # elif subfilter == 'lower': 63 | # return data.lower() 64 | # else: 65 | # raise ValueError('Unknown case subfilter: %r' % (subfilter,)) 66 | 67 | 68 | #class IndentFilter(filters.FilterBase): 69 | # """Custom filter for indenting, needs to be selected manually""" 70 | # 71 | # __kind__ = 'indent' 72 | # 73 | # def filter(self, data, subfilter=None): 74 | # # The subfilter here is a number of characters to indent 75 | # 76 | # if subfilter is None: 77 | # indent = 8 78 | # else: 79 | # indent = int(subfilter) 80 | # 81 | # return '\n'.join((' '*indent) + line for line in data.splitlines()) 82 | 83 | 84 | class GitHubFilter(filters.FilterBase): 85 | __kind__ = 'github' 86 | 87 | def filter(self, data, subfilter=None): 88 | soup = BeautifulSoup(data, "html5lib") 89 | 90 | releases = soup.select('h1.release-title a') 91 | tags = soup.select('span.tag-name') 92 | 93 | if releases: 94 | results = [rel.text for rel in releases] 95 | return '\n'.join(results) 96 | 97 | elif tags: 98 | results = [tag.text for tag in tags] 99 | return '\n'.join(results) 100 | 101 | else: 102 | fallback = soup.select('div.site') 103 | return '\n'.join([str(tag) for tag in fallback]) 104 | 105 | 106 | class PyPIFilter(filters.FilterBase): 107 | __kind__ = 'pypi' 108 | 109 | def filter(self, data, subfilter=None): 110 | soup = BeautifulSoup(data, "html5lib") 111 | 112 | downloads = soup.select('table.list tr > td > span > a:nth-of-type(1)') 113 | if downloads: 114 | downloads = [dl.text for dl in downloads] 115 | return '\n'.join(downloads) 116 | else: 117 | return data 118 | 119 | 120 | class CustomMatchUrlFilter(filters.AutoMatchFilter): 121 | # The AutoMatchFilter will apply automatically to all filters 122 | # that have the given properties set 123 | MATCH = {'url': 'http://example.org/'} 124 | 125 | def filter(self, data): 126 | return data.replace('foo', 'bar') 127 | 128 | class CustomRegexMatchUrlFilter(filters.RegexMatchFilter): 129 | # Similar to AutoMatchFilter 130 | MATCH = {'url': re.compile('http://example.org/.*')} 131 | 132 | def filter(self, data): 133 | return data.replace('foo', 'bar') 134 | 135 | 136 | class CustomTextFileReporter(reporters.TextReporter): 137 | """Custom reporter that writes the text-only report to a file""" 138 | 139 | __kind__ = 'custom_file' 140 | 141 | def submit(self): 142 | with open(self.config['filename'], 'w') as fp: 143 | fp.write('\n'.join(super().submit())) 144 | 145 | 146 | class CustomHtmlFileReporter(reporters.HtmlReporter): 147 | """Custom reporter that writes the HTML report to a file""" 148 | 149 | __kind__ = 'custom_html' 150 | 151 | def submit(self): 152 | with open(self.config['filename'], 'w') as fp: 153 | fp.write('\n'.join(super().submit())) 154 | 155 | -------------------------------------------------------------------------------- /.mutt/mailcap: -------------------------------------------------------------------------------- 1 | text/html; /usr/bin/w3m -dump -T text/html %s; needsterminal; copiousoutput 2 | application/pdf ; /usr/bin/zathura %s ; copiousoutput 3 | image/* ; /usr/bin/sxiv %s ; copiousoutput 4 | audio/* ; /usr/bin/mpv %s ; copiousoutput 5 | video/* ; /usr/bin/mpv %s ; copiousoutput 6 | 7 | text/html; /usr/bin/chromium %s 8 | text/plain; urxvt -name attach -e /usr/bin/vim -f %s; 9 | text/plain;charset=us-ascii less; needsterminal 10 | #text/*; less 11 | application/msword; libreoffice %s; copiousoutput 12 | application/vnd.msword; libreoffice %s copiousoutput 13 | application/excel; libreoffice %s; copiousoutput 14 | application/msexcel; libreoffice %s; copiousoutput 15 | application/vnd.ms-excel; libreoffice %s; copiousoutput 16 | application/x-excel; libreoffice %s; copiousoutput 17 | application/x-msexcel; libreoffice %s; copiousoutput 18 | application/vnd.ms-powerpoint; libreoffice %s; copiousoutput 19 | application/x-mspowerpoint; libreoffice %s; copiousoutput 20 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice '%s'; description="Office Open XML Spreadsheet"; nametemplate=%s.xlsx 21 | application/ppt; libreoffice %s; copiousoutput 22 | application/zip; file-roller %s; copiousoutput 23 | application/x-rar; file-roller %s; copiousoutput 24 | application/msword; libreoffice %s; copiousoutput 25 | application/vnd.msword; libreoffice %s; copiousoutput 26 | application/postscript; zathura %s; copiousoutput 27 | application/rtf; rtf2text %s; copiousoutput 28 | application/ms-tnef; mutt_bgrun tnef -w %s 29 | application/octet-stream; less; needsterminal 30 | application/x-7z-compressed; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 31 | application/x-7z-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 32 | application/x-ace; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/unace 33 | application/x-alz; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/unalz 34 | application/x-ar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/ar 35 | application/x-arj; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 36 | application/x-bzip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 37 | application/x-bzip1; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 38 | application/x-bzip-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 39 | application/x-bzip1-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 40 | application/x-cabinet; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 41 | application/x-cbr; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/unrar -o -x /usr/bin/rar 42 | application/x-cbz; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 43 | application/x-cd-image; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 44 | application/x-compress; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 45 | application/x-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 46 | application/x-cpio; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /bin/cpio 47 | application/x-deb; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 48 | application/x-ear; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 49 | application/x-gtar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 50 | application/x-gzip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 51 | application/x-gzpostscript; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 52 | application/x-jar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/zip -o -x /usr/bin/zip 53 | application/x-java-archive; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/zip -o -x /usr/bin/zip 54 | application/x-lha; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/lha 55 | application/x-lhz; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/lhz 56 | application/x-lrzip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/lrzip 57 | application/x-lrzip-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/lrzip 58 | application/x-lzip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 59 | application/x-lzip-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 60 | application/x-lzma; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 61 | application/x-lzma-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 62 | application/x-lzop; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /bin/lzop 63 | application/x-lzop-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /bin/lzop 64 | application/x-ms-dos-executable; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 65 | application/x-rar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 66 | application/x-rar-compressed; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 67 | application/x-rpm; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/rpm 68 | application/x-rzip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/rzip 69 | application/x-stuffit; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 70 | application/x-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 71 | application/x-tarz; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 72 | application/x-war; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 73 | application/x-xz; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 74 | application/x-xz-compressed-tar; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 75 | application/x-zip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 76 | application/x-zip-compressed; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 77 | application/x-zoo; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" -a -x /usr/bin/zoo 78 | application/zip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 79 | multipart/x-zip; /usr/bin/file-roller '%s'; test=test -n "$DISPLAY" 80 | *; less %s; 81 | -------------------------------------------------------------------------------- /.config/i3/config: -------------------------------------------------------------------------------- 1 | exec nm-applet 2 | 3 | set $mod Mod4 4 | 5 | # Font for window titles/i3bar 6 | font pango:Terminus 12px 7 | 8 | # Use Mouse+$mod to drag floating windows to their wanted position 9 | floating_modifier $mod 10 | 11 | # Let wine float 12 | for_window [class="Wine"] floating enable 13 | for_window [class="^Spotify$"] floating enable 14 | for_window [class="Pinentry"] floating enable 15 | 16 | # Assign certain programs to a certain workspace 17 | assign [class="Spotify" instance="spotify"] 10 18 | assign [class="Chromium"] 2 19 | assign [class="Thunderbird"] 6 20 | assign [class="Steam"] 8 21 | 22 | # start a terminal 23 | bindsym $mod+Return exec alacritty 24 | 25 | # kill focused window 26 | bindsym $mod+Shift+q kill 27 | 28 | # start dmenu (a program launcher) 29 | bindsym $mod+d exec --no-startup-id "rofi -show drun" 30 | bindsym $mod+p exec --no-startup-id "rofi -show window" 31 | 32 | # change focus 33 | bindsym $mod+j focus down 34 | bindsym $mod+k focus up 35 | bindsym $mod+l focus right 36 | bindsym $mod+h focus left 37 | 38 | # alternatively, you can use the cursor keys: 39 | bindsym $mod+Left focus left 40 | bindsym $mod+Down focus down 41 | bindsym $mod+Up focus up 42 | bindsym $mod+Right focus right 43 | 44 | # Move focused window ($mod+Shift+[hjkl]) 45 | bindsym $mod+Shift+J move down 46 | bindsym $mod+Shift+K move up 47 | bindsym $mod+Shift+L move right 48 | bindsym $mod+Shift+H move left 49 | 50 | # alternatively, you can use the cursor keys: 51 | bindsym $mod+Shift+Left move left 52 | bindsym $mod+Shift+Down move down 53 | bindsym $mod+Shift+Up move up 54 | bindsym $mod+Shift+Right move right 55 | 56 | # Resize Containers, Vim-style ($mod+Control+[hjkl]) 57 | bindsym $mod+Control+j resize grow height 10 px or 10 ppt 58 | bindsym $mod+Control+k resize shrink height 10 px or 10 ppt 59 | bindsym $mod+Control+l resize grow width 10 px or 10 ppt 60 | bindsym $mod+Control+h resize shrink width 10 px or 10 ppt 61 | 62 | # split in horizontal orientation 63 | bindsym $mod+c split h 64 | 65 | # split in vertical orientation 66 | bindsym $mod+v split v 67 | 68 | # enter fullscreen mode for the focused container 69 | bindsym $mod+f fullscreen 70 | 71 | # change container layout (stacked, tabbed, toggle split) 72 | bindsym $mod+s layout stacking 73 | bindsym $mod+w layout tabbed 74 | bindsym $mod+e layout toggle split 75 | 76 | # toggle tiling / floating 77 | bindsym $mod+Shift+space floating toggle 78 | 79 | # change focus between tiling / floating windows 80 | bindsym $mod+space focus mode_toggle 81 | 82 | # focus the parent container 83 | bindsym $mod+a focus parent 84 | 85 | # switch to workspace 86 | bindsym $mod+1 workspace 1 87 | bindsym $mod+2 workspace 2 88 | bindsym $mod+3 workspace 3 89 | bindsym $mod+4 workspace 4 90 | bindsym $mod+5 workspace 5 91 | bindsym $mod+6 workspace 6 92 | bindsym $mod+7 workspace 7 93 | bindsym $mod+8 workspace 8 94 | bindsym $mod+9 workspace 9 95 | bindsym $mod+0 workspace 10 96 | 97 | # move focused container to workspace 98 | bindsym $mod+Shift+1 move container to workspace 1 99 | bindsym $mod+Shift+2 move container to workspace 2 100 | bindsym $mod+Shift+3 move container to workspace 3 101 | bindsym $mod+Shift+4 move container to workspace 4 102 | bindsym $mod+Shift+5 move container to workspace 5 103 | bindsym $mod+Shift+6 move container to workspace 6 104 | bindsym $mod+Shift+7 move container to workspace 7 105 | bindsym $mod+Shift+8 move container to workspace 8 106 | bindsym $mod+Shift+9 move container to workspace 9 107 | bindsym $mod+Shift+0 move container to workspace 10 108 | 109 | # Move workspaces around 110 | bindsym $mod+x move workspace to output right 111 | bindsym $mod+z move workspace to output left 112 | 113 | # reload the configuration file 114 | bindsym $mod+Shift+c reload 115 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 116 | bindsym $mod+Shift+r restart 117 | # exit i3 (logs you out of your X session) 118 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" 119 | 120 | # resize window (you can also use the mouse for that) 121 | mode "resize" { 122 | # These bindings trigger as soon as you enter the resize mode 123 | 124 | bindsym h resize shrink width 10 px or 10 ppt 125 | bindsym j resize grow height 10 px or 10 ppt 126 | bindsym k resize shrink height 10 px or 10 ppt 127 | bindsym l resize grow width 10 px or 10 ppt 128 | 129 | # same bindings, but for the arrow keys 130 | bindsym Left resize shrink width 10 px or 10 ppt 131 | bindsym Down resize grow height 10 px or 10 ppt 132 | bindsym Up resize shrink height 10 px or 10 ppt 133 | bindsym Right resize grow width 10 px or 10 ppt 134 | 135 | # back to normal: Enter or Escape 136 | bindsym Return mode "default" 137 | bindsym Escape mode "default" 138 | } 139 | 140 | bindsym $mod+r mode "resize" 141 | 142 | # m1 143 | bindsym XF86Tools exec "rofi -show calc -modi calc -no-show-match -no-sort" 144 | # m2 145 | bindsym XF86Launch5 exec "spotify" 146 | # m3 147 | bindsym XF86Launch6 exec "steam" 148 | # m4 149 | bindsym XF86Launch7 exec "thunderbird" 150 | # m5 151 | bindsym XF86Launch8 exec "pavucontrol" 152 | 153 | bindsym Mod1 + l exec "i3lock -c 000000" 154 | 155 | # MPD control using media keys 156 | bindsym XF86AudioPrev exec --no-startup-id "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" 157 | bindsym XF86AudioPlay exec --no-startup-id "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" 158 | bindsym XF86AudioNext exec --no-startup-id "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" 159 | 160 | mode "spotify" { 161 | bindsym Left exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" 162 | bindsym Up exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" 163 | bindsym Right exec "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" 164 | 165 | # back to normal: Enter or Escape 166 | bindsym Return mode "default" 167 | bindsym Escape mode "default" 168 | } 169 | 170 | bindsym XF86MonBrightnessUp exec "xbacklight -inc 5" 171 | bindsym XF86MonBrightnessDown exec "xbacklight -dec 5" 172 | 173 | bindsym $mod+m mode "spotify" 174 | 175 | # Pulse Audio controls 176 | bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% #increase sound volume 177 | bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% #decrease sound volume 178 | bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle # mute sound 179 | bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle # mute mic 180 | 181 | # Scratchpad 182 | bindsym $mod+Shift+minus move scratchpad 183 | bindsym $mod+minus scratchpad show 184 | 185 | # Start i3bar to display a workspace bar (plus the system information i3status 186 | # finds out, if available) 187 | bar { 188 | status_command i3status 189 | strip_workspace_numbers yes 190 | } 191 | -------------------------------------------------------------------------------- /.vimrc: -------------------------------------------------------------------------------- 1 | "colors 2 | colorscheme jellybeans 3 | 4 | call plug#begin('~/.vim/plugged') 5 | 6 | " Group dependencies, vim-snippets depends on ultisnips 7 | Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' 8 | 9 | Plug 'w0rp/ale' 10 | 11 | " style 12 | Plug 'bling/vim-airline' 13 | Plug 'vim-airline/vim-airline-themes' 14 | 15 | " Shows git diff in a sign column 16 | Plug 'airblade/vim-gitgutter' 17 | 18 | " Git integration 19 | Plug 'tpope/vim-fugitive' 20 | 21 | " NERD tree will be loaded on the first invocation of NERDTreeToggle command 22 | Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } 23 | 24 | " Completion 25 | Plug 'maralla/completor.vim', {'do': 'make js'} 26 | 27 | " formatting 28 | Plug 'tpope/vim-surround' 29 | Plug 'tpope/vim-commentary' 30 | 31 | Plug 'editorconfig/editorconfig-vim' 32 | 33 | Plug 'vimwiki/vimwiki', {'on' : ['VimwikiIndex', 'VimwikiUISelect'], 'for': 'wiki' } 34 | Plug 'mattn/calendar-vim' 35 | 36 | Plug 'junegunn/fzf.vim' 37 | 38 | Plug 'rust-lang/rust.vim' 39 | Plug 'togglebyte/togglerust', { 'branch': 'main' } 40 | 41 | " Add plugins to &runtimepath 42 | call plug#end() 43 | 44 | filetype plugin indent on 45 | 46 | " Debug support 47 | packadd termdebug 48 | 49 | " Autocmd options 50 | " "-------------------------------- 51 | autocmd BufReadPost *.doc silent %!antiword "%" 52 | autocmd BufWriteCmd *.doc set readonly 53 | autocmd BufReadPost *.odt,*.odp silent %!odt2txt "%" 54 | autocmd BufWriteCmd *.odt set readonly 55 | autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk -layout -q -eol unix "%" - | fmt -w78 56 | autocmd BufWriteCmd *.pdf set readonly 57 | autocmd BufReadPost *.rtf silent %!unrtf --text "%" 58 | autocmd BufWriteCmd *.rtf set readonly 59 | autocmd BufRead,BufNewFile ~/.mutt/tmp/* set filetype=mail | set textwidth=72 | set spell | set wrap | setlocal spell spelllang=nl,en 60 | 61 | " Completor.vim 62 | inoremap pumvisible() ? "\" : "\" 63 | inoremap pumvisible() ? "\" : "\" 64 | inoremap pumvisible() ? "\\" : "\" 65 | 66 | " Search 67 | " ------------------------------- 68 | set hlsearch 69 | 70 | let g:UltiSnipsExpandTrigger="" 71 | let g:UltiSnipsJumpForwardTrigger="" 72 | let g:UltiSnipsJumpBackwardTrigger="" 73 | let g:UltiSnipsListSnippets = "" "List possible snippets based on current file 74 | 75 | " fugitive git bindings 76 | " http://www.reddit.com/r/vim/comments/21f4gm/best_workflow_when_using_fugitive/ 77 | nnoremap ga :Git add %:p 78 | nnoremap gs :Git 79 | nnoremap gc :Git commit -v -q 80 | nnoremap gt :Git commit -v -q %:p 81 | nnoremap gd :Gdiff 82 | nnoremap ge :Gedit 83 | nnoremap gr :Gread 84 | nnoremap gw :Gwrite 85 | nnoremap gl :silent! Glog:bot copen 86 | nnoremap gp :Ggrep 87 | nnoremap gm :Gmove 88 | nnoremap gb :Git branch 89 | nnoremap go :Git checkout 90 | nnoremap gps :Git push 91 | nnoremap gpl :Git pull 92 | nnoremap gf :GFiles 93 | 94 | " Vim-airline 95 | " ------------------------------- 96 | 97 | let g:airline#extensions#tabline#enabled = 1 98 | set laststatus=2 99 | let g:airline_powerline_fonts = 1 100 | let g:airline_theme = 'jellybeans' 101 | let g:airline_skip_empty_sections = 1 102 | 103 | syntax on 104 | 105 | " Mouse 106 | if has('mouse') 107 | set mouse=a 108 | set mousemodel=popup_setpos 109 | endif 110 | 111 | " GUI Options GVIM 112 | set guioptions-=mrL 113 | 114 | " Set max tabs to 20 115 | set tabpagemax=20 116 | 117 | set pastetoggle= 118 | 119 | " indenting 120 | set cindent 121 | set smartindent 122 | set autoindent 123 | set complete+=s 124 | 125 | " Spell 126 | set spell spelllang=nl,en 127 | set nospell 128 | let g:tex_comment_nospell= 1 129 | 130 | "open matches from a file preview in a new tab 131 | set switchbuf+=newtab 132 | 133 | " sh stuff 134 | autocmd FileType sh set expandtab shiftwidth=2 softtabstop=4 135 | 136 | " html 137 | autocmd Filetype html setlocal ts=2 sts=2 sw=2 138 | 139 | " LaTeX 140 | autocmd Filetype tex,latex set grepprg=grep\ -nH\ $ 141 | autocmd Filetype tex,latex setlocal spell 142 | autocmd Filetype tex,latex set grepprg=grep\ -nH\ $ 143 | autocmd Filetype tex,latex let g:tex_flavor = "latex" 144 | 145 | " yaml 146 | au! BufNewFile,BufReadPost *.{yaml,yml} set filetype=yaml foldmethod=indent 147 | autocmd FileType yaml setlocal ts=4 sts=4 sw=4 expandtab 148 | 149 | " workaround snippets not working https://github.com/honza/vim-snippets/issues/1362 150 | au! BufNewFile,BufReadPost *.jsx set filetype=javascript foldmethod=indent 151 | 152 | " ALE 153 | " ------------------------------ 154 | let g:ale_sign_column_always = 1 155 | let g:ale_sign_error = '✘' 156 | let g:ale_sign_warning = '⚠' 157 | let g:ale_statusline_format = ['✘ %d', '⚠ %d', ''] 158 | let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' 159 | let g:ale_completion_enabled = 1 160 | let g:ale_fix_on_save = 1 161 | " Set this. Airline will handle the rest. 162 | let g:airline#extensions#ale#enabled = 1 163 | 164 | let g:ale_linters = {} 165 | let g:ale_fixers = {} 166 | " Requires pyright flake8 bandit 167 | let g:ale_linters.python = ['flake8', 'bandit', 'pyright'] 168 | let g:ale_fixers.python = ['trim_whitespace', 'autopep8'] 169 | 170 | " Requires: rust-analyzer 171 | let g:ale_linters.rust = ['analyzer'] 172 | 173 | " Requires: gopls 174 | let g:ale_linters.golang = ['gopls', 'gofmt'] 175 | let g:ale_fixers.golang = ['gofmt'] 176 | 177 | " Requires: clangd 178 | let g:ale_linters.c = ['clangd'] 179 | 180 | " Requires: shellcheck, bash-language-server 181 | let g:ale_linters.sh = ['shellcheck', 'language_server'] 182 | 183 | let g:ale_linters.javascript = ['tsserver'] 184 | let g:ale_fixers.javascript = ['eslint'] 185 | " Ignore webpack.config.js as it's usually formatted different 186 | let g:ale_javascript_eslint_options = '--ignore-pattern webpack.config.js' 187 | 188 | nmap gd :ALEGoToDefinition 189 | nmap gr :ALEFindReferences 190 | nmap gR :ALERename 191 | nmap gs :ALESymbolSearch 192 | nmap K :ALEHover 193 | 194 | " FZF 195 | nmap F :Files 196 | nnoremap ff :Ag 197 | nnoremap ss :Snippets 198 | 199 | " Gitgutter 200 | autocmd BufWritePost * GitGutter 201 | let g:gitgutter_log=1 202 | let s:grep_available=0 203 | 204 | highlight clear ALEErrorSign 205 | 206 | " completor 207 | inoremap pumvisible() ? "\" : "\" 208 | inoremap pumvisible() ? "\" : "\" 209 | inoremap pumvisible() ? "\\" : "\" 210 | 211 | nmap (ale_previous_wrap) 212 | nmap (ale_next_wrap) 213 | 214 | nnoremap \\ :NERDTreeToggle 215 | 216 | " format json 217 | nnoremap json :%! python -m json.tool 218 | 219 | let g:calendar_diary=$HOME.'/Notes/diary' 220 | 221 | "{{{3 vimwiki:main 222 | let main_wiki = {} 223 | let main_wiki.path = '~/Notes/' 224 | let main_wiki.path_html = '~/.cache/vimwiki/main/html' 225 | let main_wiki.automatic_nested_syntaxes = 1 226 | let main_wiki.list_margin = 0 227 | let main_wiki.ext = '.md' 228 | let main_wiki.syntax = 'markdown' 229 | " TODO: https://cristianpb.github.io/blog/vimwiki-hugo 230 | let main_wiki.custom_wiki2html = '$HOME/bin/wiki2html.sh' 231 | let main_wiki.template_ext = '.html' 232 | "}}} 233 | "{{{3 vimwiki:blog 234 | let blog_wiki = {} 235 | let blog_wiki.path = '~/projects/website/' 236 | let blog_wiki.automatic_nested_syntaxes = 1 237 | let blog_wiki.list_margin = 0 238 | let blog_wiki.ext = '.md' 239 | let blog_wiki.syntax = 'markdown' 240 | "}}} 241 | "{{{ vimwiki 242 | let g:vimwiki_hl_headers = 1 243 | let g:vimwiki_hl_cb_checked = 1 244 | let g:vimwiki_use_calendar=1 245 | let g:vimwiki_listsyms = ' x' 246 | let g:vimwiki_folding = '' 247 | let g:vimwiki_list = [main_wiki, blog_wiki] 248 | "}}} 249 | -------------------------------------------------------------------------------- /.vim/colors/candycode.vim: -------------------------------------------------------------------------------- 1 | " Vim color file -- candycode 2 | " Maintainer: Justin Constantino 3 | " Last Change: 2006 Aug 12 4 | 5 | set background=dark 6 | highlight clear 7 | let g:colors_name="candycode" 8 | 9 | let save_cpo = &cpo 10 | set cpo&vim 11 | 12 | " basic highlight groups (:help highlight-groups) {{{ 13 | 14 | " text {{{ 15 | 16 | hi Normal guifg=#ffffff guibg=#050505 gui=NONE 17 | \ ctermfg=white ctermbg=black cterm=NONE 18 | 19 | hi Folded guifg=#c2bfa5 guibg=#050505 gui=underline 20 | \ ctermfg=lightgray ctermbg=black cterm=underline 21 | 22 | hi LineNr guifg=#928c75 guibg=NONE gui=NONE 23 | \ ctermfg=darkgray ctermbg=NONE cterm=NONE 24 | 25 | hi Directory guifg=#00bbdd guibg=NONE gui=NONE 26 | \ ctermfg=cyan ctermbg=NONE cterm=NONE 27 | hi NonText guifg=#77ff22 guibg=NONE gui=bold 28 | \ ctermfg=yellow ctermbg=NONE cterm=NONE 29 | hi SpecialKey guifg=#559933 guibg=NONE gui=NONE 30 | \ ctermfg=green ctermbg=NONE cterm=NONE 31 | 32 | hi SpellBad guifg=NONE guibg=NONE gui=undercurl 33 | \ ctermfg=white ctermbg=darkred guisp=#ff0011 34 | hi SpellCap guifg=NONE guibg=NONE gui=undercurl 35 | \ ctermfg=white ctermbg=darkblue guisp=#0044ff 36 | hi SpellLocal guifg=NONE guibg=NONE gui=undercurl 37 | \ ctermfg=black ctermbg=cyan guisp=#00dd99 38 | hi SpellRare guifg=NONE guibg=NONE gui=undercurl 39 | \ ctermfg=white ctermbg=darkmagenta guisp=#ff22ee 40 | 41 | hi DiffAdd guifg=#ffffff guibg=#126493 gui=NONE 42 | \ ctermfg=white ctermbg=darkblue cterm=NONE 43 | hi DiffChange guifg=#000000 guibg=#976398 gui=NONE 44 | \ ctermfg=black ctermbg=darkmagenta cterm=NONE 45 | hi DiffDelete guifg=#000000 guibg=#be1923 gui=bold 46 | \ ctermfg=black ctermbg=red cterm=bold 47 | hi DiffText guifg=#ffffff guibg=#976398 gui=bold 48 | \ ctermfg=white ctermbg=green cterm=bold 49 | 50 | " }}} 51 | " borders / separators / menus {{{ 52 | 53 | hi FoldColumn guifg=#c8bcb9 guibg=#786d65 gui=bold 54 | \ ctermfg=lightgray ctermbg=darkgray cterm=NONE 55 | hi SignColumn guifg=#c8bcb9 guibg=#786d65 gui=bold 56 | \ ctermfg=lightgray ctermbg=darkgray cterm=NONE 57 | 58 | hi Pmenu guifg=#000000 guibg=#a6a190 gui=NONE 59 | \ ctermfg=white ctermbg=darkgray cterm=NONE 60 | hi PmenuSel guifg=#ffffff guibg=#133293 gui=NONE 61 | \ ctermfg=white ctermbg=lightblue cterm=NONE 62 | hi PmenuSbar guifg=NONE guibg=#555555 gui=NONE 63 | \ ctermfg=black ctermbg=black cterm=NONE 64 | hi PmenuThumb guifg=NONE guibg=#cccccc gui=NONE 65 | \ ctermfg=gray ctermbg=gray cterm=NONE 66 | 67 | hi StatusLine guifg=#000000 guibg=#c2bfa5 gui=bold 68 | \ ctermfg=black ctermbg=white cterm=bold 69 | hi StatusLineNC guifg=#444444 guibg=#c2bfa5 gui=NONE 70 | \ ctermfg=darkgray ctermbg=white cterm=NONE 71 | hi WildMenu guifg=#ffffff guibg=#133293 gui=bold 72 | \ ctermfg=white ctermbg=darkblue cterm=bold 73 | hi VertSplit guifg=#c2bfa5 guibg=#c2bfa5 gui=NONE 74 | \ ctermfg=white ctermbg=white cterm=NONE 75 | 76 | hi TabLine guifg=#000000 guibg=#c2bfa5 gui=NONE 77 | \ ctermfg=black ctermbg=white cterm=NONE 78 | hi TabLineFill guifg=#000000 guibg=#c2bfa5 gui=NONE 79 | \ ctermfg=black ctermbg=white cterm=NONE 80 | hi TabLineSel guifg=#ffffff guibg=#133293 gui=NONE 81 | \ ctermfg=white ctermbg=black cterm=NONE 82 | 83 | "hi Menu 84 | "hi Scrollbar 85 | "hi Tooltip 86 | 87 | " }}} 88 | " cursor / dynamic / other {{{ 89 | 90 | hi Cursor guifg=#000000 guibg=#ffff99 gui=NONE 91 | \ ctermfg=black ctermbg=white cterm=NONE 92 | hi CursorIM guifg=#000000 guibg=#aaccff gui=NONE 93 | \ ctermfg=black ctermbg=white cterm=reverse 94 | hi CursorLine guifg=NONE guibg=#1b1b1b gui=NONE 95 | \ ctermfg=NONE ctermbg=NONE cterm=NONE 96 | hi CursorColumn guifg=NONE guibg=#1b1b1b gui=NONE 97 | \ ctermfg=NONE ctermbg=NONE cterm=NONE 98 | 99 | hi Visual guifg=#ffffff guibg=#606070 gui=NONE 100 | \ ctermfg=white ctermbg=lightblue cterm=NONE 101 | 102 | hi IncSearch guifg=#000000 guibg=#eedd33 gui=bold 103 | \ ctermfg=white ctermbg=yellow cterm=NONE 104 | hi Search guifg=#efefd0 guibg=#937340 gui=NONE 105 | \ ctermfg=white ctermbg=darkgreen cterm=NONE 106 | 107 | hi MatchParen guifg=NONE guibg=#3377aa gui=NONE 108 | \ ctermfg=white ctermbg=blue cterm=NONE 109 | 110 | "hi VisualNOS 111 | 112 | " }}} 113 | " listings / messages {{{ 114 | 115 | hi ModeMsg guifg=#eecc18 guibg=NONE gui=NONE 116 | \ ctermfg=yellow ctermbg=NONE cterm=NONE 117 | hi Title guifg=#dd4452 guibg=NONE gui=bold 118 | \ ctermfg=red ctermbg=NONE cterm=bold 119 | hi Question guifg=#66d077 guibg=NONE gui=NONE 120 | \ ctermfg=green ctermbg=NONE cterm=NONE 121 | hi MoreMsg guifg=#39d049 guibg=NONE gui=NONE 122 | \ ctermfg=green ctermbg=NONE cterm=NONE 123 | 124 | hi ErrorMsg guifg=#ffffff guibg=#ff0000 gui=bold 125 | \ ctermfg=white ctermbg=red cterm=bold 126 | hi WarningMsg guifg=#ccae22 guibg=NONE gui=bold 127 | \ ctermfg=yellow ctermbg=NONE cterm=bold 128 | 129 | " }}} 130 | 131 | " }}} 132 | " syntax highlighting groups (:help group-name) {{{ 133 | 134 | hi Comment guifg=#ff9922 guibg=NONE gui=NONE 135 | \ ctermfg=brown ctermbg=NONE cterm=NONE 136 | 137 | hi Constant guifg=#ff6050 guibg=NONE gui=NONE 138 | \ ctermfg=red ctermbg=NONE cterm=NONE 139 | hi Boolean guifg=#ff6050 guibg=NONE gui=bold 140 | \ ctermfg=red ctermbg=NONE cterm=bold 141 | 142 | hi Identifier guifg=#eecc44 guibg=NONE gui=NONE 143 | \ ctermfg=yellow ctermbg=NONE cterm=NONE 144 | 145 | hi Statement guifg=#66d077 guibg=NONE gui=bold 146 | \ ctermfg=green ctermbg=NONE cterm=bold 147 | 148 | hi PreProc guifg=#bb88dd guibg=NONE gui=NONE 149 | \ ctermfg=darkmagenta ctermbg=NONE cterm=NONE 150 | 151 | hi Type guifg=#4093cc guibg=NONE gui=bold 152 | \ ctermfg=lightblue ctermbg=NONE cterm=bold 153 | 154 | hi Special guifg=#9999aa guibg=NONE gui=bold 155 | \ ctermfg=lightgray ctermbg=NONE cterm=bold 156 | 157 | hi Underlined guifg=#80a0ff guibg=NONE gui=underline 158 | \ ctermfg=NONE ctermbg=NONE cterm=underline 159 | \ term=underline 160 | 161 | hi Ignore guifg=#888888 guibg=NONE gui=NONE 162 | \ ctermfg=darkgray ctermbg=NONE cterm=NONE 163 | 164 | hi Error guifg=#ffffff guibg=#ff0000 gui=NONE 165 | \ ctermfg=white ctermbg=red cterm=NONE 166 | 167 | hi Todo guifg=#ffffff guibg=#ee7700 gui=bold 168 | \ ctermfg=black ctermbg=yellow cterm=bold 169 | 170 | " }}} 171 | 172 | let &cpo = save_cpo 173 | 174 | " vim: fdm=marker fdl=0 175 | -------------------------------------------------------------------------------- /bin/arch-spdx-statistics: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from license_expression import BaseSymbol, LicenseSymbol, LicenseWithExceptionSymbol, get_spdx_licensing 4 | 5 | import json 6 | import subprocess 7 | import sys 8 | from pathlib import Path 9 | 10 | 11 | licensing = get_spdx_licensing() 12 | 13 | 14 | def get_license_canonicalized(license: str) -> str: 15 | """Get the canonicalized form of a license string 16 | 17 | This function may raise an Exception if it's not possible to derive any meaning from the input string 18 | """ 19 | return str(licensing.parse(license, strict=True)) 20 | 21 | 22 | def strip_plus_from_license(license: BaseSymbol) -> BaseSymbol: 23 | """Remove a "+" suffix from the license symbol if it contains one 24 | 25 | The license_expression module does not support the SPDX "+" operator, but parses it as part of the license 26 | symbol instead. This function strips the operator from the symbol if it is found. 27 | 28 | License identifiers ending with "-only" or "-or-later" should not be used with the plus operator. If such 29 | license identifier is detected, the plus operator is left intact and this will be later reported as an 30 | unknown license symbol. 31 | """ 32 | license_str = str(license) 33 | if license_str[-1] != "+" or license_str.startswith("LicenseRef-"): 34 | return license 35 | license_id = license_str[:-1] 36 | if license_id.endswith(("-only", "-or-later")): 37 | return license 38 | else: 39 | return LicenseSymbol(license_id) 40 | 41 | 42 | def get_license_symbols(pkg_license: str) -> set[BaseSymbol]: 43 | """Extract all license symbols from a license string 44 | 45 | This function may raise an Exception if it's not possible to derive any meaning from the input string. 46 | This may be due to being unable to parse the string at all or if a license exception in the string is not a valid 47 | SPDX license exception identifier. 48 | """ 49 | if (license_expression := licensing.parse(pkg_license, strict=True)) is None: 50 | raise ValueError("Empty license string") 51 | license_symbols: set[BaseSymbol] = set() 52 | for symbol in license_expression.symbols: 53 | if isinstance(symbol, LicenseWithExceptionSymbol): 54 | license, exception = list(symbol.decompose()) 55 | license = strip_plus_from_license(license) 56 | license_symbols.add(LicenseWithExceptionSymbol(license, exception)) 57 | else: 58 | license_symbols.add(strip_plus_from_license(symbol)) 59 | return license_symbols 60 | 61 | 62 | def get_common_spdx_license_identifiers() -> set[BaseSymbol]: 63 | """Get all common license identifiers (those that are provided system-wide and can be shared)""" 64 | common: list[BaseSymbol] = [ 65 | LicenseSymbol(f"{x.stem}") for x in sorted(Path("/usr/share/licenses/spdx/").glob("*.txt")) if x.is_file() 66 | ] 67 | return set(common) 68 | 69 | 70 | def get_common_spdx_license_exceptions() -> set[BaseSymbol]: 71 | """Get all common license exceptions (those that are provided system-wide and can be shared)""" 72 | common: list[BaseSymbol] = [ 73 | LicenseSymbol(f"{x.stem}", is_exception=True) 74 | for x in sorted(Path("/usr/share/licenses/spdx/exceptions/").glob("*.txt")) 75 | if x.is_file() 76 | ] 77 | return set(common) 78 | 79 | 80 | def get_known_spdx_license_identifiers() -> set[BaseSymbol]: 81 | """Get all known SPDX license identifiers""" 82 | all_spdx_licenses: list[BaseSymbol] = [] 83 | 84 | with open("/usr/share/licenses/known_spdx_license_identifiers.txt") as file: 85 | while line := file.readline(): 86 | all_spdx_licenses.append(LicenseSymbol(line.rstrip("\n"))) 87 | 88 | return set(all_spdx_licenses) 89 | 90 | 91 | def get_known_spdx_license_exceptions() -> set[BaseSymbol]: 92 | """Get all known SPDX license exceptions""" 93 | all_spdx_licenses: list[BaseSymbol] = [] 94 | 95 | with open("/usr/share/licenses/known_spdx_license_exceptions.txt") as file: 96 | while line := file.readline(): 97 | all_spdx_licenses.append(LicenseSymbol(line.rstrip("\n"), is_exception=True)) 98 | 99 | return set(all_spdx_licenses) 100 | 101 | 102 | def get_uncommon_license_symbols( 103 | licenses: set[BaseSymbol], 104 | known_licenses: set[BaseSymbol], 105 | known_exceptions: set[BaseSymbol], 106 | common_licenses: set[BaseSymbol], 107 | common_exceptions: set[BaseSymbol], 108 | ) -> set[BaseSymbol]: 109 | """Get the set of all uncommon licenses from a set of licenses 110 | 111 | This function compares against all uncommon, but known SPDX license symbols (those that require a custom file) or 112 | those prefixed with "LicenseRef-". 113 | When encountering LicenseWithExceptionSymbols, both the LicenseSymbol and the exception are checked. 114 | """ 115 | uncommon_licenses = known_licenses - common_licenses 116 | uncommon_exceptions = known_exceptions - common_exceptions 117 | 118 | uncommon_symbols: list[BaseSymbol] = [] 119 | for symbol in licenses: 120 | # if the symbol also carries an exception match license symbol and exception symbol separately 121 | if isinstance(symbol, LicenseWithExceptionSymbol): 122 | license, exception = list(symbol.decompose()) 123 | if license in uncommon_licenses or str(license).startswith("LicenseRef-"): 124 | uncommon_symbols.append(license) 125 | if exception in uncommon_exceptions or str(exception).startswith("LicenseRef-"): 126 | uncommon_symbols.append(exception) 127 | else: 128 | if symbol in uncommon_licenses or str(list(symbol.decompose())[0]).startswith("LicenseRef-"): 129 | uncommon_symbols.append(symbol) 130 | 131 | return set(uncommon_symbols) 132 | 133 | 134 | def get_unknown_license_symbols( 135 | licenses: set[BaseSymbol], known_licenses: set[BaseSymbol], known_exceptions: set[BaseSymbol] 136 | ) -> set[BaseSymbol]: 137 | """Get the set of all unknown license symbols from a set of licenses 138 | 139 | This function also evaluates LicenseWithExceptionSymbols and considers licenses and exceptions separately. 140 | """ 141 | unknown_symbols: list[BaseSymbol] = [] 142 | for symbol in licenses: 143 | # if the symbol also carries an exception match license symbol and exception symbol separately 144 | if isinstance(symbol, LicenseWithExceptionSymbol): 145 | license, exception = list(symbol.decompose()) 146 | if license not in known_licenses: 147 | unknown_symbols.append(symbol) 148 | if exception not in known_exceptions: 149 | unknown_symbols.append(symbol) 150 | else: 151 | if symbol not in known_licenses: 152 | unknown_symbols.append(symbol) 153 | 154 | return set(unknown_symbols) 155 | 156 | 157 | def get_pkgname_license() -> dict[str, list[str]]: 158 | packages: dict[str, list[str]] = {} 159 | output = subprocess.check_output(['expac', '-S', '-l %', '%e|%L']).decode() 160 | for line in output.splitlines(): 161 | pkgbase, license_str = line.split('|') 162 | licenses = license_str.split('%') 163 | packages[pkgbase] = licenses 164 | 165 | return packages 166 | 167 | def main(): 168 | invalid = set() 169 | unknown = set() 170 | 171 | 172 | known_licenses = get_known_spdx_license_identifiers() 173 | known_exceptions = get_known_spdx_license_exceptions() 174 | 175 | for pkgbase, licenses in get_pkgname_license().items(): 176 | # print(pkgbase, licenses) 177 | license_symbols: set[BaseSymbol] = set() 178 | for license in licenses: 179 | try: 180 | new_license_symbols = get_license_symbols(license) 181 | license_symbols.update(new_license_symbols) 182 | except Exception as exc: 183 | print(f'{pkgbase} has an invalid spdx-license "{license} - {exc}', file=sys.stderr) 184 | invalid.add(pkgbase) 185 | 186 | # check if any license (ignoring exception) symbols are unknown 187 | # (and add errors for them, if they are not prefixed with LicenseRef-) 188 | for license in get_unknown_license_symbols(license_symbols, known_licenses, known_exceptions): 189 | if not str(license).startswith("LicenseRef-"): 190 | print(f'{pkgbase} has unknown spdx license identifer "{license}', file=sys.stderr) 191 | unknown.add(pkgbase) 192 | 193 | 194 | print(f'Summary, invalid: {len(invalid)} unknown: {len(unknown)}', file=sys.stderr) 195 | print(json.dumps({'unknown': list(unknown), 'invalid': list(invalid)})) 196 | 197 | 198 | if __name__ == "__main__": 199 | main() 200 | 201 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | #------------------------------ 2 | # History stuff 3 | #------------------------------ 4 | HISTFILE=~/.histfile 5 | HISTSIZE=200000 6 | SAVEHIST=50000 7 | 8 | #------------------------------ 9 | # Variables 10 | #------------------------------ 11 | 12 | # SLRN 13 | export NNTPSERVER='news.gmane.org' 14 | 15 | export EDITOR=nvim 16 | 17 | export DE=gnome 18 | export LANG=en_GB.UTF-8 19 | 20 | export PATH=$PATH:/home/jelle/bin/ 21 | 22 | # Browser 23 | export BROWSER=firefox 24 | 25 | # I'm a cool kid now 26 | alias vim=nvim 27 | 28 | # my completions 29 | fpath=("$HOME/.zcompletions" "$fpath[@]") 30 | 31 | #------------------------------ 32 | # Keybindings 33 | #------------------------------ 34 | bindkey -v 35 | typeset -g -A key 36 | 37 | bindkey '^[[3~' delete-char 38 | 39 | # Up/Down line history arrow up/down 40 | bindkey '^[[B' down-line-or-history 41 | bindkey '^[[A' up-line-or-search 42 | 43 | # Beginning of line also ctrl+e/a ctrl+up/down 44 | bindkey "^E" end-of-line 45 | bindkey "^A" beginning-of-line 46 | bindkey "^[^?" backward-kill-word 47 | 48 | # Ctrl+r history search 49 | bindkey "^R" history-incremental-search-backward 50 | 51 | # History search (usually up/down key) 52 | bindkey '^P' up-line-or-search 53 | bindkey '^N' down-line-or-search 54 | 55 | bindkey "^[[1;5D" emacs-backward-word 56 | bindkey "^[[1;5C" emacs-forward-word 57 | 58 | #------------------------------ 59 | # History 60 | #------------------------------ 61 | setopt extended_history 62 | setopt inc_append_history 63 | setopt share_history 64 | setopt hist_ignore_dups 65 | setopt hist_ignore_all_dups 66 | setopt hist_expire_dups_first 67 | setopt hist_save_no_dups 68 | setopt hist_ignore_space 69 | setopt hist_verify 70 | 71 | 72 | #------------------------------ 73 | # Alias stuff 74 | #------------------------------ 75 | alias cat="bat" 76 | alias ls="ls --color -F" 77 | alias grep="grep --color=always" 78 | 79 | # cockpit 80 | alias cpf='PYTHONPATH=src python3 -m cockpit.misc.print' 81 | alias cpy='PYTHONPATH=src python3 -m cockpit.bridge' 82 | 83 | # pacman 84 | alias pacup='sudo pacman -Syu ' 85 | alias pacs='pacman -Ss' 86 | alias pacins='sudo pacman -S' 87 | alias pacr='sudo pacman -Rs' 88 | alias pacq='pacman -Q' 89 | alias pacu='sudo pacman -U' 90 | 91 | # vim wiki 92 | alias notes='cd ~/Notes && nvim -c VimwikiIndex' 93 | alias diary='cd ~/Notes/diary/ && nvim -c VimwikiIndex -c VimwikiDiaryIndex' 94 | alias vimwikis='vim -c VimwikiUISelect' 95 | 96 | # moving in dirs 97 | alias ..="cd .." 98 | 99 | #----------------------------- 100 | # Dircolors 101 | #----------------------------- 102 | eval $(dircolors -b $HOME/.dircolors) 103 | 104 | #------------------------------ 105 | # Comp stuff 106 | #------------------------------ 107 | zmodload zsh/complist 108 | autoload -Uz compinit 109 | compinit 110 | zstyle :compinstall filename '${HOME}/.zshrc' 111 | 112 | zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 113 | 114 | zstyle ':completion:*:*:kill:*' menu yes select 115 | zstyle ':completion:*:kill:*' force-list always 116 | 117 | zstyle ':completion:*:*:killall:*' menu yes select 118 | zstyle ':completion:*:killall:*' force-list always 119 | 120 | autoload -U incremental-complete-word predict-on 121 | zle -N incremental-complete-word 122 | zle -N predict-on 123 | zle -N predict-off 124 | bindkey '^X1' predict-on 125 | bindkey '^X2' predict-off 126 | 127 | #------------------------------ 128 | # Functions 129 | #------------------------------ 130 | sprunge() { 131 | if [ -z "$1" ] 132 | then 133 | curl -s -F 'sprunge=<-' http://sprunge.us 134 | else 135 | if [ -z "$2" ] 136 | then 137 | echo -n "$1:" 138 | cat "$1" | "$0" 139 | else 140 | for i in "$@" 141 | do 142 | "$0" "$i" 143 | done 144 | fi 145 | fi 146 | 147 | } 148 | 149 | # svn diff 150 | svndiff() { 151 | svn diff "${@}" | colordiff | less -R 152 | } 153 | 154 | _fetchpr() { 155 | origin=${3:-origin} 156 | ref=$1 157 | branch=$2 158 | program=${funcstack#_fetchpr}; 159 | if (( $# != 2 && $# != 3 )) then 160 | echo usage:$program id branchname \[remote\]; 161 | return 1 162 | fi 163 | 164 | if git rev-parse --git-dir &> /dev/null; then 165 | git fetch $origin $ref && git checkout $branch 166 | else 167 | echo 'error: not in git repo' 168 | fi 169 | } 170 | 171 | # Checkout Github PR function 172 | gitpr() { 173 | github="pull/$1/head:$2" 174 | _fetchpr $github $2 $3 175 | } 176 | 177 | # Checkout Bitbucket PR function 178 | bitpr() { 179 | bitbucket="refs/pull-requests/$1/from:$2" 180 | _fetchpr $bitbucket $2 $3 181 | } 182 | 183 | # Checkout Gitlab MR function 184 | gitmr() { 185 | gitlab="merge-requests/$1/head:$2" 186 | _fetchpr $gitlab $2 $3 187 | } 188 | 189 | cockpit-queue-status() { 190 | curl -s http://webhook-cockpit.apps.ocp.cloud.ci.centos.org/inspect-queue 191 | } 192 | 193 | #------------------------------ 194 | # Window title 195 | #------------------------------ 196 | case $TERM in 197 | *xterm*|rxvt|rxvt-unicode|rxvt-256color|(dt|k|E)term) 198 | precmd () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~]\a" } 199 | preexec () { print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a" } 200 | ;; 201 | screen) 202 | precmd () { 203 | [[ $a = zsh ]] && print -Pn "\ek$2\e\\" # show the path if no program is running 204 | [[ $a != zsh ]] && print -Pn "\ek$a\e\\" # if a program is running show that 205 | 206 | # Terminal title 207 | if [[ -n $STY ]] ; then 208 | [[ $a = zsh ]] && print -Pn "\e]2;$SHORTHOST:S\[$WINDOW\]:$2\a" 209 | [[ $a != zsh ]] && print -Pn "\e]2;$SHORTHOST:S\[$WINDOW\]:${a//\%/\%\%}\a" 210 | elif [[ -n $TMUX ]] ; then 211 | # We're running in tmux, not screen 212 | [[ $a = zsh ]] && print -Pn "\e]2;$SHORTHOST:$2\a" 213 | [[ $a != zsh ]] && print -Pn "\e]2;$SHORTHOST:${a//\%/\%\%}\a" 214 | fi 215 | } 216 | preexec () { 217 | # print -Pn "\e]83;title \"$1\"\a" 218 | # print -Pn "\e]0;$TERM - (%L) [%n@%M]%# [%~] ($1)\a" 219 | } 220 | ;; 221 | esac 222 | 223 | #------------------------------ 224 | # Prompt 225 | #------------------------------ 226 | setprompt () { 227 | # load some modules 228 | autoload -U zsh/terminfo # Used in the colour alias below 229 | # Use colorized output, necessary for prompts and completions. 230 | autoload -U colors && colors 231 | setopt prompt_subst 232 | 233 | # make some aliases for the colours: (coud use normal escap.seq's too) 234 | for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do 235 | eval PR_$color='%{$fg[${(L)color}]%}' 236 | done 237 | PR_NO_COLOR="%{$terminfo[sgr0]%}" 238 | 239 | # Check the UID 240 | if [[ $UID -ge 1000 ]]; then # normal user 241 | eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' 242 | eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}' 243 | elif [[ $UID -eq 0 ]]; then # root 244 | eval PR_USER='${PR_RED}%n${PR_NO_COLOR}' 245 | eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}' 246 | fi 247 | 248 | # Check if we are on SSH or not --{FIXME}-- always goes to |no SSH| 249 | if [[ -f /run/.toolboxenv && -f /run/.containerenv ]]; then 250 | local TOOLBOX_HOSTNAME=$(grep name /run/.containerenv | cut -d'"' -f 2) 251 | eval PR_HOST='${PR_ORANGE}⬢\ ${TOOLBOX_HOSTNAME}${PR_NO_COLOR}' 252 | elif [[ -z "$SSH_CLIENT" || -z "$SSH2_CLIENT" ]]; then 253 | eval PR_HOST='${PR_GREEN}%M${PR_NO_COLOR}' # no SSH 254 | else 255 | eval PR_HOST='${PR_YELLOW}%M${PR_NO_COLOR}' #SSH 256 | fi 257 | # set the prompt 258 | PS1=$'${PR_CYAN}[${PR_USER}${PR_CYAN}@${PR_HOST}${PR_CYAN}][${PR_BLUE}%~${PR_CYAN}]${PR_USER_OP}' 259 | PS2=$'%_>' 260 | } 261 | setprompt 262 | 263 | #------------------------------ 264 | # gpg-agent 265 | #------------------------------ 266 | # Start the gpg-agent if not already running 267 | if ! pgrep -x -u "${USER}" gpg-agent >/dev/null 2>&1; then 268 | gpg-connect-agent /bye >/dev/null 2>&1 269 | fi 270 | 271 | # Set SSH to use gpg-agent 272 | unset SSH_AGENT_PID 273 | if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then 274 | export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" 275 | fi 276 | 277 | # Set GPG TTY 278 | GPG_TTY=$(tty) 279 | export GPG_TTY 280 | 281 | # Refresh gpg-agent tty in case user switches into an X session 282 | gpg-connect-agent updatestartuptty /bye >/dev/null 283 | 284 | # setup zoxide 285 | if command -v zoxide > /dev/null; then 286 | eval "$(zoxide init --cmd j zsh)" 287 | fi 288 | -------------------------------------------------------------------------------- /.xmonad/xmonad.hs: -------------------------------------------------------------------------------- 1 | {- xmonad.hs 2 | - Author: Jelle van der Waa ( jelly1 ) 3 | -} 4 | 5 | -- Import stuff 6 | import XMonad 7 | import qualified XMonad.StackSet as W 8 | import qualified XMonad.StackSet as Z 9 | import qualified Data.Map as M 10 | import XMonad.Util.EZConfig(additionalKeys) 11 | import System.Exit 12 | import Graphics.X11.Xlib 13 | import System.IO 14 | 15 | 16 | -- actions 17 | import XMonad.Actions.CycleWS 18 | import XMonad.Actions.WindowGo 19 | import qualified XMonad.Actions.Submap as SM 20 | import XMonad.Actions.GridSelect 21 | import XMonad.Actions.FloatKeys 22 | import XMonad.Actions.Submap 23 | 24 | -- utils 25 | 26 | import XMonad.Util.Run 27 | import qualified XMonad.Prompt as P 28 | import XMonad.Prompt.Shell 29 | import XMonad.Prompt 30 | import XMonad.Prompt.AppendFile (appendFilePrompt) 31 | import XMonad.Prompt.RunOrRaise 32 | import XMonad.Util.NamedWindows (getName) 33 | import Graphics.X11.ExtraTypes.XF86 34 | import XMonad.Util.Scratchpad 35 | import XMonad.Util.NamedScratchpad 36 | 37 | -- hooks 38 | import XMonad.Hooks.DynamicLog 39 | import XMonad.Hooks.ManageDocks 40 | import XMonad.Hooks.UrgencyHook 41 | import XMonad.Hooks.ManageHelpers 42 | import XMonad.Hooks.SetWMName 43 | 44 | -- layouts 45 | import XMonad.Layout.NoBorders 46 | import XMonad.Layout.ResizableTile 47 | import XMonad.Layout.Reflect 48 | import XMonad.Layout.IM 49 | import XMonad.Layout.Tabbed 50 | import XMonad.Layout.PerWorkspace (onWorkspace) 51 | import XMonad.Layout.Grid 52 | import XMonad.Layout.ComboP 53 | import XMonad.Layout.Column 54 | import XMonad.Layout.Named 55 | import XMonad.Layout.TwoPane 56 | 57 | -- Data.Ratio for IM layout 58 | import Data.Ratio ((%)) 59 | import Data.List (isInfixOf) 60 | 61 | import XMonad.Hooks.EwmhDesktops 62 | 63 | 64 | -- Main -- 65 | main = do 66 | xmproc <- spawnPipe "xmobar" 67 | spawn "sh /home/jelle/.xmonad/autostart.sh" 68 | xmonad $ withUrgencyHook NoUrgencyHook $ defaultConfig { 69 | manageHook = myManageHook 70 | , layoutHook = myLayoutHook 71 | , borderWidth = myBorderWidth 72 | , normalBorderColor = myNormalBorderColor 73 | , focusedBorderColor = myFocusedBorderColor 74 | , keys = myKeys 75 | , modMask = myModMask 76 | , terminal = myTerminal 77 | , workspaces = myWorkspaces 78 | , focusFollowsMouse = False 79 | , logHook = dynamicLogWithPP $ xmobarPP { ppOutput = hPutStrLn xmproc , ppTitle = xmobarColor "green" "" . shorten 50} 80 | , startupHook = ewmhDesktopsStartup >> setWMName "LG3D" 81 | } 82 | 83 | 84 | -- hooks 85 | -- automaticly switching app to workspace 86 | myManageHook :: ManageHook 87 | myManageHook = composeAll 88 | [ isFullscreen --> doFullFloat 89 | , className =? "Xmessage" --> doCenterFloat 90 | , className =? "Xfce4-notifyd" --> doIgnore 91 | , className =? "stalonetray" --> doIgnore 92 | , className =? "Gimp" --> doShift "9:gimp" 93 | , className =? "Thunderbird" --> doShift "2:web" 94 | , className =? "Pidgin" --> doShift "1:chat" 95 | , className =? "Skype" --> doShift "1:chat" 96 | , className =? "MPlayer" --> doShift "8:vid" 97 | , className =? "mplayer2" --> doShift "8:vid" 98 | , className =? "mpv" --> doShift "8:vid" 99 | , className =? "rdesktop" --> doShift "6:vm" 100 | , className =? "spicec" --> doShift "6:vm" 101 | , className =? "qemu-system-x86_64" --> doShift "6:vm" 102 | , className =? "Wine" --> doShift "7:games" 103 | , className =? "Crossover" --> doShift "7:games" 104 | , className =? "Steam" --> doShift "7:games" 105 | , className =? "SeamlessRDP" --> doShift "5:doc" 106 | , className =? "Calibre-gui" --> doShift "5:doc" 107 | , className =? "Spotify" --> doShift "10:spotify" 108 | , fmap ("libreoffice" `isInfixOf`) className --> doShift "5:doc" 109 | , className =? "MPlayer" --> (ask >>= doF . W.sink) 110 | , manageDocks 111 | , scratchpadManageHook (W.RationalRect 0.125 0.25 0.75 0.5) 112 | ] 113 | 114 | -- scratchpads 115 | scratchpads = [ NS "gvim" "gvim -S ~/.vim/sessions/Session.vim" (className =? "Gvim") (customFloating $ W.RationalRect (0) (0) (0) (0)) ] 116 | 117 | 118 | --logHook 119 | myLogHook :: Handle -> X () 120 | myLogHook h = dynamicLogWithPP $ customPP { ppOutput = hPutStrLn h } 121 | 122 | ---- Looks -- 123 | ---- bar 124 | customPP :: PP 125 | customPP = defaultPP { 126 | ppHidden = xmobarColor "#00FF00" "" 127 | , ppCurrent = xmobarColor "#FF0000" "" . wrap "[" "]" 128 | , ppUrgent = xmobarColor "#FF0000" "" . wrap "*" "*" 129 | , ppLayout = xmobarColor "#FF0000" "" 130 | , ppTitle = xmobarColor "#00FF00" "" . shorten 80 131 | , ppSep = " | " 132 | } 133 | 134 | -- some nice colors for the prompt windows to match the dzen status bar. 135 | myXPConfig = defaultXPConfig 136 | { 137 | font = "-*-terminus-*-*-*-*-12-*-*-*-*-*-*-u" 138 | ,fgColor = "#0096d1" 139 | , bgColor = "#000000" 140 | , bgHLight = "#000000" 141 | , fgHLight = "#FF0000" 142 | , position = Top 143 | , historySize = 512 144 | , showCompletionOnTab = True 145 | , historyFilter = deleteConsecutive 146 | } 147 | 148 | 149 | 150 | --LayoutHook 151 | myLayoutHook = onWorkspace "1:chat" imLayout $ onWorkspace "6:VM" fullL $ onWorkspace "8:vid" fullL $ onWorkspace "7:games" fullL $ standardLayouts 152 | where 153 | standardLayouts = avoidStruts $ (tiled ||| reflectTiled ||| Mirror tiled ||| Grid ||| Full) 154 | 155 | --Layouts 156 | tiled = smartBorders (ResizableTall 1 (2/100) (1/2) []) 157 | reflectTiled = (reflectHoriz tiled) 158 | full = noBorders Full 159 | 160 | --Im Layout 161 | --Show pidgin tiled left and skype right 162 | imLayout = avoidStruts $ smartBorders $ withIM ratio pidginRoster $ reflectHoriz $ withIM skypeRatio skypeRoster (tiled ||| reflectTiled ||| Grid) where 163 | chatLayout = Grid 164 | ratio = (1%9) 165 | skypeRatio = (1%8) 166 | pidginRoster = And (ClassName "Pidgin") (Role "buddy_list") 167 | skypeRoster = (ClassName "Skype") `And` 168 | (Not (Title "Options")) `And` 169 | (Not (Role "Chats")) `And` 170 | (Not (Role "CallWindowForm")) 171 | --Weblayout 172 | webL = avoidStruts $ full ||| tiled ||| reflectHoriz tiled 173 | 174 | --VirtualLayout 175 | fullL = avoidStruts $ full 176 | 177 | 178 | 179 | ------------------------------------------------------------------------------- 180 | ---- Terminal -- 181 | myTerminal :: String 182 | myTerminal = "termite" 183 | 184 | 185 | ------------------------------------------------------------------------------- 186 | -- Keys/Button bindings -- 187 | -- modmask 188 | myModMask :: KeyMask 189 | myModMask = mod4Mask 190 | 191 | 192 | -- borders 193 | myBorderWidth :: Dimension 194 | myBorderWidth = 1 195 | myNormalBorderColor, myFocusedBorderColor :: String 196 | myNormalBorderColor = "#333333" 197 | myFocusedBorderColor = "#306EFF" 198 | 199 | --Workspaces 200 | myWorkspaces :: [WorkspaceId] 201 | myWorkspaces = ["1:chat", "2:web", "3:code", "4:pdf", "5:doc", "6:vm" ,"7:games", "8:vid", "9:gimp","10:spotify"] 202 | 203 | 204 | -- keys 205 | myKeys :: XConfig Layout -> M.Map (KeyMask, KeySym) (X ()) 206 | myKeys conf@(XConfig {XMonad.modMask = modMask}) = M.fromList $ 207 | -- killing programs 208 | [ ((modMask, xK_Return), spawn $ XMonad.terminal conf) 209 | , ((modMask .|. shiftMask, xK_c ), kill) 210 | 211 | -- opening program launcher / search engine 212 | ,((modMask , xK_p), shellPrompt myXPConfig) 213 | 214 | -- GridSelect 215 | , ((modMask, xK_g), goToSelected defaultGSConfig) 216 | 217 | -- Display key 218 | --, ("", spawn "xrandr --auto") 219 | 220 | -- layouts 221 | , ((modMask, xK_space ), sendMessage NextLayout) 222 | , ((modMask .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) 223 | , ((modMask, xK_b ), sendMessage ToggleStruts) 224 | 225 | -- floating layer stuff 226 | , ((modMask, xK_t ), withFocused $ windows . W.sink) 227 | 228 | -- refresh' 229 | , ((modMask, xK_n ), refresh) 230 | 231 | -- focus 232 | , ((modMask, xK_Tab ), windows W.focusDown) 233 | , ((modMask, xK_j ), windows W.focusDown) 234 | , ((modMask, xK_k ), windows W.focusUp) 235 | , ((modMask, xK_m ), windows W.focusMaster) 236 | 237 | 238 | -- swapping 239 | , ((modMask .|. shiftMask, xK_Return), windows W.swapMaster) 240 | , ((modMask .|. shiftMask, xK_j ), windows W.swapDown ) 241 | , ((modMask .|. shiftMask, xK_k ), windows W.swapUp ) 242 | 243 | -- increase or decrease number of windows in the master area 244 | , ((modMask , xK_comma ), sendMessage (IncMasterN 1)) 245 | , ((modMask , xK_period), sendMessage (IncMasterN (-1))) 246 | 247 | -- resizing 248 | , ((modMask, xK_h ), sendMessage Shrink) 249 | , ((modMask, xK_l ), sendMessage Expand) 250 | , ((modMask .|. shiftMask, xK_h ), sendMessage MirrorShrink) 251 | , ((modMask .|. shiftMask, xK_l ), sendMessage MirrorExpand) 252 | 253 | -- scratchpad 254 | , ((modMask, xK_f ), namedScratchpadAction scratchpads "gvim") 255 | , ((modMask, xK_x ), safeSpawn "xscreensaver-command" ["--lock"] ) 256 | 257 | --Spotify 258 | , ((modMask , xK_a ), safeSpawn "dbus-send" ["--print-reply"," --dest=org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player.Previous"] ) 259 | , ((modMask, xK_s ), safeSpawn "dbus-send" ["--print-reply", "--dest=org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player.PlayPause"] ) 260 | , ((0, xF86XK_AudioPlay ), safeSpawn "dbus-send" ["--print-reply", "--dest=org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player.PlayPause"] ) 261 | , ((modMask, xK_d ), safeSpawn "dbus-send" ["--print-reply", "--dest=org.mpris.MediaPlayer2.spotify", "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player.Next"] ) 262 | 263 | --Launching programs 264 | -- , ((0, xF86XK_Favorites ), safeSpawn "") 265 | -- , ((0, xF86XK_Mail ), runOrRaise "thunderbird" (className =? "Thunderbird")) 266 | -- , ((0, xF86XK_Messenger ), runOrRaise "pidgin" (className =? "Pidgin")) 267 | 268 | , ((0, 0x1008ff18 ), runOrRaise "aurora" (className =? "Aurora")) 269 | , ((0, xF86XK_Calculator ), safeSpawn "gnome-calculator" []) 270 | , ((0, xF86XK_Display ), spawn "bash /home/jelle/bin/xrandr-laptop") 271 | 272 | -- volume control 273 | , ((0, xF86XK_AudioRaiseVolume ), safeSpawn "ponymix" ["-N","increase", "2"]) 274 | , ((0, xF86XK_AudioLowerVolume ), safeSpawn "ponymix" ["-N","decrease", "2"]) 275 | , ((0, xF86XK_AudioMute ), safeSpawn "ponymix" ["-N","toggle"]) 276 | 277 | -- brightness control 278 | , ((0 , 0x1008ff03 ), safeSpawn "xbacklight" ["-inc", "10"]) 279 | , ((0 , 0x1008ff02 ), safeSpawn "xbacklight" ["-dec","10"]) 280 | 281 | -- toggle trackpad 282 | , ((modMask .|. shiftMask, xK_t ), safeSpawn "/home/jelle/bin/trackpad-toggle.sh" [] ) 283 | 284 | -- quit, or restart 285 | , ((modMask .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) 286 | , ((modMask , xK_q ), restart "xmonad" True) 287 | ] 288 | ++ 289 | -- mod-[1..9] %! Switch to workspace N 290 | -- mod-shift-[1..9] %! Move client to workspace N 291 | [((m .|. modMask, k), windows $ f i) 292 | | (i, k) <- zip (XMonad.workspaces conf) ([xK_1 .. xK_9] ++ [xK_0]) 293 | , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] 294 | ++ 295 | -- mod-[w,e,r] %! switch to twinview screen 1/2/3 296 | -- mod-shift-[w,e] %! move window to screen 1/2/3 297 | [((m .|. modMask, key), screenWorkspace sc >>= flip whenJust (windows . f)) 298 | | (key, sc) <- zip [xK_e, xK_w, xK_r] [0..] 299 | , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] 300 | 301 | -------------------------------------------------------------------------------- /.vim/colors/jellybeans.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " 3 | " " __ _ _ _ " 4 | " " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " 5 | " " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " 6 | " " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " 7 | " " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " 8 | " " \___/ " 9 | " 10 | " "A colorful, dark color scheme for Vim." 11 | " 12 | " File: jellybeans.vim 13 | " URL: github.com/nanotech/jellybeans.vim 14 | " Scripts URL: vim.org/scripts/script.php?script_id=2555 15 | " Maintainer: NanoTech (nanotech.nanotechcorp.net) 16 | " Version: 1.6~git 17 | " Last Change: January 15th, 2012 18 | " License: MIT 19 | " Contributors: Daniel Herbert (pocketninja) 20 | " Henry So, Jr. 21 | " David Liang 22 | " Rich Healey (richo) 23 | " Andrew Wong (w0ng) 24 | " 25 | " Copyright (c) 2009-2012 NanoTech 26 | " 27 | " Permission is hereby granted, free of charge, to any per‐ 28 | " son obtaining a copy of this software and associated doc‐ 29 | " umentation files (the “Software”), to deal in the Soft‐ 30 | " ware without restriction, including without limitation 31 | " the rights to use, copy, modify, merge, publish, distrib‐ 32 | " ute, sublicense, and/or sell copies of the Software, and 33 | " to permit persons to whom the Software is furnished to do 34 | " so, subject to the following conditions: 35 | " 36 | " The above copyright notice and this permission notice 37 | " shall be included in all copies or substantial portions 38 | " of the Software. 39 | " 40 | " THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY 41 | " KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 42 | " THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐ 43 | " LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 45 | " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐ 46 | " TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐ 47 | " NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 48 | " THE SOFTWARE. 49 | 50 | set background=dark 51 | 52 | hi clear 53 | 54 | if exists("syntax_on") 55 | syntax reset 56 | endif 57 | 58 | let colors_name = "jellybeans" 59 | 60 | if has("gui_running") || &t_Co == 88 || &t_Co == 256 61 | let s:low_color = 0 62 | else 63 | let s:low_color = 1 64 | endif 65 | 66 | " Configuration Variables: 67 | " - g:jellybeans_overrides 68 | " - g:jellybeans_use_lowcolor_black 69 | " - g:jellybeans_use_term_background_color 70 | " - g:jellybeans_use_term_italics 71 | 72 | let s:background_color = "151515" 73 | 74 | " Backwards compatibility 75 | if exists("g:jellybeans_background_color") || exists("g:jellybeans_background_color_256") 76 | if !exists("g:jellybeans_overrides") 77 | let g:jellybeans_overrides = {} 78 | endif 79 | if !has_key(g:jellybeans_overrides, "background") 80 | let g:jellybeans_overrides["background"] = {} 81 | endif 82 | 83 | if exists("g:jellybeans_background_color") 84 | let g:jellybeans_overrides["background"]["guibg"] = g:jellybeans_background_color 85 | endif 86 | 87 | if exists("g:jellybeans_background_color_256") 88 | let g:jellybeans_overrides["background"]["256ctermbg"] = g:jellybeans_background_color_256 89 | endif 90 | endif 91 | 92 | " Ensure that g:jellybeans_use_term_background_color = 0 works with overrides 93 | if exists("g:jellybeans_overrides") 94 | \ && has_key(g:jellybeans_overrides, "background") 95 | \ && has_key(g:jellybeans_overrides["background"], "guibg") 96 | let s:background_color = g:jellybeans_overrides["background"]["guibg"] 97 | endif 98 | 99 | if !exists("g:jellybeans_use_lowcolor_black") || g:jellybeans_use_lowcolor_black 100 | let s:termBlack = "Black" 101 | else 102 | let s:termBlack = "Grey" 103 | endif 104 | 105 | if !exists("g:jellybeans_use_term_background_color") 106 | " OS X's Terminal.app and iTerm apply transparency to all 107 | " backgrounds. Other terminals tend to only apply transparency 108 | " to the default unhighlighted background. 109 | " 110 | " has("mac") only detects MacVim, not Apple's /usr/bin/vim. 111 | " We could check system("uname"), but then we're calling 112 | " external programs from a colorscheme. 113 | let g:jellybeans_use_term_background_color = has("mac") 114 | end 115 | 116 | " Color approximation functions by Henry So, Jr. and David Liang {{{ 117 | " Added to jellybeans.vim by Daniel Herbert 118 | 119 | " returns an approximate grey index for the given grey level 120 | fun! s:grey_number(x) 121 | if &t_Co == 88 122 | if a:x < 23 123 | return 0 124 | elseif a:x < 69 125 | return 1 126 | elseif a:x < 103 127 | return 2 128 | elseif a:x < 127 129 | return 3 130 | elseif a:x < 150 131 | return 4 132 | elseif a:x < 173 133 | return 5 134 | elseif a:x < 196 135 | return 6 136 | elseif a:x < 219 137 | return 7 138 | elseif a:x < 243 139 | return 8 140 | else 141 | return 9 142 | endif 143 | else 144 | if a:x < 14 145 | return 0 146 | else 147 | let l:n = (a:x - 8) / 10 148 | let l:m = (a:x - 8) % 10 149 | if l:m < 5 150 | return l:n 151 | else 152 | return l:n + 1 153 | endif 154 | endif 155 | endif 156 | endfun 157 | 158 | " returns the actual grey level represented by the grey index 159 | fun! s:grey_level(n) 160 | if &t_Co == 88 161 | if a:n == 0 162 | return 0 163 | elseif a:n == 1 164 | return 46 165 | elseif a:n == 2 166 | return 92 167 | elseif a:n == 3 168 | return 115 169 | elseif a:n == 4 170 | return 139 171 | elseif a:n == 5 172 | return 162 173 | elseif a:n == 6 174 | return 185 175 | elseif a:n == 7 176 | return 208 177 | elseif a:n == 8 178 | return 231 179 | else 180 | return 255 181 | endif 182 | else 183 | if a:n == 0 184 | return 0 185 | else 186 | return 8 + (a:n * 10) 187 | endif 188 | endif 189 | endfun 190 | 191 | " returns the palette index for the given grey index 192 | fun! s:grey_color(n) 193 | if &t_Co == 88 194 | if a:n == 0 195 | return 16 196 | elseif a:n == 9 197 | return 79 198 | else 199 | return 79 + a:n 200 | endif 201 | else 202 | if a:n == 0 203 | return 16 204 | elseif a:n == 25 205 | return 231 206 | else 207 | return 231 + a:n 208 | endif 209 | endif 210 | endfun 211 | 212 | " returns an approximate color index for the given color level 213 | fun! s:rgb_number(x) 214 | if &t_Co == 88 215 | if a:x < 69 216 | return 0 217 | elseif a:x < 172 218 | return 1 219 | elseif a:x < 230 220 | return 2 221 | else 222 | return 3 223 | endif 224 | else 225 | if a:x < 75 226 | return 0 227 | else 228 | let l:n = (a:x - 55) / 40 229 | let l:m = (a:x - 55) % 40 230 | if l:m < 20 231 | return l:n 232 | else 233 | return l:n + 1 234 | endif 235 | endif 236 | endif 237 | endfun 238 | 239 | " returns the actual color level for the given color index 240 | fun! s:rgb_level(n) 241 | if &t_Co == 88 242 | if a:n == 0 243 | return 0 244 | elseif a:n == 1 245 | return 139 246 | elseif a:n == 2 247 | return 205 248 | else 249 | return 255 250 | endif 251 | else 252 | if a:n == 0 253 | return 0 254 | else 255 | return 55 + (a:n * 40) 256 | endif 257 | endif 258 | endfun 259 | 260 | " returns the palette index for the given R/G/B color indices 261 | fun! s:rgb_color(x, y, z) 262 | if &t_Co == 88 263 | return 16 + (a:x * 16) + (a:y * 4) + a:z 264 | else 265 | return 16 + (a:x * 36) + (a:y * 6) + a:z 266 | endif 267 | endfun 268 | 269 | " returns the palette index to approximate the given R/G/B color levels 270 | fun! s:color(r, g, b) 271 | " map greys directly (see xterm's 256colres.pl) 272 | if &t_Co == 256 && a:r == a:g && a:g == a:b && a:r > 3 && a:r < 243 273 | return float2nr(round(a:r - 8) / 10.0) + 232 274 | endif 275 | 276 | " get the closest grey 277 | let l:gx = s:grey_number(a:r) 278 | let l:gy = s:grey_number(a:g) 279 | let l:gz = s:grey_number(a:b) 280 | 281 | " get the closest color 282 | let l:x = s:rgb_number(a:r) 283 | let l:y = s:rgb_number(a:g) 284 | let l:z = s:rgb_number(a:b) 285 | 286 | if l:gx == l:gy && l:gy == l:gz 287 | " there are two possibilities 288 | let l:dgr = s:grey_level(l:gx) - a:r 289 | let l:dgg = s:grey_level(l:gy) - a:g 290 | let l:dgb = s:grey_level(l:gz) - a:b 291 | let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) 292 | let l:dr = s:rgb_level(l:gx) - a:r 293 | let l:dg = s:rgb_level(l:gy) - a:g 294 | let l:db = s:rgb_level(l:gz) - a:b 295 | let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db) 296 | if l:dgrey < l:drgb 297 | " use the grey 298 | return s:grey_color(l:gx) 299 | else 300 | " use the color 301 | return s:rgb_color(l:x, l:y, l:z) 302 | endif 303 | else 304 | " only one possibility 305 | return s:rgb_color(l:x, l:y, l:z) 306 | endif 307 | endfun 308 | 309 | " returns the palette index to approximate the 'rrggbb' hex string 310 | fun! s:rgb(rgb) 311 | let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0 312 | let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0 313 | let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0 314 | return s:color(l:r, l:g, l:b) 315 | endfun 316 | 317 | " sets the highlighting for the given group 318 | fun! s:X(group, fg, bg, attr, lcfg, lcbg) 319 | if s:low_color 320 | let l:fge = empty(a:lcfg) 321 | let l:bge = empty(a:lcbg) 322 | 323 | if !l:fge && !l:bge 324 | exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg 325 | elseif !l:fge && l:bge 326 | exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE" 327 | elseif l:fge && !l:bge 328 | exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg 329 | endif 330 | else 331 | let l:fge = empty(a:fg) 332 | let l:bge = empty(a:bg) 333 | 334 | if !g:jellybeans_use_term_background_color && a:bg == s:background_color 335 | let l:ctermbg = 'NONE' 336 | else 337 | let l:ctermbg = s:rgb(a:bg) 338 | endif 339 | 340 | if !l:fge && !l:bge 341 | exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".l:ctermbg 342 | elseif !l:fge && l:bge 343 | exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE" 344 | elseif l:fge && !l:bge 345 | exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE ctermbg=".l:ctermbg 346 | endif 347 | endif 348 | 349 | if empty(a:attr) 350 | let l:attr = "none" 351 | else 352 | let l:attr = a:attr 353 | endif 354 | 355 | if exists("g:jellybeans_use_term_italics") && g:jellybeans_use_term_italics 356 | let l:cterm_attr = l:attr 357 | else 358 | let l:cterm_attr = join(filter(split(l:attr, ","), "v:val !=? 'italic'"), ",") 359 | if empty(l:cterm_attr) 360 | let l:cterm_attr = "none" 361 | endif 362 | endif 363 | 364 | exec "hi ".a:group." gui=".l:attr." cterm=".l:cterm_attr 365 | endfun 366 | " }}} 367 | 368 | call s:X("Normal","e8e8d3",s:background_color,"","White","") 369 | set background=dark 370 | 371 | if version >= 700 372 | call s:X("CursorLine","","1c1c1c","","",s:termBlack) 373 | call s:X("CursorColumn","","1c1c1c","","",s:termBlack) 374 | call s:X("MatchParen","ffffff","556779","bold","","DarkCyan") 375 | 376 | call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack) 377 | call s:X("TabLineFill","9098a0","","","",s:termBlack) 378 | call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White") 379 | 380 | " Auto-completion 381 | call s:X("Pmenu","ffffff","606060","","White",s:termBlack) 382 | call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White") 383 | endif 384 | 385 | call s:X("Visual","","404040","","",s:termBlack) 386 | call s:X("Cursor",s:background_color,"b0d0f0","","","") 387 | 388 | call s:X("LineNr","605958",s:background_color,"none",s:termBlack,"") 389 | call s:X("CursorLineNr","ccc5c4","","none","White","") 390 | call s:X("Comment","888888","","italic","Grey","") 391 | call s:X("Todo","c7c7c7","","bold","White",s:termBlack) 392 | 393 | call s:X("StatusLine","000000","dddddd","italic","","White") 394 | call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") 395 | call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack) 396 | call s:X("WildMenu","f0a0c0","302028","","Magenta","") 397 | 398 | call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"") 399 | call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack) 400 | call s:X("SignColumn","777777","333333","","",s:termBlack) 401 | call s:X("ColorColumn","","000000","","",s:termBlack) 402 | 403 | call s:X("Title","70b950","","bold","Green","") 404 | 405 | call s:X("Constant","cf6a4c","","","Red","") 406 | call s:X("Special","799d6a","","","Green","") 407 | call s:X("Delimiter","668799","","","Grey","") 408 | 409 | call s:X("String","99ad6a","","","Green","") 410 | call s:X("StringDelimiter","556633","","","DarkGreen","") 411 | 412 | call s:X("Identifier","c6b6ee","","","LightCyan","") 413 | call s:X("Structure","8fbfdc","","","LightCyan","") 414 | call s:X("Function","fad07a","","","Yellow","") 415 | call s:X("Statement","8197bf","","","DarkBlue","") 416 | call s:X("PreProc","8fbfdc","","","LightBlue","") 417 | 418 | hi! link Operator Structure 419 | 420 | call s:X("Type","ffb964","","","Yellow","") 421 | call s:X("NonText","606060",s:background_color,"",s:termBlack,"") 422 | 423 | call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"") 424 | 425 | call s:X("Search","f0a0c0","302028","underline","Magenta","") 426 | 427 | call s:X("Directory","dad085","","","Yellow","") 428 | call s:X("ErrorMsg","","902020","","","DarkRed") 429 | hi! link Error ErrorMsg 430 | hi! link MoreMsg Special 431 | call s:X("Question","65C254","","","Green","") 432 | 433 | 434 | " Spell Checking 435 | 436 | call s:X("SpellBad","","902020","underline","","DarkRed") 437 | call s:X("SpellCap","","0000df","underline","","Blue") 438 | call s:X("SpellRare","","540063","underline","","DarkMagenta") 439 | call s:X("SpellLocal","","2D7067","underline","","Green") 440 | 441 | " Diff 442 | 443 | hi! link diffRemoved Constant 444 | hi! link diffAdded String 445 | 446 | " VimDiff 447 | 448 | call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen") 449 | call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed") 450 | call s:X("DiffChange","","2B5B77","","White","DarkBlue") 451 | call s:X("DiffText","8fbfdc","000000","reverse","Yellow","") 452 | 453 | " PHP 454 | 455 | hi! link phpFunctions Function 456 | call s:X("StorageClass","c59f6f","","","Red","") 457 | hi! link phpSuperglobal Identifier 458 | hi! link phpQuoteSingle StringDelimiter 459 | hi! link phpQuoteDouble StringDelimiter 460 | hi! link phpBoolean Constant 461 | hi! link phpNull Constant 462 | hi! link phpArrayPair Operator 463 | hi! link phpOperator Normal 464 | hi! link phpRelation Normal 465 | hi! link phpVarSelector Identifier 466 | 467 | " Python 468 | 469 | hi! link pythonOperator Statement 470 | 471 | " Ruby 472 | 473 | hi! link rubySharpBang Comment 474 | call s:X("rubyClass","447799","","","DarkBlue","") 475 | call s:X("rubyIdentifier","c6b6fe","","","Cyan","") 476 | hi! link rubyConstant Type 477 | hi! link rubyFunction Function 478 | 479 | call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") 480 | call s:X("rubySymbol","7697d6","","","Blue","") 481 | hi! link rubyGlobalVariable rubyInstanceVariable 482 | hi! link rubyModule rubyClass 483 | call s:X("rubyControl","7597c6","","","Blue","") 484 | 485 | hi! link rubyString String 486 | hi! link rubyStringDelimiter StringDelimiter 487 | hi! link rubyInterpolationDelimiter Identifier 488 | 489 | call s:X("rubyRegexpDelimiter","540063","","","Magenta","") 490 | call s:X("rubyRegexp","dd0093","","","DarkMagenta","") 491 | call s:X("rubyRegexpSpecial","a40073","","","Magenta","") 492 | 493 | call s:X("rubyPredefinedIdentifier","de5577","","","Red","") 494 | 495 | " Erlang 496 | 497 | hi! link erlangAtom rubySymbol 498 | hi! link erlangBIF rubyPredefinedIdentifier 499 | hi! link erlangFunction rubyPredefinedIdentifier 500 | hi! link erlangDirective Statement 501 | hi! link erlangNode Identifier 502 | 503 | " Elixir 504 | 505 | hi! link elixirAtom rubySymbol 506 | 507 | 508 | " JavaScript 509 | 510 | hi! link javaScriptValue Constant 511 | hi! link javaScriptRegexpString rubyRegexp 512 | hi! link javaScriptTemplateVar StringDelim 513 | hi! link javaScriptTemplateDelim Identifier 514 | hi! link javaScriptTemplateString String 515 | 516 | " CoffeeScript 517 | 518 | hi! link coffeeRegExp javaScriptRegexpString 519 | 520 | " Lua 521 | 522 | hi! link luaOperator Conditional 523 | 524 | " C 525 | 526 | hi! link cFormat Identifier 527 | hi! link cOperator Constant 528 | 529 | " Objective-C/Cocoa 530 | 531 | hi! link objcClass Type 532 | hi! link cocoaClass objcClass 533 | hi! link objcSubclass objcClass 534 | hi! link objcSuperclass objcClass 535 | hi! link objcDirective rubyClass 536 | hi! link objcStatement Constant 537 | hi! link cocoaFunction Function 538 | hi! link objcMethodName Identifier 539 | hi! link objcMethodArg Normal 540 | hi! link objcMessageName Identifier 541 | 542 | " Vimscript 543 | 544 | hi! link vimOper Normal 545 | 546 | " HTML 547 | 548 | hi! link htmlTag Statement 549 | hi! link htmlEndTag htmlTag 550 | hi! link htmlTagName htmlTag 551 | 552 | " XML 553 | 554 | hi! link xmlTag Statement 555 | hi! link xmlEndTag xmlTag 556 | hi! link xmlTagName xmlTag 557 | hi! link xmlEqual xmlTag 558 | hi! link xmlEntity Special 559 | hi! link xmlEntityPunct xmlEntity 560 | hi! link xmlDocTypeDecl PreProc 561 | hi! link xmlDocTypeKeyword PreProc 562 | hi! link xmlProcessingDelim xmlAttrib 563 | 564 | " Debugger.vim 565 | 566 | call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue") 567 | call s:X("DbgBreakPt","","4F0037","","","DarkMagenta") 568 | 569 | " vim-indent-guides 570 | 571 | if !exists("g:indent_guides_auto_colors") 572 | let g:indent_guides_auto_colors = 0 573 | endif 574 | call s:X("IndentGuidesOdd","","232323","","","") 575 | call s:X("IndentGuidesEven","","1b1b1b","","","") 576 | 577 | " Plugins, etc. 578 | 579 | hi! link TagListFileName Directory 580 | call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") 581 | 582 | " Manual overrides for 256-color terminals. Dark colors auto-map badly. 583 | if !s:low_color 584 | hi StatusLineNC ctermbg=235 585 | hi Folded ctermbg=236 586 | hi DiffText ctermfg=81 587 | hi DbgBreakPt ctermbg=53 588 | hi IndentGuidesOdd ctermbg=235 589 | hi IndentGuidesEven ctermbg=234 590 | endif 591 | 592 | if exists("g:jellybeans_overrides") 593 | fun! s:current_attr(group) 594 | let l:synid = synIDtrans(hlID(a:group)) 595 | let l:attrs = [] 596 | for l:attr in ["bold", "italic", "reverse", "standout", "underline", "undercurl"] 597 | if synIDattr(l:synid, l:attr, "gui") == 1 598 | call add(l:attrs, l:attr) 599 | endif 600 | endfor 601 | return join(l:attrs, ",") 602 | endfun 603 | fun! s:current_color(group, what, mode) 604 | let l:color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode) 605 | if l:color == -1 606 | return "" 607 | else 608 | return substitute(l:color, "^#", "", "") 609 | endif 610 | endfun 611 | fun! s:load_color_def(group, def) 612 | call s:X(a:group, get(a:def, "guifg", s:current_color(a:group, "fg", "gui")), 613 | \ get(a:def, "guibg", s:current_color(a:group, "bg", "gui")), 614 | \ get(a:def, "attr", s:current_attr(a:group)), 615 | \ get(a:def, "ctermfg", s:current_color(a:group, "fg", "cterm")), 616 | \ get(a:def, "ctermbg", s:current_color(a:group, "bg", "cterm"))) 617 | if !s:low_color 618 | for l:prop in ["ctermfg", "ctermbg"] 619 | let l:override_key = "256".l:prop 620 | if has_key(a:def, l:override_key) 621 | exec "hi ".a:group." ".l:prop."=".a:def[l:override_key] 622 | endif 623 | endfor 624 | endif 625 | endfun 626 | fun! s:load_colors(defs) 627 | for [l:group, l:def] in items(a:defs) 628 | if l:group == "background" 629 | call s:load_color_def("LineNr", l:def) 630 | call s:load_color_def("NonText", l:def) 631 | call s:load_color_def("Normal", l:def) 632 | else 633 | call s:load_color_def(l:group, l:def) 634 | endif 635 | unlet l:group 636 | unlet l:def 637 | endfor 638 | endfun 639 | call s:load_colors(g:jellybeans_overrides) 640 | delf s:load_colors 641 | delf s:load_color_def 642 | delf s:current_color 643 | delf s:current_attr 644 | endif 645 | 646 | " delete functions {{{ 647 | delf s:X 648 | delf s:rgb 649 | delf s:color 650 | delf s:rgb_color 651 | delf s:rgb_level 652 | delf s:rgb_number 653 | delf s:grey_color 654 | delf s:grey_level 655 | delf s:grey_number 656 | " }}} 657 | -------------------------------------------------------------------------------- /.ipython/profile_default/ipython_config.py: -------------------------------------------------------------------------------- 1 | # Configuration file for ipython. 2 | 3 | c = get_config() 4 | c.InteractiveShellApp.exec_lines = [] 5 | c.InteractiveShellApp.exec_lines.append('%load_ext autoreload') 6 | c.InteractiveShellApp.exec_lines.append('%autoreload 2') 7 | 8 | #------------------------------------------------------------------------------ 9 | # InteractiveShellApp configuration 10 | #------------------------------------------------------------------------------ 11 | 12 | # A Mixin for applications that start InteractiveShell instances. 13 | # 14 | # Provides configurables for loading extensions and executing files as part of 15 | # configuring a Shell environment. 16 | # 17 | # The following methods should be called by the :meth:`initialize` method of the 18 | # subclass: 19 | # 20 | # - :meth:`init_path` 21 | # - :meth:`init_shell` (to be implemented by the subclass) 22 | # - :meth:`init_gui_pylab` 23 | # - :meth:`init_extensions` 24 | # - :meth:`init_code` 25 | 26 | # Execute the given command string. 27 | # c.InteractiveShellApp.code_to_run = '' 28 | 29 | # Run the file referenced by the PYTHONSTARTUP environment variable at IPython 30 | # startup. 31 | # c.InteractiveShellApp.exec_PYTHONSTARTUP = True 32 | 33 | # lines of code to run at IPython startup. 34 | # c.InteractiveShellApp.exec_lines = [] 35 | 36 | # Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk3', 'none', 37 | # 'osx', 'pyglet', 'qt', 'qt4', 'tk', 'wx'). 38 | # c.InteractiveShellApp.gui = None 39 | 40 | # Pre-load matplotlib and numpy for interactive use, selecting a particular 41 | # matplotlib backend and loop integration. 42 | # c.InteractiveShellApp.pylab = None 43 | 44 | # Configure matplotlib for interactive use with the default matplotlib backend. 45 | # c.InteractiveShellApp.matplotlib = None 46 | 47 | # If true, IPython will populate the user namespace with numpy, pylab, etc. and 48 | # an ``import *`` is done from numpy and pylab, when using pylab mode. 49 | # 50 | # When False, pylab mode should not import any names into the user namespace. 51 | # c.InteractiveShellApp.pylab_import_all = True 52 | 53 | # A list of dotted module names of IPython extensions to load. 54 | # c.InteractiveShellApp.extensions = [] 55 | 56 | # Run the module as a script. 57 | # c.InteractiveShellApp.module_to_run = '' 58 | 59 | # Should variables loaded at startup (by startup files, exec_lines, etc.) be 60 | # hidden from tools like %who? 61 | # c.InteractiveShellApp.hide_initial_ns = True 62 | 63 | # dotted module name of an IPython extension to load. 64 | # c.InteractiveShellApp.extra_extension = '' 65 | 66 | # List of files to run at IPython startup. 67 | # c.InteractiveShellApp.exec_files = [] 68 | 69 | # A file to be run 70 | # c.InteractiveShellApp.file_to_run = '' 71 | 72 | #------------------------------------------------------------------------------ 73 | # TerminalIPythonApp configuration 74 | #------------------------------------------------------------------------------ 75 | 76 | # TerminalIPythonApp will inherit config from: BaseIPythonApplication, 77 | # Application, InteractiveShellApp 78 | 79 | # Run the file referenced by the PYTHONSTARTUP environment variable at IPython 80 | # startup. 81 | # c.TerminalIPythonApp.exec_PYTHONSTARTUP = True 82 | 83 | # Pre-load matplotlib and numpy for interactive use, selecting a particular 84 | # matplotlib backend and loop integration. 85 | # c.TerminalIPythonApp.pylab = None 86 | 87 | # Create a massive crash report when IPython encounters what may be an internal 88 | # error. The default is to append a short message to the usual traceback 89 | # c.TerminalIPythonApp.verbose_crash = False 90 | 91 | # Run the module as a script. 92 | # c.TerminalIPythonApp.module_to_run = '' 93 | 94 | # The date format used by logging formatters for %(asctime)s 95 | # c.TerminalIPythonApp.log_datefmt = '%Y-%m-%d %H:%M:%S' 96 | 97 | # Whether to overwrite existing config files when copying 98 | # c.TerminalIPythonApp.overwrite = False 99 | 100 | # Execute the given command string. 101 | # c.TerminalIPythonApp.code_to_run = '' 102 | 103 | # Set the log level by value or name. 104 | # c.TerminalIPythonApp.log_level = 30 105 | 106 | # lines of code to run at IPython startup. 107 | # c.TerminalIPythonApp.exec_lines = [] 108 | 109 | # Suppress warning messages about legacy config files 110 | # c.TerminalIPythonApp.ignore_old_config = False 111 | 112 | # Path to an extra config file to load. 113 | # 114 | # If specified, load this config file in addition to any other IPython config. 115 | # c.TerminalIPythonApp.extra_config_file = u'' 116 | 117 | # Should variables loaded at startup (by startup files, exec_lines, etc.) be 118 | # hidden from tools like %who? 119 | # c.TerminalIPythonApp.hide_initial_ns = True 120 | 121 | # dotted module name of an IPython extension to load. 122 | # c.TerminalIPythonApp.extra_extension = '' 123 | 124 | # A file to be run 125 | # c.TerminalIPythonApp.file_to_run = '' 126 | 127 | # The IPython profile to use. 128 | # c.TerminalIPythonApp.profile = u'default' 129 | 130 | # Configure matplotlib for interactive use with the default matplotlib backend. 131 | # c.TerminalIPythonApp.matplotlib = None 132 | 133 | # If a command or file is given via the command-line, e.g. 'ipython foo.py', 134 | # start an interactive shell after executing the file or command. 135 | # c.TerminalIPythonApp.force_interact = False 136 | 137 | # If true, IPython will populate the user namespace with numpy, pylab, etc. and 138 | # an ``import *`` is done from numpy and pylab, when using pylab mode. 139 | # 140 | # When False, pylab mode should not import any names into the user namespace. 141 | # c.TerminalIPythonApp.pylab_import_all = True 142 | 143 | # The name of the IPython directory. This directory is used for logging 144 | # configuration (through profiles), history storage, etc. The default is usually 145 | # $HOME/.ipython. This options can also be specified through the environment 146 | # variable IPYTHONDIR. 147 | # c.TerminalIPythonApp.ipython_dir = u'' 148 | 149 | # Whether to display a banner upon starting IPython. 150 | # c.TerminalIPythonApp.display_banner = True 151 | 152 | # Whether to install the default config files into the profile dir. If a new 153 | # profile is being created, and IPython contains config files for that profile, 154 | # then they will be staged into the new directory. Otherwise, default config 155 | # files will be automatically generated. 156 | # c.TerminalIPythonApp.copy_config_files = False 157 | 158 | # List of files to run at IPython startup. 159 | # c.TerminalIPythonApp.exec_files = [] 160 | 161 | # Enable GUI event loop integration with any of ('glut', 'gtk', 'gtk3', 'none', 162 | # 'osx', 'pyglet', 'qt', 'qt4', 'tk', 'wx'). 163 | # c.TerminalIPythonApp.gui = None 164 | 165 | # A list of dotted module names of IPython extensions to load. 166 | # c.TerminalIPythonApp.extensions = [] 167 | 168 | # Start IPython quickly by skipping the loading of config files. 169 | # c.TerminalIPythonApp.quick = False 170 | 171 | # The Logging format template 172 | # c.TerminalIPythonApp.log_format = '[%(name)s]%(highlevel)s %(message)s' 173 | 174 | #------------------------------------------------------------------------------ 175 | # TerminalInteractiveShell configuration 176 | #------------------------------------------------------------------------------ 177 | 178 | # TerminalInteractiveShell will inherit config from: InteractiveShell 179 | 180 | # auto editing of files with syntax errors. 181 | # c.TerminalInteractiveShell.autoedit_syntax = False 182 | 183 | # Use colors for displaying information about objects. Because this information 184 | # is passed through a pager (like 'less'), and some pagers get confused with 185 | # color codes, this capability can be turned off. 186 | # c.TerminalInteractiveShell.color_info = True 187 | 188 | # A list of ast.NodeTransformer subclass instances, which will be applied to 189 | # user input before code is run. 190 | # c.TerminalInteractiveShell.ast_transformers = [] 191 | 192 | # 193 | # c.TerminalInteractiveShell.history_length = 10000 194 | 195 | # Don't call post-execute functions that have failed in the past. 196 | # c.TerminalInteractiveShell.disable_failing_post_execute = False 197 | 198 | # Show rewritten input, e.g. for autocall. 199 | # c.TerminalInteractiveShell.show_rewritten_input = True 200 | 201 | # Set the color scheme (NoColor, Linux, or LightBG). 202 | # c.TerminalInteractiveShell.colors = 'Linux' 203 | 204 | # Autoindent IPython code entered interactively. 205 | # c.TerminalInteractiveShell.autoindent = True 206 | 207 | # 208 | # c.TerminalInteractiveShell.separate_in = '\n' 209 | 210 | # Deprecated, use PromptManager.in2_template 211 | # c.TerminalInteractiveShell.prompt_in2 = ' .\\D.: ' 212 | 213 | # 214 | # c.TerminalInteractiveShell.separate_out = '' 215 | 216 | # Deprecated, use PromptManager.in_template 217 | # c.TerminalInteractiveShell.prompt_in1 = 'In [\\#]: ' 218 | 219 | # Make IPython automatically call any callable object even if you didn't type 220 | # explicit parentheses. For example, 'str 43' becomes 'str(43)' automatically. 221 | # The value can be '0' to disable the feature, '1' for 'smart' autocall, where 222 | # it is not applied if there are no more arguments on the line, and '2' for 223 | # 'full' autocall, where all callable objects are automatically called (even if 224 | # no arguments are present). 225 | # c.TerminalInteractiveShell.autocall = 0 226 | 227 | # Number of lines of your screen, used to control printing of very long strings. 228 | # Strings longer than this number of lines will be sent through a pager instead 229 | # of directly printed. The default value for this is 0, which means IPython 230 | # will auto-detect your screen size every time it needs to print certain 231 | # potentially long strings (this doesn't change the behavior of the 'print' 232 | # keyword, it's only triggered internally). If for some reason this isn't 233 | # working well (it needs curses support), specify it yourself. Otherwise don't 234 | # change the default. 235 | # c.TerminalInteractiveShell.screen_length = 0 236 | 237 | # Set the editor used by IPython (default to $EDITOR/vi/notepad). 238 | # c.TerminalInteractiveShell.editor = u'vim' 239 | 240 | # Deprecated, use PromptManager.justify 241 | # c.TerminalInteractiveShell.prompts_pad_left = True 242 | 243 | # The part of the banner to be printed before the profile 244 | # c.TerminalInteractiveShell.banner1 = 'Python 2.7.8 (default, Jul 1 2014, 17:30:21) \nType "copyright", "credits" or "license" for more information.\n\nIPython 2.2.0 -- An enhanced Interactive Python.\n? -> Introduction and overview of IPython\'s features.\n%quickref -> Quick reference.\nhelp -> Python\'s own help system.\nobject? -> Details about \'object\', use \'object??\' for extra details.\n' 245 | 246 | # 247 | # c.TerminalInteractiveShell.readline_parse_and_bind = ['tab: complete', '"\\C-l": clear-screen', 'set show-all-if-ambiguous on', '"\\C-o": tab-insert', '"\\C-r": reverse-search-history', '"\\C-s": forward-search-history', '"\\C-p": history-search-backward', '"\\C-n": history-search-forward', '"\\e[A": history-search-backward', '"\\e[B": history-search-forward', '"\\C-k": kill-line', '"\\C-u": unix-line-discard'] 248 | 249 | # The part of the banner to be printed after the profile 250 | # c.TerminalInteractiveShell.banner2 = '' 251 | 252 | # 253 | # c.TerminalInteractiveShell.separate_out2 = '' 254 | 255 | # 256 | # c.TerminalInteractiveShell.wildcards_case_sensitive = True 257 | 258 | # 259 | # c.TerminalInteractiveShell.debug = False 260 | 261 | # Set to confirm when you try to exit IPython with an EOF (Control-D in Unix, 262 | # Control-Z/Enter in Windows). By typing 'exit' or 'quit', you can force a 263 | # direct exit without any confirmation. 264 | # c.TerminalInteractiveShell.confirm_exit = True 265 | 266 | # 267 | # c.TerminalInteractiveShell.ipython_dir = '' 268 | 269 | # 270 | # c.TerminalInteractiveShell.readline_remove_delims = '-/~' 271 | 272 | # Start logging to the default log file. 273 | # c.TerminalInteractiveShell.logstart = False 274 | 275 | # The name of the logfile to use. 276 | # c.TerminalInteractiveShell.logfile = '' 277 | 278 | # The shell program to be used for paging. 279 | # c.TerminalInteractiveShell.pager = 'less' 280 | 281 | # Enable magic commands to be called without the leading %. 282 | # c.TerminalInteractiveShell.automagic = True 283 | 284 | # Save multi-line entries as one entry in readline history 285 | # c.TerminalInteractiveShell.multiline_history = True 286 | 287 | # 288 | # c.TerminalInteractiveShell.readline_use = True 289 | 290 | # Enable deep (recursive) reloading by default. IPython can use the deep_reload 291 | # module which reloads changes in modules recursively (it replaces the reload() 292 | # function, so you don't need to change anything to use it). deep_reload() 293 | # forces a full reload of modules whose code may have changed, which the default 294 | # reload() function does not. When deep_reload is off, IPython will use the 295 | # normal reload(), but deep_reload will still be available as dreload(). 296 | # c.TerminalInteractiveShell.deep_reload = False 297 | 298 | # Start logging to the given file in append mode. 299 | # c.TerminalInteractiveShell.logappend = '' 300 | 301 | # 302 | # c.TerminalInteractiveShell.xmode = 'Context' 303 | 304 | # 305 | # c.TerminalInteractiveShell.quiet = False 306 | 307 | # Enable auto setting the terminal title. 308 | # c.TerminalInteractiveShell.term_title = False 309 | 310 | # 311 | # c.TerminalInteractiveShell.object_info_string_level = 0 312 | 313 | # Deprecated, use PromptManager.out_template 314 | # c.TerminalInteractiveShell.prompt_out = 'Out[\\#]: ' 315 | 316 | # Set the size of the output cache. The default is 1000, you can change it 317 | # permanently in your config file. Setting it to 0 completely disables the 318 | # caching system, and the minimum value accepted is 20 (if you provide a value 319 | # less than 20, it is reset to 0 and a warning is issued). This limit is 320 | # defined because otherwise you'll spend more time re-flushing a too small cache 321 | # than working 322 | # c.TerminalInteractiveShell.cache_size = 1000 323 | 324 | # 'all', 'last', 'last_expr' or 'none', specifying which nodes should be run 325 | # interactively (displaying output from expressions). 326 | # c.TerminalInteractiveShell.ast_node_interactivity = 'last_expr' 327 | 328 | # Automatically call the pdb debugger after every exception. 329 | # c.TerminalInteractiveShell.pdb = False 330 | 331 | #------------------------------------------------------------------------------ 332 | # PromptManager configuration 333 | #------------------------------------------------------------------------------ 334 | 335 | # This is the primary interface for producing IPython's prompts. 336 | 337 | # Output prompt. '\#' will be transformed to the prompt number 338 | # c.PromptManager.out_template = 'Out[\\#]: ' 339 | 340 | # Continuation prompt. 341 | # c.PromptManager.in2_template = ' .\\D.: ' 342 | 343 | # If True (default), each prompt will be right-aligned with the preceding one. 344 | # c.PromptManager.justify = True 345 | 346 | # Input prompt. '\#' will be transformed to the prompt number 347 | # c.PromptManager.in_template = 'In [\\#]: ' 348 | 349 | # 350 | # c.PromptManager.color_scheme = 'Linux' 351 | 352 | #------------------------------------------------------------------------------ 353 | # HistoryManager configuration 354 | #------------------------------------------------------------------------------ 355 | 356 | # A class to organize all history-related functionality in one place. 357 | 358 | # HistoryManager will inherit config from: HistoryAccessor 359 | 360 | # Should the history database include output? (default: no) 361 | # c.HistoryManager.db_log_output = False 362 | 363 | # Write to database every x commands (higher values save disk access & power). 364 | # Values of 1 or less effectively disable caching. 365 | # c.HistoryManager.db_cache_size = 0 366 | 367 | # Path to file to use for SQLite history database. 368 | # 369 | # By default, IPython will put the history database in the IPython profile 370 | # directory. If you would rather share one history among profiles, you can set 371 | # this value in each, so that they are consistent. 372 | # 373 | # Due to an issue with fcntl, SQLite is known to misbehave on some NFS mounts. 374 | # If you see IPython hanging, try setting this to something on a local disk, 375 | # e.g:: 376 | # 377 | # ipython --HistoryManager.hist_file=/tmp/ipython_hist.sqlite 378 | # c.HistoryManager.hist_file = u'' 379 | 380 | # Options for configuring the SQLite connection 381 | # 382 | # These options are passed as keyword args to sqlite3.connect when establishing 383 | # database conenctions. 384 | # c.HistoryManager.connection_options = {} 385 | 386 | # enable the SQLite history 387 | # 388 | # set enabled=False to disable the SQLite history, in which case there will be 389 | # no stored history, no SQLite connection, and no background saving thread. 390 | # This may be necessary in some threaded environments where IPython is embedded. 391 | # c.HistoryManager.enabled = True 392 | 393 | #------------------------------------------------------------------------------ 394 | # ProfileDir configuration 395 | #------------------------------------------------------------------------------ 396 | 397 | # An object to manage the profile directory and its resources. 398 | # 399 | # The profile directory is used by all IPython applications, to manage 400 | # configuration, logging and security. 401 | # 402 | # This object knows how to find, create and manage these directories. This 403 | # should be used by any code that wants to handle profiles. 404 | 405 | # Set the profile location directly. This overrides the logic used by the 406 | # `profile` option. 407 | # c.ProfileDir.location = u'' 408 | 409 | #------------------------------------------------------------------------------ 410 | # PlainTextFormatter configuration 411 | #------------------------------------------------------------------------------ 412 | 413 | # The default pretty-printer. 414 | # 415 | # This uses :mod:`IPython.lib.pretty` to compute the format data of the object. 416 | # If the object cannot be pretty printed, :func:`repr` is used. See the 417 | # documentation of :mod:`IPython.lib.pretty` for details on how to write pretty 418 | # printers. Here is a simple example:: 419 | # 420 | # def dtype_pprinter(obj, p, cycle): 421 | # if cycle: 422 | # return p.text('dtype(...)') 423 | # if hasattr(obj, 'fields'): 424 | # if obj.fields is None: 425 | # p.text(repr(obj)) 426 | # else: 427 | # p.begin_group(7, 'dtype([') 428 | # for i, field in enumerate(obj.descr): 429 | # if i > 0: 430 | # p.text(',') 431 | # p.breakable() 432 | # p.pretty(field) 433 | # p.end_group(7, '])') 434 | 435 | # PlainTextFormatter will inherit config from: BaseFormatter 436 | 437 | # 438 | # c.PlainTextFormatter.type_printers = {} 439 | 440 | # 441 | # c.PlainTextFormatter.newline = '\n' 442 | 443 | # 444 | # c.PlainTextFormatter.float_precision = '' 445 | 446 | # 447 | # c.PlainTextFormatter.verbose = False 448 | 449 | # 450 | # c.PlainTextFormatter.deferred_printers = {} 451 | 452 | # 453 | # c.PlainTextFormatter.pprint = True 454 | 455 | # 456 | # c.PlainTextFormatter.max_width = 79 457 | 458 | # 459 | # c.PlainTextFormatter.singleton_printers = {} 460 | 461 | #------------------------------------------------------------------------------ 462 | # IPCompleter configuration 463 | #------------------------------------------------------------------------------ 464 | 465 | # Extension of the completer class with IPython-specific features 466 | 467 | # IPCompleter will inherit config from: Completer 468 | 469 | # Instruct the completer to omit private method names 470 | # 471 | # Specifically, when completing on ``object.``. 472 | # 473 | # When 2 [default]: all names that start with '_' will be excluded. 474 | # 475 | # When 1: all 'magic' names (``__foo__``) will be excluded. 476 | # 477 | # When 0: nothing will be excluded. 478 | # c.IPCompleter.omit__names = 2 479 | 480 | # Whether to merge completion results into a single list 481 | # 482 | # If False, only the completion results from the first non-empty completer will 483 | # be returned. 484 | # c.IPCompleter.merge_completions = True 485 | 486 | # Instruct the completer to use __all__ for the completion 487 | # 488 | # Specifically, when completing on ``object.``. 489 | # 490 | # When True: only those names in obj.__all__ will be included. 491 | # 492 | # When False [default]: the __all__ attribute is ignored 493 | # c.IPCompleter.limit_to__all__ = False 494 | 495 | # Activate greedy completion 496 | # 497 | # This will enable completion on elements of lists, results of function calls, 498 | # etc., but can be unsafe because the code is actually evaluated on TAB. 499 | # c.IPCompleter.greedy = False 500 | 501 | #------------------------------------------------------------------------------ 502 | # ScriptMagics configuration 503 | #------------------------------------------------------------------------------ 504 | 505 | # Magics for talking to scripts 506 | # 507 | # This defines a base `%%script` cell magic for running a cell with a program in 508 | # a subprocess, and registers a few top-level magics that call %%script with 509 | # common interpreters. 510 | 511 | # Extra script cell magics to define 512 | # 513 | # This generates simple wrappers of `%%script foo` as `%%foo`. 514 | # 515 | # If you want to add script magics that aren't on your path, specify them in 516 | # script_paths 517 | # c.ScriptMagics.script_magics = [] 518 | 519 | # Dict mapping short 'ruby' names to full paths, such as '/opt/secret/bin/ruby' 520 | # 521 | # Only necessary for items in script_magics where the default path will not find 522 | # the right interpreter. 523 | # c.ScriptMagics.script_paths = {} 524 | 525 | #------------------------------------------------------------------------------ 526 | # StoreMagics configuration 527 | #------------------------------------------------------------------------------ 528 | 529 | # Lightweight persistence for python variables. 530 | # 531 | # Provides the %store magic. 532 | 533 | # If True, any %store-d variables will be automatically restored when IPython 534 | # starts. 535 | # c.StoreMagics.autorestore = False 536 | --------------------------------------------------------------------------------