From: Mart Lubbers Date: Thu, 8 Sep 2022 09:20:20 +0000 (+0200) Subject: latest greatest additions X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=680453b96ef8de3ad668b2163927aac7a7e33045;p=dotfiles.git latest greatest additions --- diff --git a/.gitmodules b/.gitmodules index 2ddb6ba..1ce9c02 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule "config.h/slstatus/slstatus"] path = config.h/slstatus/slstatus url = https://git.suckless.org/slstatus +[submodule "vim/.vim/pack/plugins/start/vim-LanguageTool"] + path = vim/.vim/pack/plugins/start/vim-LanguageTool + url = https://github.com/dpelle/vim-LanguageTool diff --git a/cal/.config/vdirsyncer/config b/cal/.config/vdirsyncer/config index ceddd8a..f8c624c 100644 --- a/cal/.config/vdirsyncer/config +++ b/cal/.config/vdirsyncer/config @@ -43,21 +43,6 @@ url = "https://cal.martlubbers.net/dav.php/calendars/mart/vuilnis/" username = "mart" password.fetch = ["command", "pass", "show", "caldav_ygdrassil/mart"] -[pair swsseminar] -a = "sws_web" -b = "sws_remote" -collections = null - -[storage sws_web] -type = "http" -url = "webcal://mail.ru.nl/owa/calendar/b6e050a43db94f69b7f22d03b199e2d3@ru.nl/d9d2aad2370a45e384cdd0df82dc0372275936403019441775/S-1-8-3775058472-2008174625-2090802342-630350554/reachcalendar.ics" - -[storage sws_remote] -type = "caldav" -url = "https://cal.martlubbers.net/dav.php/calendars/mart/swsseminar/" -username = "mart" -password.fetch = ["command", "pass", "show", "caldav_ygdrassil/mart"] - # CARDDAV [pair contacts] a = "contacts_local" diff --git a/config.h/dwm/dwm-autostart-20210120-cb3f58a.diff b/config.h/dwm/dwm-autostart-20210120-cb3f58a.diff new file mode 100644 index 0000000..efee676 --- /dev/null +++ b/config.h/dwm/dwm-autostart-20210120-cb3f58a.diff @@ -0,0 +1,179 @@ +From 37e970479dc5d40e57fc0cbfeaa5e39941483237 Mon Sep 17 00:00:00 2001 +From: Gan Ainm +Date: Wed, 10 Jun 2020 10:59:02 +0000 +Subject: [PATCH] dwm-xdgautostart-6.2.diff + +=================================================================== +--- + dwm.1 | 23 +++++++++++++++++ + dwm.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+) + +diff --git a/dwm.1 b/dwm.1 +index 13b3729..9533aa6 100644 +--- a/dwm.1 ++++ b/dwm.1 +@@ -30,6 +30,14 @@ top left corner. The tags which are applied to one or more windows are + indicated with an empty square in the top left corner. + .P + dwm draws a small border around windows to indicate the focus state. ++.P ++On start, dwm can start additional programs that may be specified in two special ++shell scripts (see the FILES section below), autostart_blocking.sh and ++autostart.sh. The former is executed first and dwm will wait for its ++termination before starting. The latter is executed in the background before ++dwm enters its handler loop. ++.P ++Either of these files may be omitted. + .SH OPTIONS + .TP + .B \-v +@@ -152,6 +160,21 @@ Toggles focused window between floating and tiled state. + .TP + .B Mod1\-Button3 + Resize focused window while dragging. Tiled windows will be toggled to the floating state. ++.SH FILES ++The files containing programs to be started along with dwm are searched for in ++the following directories: ++.IP "1. $XDG_DATA_HOME/dwm" ++.IP "2. $HOME/.local/share/dwm" ++.IP "3. $HOME/.dwm" ++.P ++The first existing directory is scanned for any of the autostart files below. ++.TP 15 ++autostart.sh ++This file is started as a shell background process before dwm enters its handler ++loop. ++.TP 15 ++autostart_blocking.sh ++This file is started before any autostart.sh; dwm waits for its termination. + .SH CUSTOMIZATION + dwm is customized by creating a custom config.h and (re)compiling the source + code. This keeps it fast, secure and simple. +diff --git a/dwm.c b/dwm.c +index 4465af1..2156b49 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -193,6 +194,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h); + static void resizemouse(const Arg *arg); + static void restack(Monitor *m); + static void run(void); ++static void runautostart(void); + static void scan(void); + static int sendevent(Client *c, Atom proto); + static void sendmon(Client *c, Monitor *m); +@@ -235,7 +237,11 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee); + static void zoom(const Arg *arg); + + /* variables */ ++static const char autostartblocksh[] = "autostart_blocking.sh"; ++static const char autostartsh[] = "autostart.sh"; + static const char broken[] = "broken"; ++static const char dwmdir[] = "dwm"; ++static const char localshare[] = ".local/share"; + static char stext[256]; + static int screen; + static int sw, sh; /* X display screen geometry width, height */ +@@ -1380,6 +1386,83 @@ run(void) + handler[ev.type](&ev); /* call handler */ + } + ++void ++runautostart(void) ++{ ++ char *pathpfx; ++ char *path; ++ char *xdgdatahome; ++ char *home; ++ struct stat sb; ++ ++ if ((home = getenv("HOME")) == NULL) ++ /* this is almost impossible */ ++ return; ++ ++ /* if $XDG_DATA_HOME is set and not empty, use $XDG_DATA_HOME/dwm, ++ * otherwise use ~/.local/share/dwm as autostart script directory ++ */ ++ xdgdatahome = getenv("XDG_DATA_HOME"); ++ if (xdgdatahome != NULL && *xdgdatahome != '\0') { ++ /* space for path segments, separators and nul */ ++ pathpfx = ecalloc(1, strlen(xdgdatahome) + strlen(dwmdir) + 2); ++ ++ if (sprintf(pathpfx, "%s/%s", xdgdatahome, dwmdir) <= 0) { ++ free(pathpfx); ++ return; ++ } ++ } else { ++ /* space for path segments, separators and nul */ ++ pathpfx = ecalloc(1, strlen(home) + strlen(localshare) ++ + strlen(dwmdir) + 3); ++ ++ if (sprintf(pathpfx, "%s/%s/%s", home, localshare, dwmdir) < 0) { ++ free(pathpfx); ++ return; ++ } ++ } ++ ++ /* check if the autostart script directory exists */ ++ if (! (stat(pathpfx, &sb) == 0 && S_ISDIR(sb.st_mode))) { ++ /* the XDG conformant path does not exist or is no directory ++ * so we try ~/.dwm instead ++ */ ++ char *pathpfx_new = realloc(pathpfx, strlen(home) + strlen(dwmdir) + 3); ++ if(pathpfx_new == NULL) { ++ free(pathpfx); ++ return; ++ } ++ pathpfx = pathpfx_new; ++ ++ if (sprintf(pathpfx, "%s/.%s", home, dwmdir) <= 0) { ++ free(pathpfx); ++ return; ++ } ++ } ++ ++ /* try the blocking script first */ ++ path = ecalloc(1, strlen(pathpfx) + strlen(autostartblocksh) + 2); ++ if (sprintf(path, "%s/%s", pathpfx, autostartblocksh) <= 0) { ++ free(path); ++ free(pathpfx); ++ } ++ ++ if (access(path, X_OK) == 0) ++ system(path); ++ ++ /* now the non-blocking script */ ++ if (sprintf(path, "%s/%s", pathpfx, autostartsh) <= 0) { ++ free(path); ++ free(pathpfx); ++ } ++ ++ if (access(path, X_OK) == 0) ++ system(strcat(path, " &")); ++ ++ free(pathpfx); ++ free(path); ++} ++ + void + scan(void) + { +@@ -2142,6 +2223,7 @@ main(int argc, char *argv[]) + die("pledge"); + #endif /* __OpenBSD__ */ + scan(); ++ runautostart(); + run(); + cleanup(); + XCloseDisplay(dpy); +-- +2.27.0 + diff --git a/email/.config/mutt/muttrc b/email/.config/mutt/muttrc index 1125be8..1cf9637 100644 --- a/email/.config/mutt/muttrc +++ b/email/.config/mutt/muttrc @@ -25,6 +25,9 @@ send2-hook '((~f m.lubbers@cs.ru.nl)|(~f m.lubbers@science.ru.nl)|(~f mart@cs.ru 'set sendmail="checkattach.sh msmtp -a ru"' # Macro for switching to the ru address +alias identity_1 Mart Lubbers +alias identity_2 Mart Lubbers +macro compose v "^Uidentity\_" "Select from" macro compose 1 "f^UMart Lubbers " macro compose 2 "f^UMart Lubbers " @@ -75,7 +78,7 @@ auto_view text/x-vcard # Pager options #set pager=/usr/share/vim/vim82/macros/less.sh -set pager_index_lines=20 +set pager_index_lines=5 set pager_context=3 set pager_stop set menu_scroll diff --git a/shell/.bashrc b/shell/.bashrc index cc8f34c..b7fa58a 100644 --- a/shell/.bashrc +++ b/shell/.bashrc @@ -29,7 +29,7 @@ else export CLEAN_HOME=/opt/clean-x64 fi -export PATH=$CLEAN_HOME/bin:~/.local/bin:$PATH +export PATH=$CLEAN_HOME/bin:~/.local/bin:~/.nitrile/bin:~/.cabal/bin:$PATH export PATH=/opt/texlive/2021/bin/x86_64-linux:/opt/zotero:/opt/arduino:/opt/beets/bin:/opt/firefox:$PATH export MANPATH=~/.local/share/man:/opt/texlive/2021/texmf-dist/doc/man:/opt/arduino/java/man:$MANPATH @@ -44,7 +44,7 @@ alias slrn="slrn -i \"${XDG_CONFIG_HOME:-$HOME/.config}/slrn/slrnrc\"" alias ls='ls --color=auto' alias grep='grep --color=auto' alias vi='vim --servername VIM' -alias shutdown="echo \"Are you sure? I\'m Ygdrassil\" && read && shutdown" +alias kmfbmagp=tmuxmail if [ -f /etc/bash_completion ] then @@ -68,3 +68,19 @@ set_prompt(){ PS1="$PS1\$ " } PROMPT_COMMAND='set_prompt' + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/mrl/.local/share/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/mrl/.local/share/anaconda3/etc/profile.d/conda.sh" ]; then + . "/home/mrl/.local/share/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/home/mrl/.local/share/anaconda3/bin:$PATH" + fi +fi +unset __conda_setup +# <<< conda initialize <<< + diff --git a/vim/.vim/after/plugin/vimwiki-git.vim b/vim/.vim/after/plugin/vimwiki-git.vim new file mode 100644 index 0000000..680190e --- /dev/null +++ b/vim/.vim/after/plugin/vimwiki-git.vim @@ -0,0 +1,18 @@ +" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99 +" Vimwiki support for having your wiki directory as a git repo. + +" We add to the vimwiki group +if exists("g:vimwiki_list") + for w in g:vimwiki_list + augroup vimwiki + let home = w['path']."/index.wiki" + " Make sure this window's working dir is the wiki repo dir whenever home.md is opened + au! BufRead home lcd w['path']; echo "enabling vimwiki autogit"; + " Also do a git pull whenever home.md is opened + au BufRead home !git pull + let wikifiles = w['path'] . "/*" + " After writing to any file in the wiki dir, add all files in the repo, commit and push + au! BufWritePost wikifiles !git add .;git commit -m "Autocommit and push"; git push + augroup END + endfor +endif diff --git a/vim/.vim/spell/en.utf-8.add b/vim/.vim/spell/en.utf-8.add index d0c03a5..abadc9e 100644 --- a/vim/.vim/spell/en.utf-8.add +++ b/vim/.vim/spell/en.utf-8.add @@ -29,3 +29,12 @@ tagless Brightspace GitLab metaprogramming +quasiquotion +quasiquotation +quasiquoter +Radboud +Nijmegen +quasiquoters +capturable +reification +reifies diff --git a/vim/.vimrc b/vim/.vimrc index d2a798e..5cff236 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -85,3 +85,6 @@ let g:syntastic_check_on_wq = 0 " Vimwiki let g:vimwiki_list = [{'path': '~/projects/kaartenbak'}] + +" Language tools +let g:languagetool_jar = '/opt/LanguageTool-5.5/languagetool-commandline.jar' diff --git a/x/.XCompose b/x/.XCompose index cd02517..4543f3d 100644 --- a/x/.XCompose +++ b/x/.XCompose @@ -160,6 +160,7 @@ include "%L" : "∃" U2203 : "∄" U2204 : "∀" U2200 + : "⊥" U2200 # Genders : "♂" U2642 diff --git a/x/.local/bin/scr b/x/.local/bin/scr index bcbbda3..c54bf98 100755 --- a/x/.local/bin/scr +++ b/x/.local/bin/scr @@ -2,4 +2,4 @@ [ "$#" -ne 1 ] && CROP="" || CROP="-window root" URL="scr/$(date +%F_%H-%M-%S).png" import $CROP png:- | ssh helheim2 cat \> /var/www/martlubbers.net/$URL -echo "http://martlubbers.net/$URL" | cloo.gl | xclip -f | xargs -I{} notify-send {} +echo "http://martlubbers.net/$URL" | xclip -f | xargs -I{} notify-send {} diff --git a/x/.local/bin/xrandr-extend-hdmi.sh b/x/.local/bin/xrandr-extend-hdmi.sh index e567214..d034b16 100755 --- a/x/.local/bin/xrandr-extend-hdmi.sh +++ b/x/.local/bin/xrandr-extend-hdmi.sh @@ -1,2 +1,13 @@ #!/bin/sh -xrandr --output eDP-1 --auto --output HDMI-1 --right-of eDP-1 --auto +external=HDMI-1 +if xrandr | grep -q 'DP-2-1 connected' +then + echo "Docking station detected" + xrandr --output eDP-1 --auto --output DP-2-1 --right-of eDP-1 --auto +elif xrandr | grep -q 'HDMI-1 connected' +then + echo "HDMI" + xrandr --output eDP-1 --auto --output HDMI-1 --right-of eDP-1 --auto +else + echo "No external screen detected" +fi diff --git a/x/.local/bin/xrandr-only-laptop.sh b/x/.local/bin/xrandr-only-laptop.sh index 3060bbd..40ff80c 100755 --- a/x/.local/bin/xrandr-only-laptop.sh +++ b/x/.local/bin/xrandr-only-laptop.sh @@ -1,2 +1,2 @@ #!/bin/sh -xrandr --output eDP-1 --auto --output HDMI-1 --off +xrandr --output eDP-1 --auto --output HDMI-1 --off --output DP-2-1 --off diff --git a/x/.local/share/dwm/autostart.sh b/x/.local/share/dwm/autostart.sh new file mode 100755 index 0000000..c6a6cdf --- /dev/null +++ b/x/.local/share/dwm/autostart.sh @@ -0,0 +1,3 @@ +#!/bin/sh +sleep 2 +setxkbmap dvorak,ru ,phonetic_dvorak ctrl:swapcaps,compose:ralt,grp:shifts_toggle,grp_led:scroll