diff --git a/docs/alacritty.html b/docs/alacritty.html new file mode 100644 index 0000000..05b8423 --- /dev/null +++ b/docs/alacritty.html @@ -0,0 +1,114 @@ + + + + + + +Alacritty Configuration + + + + + + +
+ UP + | + HOME +
+

Alacritty Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

Fonts

+
+
+
font:
+  normal:
+    family: Hack Nerd Font Mono
+    style: Regular
+
+  bold:
+    family: Hack Nerd Font Mono
+    style: Bold
+
+  italic:
+    family: Hack Nerd Font Mono
+    style: Italic
+
+  bold_italic:
+    family: Hack Nerd Font Mono
+    style: Bold Italic
+
+  size: 10.0
+
+
+
+
+ +
+

Colors

+
+
+
colors:
+  primary:
+    background:        &gruvbox_dark_bg '#32302f'
+    foreground:        '#fbf1c7'
+    bright_foreground: '#f9f5d7'
+    dim_foreground:    '#f2e5bc'
+  cursor:
+    text:   CellBackground
+    cursor: CellForeground
+  vi_mode_cursor:
+    text:   CellBackground
+    cursor: CellForeground
+  selection:
+    text:       CellBackground
+    background: CellForeground
+  bright:
+    black:   '#928374'
+    red:     '#fb4934'
+    green:   '#b8bb26'
+    yellow:  '#fabd2f'
+    blue:    '#83a598'
+    magenta: '#d3869b'
+    cyan:    '#8ec07c'
+    white:   '#ebdbb2'
+  normal:
+    black:   *gruvbox_dark_bg
+    red:     '#cc241d'
+    green:   '#98971a'
+    yellow:  '#d79921'
+    blue:    '#458588'
+    magenta: '#b16286'
+    cyan:    '#689d6a'
+    white:   '#a89984'
+  dim:
+    black:   '#32302f'
+    red:     '#9d0006'
+    green:   '#79740e'
+    yellow:  '#b57614'
+    blue:    '#076678'
+    magenta: '#8f3f71'
+    cyan:    '#427b58'
+    white:   '#928374'
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2021-06-20 dim. 14:22

+
+ + diff --git a/docs/android.html b/docs/android.html index 1659f27..28ede9e 100644 --- a/docs/android.html +++ b/docs/android.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Android Phone @@ -33,6 +33,7 @@
  • Favorite Apps
  • Tutorials
  • @@ -472,6 +473,23 @@ Tutorial: https://www.yout

    Tutorials

    +
    +

    Backup

    +
    +

    +I use adb backup to backup the phone (guide). +

    + +

    +Basically, I have to run: +

    +
    +
    adb backup -apk -shared -all -f ~/Cloud/android/backup/backup_$(date +"%Y_%m_%d").ab
    +
    +
    +
    +
    +

    Connect to the phone by SSH

    @@ -488,7 +506,7 @@ An other option would be to use Wireguard and shen to ssh.

    Author: Dehaeze Thomas

    -

    Created: 2021-05-02 dim. 11:26

    +

    Created: 2021-06-20 dim. 14:21

    diff --git a/docs/bash.html b/docs/bash.html index c05a044..7531ddd 100644 --- a/docs/bash.html +++ b/docs/bash.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Bash Configuration - + @@ -16,11 +16,11 @@ UP | HOME -
    +

    Bash Configuration

    -
    +

    Table of Contents

    -
    +
    • ~/.bashrc
        @@ -63,13 +63,12 @@
      • Export some default applications
      • Exports
      • Path
      • @@ -496,7 +495,7 @@ Enable the keyring for applications run through the terminal
        export EDITOR="nvim"
        -export TERMINAL="termite"
        +export TERMINAL="alacritty"
         export BROWSER="qutebrowser"
         export READER="zathura"
         export FILE="ranger"
        @@ -509,19 +508,6 @@ Enable the keyring for applications run through the terminal
         

        Exports

        -
        -

        Term

        -
        -

        -This is important for termite to work when sshing in remote machines. -

        -
        -
        export TERM=xterm-color
        -
        -
        -
        -
        -

        XDG Default

        @@ -563,16 +549,6 @@ This is important for termite to work when sshing in remote machines.
        -
        -

        Bitwarden Session

        -
        -
        -
        export BW_SESSION="HH0yycfocRSuGtq/iW1e6v13PQ1sShMXbMhdb/En94S6OcIXFnJlLEyU+dySsmf2YShY4CImoB5FrxgdPsY9Qw=="
        -
        -
        -
        -
        -

        Python Path

        @@ -582,6 +558,17 @@ This is important for termite to work when sshing in remote machines.
        + +
        +

        Linkding

        +
        +
        +
        export LINKDING_URL="localhost:9090"
        +export LINKDING_TOKEN=`pass nas/linkding_token`
        +
        +
        +
        +
        @@ -691,7 +678,7 @@ Don’t echo ^C after Ctrl+C is pressed.

        Author: Dehaeze Thomas

        -

        Created: 2021-01-08 ven. 01:40

        +

        Created: 2021-10-25 lun. 14:33

        diff --git a/docs/binaries-private.html b/docs/binaries-private.html index bb92aac..ce63983 100644 --- a/docs/binaries-private.html +++ b/docs/binaries-private.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + My own specific binaries @@ -16,11 +16,11 @@ UP | HOME -
    +

    My own specific binaries

    -
    +

    Table of Contents

    -
    +
    • remote-desktop - Remote Desktop Connect
    • print-rnice - Print on Rnice
    • @@ -29,7 +29,6 @@
    • torrent-add - Download Torrent
    • dl-add - Direct Download with Aria2
    • note-extract-fig - Extract Figure from note file
    • -
    • share - Share file with self-hosted transfer.sh
    • screen-select - Xrandr pre-defined scripts
    • color-picker - Pick color and copy to clipboard
    • readbib - Open Bibliography File
    • @@ -78,9 +77,9 @@ dunstify --replace=89891 media=$(echo -e 'A4\nA3' | dmenu -p 'Size:' -l 20); # First copy the file to Rnice -if sshpass -p "$(pass ssl.esrf.fr/dehaeze | sed -n 1p)" scp $1 dehaeze@rnice:~/Downloads/; then +if sshpass -p "$(pass esrf.fr/dehaeze | sed -n 1p)" scp $1 dehaeze@rnice:/home/esrf/dehaeze/Downloads/; then # Then print on Rnice - sshpass -p "$(pass ssl.esrf.fr/dehaeze | sed -n 1p)" ssh dehaeze@rnice "lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P ctb110c1u ~/Downloads/$1"; + sshpass -p "$(pass esrf.fr/dehaeze | sed -n 1p)" ssh dehaeze@rnice "lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P ctb127c1w \"/home/esrf/dehaeze/Downloads/$1\""; # Finally, delete the file else echo "Command Failed" @@ -126,13 +125,13 @@ As an alternative, sshfs can be used:
      if [ $1 == "mount" ]; then
      -    if mount /home/thomas/mnt/NAS/; then
      +    if sshfs -o allow_other,default_permissions homelab:/srv/storage/ ~/mnt/NAS; then
               dunstify --replace=58249 'NAS ' 'Successfully mounted'
           else
               dunstify --replace=58249 --urgency=critical 'NAS ' 'Error while mounted'
           fi
       elif [ $1 == "umount" ]; then
      -    if umount /home/thomas/mnt/NAS/; then
      +    if umount ~/mnt/NAS/; then
               dunstify --replace=58249 'NAS ' 'Successfully unmounted'
           else
               dunstify --replace=58249 --urgency=critical 'NAS ' 'Error while unmounted'
      @@ -147,7 +146,7 @@ As an alternative, sshfs can be used:
       

      torrent-add - Download Torrent

      -
      transmission-remote <<get-password(passname="ip/grenoble")>>:9091 --auth tdehaeze:$(pass nas/transmission | sed -n 1p) -a $1 && \
      +
      transmission-remote <<get-password(passname="ip/homelab")>>:9091 --auth tdehaeze:$(pass nas/transmission | sed -n 1p) -a $1 && \
           dunstify 'Torrent' 'Successfully added' || \
           dunstify 'Torrent' 'Error'
       
      @@ -185,46 +184,44 @@ Script used to convert a figure drawn on my Boox note2 to a png file that can th
      -
      -

      share - Share file with self-hosted transfer.sh

      -
      -
      -
      if [ $TMUX ]; then
      -    tmux split -v -l 1 "curl --progress-bar -F\"file=@$1\" https://file.tdehaeze.xyz/ | xsel -ib && dunstify 'Upload' 'Successful' || dunstify --urgency=critical 'Upload' 'Failed';" && tmux select-pane -U
      -else
      -    curl --progress-bar -F"file=@$1" https://file.tdehaeze.xyz/ | xsel -ib && \
      -        dunstify 'Upload' 'Successful' || \
      -        dunstify --urgency=critical 'Upload' 'Failed'
      -fi
      -
      -
      -
      -
      -

      screen-select - Xrandr pre-defined scripts

      option=$(echo -e "Work\nXPS\nHome" | rofi -i -dmenu)
       
      +after_screen_change () {
      +    # Fix background if screen size/arangement has changed.
      +    setbg
      +
      +    # Kill polybar
      +    killall -q polybar
      +
      +    # Wait until the processes have been shut down
      +    while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
      +
      +    # Launch bars
      +    polybar top &
      +}
      +
       case "$option" in
           "Work")
      -        xrandr --output eDP1 --off --output DP1 --off --output DP1-1 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output DP1-2 --off --output DP2 --off --output VIRTUAL1 --off
      +        xrandr --output eDP1 --off --output DP1 --off --output DP2 --off --output DP2-1 --off --output VIRTUAL1 --off --output DP2-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
      +            after_screen_change
               ;;
           "XPS")
      -        xrandr --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP1 --off --output DP1-1 --off --output DP1-2 --off --output DP2 --off --output VIRTUAL1 --off
      +        xrandr --output DP1 --off --output DP2 --off --output DP2-1 --off --output VIRTUAL1 --off --output DP2-2 --off --output eDP1 --primary --mode 1920x1080 --pos 0x0 --rotate normal && \
      +            after_screen_change
               ;;
           "Home")
      -        xrandr --output eDP1 --off --output DP2-1 --primary --mode 2560x1440 --pos 0x0 --rotate normal --output DP1 --off --output VIRTUAL1 --off
      +        xrandr --output eDP1 --off --output DP1 --off --output DP2 --off --output DP2-2 --off --output VIRTUAL1 --off --output DP2-1  --primary --mode 2560x1440 --pos 0x0 --rotate normal && \
      +            after_screen_change
               ;;
           *)
               echo "== ! missing or invalid argument ! =="
               exit 2
       esac
       
      -setbg && \    # Fix background if screen size/arangement has changed.
      -  polybar-msg cmd restart # restart polybar
      -
       exit 0
       
      @@ -263,7 +260,7 @@ List all pdf files and open selected one with zathura.

      -
      cd ~/Cloud/brain/pdfs/ && ls | rofi -dmenu -lines 20 | xargs -I {} zathura {}
      +
      cd ~/Cloud/brain/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {}
       
      @@ -271,7 +268,7 @@ List all pdf files and open selected one with zathura.

      Author: Dehaeze Thomas

      -

      Created: 2021-05-02 dim. 11:26

      +

      Created: 2021-10-25 lun. 14:33

      diff --git a/docs/binaries.html b/docs/binaries.html index 4b5de0b..4ba5c83 100644 --- a/docs/binaries.html +++ b/docs/binaries.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Binaries @@ -16,11 +16,11 @@ UP | HOME -
      +

      Binaries

      -
      +

      Table of Contents

      -
      +
      • dmenumount - Mount USB and Android
      • dmenuumount - Unmount USB and Android devices
      • @@ -37,14 +37,80 @@
      • setbg - Set Background
      • insert-unicode - Insert Unicode Icon
      • insert-nerd-fonts - Insert Nerd Font Icon
      • -
      • linkhandler - Open with Default application
      • +
      • linkhandler - Open any URL with Default application
      • +
      • open - Open any file using rifle
      • lockscreen - Lock Screen
      • mopidy-restart - Restart Mopidy
      • upload - Upload Script
      • weather - Display Weather in terminal
      • pdf2bib - Extract bibtex entry from PDF file
      • pdf2png - Convert a PDF to PNG
      • -
      • convert-file - Convert any file to another filetype
      • +
      • convert-file - Convert any file to another filetype + +
      • pdf-shrink - Pdf Shrink
      • pdf-delete-annotations - Delete Annotations from PDFs
      • pdf-delete-first-page - Delete first page of PDF
      • @@ -466,7 +532,7 @@ Script taken from here that a if [[ $val -eq 1 ]]; then exit elif [[ $val -eq 0 ]]; then - if [[ $(echo "${inserttags}" | wc -l) -gt 1 ]]; then + if [[ $(echo "${inserttags}" | wc -l) -gt 1 ]]; then taglist=$(echo "${inserttags}" | tr '\n' ',') tags=() for tag in $taglist; do @@ -831,33 +897,50 @@ xsel -h 2>/dev/null ||
        -

        linkhandler - Open with Default application

        +

        linkhandler - Open any URL with Default application

        Inspired from linkhandler script (github). -This is used to open any type of file with the wanted program. -It can be used in newsboat, neomutt and ranger for instance. +This is used to open any url with the wanted program.

        [ -z "$1" ] && { "$BROWSER"; exit; }
         
         case "$1" in
        -    *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*)
        -        setsid mpv --input-ipc-server=/tmp/mpvsoc$(date +%s) -quiet "$1" >/dev/null 2>&1 & ;;
        -    *png|*jpg|*jpe|*jpeg|*gif)
        -        curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")"  >/dev/null 2>&1 & ;;
        +    *mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*gif)
        +        setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
        +    *png|*jpg|*jpe|*jpeg)
        +        curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
        +    *pdf|*cbz|*cbr)
        +        curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
        +    *svg)
        +        curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && inkview "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;;
             *mp3|*flac|*opus|*mp3?source*)
                 setsid curl -LO "$1" >/dev/null 2>&1 & ;;
             *)
        -        if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1"
        -        else setsid $BROWSER "$1" >/dev/null 2>&1 & fi ;;
        +        [ -f "$1" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$1" >/dev/null 2>&1 || setsid -f "$BROWSER" "$1" >/dev/null 2>&1
         esac
         
        +
        +

        open - Open any file using rifle

        +
        +

        +Simple alternative to xdg-open, uses the rifle program included with ranger. +The default applications are listed here. +

        + +
        +
        rifle -p $(rifle -l "$1" | rofi -dmenu -i | sed -n -e 's/\([0-9]*\):.*/\1/p') "$1"
        +
        +
        +
        +
        +

        lockscreen - Lock Screen

        @@ -1023,6 +1106,11 @@ Get the weather from http://wttr.in/.

        convert-file - Convert any file to another filetype

        +
        + +
        +

        Get basic information about the file

        +
        # Get filename
         filename_with_extension=$(basename -- "$1")
        @@ -1030,8 +1118,55 @@ Get the weather from http://wttr.in/.
         in_ext="${filename_with_extension##*.}"
         # filename without extension
         filename_without_extension=${filename_with_extension%.*}
        +
        +
        +
        +
        -# Convert SVG Files +
        +

        SVG files

        +
        +

        +List of useful programs: +

        +
          +
        • inkscape
        • +
        +
        + +
        +

        SVG to PNG

        +
        +
        +
        svg2png_function() { \
        +    if command -v inkscape &> /dev/null; then
        +        inkscape --export-type="$out_ext" --export-dpi=200 --export-area-drawing "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        SVG to PDF

        +
        +
        +
        svg2pdf_function() { \
        +    if command -v inkscape &> /dev/null; then
        +        inkscape --export-type="$out_ext" "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert SVG Files
         svg2() { \
             out_ext=$(echo -e "pdf\npng" | rofi -i -dmenu -p "Convert SVG to")
         
        @@ -1041,37 +1176,306 @@ Get the weather from http://wttr.in/.
         
             case "$out_ext" in
                 "png")
        -            inkscape --export-type="$out_ext" --export-dpi=200 --export-area-drawing "$filename_with_extension"
        +            svg2png_function
                     ;;
                 "pdf")
        -            inkscape --export-type="$out_ext" "$filename_with_extension"
        -            # pdf2svg file.pdf file.svg
        +            svg2pdf_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -# Convert PDF Files +
        +

        PDF files

        +
        +

        +List of useful programs: +

        +
          +
        • pdftocairo
        • +
        • pdftoppm
        • +
        • convert
        • +
        • inkscape
        • +
        • gs
        • +
        • pdfcrop
        • +
        • pdftk
        • +
        +
        + +
        +

        PDF to PNG

        +
        +
        +
        pdf2png_function() { \
        +    if command -v pdftocairo &> /dev/null; then
        +        pdftocairo -png -singlefile -cropbox "$filename_with_extension" "$filename_without_extension"
        +    elif command -v pdftoppm &> /dev/null; then
        +        pdftoppm -png "$filename_with_extension" > "$filename_without_extension.png"
        +    elif command -v convert &> /dev/null; then
        +        convert -density 100 -trim -antialias "$filename_with_extension" -quality 100 "$filename_without_extension.png"
        +    elif command -v inkscape &> /dev/null; then
        +        inkscape --export-type="$out_ext" --export-dpi=200 --export-area-drawing "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PDF to SVG

        +
        +
        +
        pdf2svg_function() { \
        +    if command -v pdftocairo &> /dev/null; then
        +        pdftocairo -svg "$filename_with_extension" "$filename_without_extension.svg"
        +    elif command -v pdf2svg &> /dev/null; then
        +        pdf2svg "$filename_with_extension" "$filename_without_extension.svg"
        +    elif command -v inkscape &> /dev/null; then
        +        inkscape --export-type="$out_ext" "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PDF Reduce Size

        +
        +
        +
        pdfreduce_function() { \
        +    if command -v gs &> /dev/null; then
        +        # Maybe ask for new filename?
        +        gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$filename_without_extension.red.pdf" "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PDF Trim

        +
        +
        +
        pdftrim_function() { \
        +    if command -v pdfcrop &> /dev/null; then
        +        pdfcrop "$filename_with_extension" "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PDF Extract Pages

        +
        +
        +
        pdfextract_function() { \
        +    if command -v pdftk &> /dev/null; then
        +        pages=$(echo -e "get first\ndelete first\nextract i-j" | rofi -i -dmenu -p "Extract pages")
        +
        +        if [ -z "$pages" ]; then
        +            exit;
        +        fi
        +
        +        case "$pages" in
        +            "get first")
        +                if command -v pdftk &> /dev/null; then
        +                    pdftk "$filename_with_extension" cat 1-1 output "$filename_without_extension.first.pdf"
        +                fi
        +                ;;
        +            "delete first")
        +                if command -v pdftk &> /dev/null; then
        +                    pdftk "$filename_with_extension" cat 2-end output "$filename_with_extension"
        +                fi
        +                ;;
        +            "extract i-j")
        +                # TODO
        +                page_i=$(rofi -dmenu -p "From")
        +                page_j=$(rofi -dmenu -p "To")
        +                if command -v pdftk &> /dev/null; then
        +                    pdftk "$filename_with_extension" cat "$page_i-$page_j" output "$filename_with_extension.slice.pdf"
        +                fi
        +                ;;
        +        esac
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Delete First Page

        +
        +
        +
        pdf_delete_first_page_function() { \
        +    if command -v stapler &> /dev/null; then
        +        stapler del "$filename_with_extension" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
        +    elif command -v pdftk &> /dev/null; then
        +        pdftk "$filename_with_extension" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Remove Annotations

        +
        +
        +
        pdf_remove_annotations_function() { \
        +    if command -v pdftk &> /dev/null; then
        +        pdftk "$filename_with_extension" output /tmp/uncompressed.pdf uncompress
        +        LANG=C sed -n '/^\/Annots/!p' /tmp/uncompressed.pdf > /tmp/stripped.pdf
        +        pdftk /tmp/stripped.pdf output "$filename_with_extension" compress
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert PDF Files
         pdf2() { \
        -    out_ext=$(echo -e "svg\npng\nreduce" | rofi -i -dmenu -p "Convert PDF to")
        +    out_ext=$(echo -e "svg\npng\nreduce size\ntrim\nextract pages\ndelete first page\nremove annotations" | rofi -i -dmenu -p "Convert PDF to")
         
             if [ -z "$out_ext" ]; then
                 exit;
             fi
         
             case "$out_ext" in
        -        "png")
        -            inkscape --export-type="$out_ext" --export-dpi=200 --export-area-drawing "$filename_with_extension"
        -            ;;
        -        "reduce")
        -            gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$filename_without_extension.red.pdf" "$filename_with_extension"
        -            ;;
                 "svg")
        -            inkscape --export-type="$out_ext" "$filename_with_extension"
        +            pdf2svg_function
        +            ;;
        +        "png")
        +            pdf2png_function
        +            ;;
        +        "reduce size")
        +            pdfreduce_function
        +            ;;
        +        "trim")
        +            pdftrim_function
        +            ;;
        +        "extract pages")
        +            pdfextract_function
        +            ;;
        +        "delete first page")
        +            pdf_delete_first_page_function
        +            ;;
        +        "remove annotations")
        +            pdf_remove_annotations_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -# Convert DOCX/PPTX Files +
        +

        DVI files

        +
        +

        +List of useful programs: +

        +
          +
        • dvisvgm
        • +
        • dvipng
        • +
        +
        + +
        +

        DVI to PNG

        +
        +
        +
        dvi2png_function() { \
        +    if command -v dvipng &> /dev/null; then
        +        dvipng "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        DVI to SVG

        +
        +
        +
        dvi2svg_function() { \
        +    if command -v dvisvgm &> /dev/null; then
        +        dvisvgm "$filename_with_extension" -o "$filename_without_extension.svg"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert DVI Files
        +dvi2() { \
        +    out_ext=$(echo -e "svg\npng" | rofi -i -dmenu -p "Convert DVI to")
        +
        +    if [ -z "$out_ext" ]; then
        +        exit;
        +    fi
        +
        +    case "$out_ext" in
        +        "svg")
        +            dvi2svg_function
        +            ;;
        +        "png")
        +            dvi2png_function
        +            ;;
        +    esac
        +}
        +
        +
        +
        +
        +
        + +
        +

        DOCX/PTTX files

        +
        +
        +
        +

        DOC to PDF

        +
        +
        +
        doc2pdf_function() { \
        +    if command -v lowriter &> /dev/null; then
        +        lowriter --convert-to pdf "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert DOCX/PPTX Files
         docx2() { \
             out_ext=$(echo -e "pdf" | rofi -i -dmenu -p "Convert DOCX/PPTX to")
         
        @@ -1081,12 +1485,39 @@ Get the weather from http://wttr.in/.
         
             case "$out_ext" in
                 "pdf")
        -            lowriter --convert-to pdf "$filename_with_extension"
        +            doc2pdf_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -# Convert GIF Files +
        +

        GIF files

        +
        +
        +
        +

        GIF to PNG

        +
        +
        +
        gif2png_function() { \
        +    if command -v convert &> /dev/null; then
        +        convert -coalesce "$filename_with_extension" "$filename_without_extension.png"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert GIF Files
         gif2() { \
             out_ext=$(echo -e "png" | rofi -i -dmenu -p "Convert GIF to")
         
        @@ -1096,14 +1527,90 @@ Get the weather from http://wttr.in/.
         
             case "$out_ext" in
                 "png")
        -            convert -coalesce "$filename_with_extension" "$filename_without_extension.png"
        +            gif2png_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -# Convert PNG Files +
        +

        PNG files

        +
        +
        +
        +

        PNG to PDF

        +
        +
        +
        png2pdf_function() { \
        +    if command -v convert &> /dev/null; then
        +        convert "$filename_with_extension" "$filename_without_extension.pdf"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PNG to JPG

        +
        +
        +
        png2jpg_function() { \
        +    if command -v convert &> /dev/null; then
        +        convert "$filename_with_extension" "$filename_without_extension.jpg"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PNG Trim

        +
        +
        +
        pngtrim_function() { \
        +    if command -v convert &> /dev/null; then
        +        convert -trim "$filename_with_extension" "$filename_with_extension"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        PNG Resize

        +
        +
        +
        pngresize_function() { \
        +    if command -v convert &> /dev/null; then
        +         size_type=$(echo -e "width\nheight" | rofi -i -dmenu -p "Maximum:")
        +         size_px=$(rofi -dmenu -p "Number of px:")
        +
        +         if [ "$size_type" = "width" ]; then
        +             convert -resize "$size_px"x "$filename_with_extension" "$filename_with_extension"
        +         elif [ "$size_type" = "height" ]; then
        +             convert -resize x"$size_px" "$filename_with_extension" "$filename_with_extension"
        +         fi
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert PNG Files
         png2() { \
        -    out_ext=$(echo -e "pdf\ntrim" | rofi -i -dmenu -p "Convert PNG to")
        +    out_ext=$(echo -e "pdf\njpg\ntrim\nresize" | rofi -i -dmenu -p "Convert PNG to")
         
             if [ -z "$out_ext" ]; then
                 exit;
        @@ -1111,15 +1618,126 @@ Get the weather from http://wttr.in/.
         
             case "$out_ext" in
                 "pdf")
        -            convert "$filename_with_extension" "$filename_without_extension.pdf"
        +            png2pdf_function
        +            ;;
        +        "jpg")
        +            png2jpg_function
                     ;;
                 "trim")
        -            convert -trim "$filename_with_extension" "$filename_with_extension" # Maybe should ask new filename
        +            pngtrim_function
        +            ;;
        +        "resize")
        +            pngresize_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -# Convert MP4 Files +
        +

        JPG files

        +
        +
        +
        +

        JPG to PDF

        +
        +
        +
        jpg2pdf_function() { \
        +    if command -v convert &> /dev/null; then
        +        convert "$filename_with_extension" "$filename_without_extension.pdf"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        JPG Resize

        +
        +
        +
        jpgresize_function() { \
        +    if command -v convert &> /dev/null; then
        +         size_type=$(echo -e "width\nheight" | rofi -i -dmenu -p "Maximum:")
        +         size_px=$(rofi -dmenu -p "Number of px:")
        +
        +         if [ "$size_type" = "width" ]; then
        +             convert -resize "$size_px"x "$filename_with_extension" "$filename_with_extension"
        +         elif [ "$size_type" = "height" ]; then
        +             convert -resize x"$size_px" "$filename_with_extension" "$filename_with_extension"
        +         fi
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert JPG Files
        +jpg2() { \
        +    out_ext=$(echo -e "pdf\nresize" | rofi -i -dmenu -p "Convert JPG to")
        +
        +    if [ -z "$out_ext" ]; then
        +        exit;
        +    fi
        +
        +    case "$out_ext" in
        +        "pdf")
        +            jpg2pdf_function
        +            ;;
        +        "resize")
        +            jpgresize_function
        +            ;;
        +    esac
        +}
        +
        +
        +
        +
        +
        + +
        +

        MP4 files

        +
        +
        +
        +

        MP4 to GIF

        +
        +
        +
        mp42gif_function() { \
        +    if command -v ffmpeg &> /dev/null; then
        +         palette="/tmp/palette.png"
        +
        +         width=$(echo -e "auto" | rofi -i -dmenu -p "GIF width")
        +         if [ "$width" = "auto" ]; then
        +             filters="fps=15"
        +         else
        +             filters="fps=15,scale=$width:-1:flags=lanczos"
        +         fi
        +
        +         # Generate optimal pallette of colors
        +         ffmpeg -v warning -i "$filename_with_extension" -vf "$filters,palettegen" -y $palette
        +         # Convert
        +         ffmpeg -v warning -i "$filename_with_extension" -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y "$filename_without_extension.gif"
        +    fi
        +}
        +
        +
        +
        +
        + +
        +

        Main function

        +
        +
        +
        # Convert MP4 Files
         mp42() { \
             out_ext=$(echo -e "gif" | rofi -i -dmenu -p "Convert MP4 to")
         
        @@ -1129,18 +1747,30 @@ Get the weather from http://wttr.in/.
         
             case "$out_ext" in
                 "gif")
        -            make-gif "$filename_with_extension" "$filename_without_extension.gif"
        +            mp42gif_function
                     ;;
             esac
         }
        +
        +
        +
        +
        +
        -case "$in_ext" in +
        +

        Case statement

        +
        +
        +
        case "$in_ext" in
             "svg")
                 svg2
                 ;;
             "gif")
                 gif2
                 ;;
        +    "dvi")
        +        dvi2
        +        ;;
             "pdf")
                 pdf2
                 ;;
        @@ -1150,6 +1780,12 @@ Get the weather from http://wttr.in/.
             "png")
                 png2
                 ;;
        +    "jpg")
        +        jpg2
        +        ;;
        +    "jpeg")
        +        jpg2
        +        ;;
             "docx")
                 docx2
                 ;;
        @@ -1161,6 +1797,7 @@ Get the weather from http://wttr.in/.
         
        +

        pdf-shrink - Pdf Shrink

        @@ -1335,7 +1972,7 @@ Run some simple calculations with rofi.

        Author: Dehaeze Thomas

        -

        Created: 2021-04-25 dim. 19:10

        +

        Created: 2021-10-25 lun. 14:33

        diff --git a/docs/calendar-contact.html b/docs/calendar-contact.html index 52a588b..24dee58 100644 --- a/docs/calendar-contact.html +++ b/docs/calendar-contact.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Calendar and Contact Configuration @@ -16,15 +16,16 @@ UP | HOME -
        +

        Calendar and Contact Configuration

        -
        +

        Table of Contents

        - @@ -46,7 +47,7 @@ type = "caldav" url = "https://radicale.tdehaeze.xyz/tdehaeze/" username = "tdehaeze" -password = "<<get-password(passname="radicale.tdehaeze.xyz/tdehaeze")>>" +password = "<<get-password(passname='radicale.tdehaeze.xyz/tdehaeze')>>" [storage radicale_calendar_local] type = "filesystem" @@ -63,7 +64,7 @@ type = "caldav" url = "https://calendar.esrf.fr/egroupware/groupdav.php/calendar" username = "dehaeze" -password = "<<get-password(passname="ce-esrf.fr/dehaeze")>>" +password = "<<get-password(passname='esrf.fr/dehaeze')>>" [storage esrf_calendar_local] type = "filesystem" @@ -85,7 +86,7 @@ type = "carddav" url = "https://radicale.tdehaeze.xyz/tdehaeze/" username = "tdehaeze" -password = "<<get-password(passname="radicale.tdehaeze.xyz/tdehaeze")>>" +password = "<<get-password(passname='radicale.tdehaeze.xyz/tdehaeze')>>"
        @@ -191,10 +192,40 @@
      + +
      +

      ics-add - Add ICS file to Khal

      +
      +

      +This function is useful to easily add an event to khal. +It is for instance used in the mutt configuration. +

      + +

      +To share an event by email, the currently best way to proceed is to first find the event on khal, press e to export it to a file, and then add this file as an attachment. +

      + +
      +
      if [[ -f $1 ]]; then
      +    resp=$(echo -e "yes\nno" | rofi -i -only-match -dmenu -p "Would you like to add the event:" -mesg "`khal printics $1 | tail -n +2`")
      +
      +    if [[ "$resp" == "yes" ]]; then
      +        calendar=$(echo "`khal printcalendars`" | rofi -i -only-match -dmenu -p "Save to:")
      +        if [ -z "$calendar" ]; then
      +            exit;
      +        fi
      +        khal import -a "$calendar" --batch $1 && \
      +            dunstify "Calendar" "Even added";
      +    fi
      +fi
      +
      +
      +
      +

      Author: Dehaeze Thomas

      -

      Created: 2021-05-02 dim. 11:26

      +

      Created: 2021-10-25 lun. 14:33

      diff --git a/docs/config.html b/docs/config.html index 7b32f10..b810fa3 100644 --- a/docs/config.html +++ b/docs/config.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Configuration Files @@ -16,11 +16,11 @@ UP | HOME -
      +

      Configuration Files

      -
      +

      Table of Contents

      -
      +
      • SSH
      • Font
      • @@ -41,14 +41,26 @@
        AddKeysToAgent  yes
         
        -Host grenoble
        -    hostname <<get-password(passname="ip/grenoble")>>
        +Host homelab
        +    hostname <<get-password(passname="ip/homelab")>>
        +    Port 22
        +    user thomas
        +    IdentityFile ~/.ssh/id_rsa
        +
        +Host router
        +    hostname 192.168.1.1
        +    Port 22
        +    user root
        +    IdentityFile ~/.ssh/id_rsa
        +
        +Host smarttv
        +    hostname 192.168.1.73
             Port 22
             user thomas
             IdentityFile ~/.ssh/id_rsa
         
         Host oneplus
        -    hostname 192.168.1.58
        +    hostname 192.168.1.101
             Port 8022
             IdentityFile ~/.ssh/id_rsa
         
        @@ -769,7 +781,7 @@ login tdehaeze machine torrent.tdehaeze.xyz login tdehaeze -password <<get-password(passname="torrent.tdehaeze.xyz/tdehaeze")>> +password <<get-password(passname="nas/transmission")>> machine dl.tdehaeze.xyz login tdehaeze @@ -790,6 +802,14 @@ login tdehaeze machine qobuz.tdehaeze.xyz login tdehaeze password <<get-password(passname="qobuz.tdehaeze.xyz/tdehaeze")>> + +machine down.tdehaeze.xyz +login tdehaeze +password <<get-password(passname="down.tdehaeze.xyz/tdehaeze")>> + +machine joal.tdehaeze.xyz +login tdehaeze +password <<get-password(passname="joal.tdehaeze.xyz/tdehaeze")>>
      @@ -838,7 +858,7 @@ Colors

      Author: Dehaeze Thomas

      -

      Created: 2021-05-02 dim. 11:26

      +

      Created: 2021-10-25 lun. 14:33

      diff --git a/docs/doom.html b/docs/doom.html index 70e145b..9490c0a 100644 --- a/docs/doom.html +++ b/docs/doom.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Doom Emacs Configuration @@ -16,11 +16,11 @@ UP | HOME -
      +

      Doom Emacs Configuration

      -
      +

      Table of Contents

      -
      +
      @@ -772,6 +781,22 @@ Switch from one language to an other ((setq ispell-program-name "aspell")
      + +
      +
      (defun tdh-correct-last-word ()
      +  (interactive)
      +  (save-excursion
      +    (+spell/previous-error)
      +    (+spell/correct)
      +    )
      +  )
      +
      +
      + +
      +
      (define-key evil-insert-state-map (kbd "C-l") 'tdh-correct-last-word)
      +
      +
      @@ -792,9 +817,9 @@ Switch from one language to an other ((global-hl-line-mode -1) (after! org (add-hook 'org-mode-hook - (lambda() - (hl-line-mode -1) - (global-hl-line-mode -1)) + (lambda() + (hl-line-mode -1) + (global-hl-line-mode -1)) 't )) @@ -823,17 +848,17 @@ Switch from one language to an other ((after! magit (setq magit-diff-refine-hunk 'all) - (setq magit-repository-directories `(("~/Cloud/thesis/matlab/" . 1) - ("~/Cloud/thesis/papers/" . 1))) - (setq magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) - ("Status" 7 magit-repolist-column-flag) - ("B<U" 3 magit-repolist-column-unpulled-from-upstream - ((:right-align t) - (:help-echo "Upstream changes not in branch"))) - ("B>U" 3 magit-repolist-column-unpushed-to-upstream - ((:right-align t) - (:help-echo "Local changes not in upstream"))) - ("Path" 99 magit-repolist-column-path nil))) + (setq magit-repository-directories `(("~/Cloud/thesis/matlab/" . 1) + ("~/Cloud/thesis/papers/" . 1))) + (setq magit-repolist-columns '(("Name" 25 magit-repolist-column-ident nil) + ("Status" 7 magit-repolist-column-flag) + ("B<U" 3 magit-repolist-column-unpulled-from-upstream + ((:right-align t) + (:help-echo "Upstream changes not in branch"))) + ("B>U" 3 magit-repolist-column-unpushed-to-upstream + ((:right-align t) + (:help-echo "Local changes not in upstream"))) + ("Path" 99 magit-repolist-column-path nil))) )
      @@ -868,6 +893,17 @@ This works also with C-x C-q
    • ( Hide details
    • ) Show git infos
    + +
    +
    (after! magit
    +  (setq dired-listing-switches "-lAGh1v --group-directories-first")
    +  (add-hook 'dired-mode-hook
    +            (lambda ()
    +              (dired-hide-details-mode)
    +              (dired-sort-toggle-or-edit)))
    +  )
    +
    +
    @@ -877,7 +913,7 @@ This works also with C-x C-q
    (use-package! pdf-tools
       :config
    -  (add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
    +  (add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
       )
     
    @@ -886,11 +922,11 @@ This works also with C-x C-q
    (defun tdh-screenshot-page ()
       "Open current page as an SVG file with Inkscape"
       (interactive)
    -  (if (string-match "_" (file-name-base buffer-file-name))
    -      (setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_"))))
    -    (setq filename (read-string "Enter file name:")))
    +  (if (string-match "_" (file-name-base buffer-file-name))
    +      (setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_"))))
    +    (setq filename (read-string "Enter file name:")))
       (setq filepath (concat "/tmp/" filename ".svg"))
    -  (shell-command (concat "pdftk " buffer-file-name " cat " (number-to-string (pdf-view-current-page)) " output /tmp/pdf_page.pdf"))
    +  (shell-command (concat "pdftk " buffer-file-name " cat " (number-to-string (pdf-view-current-page)) " output /tmp/pdf_page.pdf"))
       (shell-command (concat "pdf2svg /tmp/pdf_page.pdf " filepath))
       (start-process "" nil "inkscape" filepath))
     
    @@ -907,6 +943,38 @@ This works also with C-x C-q
    +
    +

    Flycheck

    +
    +
    +
    (flycheck-define-checker proselint
    +  "A linter for prose."
    +  :command ("proselint" source-inplace)
    +  :error-patterns
    +  ((warning line-start (file-name) ":" line ":" column ": "
    +            (id (one-or-more (not (any " "))))
    +            (message (one-or-more not-newline)
    +                     (zero-or-more "\n" (any " ") (one-or-more not-newline)))
    +            line-end))
    +  :modes (text-mode markdown-mode gfm-mode org-mode))
    +
    +(add-to-list 'flycheck-checkers 'proselint)
    +
    +
    + +

    +Disable flycheck for now with orgmode buffers: +

    +
    +
    (defun disable-flycheck-mode ()
    +  (interactive)
    +  (flycheck-mode -1))
    +(add-hook 'org-mode-hook 'disable-flycheck-mode)
    +
    +
    +
    +
    +

    Yassnippets

    @@ -925,14 +993,14 @@ This works also with C-x C-q
    (defun tdh-export-everything-to-hugo ()
       "Export all the .org files in the specified directory to markdown using Hugo"
       (interactive)
    -  (setq org-files (directory-files (read-directory-name "Directory:" "/home/thomas/Cloud/brain/") t "org$" t))
    +  (setq org-files (directory-files (read-directory-name "Directory:" "/home/thomas/Cloud/brain/") t "org$" t))
     
       (while org-files
    -    (setq current-org-file (car org-files))
    +    (setq current-org-file (car org-files))
         (message "Exporting %s" current-org-file)
         (find-file current-org-file)
         (org-hugo-export-to-md)
    -    (setq org-files (cdr org-files))))
    +    (setq org-files (cdr org-files))))
     
    @@ -1016,15 +1084,15 @@ Display the real size of images and not the one set with attr_latex: :widt
    -
    -

    Org Links

    -
    +
    +

    Org Links

    +
    (after! org
       (setq org-link-abbrev-alist
    -    '(("bib" . "~/Cloud/brain/biblio/references.bib::%s")
    -      ("notes" . "~/Cloud/brain/%s.org")
    -      ("papers" . "~/Cloud/pdfs/%s.pdf")))
    +    '(("bib" . "~/Cloud/brain/biblio/references.bib::%s")
    +      ("notes" . "~/Cloud/brain/%s.org")
    +      ("papers" . "~/Cloud/pdfs/%s.pdf")))
       )
     
    @@ -1050,10 +1118,10 @@ Display the real size of images and not the one set with attr_latex: :widt ;; Align Tags and flush right (setq org-tags-column -78) ;; Tags with fast selection keys - (setq org-tag-alist (quote (("@home" . ?h) - ("@work" . ?w) - ("@christophe" . ?c) - ("@veijo" . ?v)))) + (setq org-tag-alist (quote (("@home" . ?h) + ("@work" . ?w) + ("@christophe" . ?c) + ("@veijo" . ?v)))) )
    @@ -1065,7 +1133,7 @@ Display the real size of images and not the one set with attr_latex: :widt
    (after! org
    -  (setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
    +  (setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
       )
     
    @@ -1079,29 +1147,29 @@ Display the real size of images and not the one set with attr_latex: :widt
    (after! org
       ;; Tags with fast selection keys
       (setq org-todo-keywords '(
    -                            (sequence "TODO(t)" "NEXT(n)" "MAIL(m)" "|" "DONE(d)")
    -                            (sequence "READ(r)" "BKMK(b)" "EXER(x)" "|" "DONE(d)")
    -                            (sequence "WAIT(w@/!)" "SDAY(s)" "|" "CANC(c@/!)")
    -                            (sequence "QUES(q)" "|" "ANSW(a)")
    -                            (sequence "EXAM(e)" "IDEA(i)" "|")
    +                            (sequence "TODO(t)" "NEXT(n)" "MAIL(m)" "|" "DONE(d)")
    +                            (sequence "READ(r)" "BKMK(b)" "EXER(x)" "|" "DONE(d)")
    +                            (sequence "WAIT(w@/!)" "SDAY(s)" "|" "CANC(c@/!)")
    +                            (sequence "QUES(q)" "|" "ANSW(a)")
    +                            (sequence "EXAM(e)" "IDEA(i)" "|")
                                 ))
     
       ;; Display of the keywords
       (setq org-todo-keyword-faces
    -        '(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red
    -          ("EXER" . (:foreground "#cc241d" :weight bold)) ;; red
    -          ("NEXT" . (:foreground "#cc241d" :weight bold)) ;; red
    -          ("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red
    -          ("READ" . (:foreground "#cc241d" :weight bold)) ;; red
    -          ("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua
    -          ("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua
    -          ("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange
    -          ("QUES" . (:foreground "#d79921" :weight bold)) ;; yellow
    -          ("CANC" . (:foreground "#a89984" :weight bold)) ;; grey
    -          ("SDAY" . (:foreground "#98971a" :weight bold)) ;; green
    -          ("BKMK" . (:foreground "#98971a" :weight bold)) ;; green
    -          ("IDEA" . (:foreground "#98971a" :weight bold)) ;; green
    -          ("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
    +        '(("TODO" . (:foreground "#cc241d" :weight bold)) ;; red
    +          ("EXER" . (:foreground "#cc241d" :weight bold)) ;; red
    +          ("NEXT" . (:foreground "#cc241d" :weight bold)) ;; red
    +          ("MAIL" . (:foreground "#cc241d" :weight bold)) ;; red
    +          ("READ" . (:foreground "#cc241d" :weight bold)) ;; red
    +          ("ANSW" . (:foreground "#689d6a" :weight bold)) ;; aqua
    +          ("DONE" . (:foreground "#689d6a" :weight bold)) ;; aqua
    +          ("WAIT" . (:foreground "#d65d0e" :weight bold)) ;; orange
    +          ("QUES" . (:foreground "#d79921" :weight bold)) ;; yellow
    +          ("CANC" . (:foreground "#a89984" :weight bold)) ;; grey
    +          ("SDAY" . (:foreground "#98971a" :weight bold)) ;; green
    +          ("BKMK" . (:foreground "#98971a" :weight bold)) ;; green
    +          ("IDEA" . (:foreground "#98971a" :weight bold)) ;; green
    +          ("EXAM" . (:foreground "#98971a" :weight bold)))) ;; green
       )
     
    @@ -1119,47 +1187,47 @@ Archive subtrees under the same hierarchy as original in the archive files
    (after! org
       (defadvice org-archive-subtree (around fix-hierarchy activate)
    -    (let* ((fix-archive-p (and (not current-prefix-arg)
    -                               (not (use-region-p))))
    -           (location (org-archive--compute-location org-archive-location))
    -           (afile (car location))
    -           (offset (if (= 0 (length (cdr location)))
    +    (let* ((fix-archive-p (and (not current-prefix-arg)
    +                               (not (use-region-p))))
    +           (location (org-archive--compute-location org-archive-location))
    +           (afile (car location))
    +           (offset (if (= 0 (length (cdr location)))
                            1
    -                     (1+ (string-match "[^*]" (cdr location)))))
    -           (buffer (or (find-buffer-visiting afile) (find-file-noselect afile))))
    +                     (1+ (string-match "[^*]" (cdr location)))))
    +           (buffer (or (find-buffer-visiting afile) (find-file-noselect afile))))
           ad-do-it
    -      (when fix-archive-p
    -        (with-current-buffer buffer
    -          (goto-char (point-max))
    -          (while (> (org-current-level) offset) (org-up-heading-safe))
    -          (let* ((olpath (org-entry-get (point) "ARCHIVE_OLPATH"))
    -                 (path (and olpath (split-string olpath "/")))
    -                 (level offset)
    -                 tree-text)
    -            (when olpath
    -              (org-mark-subtree)
    -              (setq tree-text (buffer-substring (region-beginning) (region-end)))
    -              (let (this-command) (org-cut-subtree))
    -              (goto-char (point-min))
    -              (save-restriction
    -                (widen)
    -                (-each path
    -                  (lambda (heading)
    -                    (if (re-search-forward
    +      (when fix-archive-p
    +        (with-current-buffer buffer
    +          (goto-char (point-max))
    +          (while (> (org-current-level) offset) (org-up-heading-safe))
    +          (let* ((olpath (org-entry-get (point) "ARCHIVE_OLPATH"))
    +                 (path (and olpath (split-string olpath "/")))
    +                 (level offset)
    +                 tree-text)
    +            (when olpath
    +              (org-mark-subtree)
    +              (setq tree-text (buffer-substring (region-beginning) (region-end)))
    +              (let (this-command) (org-cut-subtree))
    +              (goto-char (point-min))
    +              (save-restriction
    +                (widen)
    +                (-each path
    +                  (lambda (heading)
    +                    (if (re-search-forward
                              (rx-to-string
    -                          `(: bol (repeat ,level "*") (1+ " ") ,heading)) nil t)
    -                        (org-narrow-to-subtree)
    -                      (goto-char (point-max))
    -                      (unless (looking-at "^")
    -                        (insert "\n"))
    -                      (insert (make-string level ?*)
    +                          `(: bol (repeat ,level "*") (1+ " ") ,heading)) nil t)
    +                        (org-narrow-to-subtree)
    +                      (goto-char (point-max))
    +                      (unless (looking-at "^")
    +                        (insert "\n"))
    +                      (insert (make-string level ?*)
                                   " "
                                   heading
    -                              "\n"))
    -                    (cl-incf level)))
    -                (widen)
    -                (org-end-of-subtree t t)
    -                (org-paste-subtree level tree-text))))))))
    +                              "\n"))
    +                    (cl-incf level)))
    +                (widen)
    +                (org-end-of-subtree t t)
    +                (org-paste-subtree level tree-text))))))))
       )
     
    @@ -1186,9 +1254,9 @@ General configuration (setq org-default-priority ?C) ;; Set colours for priorities - (setq org-priority-faces '((?A . (:foreground "#FB4934")) - (?B . (:foreground "#FABD2F")) - (?C . (:foreground "#98971A")))) + (setq org-priority-faces '((?A . (:foreground "#FB4934")) + (?B . (:foreground "#FABD2F")) + (?C . (:foreground "#98971A")))) ;; Open agenda in current window (setq org-agenda-window-setup 'current-window) @@ -1199,10 +1267,10 @@ General configuration (setq org-agenda-span 7) (setq org-agenda-prefix-format - '((agenda . " %?-12t% s") - (todo . "") ;; Don't show the filename for reading agenda - (tags . " %-12:c") - (search . " %-12:c")) + '((agenda . " %?-12t% s") + (todo . "") ;; Don't show the filename for reading agenda + (tags . " %-12:c") + (search . " %-12:c")) ) ) @@ -1217,78 +1285,78 @@ Org Agenda Custom Views (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>")) (setq org-agenda-custom-commands - '(("w" "Work" - ((org-ql-block '(and (tags "@work") - (todo "TODO") - (priority "A")) - ((org-ql-block-header "Important TODOs"))) - (org-ql-block '(and (tags "@work") - (todo "TODO") - (priority "B")) - ((org-ql-block-header "TODOs"))) - (org-ql-block '(and (tags "@work") - (todo "TODO") - (priority "C")) - ((org-ql-block-header "Not important TODOs"))))) - ("h" "Home" - ((org-ql-block '(and (tags "@home") - (todo "TODO") - (priority "A")) - ((org-ql-block-header "Things to do"))) - (org-ql-block '(and (tags "@home") - (todo "TODO") - (priority "B")) - ((org-ql-block-header "Things to do"))) - (org-ql-block '(and (tags "@home") - (todo "TODO") - (priority "C")) - ((org-ql-block-header "Things to do"))))) - ("q" "Questions to ask" - ((org-ql-block '(and (todo "QUES") - (tags "@christophe")) - ((org-ql-block-header "Questions to Christophe"))) - (org-ql-block '(and (todo "QUES") - (tags "@veijo")) - ((org-ql-block-header "Questions to Veijo"))) - (org-ql-block '(and (todo "QUES") - (not (tags "@veijo" "@christophe"))) - ((org-ql-block-header "Other Questions"))))) - ("R" "Already read Articles and Books" - ((org-ql-block '(and (todo "DONE") - (level 1) - (tags "article" "inproceedings" "techreport" "inbook")) - ((org-ql-block-header "Articles"))) - (org-ql-block '(and (todo "DONE") - (level 1) - (tags "book")) - ((org-ql-block-header "Books"))) - (org-ql-block '(and (todo "DONE") - (level 1) - (tags "phdthesis")) - ((org-ql-block-header "Phd Thesis"))) - (org-ql-block '(and (todo "DONE") - (level 1) - (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) - ((org-ql-block-header "Other Things")))) - ((org-agenda-files '("~/Cloud/brain/")))) - ("r" "Articles and Books to read" - ((org-ql-block '(and (todo "READ") - (level 1) - (tags "article" "inproceedings" "techreport" "inbook")) - ((org-ql-block-header "Article to Read"))) - (org-ql-block '(and (todo "READ") - (level 1) - (tags "book")) - ((org-ql-block-header "Books to Read"))) - (org-ql-block '(and (todo "READ") - (level 1) - (tags "phdthesis")) - ((org-ql-block-header "Phd Thesis to Read"))) - (org-ql-block '(and (todo "READ") - (level 1) - (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) - ((org-ql-block-header "Other Things to Read")))) - ((org-agenda-files '("~/Cloud/brain/"))))) + '(("w" "Work" + ((org-ql-block '(and (tags "@work") + (todo "TODO") + (priority "A")) + ((org-ql-block-header "Important TODOs"))) + (org-ql-block '(and (tags "@work") + (todo "TODO") + (priority "B")) + ((org-ql-block-header "TODOs"))) + (org-ql-block '(and (tags "@work") + (todo "TODO") + (priority "C")) + ((org-ql-block-header "Not important TODOs"))))) + ("h" "Home" + ((org-ql-block '(and (tags "@home") + (todo "TODO") + (priority "A")) + ((org-ql-block-header "Things to do"))) + (org-ql-block '(and (tags "@home") + (todo "TODO") + (priority "B")) + ((org-ql-block-header "Things to do"))) + (org-ql-block '(and (tags "@home") + (todo "TODO") + (priority "C")) + ((org-ql-block-header "Things to do"))))) + ("q" "Questions to ask" + ((org-ql-block '(and (todo "QUES") + (tags "@christophe")) + ((org-ql-block-header "Questions to Christophe"))) + (org-ql-block '(and (todo "QUES") + (tags "@veijo")) + ((org-ql-block-header "Questions to Veijo"))) + (org-ql-block '(and (todo "QUES") + (not (tags "@veijo" "@christophe"))) + ((org-ql-block-header "Other Questions"))))) + ("R" "Already read Articles and Books" + ((org-ql-block '(and (todo "DONE") + (level 1) + (tags "article" "inproceedings" "techreport" "inbook")) + ((org-ql-block-header "Articles"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (tags "book")) + ((org-ql-block-header "Books"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (tags "phdthesis")) + ((org-ql-block-header "Phd Thesis"))) + (org-ql-block '(and (todo "DONE") + (level 1) + (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) + ((org-ql-block-header "Other Things")))) + ((org-agenda-files '("~/Cloud/brain/")))) + ("r" "Articles and Books to read" + ((org-ql-block '(and (todo "READ") + (level 1) + (tags "article" "inproceedings" "techreport" "inbook")) + ((org-ql-block-header "Article to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (tags "book")) + ((org-ql-block-header "Books to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (tags "phdthesis")) + ((org-ql-block-header "Phd Thesis to Read"))) + (org-ql-block '(and (todo "READ") + (level 1) + (not (tags "article" "inproceedings" "techreport" "inbook" "book" "phdthesis"))) + ((org-ql-block-header "Other Things to Read")))) + ((org-agenda-files '("~/Cloud/brain/"))))) ) ) @@ -1308,7 +1376,7 @@ This idea comes from
    (defun tdh-org-agenda-to-html ()
       (interactive)
       (org-agenda-list)
    -  (org-agenda-write "/ssh:thomas@grenoble:~/docker/config/calendar/www/index.html"))
    +  (org-agenda-write "/ssh:thomas@homelab:~/docker/config/calendar/www/index.html"))
     
    @@ -1335,23 +1403,23 @@ This idea comes from
    (after! org-agenda
    -  (setq appt-message-warning-time 5)
    +  (setq appt-message-warning-time 5)
       (defun tdh-org-agenda-to-appt ()
         (interactive)
    -    (setq appt-time-msg-list nil)
    +    (setq appt-time-msg-list nil)
         (org-agenda-to-appt))
     
       (tdh-org-agenda-to-appt)
                                             ; Display appointments as a window manager notification
    -  (setq appt-disp-window-function 'tdh-appt-display)
    -  (setq appt-delete-window-function (lambda () t))
    +  (setq appt-disp-window-function 'tdh-appt-display)
    +  (setq appt-delete-window-function (lambda () t))
     
    -  (setq tdh-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification"))
    +  (setq tdh-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification"))
       (defun tdh-appt-display (min-to-app new-time msg)
    -    (if (atom min-to-app)
    -        (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app min-to-app msg)
    -      (dolist (i (number-sequence 0 (1- (length min-to-app))))
    -        (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app (nth i min-to-app) (nth i msg)))))
    +    (if (atom min-to-app)
    +        (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app min-to-app msg)
    +      (dolist (i (number-sequence 0 (1- (length min-to-app))))
    +        (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app (nth i min-to-app) (nth i msg)))))
       )
     
    @@ -1378,26 +1446,26 @@ dunstify --replace=85401 (after! org (require 'org-tempo) (setq org-structure-template-alist - '(("c" . "center") - ("C" . "comment") - ("mm" . "src matlab") - ("mf" . "src matlab :exports none") - ("mv" . "src matlab :results value replace :exports results :tangle no") - ("l" . "src emacs-lisp") - ("q" . "quote") - ("s" . "src") - ("ba" . "answer") - ("bd" . "definition") - ("be" . "exampl") - ("bx" . "exercice") - ("bq" . "question") - ("bs" . "summary") - ("bS" . "seealso") - ("bh" . "hint") - ("bn" . "note") - ("bi" . "important") - ("bc" . "caution") - ("bw" . "warning") + '(("c" . "center") + ("C" . "comment") + ("mm" . "src matlab") + ("mf" . "src matlab :exports none") + ("mv" . "src matlab :results value replace :exports results :tangle no") + ("l" . "src emacs-lisp") + ("q" . "quote") + ("s" . "src") + ("ba" . "answer") + ("bd" . "definition") + ("be" . "exampl") + ("bx" . "exercice") + ("bq" . "question") + ("bs" . "summary") + ("bS" . "seealso") + ("bh" . "hint") + ("bn" . "note") + ("bi" . "important") + ("bc" . "caution") + ("bw" . "warning") )) ) @@ -1420,58 +1488,102 @@ Documentation:
    (after! org
       (setq org-capture-templates
    -        (quote (("t"    ; key
    +        (quote (("t"    ; key
                      "Todo" ; name
                      entry  ; type
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox") ; target
    -                 "** TODO %?\n%U\n" ; template
    -                 )
    -                ("M"    ; key
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox") ; target
    +                 "** TODO %?\n%U\n" ; template
    +                 )
    +                ("M"    ; key
                      "Meeting" ; name
                      entry  ; type
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Meetings") ; target
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Meetings") ; target
                      "** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n" ; template
    -                 )
    -                ("m"    ; key
    +                 )
    +                ("m"    ; key
                      "Mail" ; name
                      entry  ; type
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Mails") ; target
    -                 "** TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n" ; template
    -                 )
    -                ("r"    ; key
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Mails") ; target
    +                 "** TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n" ; template
    +                 )
    +                ("r"    ; key
                      "Reference" ; name
                      entry  ; type
    -                 (file+headline "~/Cloud/org/inbox-ereader.org" "Things to Read") ; target
    -                 "** TODO [#B] %?\n" ; template
    -                 )
    -                ("pm"
    +                 (file+headline "~/Cloud/org/inbox-ereader.org" "Things to Read") ; target
    +                 "** TODO [#B] %?\n" ; template
    +                 )
    +                ("pm"
                      "Org-Protocol Mail"
                      entry
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Mails")
    -                 "* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n\n"
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Mails")
    +                 "* MAIL %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%i\n"
                      :immediate-finish t
    -                 )
    -                ("pu"
    +                 )
    +                ("ps"
    +                 "Org-Protocol Sent Mail"
    +                 entry
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Mails")
    +                 "* WAIT %:description [[message:%:link][link]]\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n- to: %i\n\n\n\n"
    +                 :immediate-finish t
    +                 )
    +                ("pu"
                      "Org-Protocol Url"
                      entry
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
                      "* [[%:link][%:description]]\nCaptured On: %U\n\n"
                      :immediate-finish t
    -                 )
    -                ("pt"
    +                 )
    +                ("pt"
                      "Org-Protocol text"
                      entry
    -                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
    +                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
                      "* %:description\nSource: %:link\nCaptured On: %U\n\n#+begin_quote\n%i\n#+end_quote\n\n"
                      :immediate-finish t
    -                 )
    -                )))
    +                 )
    +                )))
       )
     
    +
    +

    message: link to mutt

    +
    +
    +
    (require 'org-protocol)
    +
    +(defun stefanv/mutt-open-message (message-id)
    +  "In neomutt, open the email with the the given Message-ID"
    +  (let*
    +      ((message-id (replace-regexp-in-string "^/*" "" message-id))
    +       (mail-file
    +        (replace-regexp-in-string
    +         "\n$" "" (shell-command-to-string
    +                   (format "mu find -f l i:%s | head -n 1" message-id))))
    +       (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" ""
    +                                           (file-name-directory mail-file)))
    +       (process-id (concat "neomutt-" message-id))
    +       (message-id-escaped (regexp-quote message-id))
    +       (mutt-keystrokes
    +        (format "L~i %s\n\nLall\n\nl" (shell-quote-argument message-id-escaped)))
    +       (mutt-command (list "neomutt" "-R" "-f" mail-dir
    +                           "-e" (format "push '%s'" mutt-keystrokes))))
    +
    +    (message "Launching neomutt for message %s" message-id)
    +    (call-process "setsid" nil nil
    +                  "-f" "alacritty" "-e"
    +                  "neomutt" "-R" "-f" mail-dir
    +                  "-e" (format "push '%s'" mutt-keystrokes))))
    +
    +; Whenever org-mode sees a link starting with `message://`, it
    +; calls our `mutt-open-message` function
    +(org-add-link-type "message" 'stefanv/mutt-open-message)
    +
    +
    +
    +
    +

    Org Export

    @@ -1521,6 +1633,19 @@ Do not export headline with the :ignore: tag:
    +
    +

    Org Effort

    +
    +
    +
    (after! org
    +  (setq org-global-properties
    +        '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
    +  )
    +
    +
    +
    +
    +

    HTML Export

    @@ -1576,11 +1701,11 @@ Do not export headline with the :ignore: tag: src=\"%PATH\"></script>") (setq org-html-mathjax-options - '((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" ) - (scale "1") - (autonumber "ams") - (tagindent ".8em") - (tagside "right"))) + '((path "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js" ) + (scale "1") + (autonumber "ams") + (tagindent ".8em") + (tagside "right"))) )
    @@ -1592,13 +1717,13 @@ Do not export headline with the :ignore: tag:
    (defun org-video-link-export (path desc backend)
    -  (let ((ext (file-name-extension path)))
    +  (let ((ext (file-name-extension path)))
         (cond
    -     ((eq 'html backend)
    -      (format "<video preload='metadata' controls='controls'><source type='video/%s' src='%s' /></video>" ext path))
    +     ((eq 'html backend)
    +      (format "<video preload='metadata' controls='controls'><source type='video/%s' src='%s' /></video>" ext path))
          ;; fall-through case for everything else
    -     (t
    -      path))))
    +     (t
    +      path))))
     
     (after! org
       (org-link-set-parameters "video" :export 'org-video-link-export)
    @@ -1634,10 +1759,10 @@ This is not working
     
     (defun unpackaged/org-export-get-reference (datum info)
       "Like `org-export-get-reference', except uses heading titles instead of random numbers."
    -  (let ((cache (plist-get info :internal-references)))
    -    (or (car (rassq datum cache))
    -        (let* ((crossrefs (plist-get info :crossrefs))
    -               (cells (org-export-search-cells datum))
    +  (let ((cache (plist-get info :internal-references)))
    +    (or (car (rassq datum cache))
    +        (let* ((crossrefs (plist-get info :crossrefs))
    +               (cells (org-export-search-cells datum))
                    ;; Preserve any pre-existing association between
                    ;; a search cell and a reference, i.e., when some
                    ;; previously published document referenced a location
    @@ -1651,82 +1776,82 @@ This is not working
                    ;; As a consequence, before re-using any reference to
                    ;; an element or object, we check that it doesn't refer
                    ;; to a previous element or object.
    -               (new (or (cl-some
    -                         (lambda (cell)
    -                           (let ((stored (cdr (assoc cell crossrefs))))
    -                             (when stored
    -                               (let ((old (org-export-format-reference stored)))
    -                                 (and (not (assoc old cache)) stored)))))
    -                         cells)
    -                        (when (org-element-property :raw-value datum)
    +               (new (or (cl-some
    +                         (lambda (cell)
    +                           (let ((stored (cdr (assoc cell crossrefs))))
    +                             (when stored
    +                               (let ((old (org-export-format-reference stored)))
    +                                 (and (not (assoc old cache)) stored)))))
    +                         cells)
    +                        (when (org-element-property :raw-value datum)
                               ;; Heading with a title
    -                          (unpackaged/org-export-new-named-reference datum cache))
    -                        (when (member (car datum) '(src-block table example fixed-width property-drawer))
    +                          (unpackaged/org-export-new-named-reference datum cache))
    +                        (when (member (car datum) '(src-block table example fixed-width property-drawer))
                               ;; Nameable elements
    -                          (unpackaged/org-export-new-named-reference datum cache))
    -                        ;; NOTE: This probably breaks some Org Export
    +                          (unpackaged/org-export-new-named-reference datum cache))
    +                        ;; NOTE: This probably breaks some Org Export
                             ;; feature, but if it does what I need, fine.
    -                        (org-export-format-reference
    -                         (org-export-new-reference cache))))
    -               (reference-string new))
    +                        (org-export-format-reference
    +                         (org-export-new-reference cache))))
    +               (reference-string new))
               ;; Cache contains both data already associated to
               ;; a reference and in-use internal references, so as to make
               ;; unique references.
    -          (dolist (cell cells) (push (cons cell new) cache))
    +          (dolist (cell cells) (push (cons cell new) cache))
               ;; Retain a direct association between reference string and
               ;; DATUM since (1) not every object or element can be given
               ;; a search cell (2) it permits quick lookup.
    -          (push (cons reference-string datum) cache)
    -          (plist-put info :internal-references cache)
    -          reference-string))))
    +          (push (cons reference-string datum) cache)
    +          (plist-put info :internal-references cache)
    +          reference-string))))
     
     (defun unpackaged/org-export-new-named-reference (datum cache)
       "Return new reference for DATUM that is unique in CACHE."
    -  (cl-macrolet ((inc-suffixf (place)
    -                             `(progn
    -                                (string-match (rx bos
    -                                                  (minimal-match (group (1+ anything)))
    -                                                  (optional "--" (group (1+ digit)))
    -                                                  eos)
    -                                              ,place)
    -                                ;; HACK: `s1' instead of a gensym.
    -                                (-let* (((s1 suffix) (list (match-string 1 ,place)
    -                                                           (match-string 2 ,place)))
    -                                        (suffix (if suffix
    -                                                    (string-to-number suffix)
    -                                                  0)))
    -                                  (setf ,place (format "%s--%s" s1 (cl-incf suffix)))))))
    -    (let* ((headline-p (eq (car datum) 'headline))
    -           (title (if headline-p
    -                      (org-element-property :raw-value datum)
    -                    (or (org-element-property :name datum)
    -                        (concat (org-element-property :raw-value
    -                                                      (org-element-property :parent
    -                                                                            (org-element-property :parent datum)))))))
    +  (cl-macrolet ((inc-suffixf (place)
    +                             `(progn
    +                                (string-match (rx bos
    +                                                  (minimal-match (group (1+ anything)))
    +                                                  (optional "--" (group (1+ digit)))
    +                                                  eos)
    +                                              ,place)
    +                                ;; HACK: `s1' instead of a gensym.
    +                                (-let* (((s1 suffix) (list (match-string 1 ,place)
    +                                                           (match-string 2 ,place)))
    +                                        (suffix (if suffix
    +                                                    (string-to-number suffix)
    +                                                  0)))
    +                                  (setf ,place (format "%s--%s" s1 (cl-incf suffix)))))))
    +    (let* ((headline-p (eq (car datum) 'headline))
    +           (title (if headline-p
    +                      (org-element-property :raw-value datum)
    +                    (or (org-element-property :name datum)
    +                        (concat (org-element-property :raw-value
    +                                                      (org-element-property :parent
    +                                                                            (org-element-property :parent datum)))))))
                ;; get ascii-only form of title without needing percent-encoding
    -           (ref (concat (org-reference-contraction (substring-no-properties title))
    -                        (unless (or headline-p (org-element-property :name datum))
    -                          (concat ","
    -                                  (pcase (car datum)
    -                                    ('src-block "code")
    -                                    ('example "example")
    -                                    ('fixed-width "mono")
    -                                    ('property-drawer "properties")
    -                                    (_ (symbol-name (car datum))))
    -                                  "--1"))))
    -           (parent (when headline-p (org-element-property :parent datum))))
    -      (while (--any (equal ref (car it))
    -                    cache)
    +           (ref (concat (org-reference-contraction (substring-no-properties title))
    +                        (unless (or headline-p (org-element-property :name datum))
    +                          (concat ","
    +                                  (pcase (car datum)
    +                                    ('src-block "code")
    +                                    ('example "example")
    +                                    ('fixed-width "mono")
    +                                    ('property-drawer "properties")
    +                                    (_ (symbol-name (car datum))))
    +                                  "--1"))))
    +           (parent (when headline-p (org-element-property :parent datum))))
    +      (while (--any (equal ref (car it))
    +                    cache)
             ;; Title not unique: make it so.
    -        (if parent
    +        (if parent
                 ;; Append ancestor title.
    -            (setf title (concat (org-element-property :raw-value parent)
    -                                "--" title)
    +            (setf title (concat (org-element-property :raw-value parent)
    +                                "--" title)
                       ;; get ascii-only form of title without needing percent-encoding
    -                  ref (org-reference-contraction (substring-no-properties title))
    -                  parent (when headline-p (org-element-property :parent parent)))
    +                  ref (org-reference-contraction (substring-no-properties title))
    +                  parent (when headline-p (org-element-property :parent parent)))
               ;; No more ancestors: add and increment a number.
    -          (inc-suffixf ref)))
    +          (inc-suffixf ref)))
           ref)))
     
     (add-hook 'org-load-hook #'unpackaged/org-export-html-with-useful-ids-mode)
    @@ -1761,26 +1886,26 @@ Adapt this from https://github.com/
     or otherwise the drawer's name is used with all underscores replaced
     by spaces.
     "
    -  (let* ((contents′ (replace-regexp-in-string ":export:.*\n?" "" contents))
    -         (fold? (s-prefix? "fold_" name 'ignore-case))
    -         (export? (string-match ":export:\s+t" contents))
    -         (not-export? (string-match ":export:\s+nil" contents))
    -         (title′ (and (string-match ":title:\\(.*\\)\n" contents)
    -                      (match-string 1 contents))))
    +  (let* ((contents′ (replace-regexp-in-string ":export:.*\n?" "" contents))
    +         (fold? (s-prefix? "fold_" name 'ignore-case))
    +         (export? (string-match ":export:\s+t" contents))
    +         (not-export? (string-match ":export:\s+nil" contents))
    +         (title′ (and (string-match ":title:\\(.*\\)\n" contents)
    +                      (match-string 1 contents))))
     
         ;; Ensure we have a title.
    -    (unless title′ (setq title′ (s-join " " (cdr (s-split "_" name)))))
    +    (unless title′ (setq title′ (s-join " " (cdr (s-split "_" name)))))
     
         ;; Output
         (cond
    -     ((and export? (not fold?)) contents′)
    -     (not-export? nil)
    -     (fold?
    -      (thread-last contents′
    -        (replace-regexp-in-string ":title:.*\n" "")
    -        (format "<details class=\"code-details\"> <summary> <strong>
    +     ((and export? (not fold?)) contents′)
    +     (not-export? nil)
    +     (fold?
    +      (thread-last contents′
    +        (replace-regexp-in-string ":title:.*\n" "")
    +        (format "<details class=\"code-details\"> <summary> <strong>
                 <font face=\"Courier\" size=\"3\" color=\"green\"> %s
    -            </font> </strong> </summary> %s </details>" title′))))))
    +            </font> </strong> </summary> %s </details>" title′))))))
     
     (setq org-html-format-drawer-function 'my/org-drawer-format)
     
    @@ -1806,6 +1931,18 @@ Adapt this from https://github.com/
    +
    +

    Org Transclusion

    +
    +
    +
    (use-package! org-transclusion
    +  :config
    +  )
    +
    +
    +
    +
    +

    Org LaTeX

    @@ -1821,57 +1958,57 @@ Adapt this from https://github.com/ ;; Use F9 to globally generate all the latex fragments (map! :map org-mode-map :n "<f9>" - (lambda () (interactive) (org-preview-latex-fragment 16))) + (lambda () (interactive) (org-preview-latex-fragment 16))) ;; Put all the preview images in some directory (setq org-preview-latex-image-directory "~/.ltximg/") ;; Define backends to preview LaTeX fragments - (setq org-preview-latex-process-alist '((imagemagick - :programs ("pdflatex" "convert") + (setq org-preview-latex-process-alist '((imagemagick + :programs ("pdflatex" "convert") :description "pdf > png" :message "you need to install the programs: pdflatex and imagemagick." :image-input-type "pdf" :image-output-type "png" - :image-size-adjust (1.0 . 1.0) - :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") - :image-converter ("convert -density 100 -trim -antialias %f -quality 100 %O")) - (dvipng - :programs ("latex" "dvipng") + :image-size-adjust (1.0 . 1.0) + :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") + :image-converter ("convert -density 100 -trim -antialias %f -quality 100 %O")) + (dvipng + :programs ("latex" "dvipng") :description "dvi > png" :message "you need to install the programs: latex and dvipng." :image-input-type "dvi" :image-output-type "png" - :image-size-adjust (0.4 . 0.4) - :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvipng -D %D -T tight -o %O %f")) - (pdf2svg - :programs ("pdflatex" "pdftocairo" "pdfcrop") + :image-size-adjust (0.4 . 0.4) + :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f") + :image-converter ("dvipng -D %D -T tight -o %O %f")) + (pdf2svg + :programs ("pdflatex" "pdftocairo" "pdfcrop") :description "pdf > png" :message "you need to install the programs: pdflatex, pdftocairo and pdfcrop." :image-input-type "pdf" :image-output-type "svg" - :image-size-adjust (1.0 . 1.0) - :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") - :image-converter ("pdfcrop %f %f && pdf2svg %f %O")) - (pdf2dvi - :programs ("pdflatex" "dvipng") + :image-size-adjust (1.0 . 1.0) + :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f") + :image-converter ("pdfcrop %f %f && pdf2svg %f %O")) + (pdf2dvi + :programs ("pdflatex" "dvipng") :description "pdf > png" :message "you need to install the programs: pdflatex, pdftocairo and pdfcrop." :image-input-type "dvi" :image-output-type "png" - :image-size-adjust (0.4 . 0.4) - :latex-compiler ("pdflatex -output-format dvi -interaction nonstopmode -output-directory %o %f") - :image-converter ("dvipng -D %D -T tight -o %O %f")) - (dvisvgm - :programs ("xetex" "dvisvgm") + :image-size-adjust (0.4 . 0.4) + :latex-compiler ("pdflatex -output-format dvi -interaction nonstopmode -output-directory %o %f") + :image-converter ("dvipng -D %D -T tight -o %O %f")) + (dvisvgm + :programs ("xetex" "dvisvgm") :description "xdv > svg" :message "you need to install the programs: xetex and dvisvgm." :image-input-type "xdv" :image-output-type "svg" - :image-size-adjust (0.6 . 0.6) - :latex-compiler ("xelatex -no-pdf -output-directory %o %f") - :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) + :image-size-adjust (0.6 . 0.6) + :latex-compiler ("xelatex -no-pdf -output-directory %o %f") + :image-converter ("dvisvgm %f -n -b min -c %S -o %O")) )) ;; Use imagemagick/dvisvgm to generate png from pdf @@ -1879,7 +2016,7 @@ Adapt this from https://github.com/ ;; Don't change the font size for subscripts and superscripts in latex fragments. ;; This cause the orgmode tables not to be well aligned. - (setq font-latex-fontify-script nil) + (setq font-latex-fontify-script nil) ;; Colors of latex fragments (setq org-format-latex-options (plist-put org-format-latex-options :foreground 'default)) @@ -1898,76 +2035,76 @@ Adapt this from https://github.com/ ;; Custom classes to use when exporting to latex (add-to-list 'org-latex-classes '("beamer" - ,(concat "\\documentclass[presentation]{beamer}\n" + ,(concat "\\documentclass[presentation]{beamer}\n" "[DEFAULT-PACKAGES]" "[PACKAGES]" - "[EXTRA]\n") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) + "[EXTRA]\n") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))) (add-to-list 'org-latex-classes '("clean-cheatsheet" "\\documentclass{clean-cheatsheet}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("clean-beamer" "\\documentclass{clean-beamer}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("cleanreport" "\\documentclass{cleanreport}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("scrartcl" "\\documentclass{scrartcl}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("scrreprt" "\\documentclass[a4paper, 10pt, DIV=12, parskip=full]{scrreprt}" - ("\\chapter{%s}" . "\\chapter*{%s}") - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\chapter{%s}" . "\\chapter*{%s}") + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("biblioreport" "\\documentclass{biblioreport}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) (add-to-list 'org-latex-classes '("moderncv" "\\documentclass{moderncv}" - ("\\section{%s}" . "\\section*{%s}") - ("\\subsection{%s}" . "\\subsection*{%s}") - ("\\subsubsection{%s}" . "\\subsubsection*{%s}") - ("\\paragraph{%s}" . "\\paragraph*{%s}") - ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) + ("\\section{%s}" . "\\section*{%s}") + ("\\subsection{%s}" . "\\subsection*{%s}") + ("\\subsubsection{%s}" . "\\subsubsection*{%s}") + ("\\paragraph{%s}" . "\\paragraph*{%s}") + ("\\subparagraph{%s}" . "\\subparagraph*{%s}")) ) ) @@ -2005,14 +2142,14 @@ Adapt this from https://github.com/
    (after! org
       (defun tdh-get-headline-string-element  (headline backend info)
    -    (let ((prop-point (next-property-change 0 headline)))
    -      (if prop-point (plist-get (text-properties-at prop-point headline) :parent))))
    +    (let ((prop-point (next-property-change 0 headline)))
    +      (if prop-point (plist-get (text-properties-at prop-point headline) :parent))))
     
       (defun tdh-ensure-latex-clearpage (headline backend info)
    -    (when (org-export-derived-backend-p backend 'latex)
    -      (let ((elmnt (tdh-get-headline-string-element headline backend info)))
    -        (when (and elmnt (org-element-property :CLEARPAGE elmnt))
    -          (concat "\\clearpage\n" headline)))))
    +    (when (org-export-derived-backend-p backend 'latex)
    +      (let ((elmnt (tdh-get-headline-string-element headline backend info)))
    +        (when (and elmnt (org-element-property :CLEARPAGE elmnt))
    +          (concat "\\clearpage\n" headline)))))
     
       (add-to-list 'org-export-filter-headline-functions
                    'tdh-ensure-latex-clearpage)
    @@ -2028,19 +2165,19 @@ Adapt this from https://github.com/
     
    (after! org
       (setq org-latex-default-packages-alist
    -        '(("AUTO" "inputenc" t ("pdflatex")) ;; for basic font and character selection
    -          ("T1" "fontenc" t ("pdflatex")) ;; for basic font and character selection
    -          ("" "graphicx" t) ;; for including images
    -          ("" "grffile" t) ;; allow periods and spaces in graphics file names
    -          ("" "longtable" nil) ;; For multipage tables
    -          ("" "wrapfig" nil) ;; for figure placement
    -          ("" "rotating" nil) ;; for sideways figures and tables
    -          ("normalem" "ulem" t) ;; for underline and strike-through
    -          ("" "amsmath" t) ;; for subscript and superscript and math environments
    -          ("" "textcomp" t) ;; for various symbols
    -          ("" "amssymb" t) ;; for various symbols
    -          ("" "capt-of" nil) ;; for captions outside of floats
    -          ("" "hyperref" nil)) ;; for cross references
    +        '(("AUTO" "inputenc" t ("pdflatex")) ;; for basic font and character selection
    +          ("T1" "fontenc" t ("pdflatex")) ;; for basic font and character selection
    +          ("" "graphicx" t) ;; for including images
    +          ("" "grffile" t) ;; allow periods and spaces in graphics file names
    +          ("" "longtable" nil) ;; For multipage tables
    +          ("" "wrapfig" nil) ;; for figure placement
    +          ("" "rotating" nil) ;; for sideways figures and tables
    +          ("normalem" "ulem" t) ;; for underline and strike-through
    +          ("" "amsmath" t) ;; for subscript and superscript and math environments
    +          ("" "textcomp" t) ;; for various symbols
    +          ("" "amssymb" t) ;; for various symbols
    +          ("" "capt-of" nil) ;; for captions outside of floats
    +          ("" "hyperref" nil)) ;; for cross references
             )
       )
     
    @@ -2081,7 +2218,7 @@ Adapt this from
    https://github.com/ (setq org-latex-listings 'minted) ;; Set the following as images - (setq org-latex-inline-image-rules '(("file" . "\\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\|tikz\\|pgf\\|svg\\|gif\\)\\'"))) + (setq org-latex-inline-image-rules '(("file" . "\\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\|tikz\\|pgf\\|svg\\|gif\\)\\'"))) ;; Command used when exporting to pdf (setq org-latex-pdf-process @@ -2101,11 +2238,11 @@ Bold Text
    (after! org
       (defun tdh-my-beamer-bold (contents backend info)
    -    (when (eq backend 'beamer)
    -      (replace-regexp-in-string
    -       (concat "\\`\\\\" "[A-Za-z0-9]+") ;; If not, orgmode is crazy...
    +    (when (eq backend 'beamer)
    +      (replace-regexp-in-string
    +       (concat "\\`\\\\" "[A-Za-z0-9]+") ;; If not, orgmode is crazy...
            "\\\\textbf"
    -       contents)))
    +       contents)))
     
       (add-to-list 'org-export-filter-bold-functions 'tdh-my-beamer-bold)
       )
    @@ -2146,15 +2283,15 @@ Special Environments
     
     
    (defcustom tdh-org-property-mapping
    -  '((latex ("CUSTOM_PAGE" . tdh-insert-org-page-latex)
    -           ("CUSTOM_LABEL" . tdh-insert-org-label-latex)))
    +  '((latex ("CUSTOM_PAGE" . tdh-insert-org-page-latex)
    +           ("CUSTOM_LABEL" . tdh-insert-org-label-latex)))
       "List of mappings from org property to arbitrary strings.
     Each element is a list:
       (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...)
     FUNCTION are functions which get called with a single
     argument (the value of PROPERTY) and are responsible for doing
     whatever should be done."
    -  :type '(repeat (cons symbol (repeat (cons string string)))))
    +  :type '(repeat (cons symbol (repeat (cons string string)))))
     
    @@ -2165,15 +2302,15 @@ Special Environments (PROPERTY REPLACEMENT). For each healine being exported, if it has a PROPERTY listed insert a string immediately after the healine given by (format REPLACEMENT PROPERTY-VALUE)" - (let ((map (cdr (assoc backend tdh-org-property-mapping))) + (let ((map (cdr (assoc backend tdh-org-property-mapping))) value replacement) (when map - (org-map-entries - (lambda () - (dolist (it map) - (save-excursion - (when (setq value (org-entry-get (point) (car it))) - (funcall (cdr it) value))))))))) + (org-map-entries + (lambda () + (dolist (it map) + (save-excursion + (when (setq value (org-entry-get (point) (car it))) + (funcall (cdr it) value))))))))) (add-hook 'org-export-before-processing-hook #'tdh-replace-org-property)
    @@ -2206,42 +2343,42 @@ Special Environments
    (after! org
       (defun tdh-org-renumber-environment (orig-func &rest args)
         "A function to inject numbers in LaTeX fragment previews."
    -    (let ((results '())
    -          (counter -1)
    -          (numberp))
    +    (let ((results '())
    +          (counter -1)
    +          (numberp))
     
    -      (setq results (loop for (begin .  env) in
    -                          (org-element-map (org-element-parse-buffer) 'latex-environment
    -                            (lambda (env)
    -                              (cons
    -                               (org-element-property :begin env)
    -                               (org-element-property :value env))))
    +      (setq results (loop for (begin .  env) in
    +                          (org-element-map (org-element-parse-buffer) 'latex-environment
    +                            (lambda (env)
    +                              (cons
    +                               (org-element-property :begin env)
    +                               (org-element-property :value env))))
                               collect
    -                          (cond
    -                           ((and (string-match "\\\\begin{equation}" env)
    -                                 (not (string-match "\\\\tag{" env)))
    -                            (incf counter)
    -                            (cons begin counter))
    -                           ((string-match "\\\\begin{align}" env)
    -                            (prog2
    -                                (incf counter)
    -                                (cons begin counter)
    -                              (with-temp-buffer
    -                                (insert env)
    -                                (goto-char (point-min))
    +                          (cond
    +                           ((and (string-match "\\\\begin{equation}" env)
    +                                 (not (string-match "\\\\tag{" env)))
    +                            (incf counter)
    +                            (cons begin counter))
    +                           ((string-match "\\\\begin{align}" env)
    +                            (prog2
    +                                (incf counter)
    +                                (cons begin counter)
    +                              (with-temp-buffer
    +                                (insert env)
    +                                (goto-char (point-min))
                                     ;; \\ is used for a new line. Each one leads to a number
    -                                (incf counter (count-matches "\\\\$"))
    +                                (incf counter (count-matches "\\\\$"))
                                     ;; unless there are nonumbers.
    -                                (goto-char (point-min))
    -                                (decf counter (count-matches "\\nonumber")))))
    -                           (t
    -                            (cons begin nil)))))
    +                                (goto-char (point-min))
    +                                (decf counter (count-matches "\\nonumber")))))
    +                           (t
    +                            (cons begin nil)))))
     
    -      (when (setq numberp (cdr (assoc (point) results)))
    -        (setf (car args)
    -              (concat
    -               (format "\\setcounter{equation}{%s}\n" numberp)
    -               (car args)))))
    +      (when (setq numberp (cdr (assoc (point) results)))
    +        (setf (car args)
    +              (concat
    +               (format "\\setcounter{equation}{%s}\n" numberp)
    +               (car args)))))
     
         (apply orig-func args))
     
    @@ -2282,14 +2419,14 @@ Special Environments
       (add-to-list 'org-src-lang-modes '("latex-macros" . latex))
     
       (defvar org-babel-default-header-args:latex-macros
    -    '((:results . "raw")
    -      (:exports . "results")))
    +    '((:results . "raw")
    +      (:exports . "results")))
     
       (defun prefix-all-lines (pre body)
         (with-temp-buffer
    -      (insert body)
    -      (string-insert-rectangle (point-min) (point-max) pre)
    -      (buffer-string)))
    +      (insert body)
    +      (string-insert-rectangle (point-min) (point-max) pre)
    +      (buffer-string)))
     
       (defun org-babel-execute:latex-macros (body _params)
         (concat
    @@ -2337,7 +2474,7 @@ Special Environments
              :author "Dehaeze Thomas"
              :email "dehaeze.thomas@gmail.com/"
              :recursive nil
    -         :publishing-function (list org-html-publish-to-html org-latex-publish-to-pdf)
    +         :publishing-function (list org-html-publish-to-html org-latex-publish-to-pdf)
              :auto-preamble t
              :auto-sitemap nil
              :html-link-up "index.html"
    @@ -2371,10 +2508,10 @@ Special Environments
     
    (after! org
       (defun tdh-eval-startblock ()
    -    (if (member "startblock" (org-babel-src-block-names))
    -        (save-excursion
    -          (org-babel-goto-named-src-block "startblock")
    -          (org-babel-execute-src-block))
    +    (if (member "startblock" (org-babel-src-block-names))
    +        (save-excursion
    +          (org-babel-goto-named-src-block "startblock")
    +          (org-babel-execute-src-block))
           nil
           )
         )
    @@ -2394,13 +2531,13 @@ Special Environments
       "Convert all #+keywords to #+keywords."
       (interactive)
       (save-excursion
    -    (goto-char (point-min))
    -    (let ((count 0)
    -          (case-fold-search nil))
    -      (while (re-search-forward "#\\+[A-Z_]+" nil t)
    -        (replace-match (downcase (match-string 0)) t)
    -        (setq count (1+ count)))
    -      (message "Replaced %d occurances" count))))
    +    (goto-char (point-min))
    +    (let ((count 0)
    +          (case-fold-search nil))
    +      (while (re-search-forward "#\\+[A-Z_]+" nil t)
    +        (replace-match (downcase (match-string 0)) t)
    +        (setq count (1+ count)))
    +      (message "Replaced %d occurances" count))))
     
    @@ -2435,40 +2572,40 @@ Special Environments (let (file-list target-dir file-list-sorted start-file start-file-full file-ext end-file end-file-base end-file-full file-number) ;; Clean directories from list but keep times (setq file-list - (-remove (lambda (x) (nth 1 x)) - (directory-files-and-attributes tdh-image-dir))) + (-remove (lambda (x) (nth 1 x)) + (directory-files-and-attributes tdh-image-dir))) ;; Get target directory - (setq target-dir (file-name-directory (buffer-file-name))) + (setq target-dir (file-name-directory (buffer-file-name))) ;; Sort list by most recent (setq file-list-sorted - (mapcar #'car - (sort file-list - #'(lambda (x y) (time-less-p (nth 6 y) (nth 6 x)))))) + (mapcar #'car + (sort file-list + #'(lambda (x y) (time-less-p (nth 6 y) (nth 6 x)))))) ;; Use ivy to select start-file - (setq start-file (ivy-read - (concat "Move selected file to " target-dir ":") + (setq start-file (ivy-read + (concat "Move selected file to " target-dir ":") file-list-sorted :re-builder #'ivy--regex :sort nil - :initial-input nil)) + :initial-input nil)) ;; add full path to start file and end-file (setq start-file-full - (expand-file-name start-file tdh-image-dir)) + (expand-file-name start-file tdh-image-dir)) ;; final file name including path (setq end-file-full - (expand-file-name start-file target-dir)) + (expand-file-name start-file target-dir)) ;; rename file (rename-file start-file-full end-file-full) (message "moved %s to %s" start-file-full start-file) ;; insert link - (insert (org-make-link-string (format "file:%s" start-file))) + (insert (org-make-link-string (format "file:%s" start-file))) ;; display image (org-display-inline-images t t))) @@ -2489,53 +2626,53 @@ Special Environments (defun tdh-render-org-table-at-point () (interactive) (save-excursion - (beginning-of-line) + (beginning-of-line) ;; removes the overlay is already there - (if (overlays-at (point)) - (delete-overlay (car (overlays-at (point)))) + (if (overlays-at (point)) + (delete-overlay (car (overlays-at (point)))) - (let* ((element-type (org-element-type (org-element-at-point)))) - (if (and (not (eq element-type 'table)) - (not (eq element-type 'table-row))) - (error "not at an org table") + (let* ((element-type (org-element-type (org-element-at-point)))) + (if (and (not (eq element-type 'table)) + (not (eq element-type 'table-row))) + (error "not at an org table") - (while (not (eq 'table (org-element-type (org-element-at-point)))) - (forward-line -1)) - (tdh-render-org-table (org-element-at-point)) - ))))) + (while (not (eq 'table (org-element-type (org-element-at-point)))) + (forward-line -1)) + (tdh-render-org-table (org-element-at-point)) + ))))) (defun tdh-render-org-table (table) (interactive) - (let* ((begin (org-element-property :begin table)) - (end (let ((pos (org-element-property :end table))) - (goto-char pos) - (beginning-of-line) + (let* ((begin (org-element-property :begin table)) + (end (let ((pos (org-element-property :end table))) + (goto-char pos) + (beginning-of-line) ;; skip possible space after table - (while (not (looking-at " *[|#]")) - (setq pos (point)) - (forward-line -1)) - pos)) - (tabletxt (buffer-substring-no-properties begin end)) - (img (with-temp-buffer - (insert tabletxt) - (mark-whole-buffer) - (org-latex-convert-region-to-latex) - (org-latex-preview) - (goto-char (point-min)) - (overlay-get (car (overlays-at (point))) 'display))) - (overlay (make-overlay begin end))) - (overlay-put overlay 'display img) - (forward-line -1)) + (while (not (looking-at " *[|#]")) + (setq pos (point)) + (forward-line -1)) + pos)) + (tabletxt (buffer-substring-no-properties begin end)) + (img (with-temp-buffer + (insert tabletxt) + (mark-whole-buffer) + (org-latex-convert-region-to-latex) + (org-latex-preview) + (goto-char (point-min)) + (overlay-get (car (overlays-at (point))) 'display))) + (overlay (make-overlay begin end))) + (overlay-put overlay 'display img) + (forward-line -1)) ) (defun tdh-render-org-tables-in-buffer () (save-excursion - (org-element-map (org-element-parse-buffer) 'table 'tdh-render-org-table))) + (org-element-map (org-element-parse-buffer) 'table 'tdh-render-org-table))) ;; Use F9 to globally generate tables - (map! :map org-mode-map :n "<f8>" (lambda () (interactive) (tdh-render-org-table-at-point))) + (map! :map org-mode-map :n "<f8>" (lambda () (interactive) (tdh-render-org-table-at-point))) )
    @@ -2566,9 +2703,9 @@ Special Environments
    -
    -

    Org Links

    -
    +
    +

    Org Links

    +

    Youtube Links

    @@ -2585,19 +2722,19 @@ Special Environments (org-add-link-type "yt" - (lambda (handle) - (browse-url - (concat "https://www.youtube.com/embed/" - handle))) - (lambda (path desc backend) - (cl-case backend - (html (format yt-iframe-format - path (or desc ""))) - (md (format "{{< youtube %s >}}" - path)) - (latex (format "\\href{%s}{%s}" - (concat "https://www.youtube.com/embed/" - path) (or desc "video")))))) + (lambda (handle) + (browse-url + (concat "https://www.youtube.com/embed/" + handle))) + (lambda (path desc backend) + (cl-case backend + (html (format yt-iframe-format + path (or desc ""))) + (md (format "{{< youtube %s >}}" + path)) + (latex (format "\\href{%s}{%s}" + (concat "https://www.youtube.com/embed/" + path) (or desc "video")))))) )
    @@ -2605,30 +2742,6 @@ Special Environments
    -
    -

    Org Gcal

    -
    - - -
    -
    (use-package! org-gcal
    -  :after org
    -  :init
    -  :config
    -  (setq org-gcal-client-id "396102378658-dcmbcmrnthbe925519otsjbd921otq0v.apps.googleusercontent.com"
    -        org-gcal-client-secret "4M5PWrbhQjwYEMXGK85lDYX9"
    -        org-gcal-file-alist '(("dehaeze.thomas@gmail.com" . "~/Cloud/org/gcal.org")
    -                              ("8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com" . "~/Cloud/org/gcal_phd.org")))
    -  ;; Automatic fetch of the new events
    -  ;; (add-hook 'org-agenda-mode-hook (lambda () (org-gcal-fetch) ))
    -  )
    -
    -
    -
    -
    -

    Citeproc-Org

    @@ -2762,8 +2875,8 @@ Insert Link to paper
    (defun tdh-insert-paper-org-link (paper)
       "Insert an org link to some paper, choosing the file with completion"
       (interactive
    -   (list (read-file-name "Paper: " "~/Cloud/pdfs/" nil t)))
    -  (insert (format "[[papers:%s]]" (file-name-base paper))))
    +   (list (read-file-name "Paper: " "~/Cloud/pdfs/" nil t)))
    +  (insert (format "[[papers:%s]]" (file-name-base paper))))
     
    @@ -2774,8 +2887,8 @@ Insert Link to notes
    (defun tdh-insert-note-org-link (note)
       "Insert an org link to some note, choosing the file with completion"
       (interactive
    -   (list (read-file-name "Note: " "~/Cloud/pdfs/" nil t)))
    -  (insert (format "[[notes:%s]]" (file-name-base note))))
    +   (list (read-file-name "Note: " "~/Cloud/pdfs/" nil t)))
    +  (insert (format "[[notes:%s]]" (file-name-base note))))
     
    @@ -2787,7 +2900,7 @@ Insert Image that is in the figs folder "Insert an org image link, choosing the file with completion and starting from `my-default-image-directory'." (interactive - (list (file-relative-name (read-file-name "Image: " (concat default-directory "figs/")) default-directory))) + (list (file-relative-name (read-file-name "Image: " (concat default-directory "figs/")) default-directory))) (insert (format "[[file:%s]]" img)))
    @@ -2802,7 +2915,7 @@ Insert Image that is in the figs folder using SXIV (interactive) (setq img (shell-command-to-string "ls figs/*.{jpg,jpeg,bmp,png,gif} 2> /dev/null | sxiv -i -t -o | tail -1 | tr -d '\n'")) (unless (equal "" img) - (insert (format "[[file:%s]]" img))) + (insert (format "[[file:%s]]" img))) )
    @@ -2815,7 +2928,7 @@ Copy picture from phone folder using SXIV and insert it (interactive) (setq img (shell-command-to-string "~/.config/doom/bin/copy-phone-picture.sh")) (unless (equal "" img) - (insert (format "[[file:%s]]" img))) + (insert (format "[[file:%s]]" img))) )
    @@ -2854,9 +2967,9 @@ Take Screenshot and insert a link: "Capture screenshot and insert the resulting file. The screenshot tool is determined by `org-download-screenshot-method'." (interactive) - (if (string-match "_" (file-name-base buffer-file-name)) - (setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_")))) - (setq filename (read-string "Enter file name:"))) + (if (string-match "_" (file-name-base buffer-file-name)) + (setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_")))) + (setq filename (read-string "Enter file name:"))) (setq filepath (concat "./figs/" filename ".png")) (shell-command (concat "maim -u -s " filepath)) (insert (format "#+name: fig:%s\n#+caption:\n[[file:%s]]" filename filepath)) @@ -2874,7 +2987,7 @@ Insert link to next figure: (interactive) (save-excursion (re-search-forward "^#\\+name:\s*\\(fig:.*\\)" nil t 1)) - (insert (concat "[[" (match-string 1) "]]")) + (insert (concat "[[" (match-string 1) "]]")) )
    @@ -2887,7 +3000,7 @@ Insert link to previous figure: (interactive) (save-excursion (re-search-backward "^#\\+name:\s*\\(fig:.*\\)" nil t 1)) - (insert (concat "[[" (match-string 1) "]]")) + (insert (concat "[[" (match-string 1) "]]")) ) @@ -2898,7 +3011,7 @@ Map Keys
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",i" . "Insert")
    +        (:prefix (",i" . "Insert")
             :n "p" 'tdh-insert-paper-org-link
             :n "n" 'tdh-insert-note-org-link
             :n "f" 'tdh-insert-image-org-link
    @@ -2920,9 +3033,7 @@ Map Keys
       "Watch LaTeX file using latexmk"
       (interactive)
       (start-process-shell-command "latexmk-watch" "*latexmk-watch-output*"
    -                               "latexmk" (format "-pdflatex=\"xelatex -synctex=1 -shell-escape -interaction nonstopmode  -output-directory='%s'\" -pdf -pvc -bibtex -f %s.tex"
    -                                                 (file-name-directory buffer-file-name)
    -                                                 (file-name-base buffer-file-name))))
    +                               "latexmk" "-pvc"))
     
    @@ -2938,7 +3049,7 @@ Map Keys
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",l" . "LaTeX")
    +        (:prefix (",l" . "LaTeX")
             :n "w" 'tdh-latex-watch
             :n "k" 'tdh-latex-watch-kill
             :n "l" 'org-latex-export-to-latex)))
    @@ -2973,7 +3084,7 @@ Map Keys
     
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",l" . "LaTeX")
    +        (:prefix (",l" . "LaTeX")
             :n "f" 'tdh-automatic-latex-fragment-activate
             :n "F" 'tdh-automatic-latex-fragment-deactivate)))
     
    @@ -2987,7 +3098,7 @@ Map Keys
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",r" . "References")
    +        (:prefix (",r" . "References")
             :n "b" 'helm-bibtex
             :n "B" 'helm-bibtex-with-local-bibliography
             :n "f" 'tdh-helm-bibtex-favorites
    @@ -3004,7 +3115,7 @@ Map Keys
     
    (defun tdh-open-ranger-in-workdir ()
       (interactive)
       (call-process-shell-command
    -  (concat "termite --directory=" default-directory " --exec=ranger") nil 0))
    +  (concat "alacritty -e ranger " default-directory) nil 0))
     
    @@ -3026,7 +3137,7 @@ Open PDF output with zathura
    (defun tdh-open-org-pdf-externally ()
       (interactive)
    -  (call-process "zathura" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".pdf"))
    +  (call-process "zathura" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".pdf"))
       )
     
    @@ -3037,7 +3148,7 @@ Open HTML output externally
    (defun tdh-open-org-html-externally ()
         (interactive)
    -    (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html"))
    +    (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html"))
         )
     
    @@ -3045,7 +3156,7 @@ Open HTML output externally
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",v" . "View")
    +        (:prefix (",v" . "View")
             :n "p" 'tdh-open-org-pdf-externally
             :n "h" 'tdh-open-org-html-externally)))
     
    @@ -3067,7 +3178,7 @@ Don’t ask for confirmation when evaluating following blocs

    (defun tdh-org-confirm-babel-evaluate (lang body)
    -  (not (member lang '("emacs-lisp" "latex" "matlab" "sh" "latex-macros" "python"))))
    +  (not (member lang '("emacs-lisp" "latex" "matlab" "sh" "latex-macros" "python"))))
     
     (after! org
       (setq org-confirm-babel-evaluate 'tdh-org-confirm-babel-evaluate))
    @@ -3079,7 +3190,7 @@ Default header arguments.
     

    (after! org
    -  (setq org-babel-default-header-args '((:eval . "no-export"))))
    +  (setq org-babel-default-header-args '((:eval . "no-export"))))
     
    @@ -3101,11 +3212,11 @@ Use the current window for C-c ’ source editing
    (defun tdh-org-prettify-symbols ()
       (mapc (apply-partially 'add-to-list 'prettify-symbols-alist)
             (cl-reduce 'append
    -                   (mapcar (lambda (x) (list x (cons (upcase (car x)) (cdr x))))
    -                           `(("#+begin_src" . ?✎)
    -                             ("#+end_src"   . ?□)
    -                             ("#+begin_quote" . ?«)
    -                             ("#+end_quote" . ?»)))))
    +                   (mapcar (lambda (x) (list x (cons (upcase (car x)) (cdr x))))
    +                           `(("#+begin_src" . ?✎)
    +                             ("#+end_src"   . ?□)
    +                             ("#+begin_quote" . ?«)
    +                             ("#+end_quote" . ?»)))))
       (turn-on-prettify-symbols-mode))
     (add-hook 'org-mode-hook #'tdh-org-prettify-symbols)
     
    @@ -3158,16 +3269,16 @@ Default options for Matlab code
    (after! org
       (setq org-babel-default-header-args:matlab
    -        '((:results . "none")
    -          (:session . "*MATLAB*")
    -          (:comments . "org")
    -          (:exports . "both")
    -          (:cache .   "no")
    -          (:noweb . "no")
    -          (:hlines . "no")
    -          (:tangle . "yes")
    -          (:mkdir . "yes")
    -          (:eval . "no-export")))
    +        '((:results . "none")
    +          (:session . "*MATLAB*")
    +          (:comments . "org")
    +          (:exports . "both")
    +          (:cache .   "no")
    +          (:noweb . "no")
    +          (:hlines . "no")
    +          (:tangle . "yes")
    +          (:mkdir . "yes")
    +          (:eval . "no-export")))
       )
     
    @@ -3180,84 +3291,84 @@ Better format the output results for Matlab ((defun org-babel-octave-evaluate-session (session body result-type &optional matlabp) "Evaluate BODY in SESSION." - (let* ((tmp-file (org-babel-temp-file (if matlabp "matlab-" "octave-"))) - (wait-file (org-babel-temp-file "matlab-emacs-link-wait-signal-")) - (full-body - (pcase result-type - (`output - (mapconcat + (let* ((tmp-file (org-babel-temp-file (if matlabp "matlab-" "octave-"))) + (wait-file (org-babel-temp-file "matlab-emacs-link-wait-signal-")) + (full-body + (pcase result-type + (`output + (mapconcat #'org-babel-chomp - (list (if matlabp - (multi-replace-regexp-in-string - '(("%.*$" . "") ;Remove comments + (list (if matlabp + (multi-replace-regexp-in-string + '(("%.*$" . "") ;Remove comments (";\\s-*\n+" . "; ") ;Concatenate lines ("\\(\\.\\)\\{3\\}\\s-*\n+" . " ") ;Handle continuations - (",*\\s-*\n+" . ", ")) ;Concatenate lines - body) - body) - org-babel-octave-eoe-indicator) "\n")) - (`value - (if (and matlabp org-babel-matlab-with-emacs-link) - (concat - (format org-babel-matlab-emacs-link-wrapper-method + (",*\\s-*\n+" . ", ")) ;Concatenate lines + body) + body) + org-babel-octave-eoe-indicator) "\n")) + (`value + (if (and matlabp org-babel-matlab-with-emacs-link) + (concat + (format org-babel-matlab-emacs-link-wrapper-method body - (org-babel-process-file-name tmp-file 'noquote) - (org-babel-process-file-name tmp-file 'noquote) wait-file) "\n") - (mapconcat + (org-babel-process-file-name tmp-file 'noquote) + (org-babel-process-file-name tmp-file 'noquote) wait-file) "\n") + (mapconcat #'org-babel-chomp - (list (format org-babel-octave-wrapper-method + (list (format org-babel-octave-wrapper-method body - (org-babel-process-file-name tmp-file 'noquote) - (org-babel-process-file-name tmp-file 'noquote)) - org-babel-octave-eoe-indicator) "\n"))))) - (raw (if (and matlabp org-babel-matlab-with-emacs-link) - (save-window-excursion - (with-temp-buffer - (insert full-body) - (write-region "" 'ignored wait-file nil nil nil 'excl) - (matlab-shell-run-region (point-min) (point-max)) - (message "Waiting for Matlab Emacs Link") - (while (file-exists-p wait-file) (sit-for 0.01)) - "")) ;; matlab-shell-run-region doesn't seem to + (org-babel-process-file-name tmp-file 'noquote) + (org-babel-process-file-name tmp-file 'noquote)) + org-babel-octave-eoe-indicator) "\n"))))) + (raw (if (and matlabp org-babel-matlab-with-emacs-link) + (save-window-excursion + (with-temp-buffer + (insert full-body) + (write-region "" 'ignored wait-file nil nil nil 'excl) + (matlab-shell-run-region (point-min) (point-max)) + (message "Waiting for Matlab Emacs Link") + (while (file-exists-p wait-file) (sit-for 0.01)) + "")) ;; matlab-shell-run-region doesn't seem to ;; make *matlab* buffer contents easily ;; available, so :results output currently ;; won't work - (org-babel-comint-with-output - (session - (if matlabp + (org-babel-comint-with-output + (session + (if matlabp org-babel-octave-eoe-indicator - org-babel-octave-eoe-output) - t full-body) - (insert full-body) (comint-send-input nil t)))) results) - (pcase result-type - (`value - (org-babel-octave-import-elisp-from-file tmp-file)) - (`output - (setq results - (if matlabp - (cdr (reverse (delete "" (mapcar #'org-strip-quotes - (mapcar #'org-trim (remove-car-upto-newline raw)))))) - (cdr (member org-babel-octave-eoe-output - (reverse (mapcar #'org-strip-quotes - (mapcar #'org-trim raw))))))) - (mapconcat #'identity (reverse results) "\n"))))) + org-babel-octave-eoe-output) + t full-body) + (insert full-body) (comint-send-input nil t)))) results) + (pcase result-type + (`value + (org-babel-octave-import-elisp-from-file tmp-file)) + (`output + (setq results + (if matlabp + (cdr (reverse (delete "" (mapcar #'org-strip-quotes + (mapcar #'org-trim (remove-car-upto-newline raw)))))) + (cdr (member org-babel-octave-eoe-output + (reverse (mapcar #'org-strip-quotes + (mapcar #'org-trim raw))))))) + (mapconcat #'identity (reverse results) "\n"))))) (defun remove-car-upto-newline (raw) "Truncate each string in a list of strings up to the first newline" - (cons (mapconcat #'identity - (cdr (split-string-and-unquote (car raw) "\n")) - "\n") (cdr raw))) + (cons (mapconcat #'identity + (cdr (split-string-and-unquote (car raw) "\n")) + "\n") (cdr raw))) (defun multi-replace-regexp-in-string (replacements-list string &optional rest) (interactive) "Replace multiple regexps in a string. Order matters." - (if (null replacements-list) + (if (null replacements-list) string - (let ((regex (caar replacements-list)) - (replacement (cdar replacements-list))) - (multi-replace-regexp-in-string (cdr replacements-list) - (replace-regexp-in-string regex replacement - string rest))))) + (let ((regex (caar replacements-list)) + (replacement (cdar replacements-list))) + (multi-replace-regexp-in-string (cdr replacements-list) + (replace-regexp-in-string regex replacement + string rest))))) )
    @@ -3296,7 +3407,7 @@ Future task2 : des4, after des3, 5d
    -
    +

    mermaid.png

    @@ -3314,9 +3425,9 @@ Future task2 : des4, after des3, 5d "Get what is in the Matlab workspace" (interactive) (if (use-region-p) - (let ((regionp (buffer-substring (region-beginning) (region-end)))) - (process-send-string "*MATLAB*" (concat "whosEmacs " regionp "\n"))) - (process-send-string "*MATLAB*" (concat "whosEmacs" "\n")))) + (let ((regionp (buffer-substring (region-beginning) (region-end)))) + (process-send-string "*MATLAB*" (concat "whosEmacs " regionp "\n"))) + (process-send-string "*MATLAB*" (concat "whosEmacs" "\n"))))
    @@ -3328,9 +3439,9 @@ Future task2 : des4, after des3, 5d "Get help on the selected function" (interactive) (if (use-region-p) - (let ((regionp (buffer-substring (region-beginning) (region-end)))) - (process-send-string "*MATLAB*" (concat "help " regionp "\n"))) - (process-send-string "*MATLAB*" (concat "help " (read-string "Matlab help:") "\n"))) + (let ((regionp (buffer-substring (region-beginning) (region-end)))) + (process-send-string "*MATLAB*" (concat "help " regionp "\n"))) + (process-send-string "*MATLAB*" (concat "help " (read-string "Matlab help:") "\n"))) ) @@ -3342,7 +3453,7 @@ Specify a Matlab command to run
    (defun tdh-matlab-run-command ()
     "Prompt user to enter a matlab command"
     (interactive)
    -(process-send-string "*MATLAB*" (concat (read-string "Matlab Command: ") "\n")))
    +(process-send-string "*MATLAB*" (concat (read-string "Matlab Command: ") "\n")))
     
    @@ -3353,7 +3464,7 @@ Specify a Matlab command to run and show output in mini-buffer
    (defun tdh-matlab-run-command-show-output ()
       "Prompt user to enter a matlab command"
       (interactive)
    -  (process-send-string "*MATLAB*" (concat "evalEmacs('" (read-string "Matlab Command: ") "')\n")))
    +  (process-send-string "*MATLAB*" (concat "evalEmacs('" (read-string "Matlab Command: ") "')\n")))
     
    @@ -3365,15 +3476,15 @@ Org-Babel Tangle File and Execute with Matlab "Jump to tangle file for the source block at point." (interactive) (let (file org-babel-pre-tangle-hook org-babel-post-tangle-hook) - (cl-letf (((symbol-function 'write-region) (lambda (start end filename &rest _ignore) - (setq file filename))) - ((symbol-function 'delete-file) #'ignore)) - (org-babel-tangle '(4))) + (cl-letf (((symbol-function 'write-region) (lambda (start end filename &rest _ignore) + (setq file filename))) + ((symbol-function 'delete-file) #'ignore)) + (org-babel-tangle '(4))) (when file - (setq file (expand-file-name file)) - (if (file-readable-p file) - (process-send-string "*MATLAB*" (concat "run " file "\n")) - (error "Cannot open tangle file %S" file))))) + (setq file (expand-file-name file)) + (if (file-readable-p file) + (process-send-string "*MATLAB*" (concat "run " file "\n")) + (error "Cannot open tangle file %S" file))))) @@ -3383,7 +3494,7 @@ Map Functions
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",m" . "Matlab")
    +        (:prefix (",m" . "Matlab")
             :n  "e" 'tdh-matlab-run-command
             :n  "E" 'tdh-matlab-run-command-show-output
             :n  "T" 'tdh-matlab-tangle-and-execute
    @@ -3411,12 +3522,12 @@ when inside a source block. Otherwise, keep the normal behavior for ctrl-r
       (interactive)
       (defun tdh-in-src-block-p ()
         "Returns t when the point is inside a source code block"
    -    (string= "src" (org-in-block-p '("src"))))
    +    (string= "src" (org-in-block-p '("src"))))
     
    -  (if (tdh-in-src-block-p)
    +  (if (tdh-in-src-block-p)
           (progn
    -        (org-babel-execute-src-block)
    -        (org-babel-next-src-block))
    +        (org-babel-execute-src-block)
    +        (org-babel-next-src-block))
         (+org--insert-item 'below)))
     
    @@ -3440,61 +3551,61 @@ when inside a source block. Otherwise, keep the normal behavior for ctrl-r
    (defun tdh-org-babel-execute-matlab-background (&optional arg info params)
       (interactive)
    -  (let* ((org-babel-current-src-block-location
    -      (or org-babel-current-src-block-location
    -          (nth 5 info)
    -          (org-babel-where-is-src-block-head)))
    -     (info (if info (copy-tree info) (org-babel-get-src-block-info))))
    +  (let* ((org-babel-current-src-block-location
    +      (or org-babel-current-src-block-location
    +          (nth 5 info)
    +          (org-babel-where-is-src-block-head)))
    +     (info (if info (copy-tree info) (org-babel-get-src-block-info))))
         ;; Merge PARAMS with INFO before considering source block
         ;; evaluation since both could disagree.
    -    (cl-callf org-babel-merge-params (nth 2 info) params)
    -    (when (org-babel-check-evaluate info)
    -      (cl-callf org-babel-process-params (nth 2 info))
    -      (let* ((params (nth 2 info))
    -         (cache (let ((c (cdr (assq :cache params))))
    -              (and (not arg) c (string= "yes" c))))
    -         (new-hash (and cache (org-babel-sha1-hash info :eval)))
    -         (old-hash (and cache (org-babel-current-result-hash)))
    -         (current-cache (and new-hash (equal new-hash old-hash))))
    -    (cond
    -     (current-cache
    -      (save-excursion           ;Return cached result.
    -        (goto-char (org-babel-where-is-src-block-result nil info))
    -        (forward-line)
    -        (skip-chars-forward " \t")
    -        (let ((result (org-babel-read-result)))
    -          (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
    -          result)))
    -     ((org-babel-confirm-evaluate info)
    -      (let* ((lang (nth 0 info))
    -         (result-params (cdr (assq :result-params params)))
    +    (cl-callf org-babel-merge-params (nth 2 info) params)
    +    (when (org-babel-check-evaluate info)
    +      (cl-callf org-babel-process-params (nth 2 info))
    +      (let* ((params (nth 2 info))
    +         (cache (let ((c (cdr (assq :cache params))))
    +              (and (not arg) c (string= "yes" c))))
    +         (new-hash (and cache (org-babel-sha1-hash info :eval)))
    +         (old-hash (and cache (org-babel-current-result-hash)))
    +         (current-cache (and new-hash (equal new-hash old-hash))))
    +    (cond
    +     (current-cache
    +      (save-excursion           ;Return cached result.
    +        (goto-char (org-babel-where-is-src-block-result nil info))
    +        (forward-line)
    +        (skip-chars-forward " \t")
    +        (let ((result (org-babel-read-result)))
    +          (message (replace-regexp-in-string "%" "%%" (format "%S" result)))
    +          result)))
    +     ((org-babel-confirm-evaluate info)
    +      (let* ((lang (nth 0 info))
    +         (result-params (cdr (assq :result-params params)))
              ;; Expand noweb references in BODY and remove any
              ;; coderef.
    -         (body
    -          (let ((coderef (nth 6 info))
    -            (expand
    +         (body
    +          (let ((coderef (nth 6 info))
    +            (expand
                  (if (org-babel-noweb-p params :eval)
                      (org-babel-expand-noweb-references info)
    -               (nth 1 info))))
    -            (if (not coderef) expand
    -              (replace-regexp-in-string
    -               (org-src-coderef-regexp coderef) "" expand nil nil 1))))
    -         (dir (cdr (assq :dir params)))
    -         (mkdirp (cdr (assq :mkdirp params)))
    -         (default-directory
    -           (cond
    -            ((not dir) default-directory)
    -            ((member mkdirp '("no" "nil" nil))
    -             (file-name-as-directory (expand-file-name dir)))
    -            (t
    -             (let ((d (file-name-as-directory (expand-file-name dir))))
    +               (nth 1 info))))
    +            (if (not coderef) expand
    +              (replace-regexp-in-string
    +               (org-src-coderef-regexp coderef) "" expand nil nil 1))))
    +         (dir (cdr (assq :dir params)))
    +         (mkdirp (cdr (assq :mkdirp params)))
    +         (default-directory
    +           (cond
    +            ((not dir) default-directory)
    +            ((member mkdirp '("no" "nil" nil))
    +             (file-name-as-directory (expand-file-name dir)))
    +            (t
    +             (let ((d (file-name-as-directory (expand-file-name dir))))
                    (make-directory d 'parents)
    -               d))))
    -         (cmd (intern (concat "org-babel-execute:" lang)))
    -         result)
    -        (process-send-string "*MATLAB*" (concat body "\n"))
    -        result))
    -     )))
    +               d))))
    +         (cmd (intern (concat "org-babel-execute:" lang)))
    +         result)
    +        (process-send-string "*MATLAB*" (concat body "\n"))
    +        result))
    +     )))
         )
       )
     
    @@ -3509,8 +3620,8 @@ when inside a source block. Otherwise, keep the normal behavior for ctrl-r
    (defun tdh-matlab-execute-selected (start end)
     "Execute selected text in the *MATLAB* buffer"
       (interactive "r")
    -  (let ((regionp (buffer-substring start end)))
    -      (process-send-string "*MATLAB*" (concat regionp "\n"))))
    +  (let ((regionp (buffer-substring start end)))
    +      (process-send-string "*MATLAB*" (concat regionp "\n"))))
     
    @@ -3537,16 +3648,16 @@ if no region is selected, it runs all the code blocks and goes to the next block (interactive) (defun tdh-in-src-block-p () "Returns t when the point is inside a source code block" - (string= "src" (org-in-block-p '("src")))) + (string= "src" (org-in-block-p '("src")))) - (if (tdh-in-src-block-p) - (let ((lang (nth 0 (org-babel-get-src-block-info)))) - (if (string= lang "matlab") - (if (region-active-p) - (tdh-matlab-execute-selected (region-beginning) (region-end)) - (progn (tdh-org-babel-execute-matlab-background) - (org-babel-next-src-block))) - (org-babel-next-src-block)) + (if (tdh-in-src-block-p) + (let ((lang (nth 0 (org-babel-get-src-block-info)))) + (if (string= lang "matlab") + (if (region-active-p) + (tdh-matlab-execute-selected (region-beginning) (region-end)) + (progn (tdh-org-babel-execute-matlab-background) + (org-babel-next-src-block))) + (org-babel-next-src-block)) ) (org-babel-next-src-block) ) @@ -3572,13 +3683,13 @@ if no region is selected, it runs all the code blocks and goes to the next block (interactive) (defun tdh-in-src-block-p () "Returns t when the point is inside a source code block" - (string= "src" (org-in-block-p '("src")))) + (string= "src" (org-in-block-p '("src")))) - (if (tdh-in-src-block-p) + (if (tdh-in-src-block-p) (progn - (org-edit-special) - (indent-region (point-min) (point-max)) - (org-edit-src-exit)) + (org-edit-special) + (indent-region (point-min) (point-max)) + (org-edit-src-exit)) (org-table-eval-formula))) @@ -3611,15 +3722,15 @@ Org-Tangle and Org-Babel Jump to Tangle File "Jump to tangle file for the source block at point." (interactive) (let (file org-babel-pre-tangle-hook org-babel-post-tangle-hook) - (cl-letf (((symbol-function 'write-region) (lambda (start end filename &rest _ignore) - (setq file filename))) - ((symbol-function 'delete-file) #'ignore)) - (org-babel-tangle '(4))) + (cl-letf (((symbol-function 'write-region) (lambda (start end filename &rest _ignore) + (setq file filename))) + ((symbol-function 'delete-file) #'ignore)) + (org-babel-tangle '(4))) (when file - (setq file (expand-file-name file)) - (if (file-readable-p file) - (find-file file) - (error "Cannot open tangle file %S" file))))) + (setq file (expand-file-name file)) + (if (file-readable-p file) + (find-file file) + (error "Cannot open tangle file %S" file))))) @@ -3629,7 +3740,7 @@ Map Functions
    (after! org
       (map! :map org-mode-map
    -        (:prefix (",b" . "Tangle")
    +        (:prefix (",b" . "Tangle")
             :n  "F" 'tdh-org-babel-jump-to-tangle-file
             :n  "T" 'tdh-org-babel-tangle-subtree)))
     
    @@ -3684,19 +3795,19 @@ Nice Functions: (setq org-ref-pdf-directory "~/Cloud/pdfs") (setq org-ref-bibliography-entry-format - '(("article" . "%a, %t, %j, v(%n), %p (%y).") - ("book" . "%a, %t, %u (%y).") - ("techreport" . "%a, %t, %i, %u (%y).") - ("phdthesis" . "%a, %t (%y).") - ("proceedings" . "%e, %t in %S, %u (%y).") - ("inproceedings" . "%a, %t, %p, in %b, edited by %e, %u (%y)"))) + '(("article" . "%a, %t, %j, v(%n), %p (%y).") + ("book" . "%a, %t, %u (%y).") + ("techreport" . "%a, %t, %i, %u (%y).") + ("phdthesis" . "%a, %t (%y).") + ("proceedings" . "%e, %t in %S, %u (%y).") + ("inproceedings" . "%a, %t, %p, in %b, edited by %e, %u (%y)"))) ;; Tell org-ref to let helm-bibtex find notes for it (setq org-ref-notes-function - (lambda (thekey) - (let ((bibtex-completion-bibliography (org-ref-find-bibliography))) - (bibtex-completion-edit-notes - (list (car (org-ref-get-bibtex-key-and-file thekey))))))) + (lambda (thekey) + (let ((bibtex-completion-bibliography (org-ref-find-bibliography))) + (bibtex-completion-edit-notes + (list (car (org-ref-get-bibtex-key-and-file thekey))))))) ;; Problem with speed: don't display broken links (setq org-ref-show-broken-links t) @@ -3704,26 +3815,26 @@ Nice Functions: (setq org-ref-show-citation-on-enter t) (add-to-list 'org-ref-helm-user-candidates - '("Open pdf in Zathura" . (lambda () (call-process "zathura" nil 0 nil (concat - (file-name-as-directory org-ref-pdf-directory) - (car (org-ref-get-bibtex-key-and-file)) - ".pdf")))) + '("Open pdf in Zathura" . (lambda () (call-process "zathura" nil 0 nil (concat + (file-name-as-directory org-ref-pdf-directory) + (car (org-ref-get-bibtex-key-and-file)) + ".pdf")))) t) (add-to-list 'org-ref-helm-user-candidates - '("Drag and Drop" . (lambda () (call-process "/bin/bash" nil 0 nil "-c" (concat + '("Drag and Drop" . (lambda () (call-process "/bin/bash" nil 0 nil "-c" (concat "dragon-drag-and-drop " - (file-name-as-directory org-ref-pdf-directory) - (car (org-ref-get-bibtex-key-and-file)) - ".pdf")))) + (file-name-as-directory org-ref-pdf-directory) + (car (org-ref-get-bibtex-key-and-file)) + ".pdf")))) t) ;; Let Mathjax deals with equation reference (defun org-ref-eqref-export (keyword desc format) (cond - ((eq format 'latex) (format "\\eqref{%s}" keyword)) - ((eq format 'html) (format "\\eqref{%s}" keyword)) - ((eq format 'md) (format "\\eqref{%s}" keyword)))) + ((eq format 'latex) (format "\\eqref{%s}" keyword)) + ((eq format 'html) (format "\\eqref{%s}" keyword)) + ((eq format 'md) (format "\\eqref{%s}" keyword)))) )
    @@ -3732,12 +3843,12 @@ Nice Functions:
    (defun tdh-org-ref-open-pdf-at-point ()
       "Open the pdf in external program for bibtex key under point if it exists."
       (interactive)
    -  (let* ((results (org-ref-get-bibtex-key-and-file))
    -         (key (car results))
    -         (pdf-file (funcall org-ref-get-pdf-filename-function key)))
    -    (if (file-exists-p pdf-file)
    -        (call-process "zathura" nil 0 nil pdf-file)
    -      (message "no pdf found for %s" key))))
    +  (let* ((results (org-ref-get-bibtex-key-and-file))
    +         (key (car results))
    +         (pdf-file (funcall org-ref-get-pdf-filename-function key)))
    +    (if (file-exists-p pdf-file)
    +        (call-process "zathura" nil 0 nil pdf-file)
    +      (message "no pdf found for %s" key))))
     
     
     ;; Open with Zathura by default
    @@ -3787,43 +3898,68 @@ Nice Functions:
     
     
     
    +
    +

    Capture Templates

    +
    +
    +
    +

    Bibliography

    +
    +
    +
    - Tags :: %?
    +- Reference :: ${ref}
    +- Author(s) :: %^{author}
    +- Year :: %^{year}
    +
    +
    +* %^{author-abbrev} (%^{year}): %^{title} :%^{entry-type}:ignore:
    +:PROPERTIES:
    +:NOTER_DOCUMENT: ../pdfs/%^{citekey}.pdf
    +:END:
    +
    +* Bibliography                                                        :ignore:
    +#+BIBLIOGRAPHY: here
    +
    +
    +
    +
    + +
    +

    Default

    +
    +
    +
    - Tags ::
    +
    +%?
    +
    +* Bibliography                                                        :ignore:
    +#+BIBLIOGRAPHY: here
    +
    +
    +
    +
    +
    +

    Org Roam (link)

    (use-package! org-roam
       :custom-face
    -  (org-roam-link ((t (:inherit org-link :foreground "#cc241d"))))
    +  (org-roam-link ((t (:inherit org-link :foreground "#cc241d"))))
       :config
       (setq org-roam-directory (file-truename "~/Cloud/brain/"))
    -  (setq org-roam-completion-system 'helm)
    -  (setq org-roam-tag-sources '(prop last-directory))
    +  (make-directory org-roam-directory 'parents)
    +  (setq org-roam-completion-system 'helm)
    +  (setq org-roam-tag-sources '(prop last-directory))
    +
       (setq org-roam-capture-templates
    -        `(("d" "default" plain (function org-roam--capture-get-point)
    -           "%?"
    -           :file-name "${slug}"
    -           :head ,(concat "#+title: ${title}\n"
    -                          "#+setupfile: ./setup/org-setup-file.org\n"
    -                          "#+hugo_section: zettels\n"
    -                          "\n"
    -                          "- Tags ::\n"
    -                          "\n"
    -                          "* Bibliography                                                        :ignore:\n"
    -                          "bibliography:./biblio/references.bib"
    -                          )
    -           :unnarrowed t)))
    -  (setq org-roam-capture-ref-templates
    -        `(("r" "ref" plain (function org-roam--capture-get-point)
    -           "%?"
    -           :file-name "${slug}"
    -           :head ,(concat "#+title: ${title}\n"
    -                          "#+setupfile: ./setup/org-setup-file.org\n"
    -                          "#+hugo_section: websites\n"
    -                          "#+roam_key: ${ref}\n"
    -                          "\n"
    -                          "- Tags ::\n"
    -                          )
    -           :unnarrowed t)))
    +        `(("d" "default" plain (file "~/.config/doom/capture-templates/default.org")
    +           :if-new (file+head "${slug}.org" "#+title: ${title}\n#+setupfile: ./setup/org-setup-file.org\n#+hugo_section: zettels\n\n")
    +           :unnarrowed t)
    +          ("r" "bibliography reference" plain (file "~/.config/doom/capture-templates/ref.org")
    +           :if-new (file+head "${citekey}.org" "#+title: ${title}\n#+setupfile: ./setup/org-setup-file.org\n#+hugo_section: ${entry-type}\n\n")
    +           :unnarrowed t)))
       )
     
    @@ -3834,18 +3970,18 @@ Automatic export of backlinks
    (after! (org org-roam)
       (defun tdh-org-roam--backlinks-list (file)
    -    (when (org-roam--org-roam-file-p file)
    -      (mapcar #'car (org-roam-db-query [:select :distinct [from]
    +    (when (org-roam--org-roam-file-p file)
    +      (mapcar #'car (org-roam-db-query [:select :distinct [from]
                                             :from links
    -                                        :where (= to $s1)
    -                                        :and from :not :like $s2] file "%private%"))))
    +                                        :where (= to $s1)
    +                                        :and from :not :like $s2] file "%private%"))))
       (defun tdh-org-export-preprocessor (_backend)
    -    (when-let ((links (tdh-org-roam--backlinks-list (buffer-file-name))))
    -      (insert "\nBacklinks:\n")
    -      (dolist (link links)
    -        (insert (format "- [[file:%s][%s]]\n"
    -                        (file-relative-name link org-roam-directory)
    -                        (org-roam--get-title-or-slug link))))))
    +    (when-let ((links (tdh-org-roam--backlinks-list (buffer-file-name))))
    +      (insert "\nBacklinks:\n")
    +      (dolist (link links)
    +        (insert (format "- [[file:%s][%s]]\n"
    +                        (file-relative-name link org-roam-directory)
    +                        (org-roam--get-title-or-slug link))))))
     
       (add-hook 'org-export-before-processing-hook #'tdh-org-export-preprocessor)
       )
    @@ -3859,54 +3995,10 @@ Re-Export all roam files.
     
    (defun tdh-org-roam-export-all ()
       "Re-exports all Org-roam files to Hugo markdown."
       (interactive)
    -  (dolist (f (org-roam--list-all-files))
    -    (with-current-buffer (find-file f)
    -      (when (s-contains? "SETUPFILE" (buffer-string))
    -        (org-hugo-export-wim-to-md)))))
    -
    -
    - -

    -Create Org-Roam file from heading (link) -

    -
    -
    (defun tdh/make-roam-filepath (title)
    -  "Make filename from note TITLE."
    -  (concat
    -   org-roam-directory
    -   (org-roam--title-to-slug title)
    -   ".org"))
    -
    -(defun tdh/insert-org-roam-file (file-path title text)
    -  "Insert org roam file in FILE-PATH with TITLE, LINKS, SOURCES, TEXT, QUOTE."
    -  (with-temp-file file-path
    -    (insert
    -     "#+title: " title "\n"
    -     "#+setupfile: ./setup/org-setup-file.org\n"
    -     "#+hugo_section: zettels\n"
    -     "\n"
    -     "- Tags ::\n"
    -     "\n"
    -     text
    -     "\n"
    -     "\n"
    -     "* Bibliography                                                        :ignore:\n"
    -     "bibliography:./biblio/references.bib"
    -     "\n"
    -     )))
    -
    -
    -(defun tdh/convert-task-to-org-note ()
    -  "Convert a task in a `org-roam' note."
    -  (interactive)
    -  (let* ((heading (org-get-heading t t t t))
    -         (body (org-get-entry))
    -         (filepath (tdh/make-roam-filepath heading)))
    -    (tdh/insert-org-roam-file
    -     filepath
    -     heading
    -     body)
    -    (find-file filepath)))
    +  (dolist (f (org-roam--list-all-files))
    +    (with-current-buffer (find-file f)
    +      (when (s-contains? "SETUPFILE" (buffer-string))
    +        (org-hugo-export-wim-to-md)))))
     
    @@ -3942,7 +4034,7 @@ Create Org-Roam file from heading (;; Display of bibtex entries with helm (setq bibtex-completion-display-formats - '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"))) + '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}"))) ;; Special symbols for notes and pdf (setq bibtex-completion-pdf-symbol "⌘") @@ -3953,6 +4045,7 @@ Create Org-Roam file from heading ("#+setupfile: ./setup/org-setup-file.org\n" "#+hugo_section: ${=type=}\n" "#+roam_key: ${=key=}\n" + "#+hugo_draft: true\n" "\n" "- Tags ::\n" "- Reference :: cite:${=key=}\n" @@ -3986,9 +4079,9 @@ Create Org-Roam file from heading ((defun tdh-insert-link-to-pdf-entry (key) "Insert a link to a pdf associated with the bibtex entry." (let* - ((entry (bibtex-completion-get-entry key)) - (title (bibtex-completion-get-value "title" entry))) - (insert (concat "[[file:Download/" key ".pdf][" title "]] (cite:" key ")")) + ((entry (bibtex-completion-get-entry key)) + (title (bibtex-completion-get-value "title" entry))) + (insert (concat "[[file:Download/" key ".pdf][" title "]] (cite:" key ")")) ) )
    @@ -3998,12 +4091,12 @@ Create Org-Roam file from heading ((defun tdh-insert-link-to-note (key) "Insert a link to a note associated with the bibtex entry." (if (and bibtex-completion-notes-path - (f-directory? bibtex-completion-notes-path)) - (let* ((path (f-join bibtex-completion-notes-path - (s-concat key bibtex-completion-notes-extension)))) - (if (file-exists-p path) - (insert (concat "[[file:" (file-relative-name path) "][Notes]]")) - (message "No note file associated")) + (f-directory? bibtex-completion-notes-path)) + (let* ((path (f-join bibtex-completion-notes-path + (s-concat key bibtex-completion-notes-extension)))) + (if (file-exists-p path) + (insert (concat "[[file:" (file-relative-name path) "][Notes]]")) + (message "No note file associated")) ))) @@ -4013,7 +4106,7 @@ Open pdf externally

    (defun tdh-open-pdf-externally (key)
    -  (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
    +  (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
     
    @@ -4038,16 +4131,16 @@ List all element of the bibliography without pdf associated (setq candidates (bibtex-completion-candidates)) (defun canditate-is-pdf-present (candidate) - (bibtex-completion-find-pdf-in-library (cdr (assoc "=key=" candidate))) + (bibtex-completion-find-pdf-in-library (cdr (assoc "=key=" candidate))) ) (setq candidates-without-pdf (remove-if #'canditate-is-pdf-present candidates)) (setq candidate-without-pdf-names (mapcar - (lambda (x) (cdr (assoc "title" x))) + (lambda (x) (cdr (assoc "title" x))) candidates-without-pdf)) - (with-output-to-temp-buffer "*bib-without-pdf*" (princ (string-join candidate-without-pdf-names "\n"))) + (with-output-to-temp-buffer "*bib-without-pdf*" (princ (string-join candidate-without-pdf-names "\n"))) (switch-to-buffer-other-window "*bib-without-pdf*") ) @@ -4055,21 +4148,21 @@ List all element of the bibliography without pdf associated -
    -

    Deft

    -
    +
    +

    Deft (link)

    +
    (use-package! deft
       :custom
    -  (deft-directory "~/Cloud/brain/"))
    +  (deft-directory "~/Cloud/brain/"))
     
    -
    -

    Org-Roam-Bibtex (link)

    -
    +
    +

    Org-Roam-Bibtex (link)

    +

    Provides nice functions such as:

    @@ -4081,34 +4174,10 @@ Provides nice functions such as:
    (use-package! org-roam-bibtex
    -  :hook (org-roam-mode . org-roam-bibtex-mode)
    +  :after org-roam
       :config
    -  (setq orb-preformat-keywords `("=key=" "title" "author" "year" "author-abbrev" "=type="))
    -
    -  (setq orb-templates
    -        `(("r" "ref" plain (function org-roam-capture--get-point) ""
    -           :file-name "${=key=}"
    -           :head ,(concat "#+title: ${title}\n"
    -                          "#+setupfile: ./setup/org-setup-file.org\n"
    -                          "#+hugo_section: ${=type=}\n"
    -                          "#+roam_key: ${ref}\n"
    -                          "\n"
    -                          "- Tags ::\n"
    -                          "- Reference :: ${ref}\n"
    -                          "- Author(s) :: ${author}\n"
    -                          "- Year :: ${year}\n"
    -                          "\n"
    -                          "* ${author-abbrev} (${year}): ${title} :${=type=}:ignore:\n"
    -                          ":PROPERTIES:\n"
    -                          ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
    -                          ":END:\n"
    -                          "\n"
    -                          "* Bibliography                                                        :ignore:\n"
    -                          "bibliography:./biblio/references.bib"
    -                          )
    -           :unnarrowed t)))
    -
    -  (setq orb-note-actions-user '(("Open with Zathura" . tdh-open-bib-with-zathura)))
    +  (setq orb-preformat-keywords '("citekey" "title" "author" "year" "author-abbrev" "entry-type"))
    +  (setq orb-note-actions-user '(("Open with Zathura" . tdh-open-bib-with-zathura)))
       )
     
    @@ -4117,7 +4186,7 @@ Provides nice functions such as:
    (defun tdh-open-bib-with-zathura (key)
       "Open the pdf corresponding to the reference KEY with Zathura"
       (if (listp key)
    -      (setq key (car key)))
    +      (setq key (car key)))
       (call-process "zathura" nil 0 nil (org-ref-get-pdf-filename key)))
     
    @@ -4160,9 +4229,9 @@ Provides nice functions such as:
    -
    -

    Basic Config

    -
    +
    +

    Basic Config

    +
    (after! auctex
       (setq +latex-viewers '(zathura pdf-tools)))
    @@ -4215,7 +4284,7 @@ Provides nice functions such as:
       "A Matlab checker based on mlint."
       :command `(,mlint-executable source)
       :error-patterns
    -  '((warning line-start "L " line " (C " (1+ digit)  "): " (message) line-end))
    +  '((warning line-start "L " line " (C " (1+ digit)  "): " (message) line-end))
       :modes '(matlab-mode))
     
     (add-to-list 'flycheck-checkers 'matlab-mlint)
    @@ -4246,11 +4315,11 @@ Provides nice functions such as:
       "Beautify Current Matlab Buffer"
       (interactive)
       ;; First verifies is the current file is a Matlab file
    -  (if (string= (file-name-extension (buffer-file-name)) "m")
    +  (if (string= (file-name-extension (buffer-file-name)) "m")
           (progn
    -        (save-buffer)
    -        (matlab-shell-run-command (concat "MBeautify.formatFileNoEditor(\"" (buffer-file-name) "\", \"" (buffer-file-name) "\")"))
    -        (revert-buffer :ignore-auto :noconfirm))
    +        (save-buffer)
    +        (matlab-shell-run-command (concat "MBeautify.formatFileNoEditor(\"" (buffer-file-name) "\", \"" (buffer-file-name) "\")"))
    +        (revert-buffer :ignore-auto :noconfirm))
         (message "Current buffer is not a matlab file")
         )
       )
    @@ -4265,19 +4334,19 @@ Provides nice functions such as:
     
    (defun tdh-matlab-add-breakpoint ()
       (interactive)
    -  (matlab-shell-run-command (concat "dbstop in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
    +  (matlab-shell-run-command (concat "dbstop in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
     
     (defun tdh-matlab-remove-breakpoint ()
       (interactive)
    -  (matlab-shell-run-command (concat "dbclear in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
    +  (matlab-shell-run-command (concat "dbclear in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
     
     (defun tdh-matlab-list-breakpoints ()
       (interactive)
    -  (matlab-shell-run-command (concat "dbstatus " (buffer-name))))
    +  (matlab-shell-run-command (concat "dbstatus " (buffer-name))))
     
     (defun tdh-matlab-clear-breakpoints ()
       (interactive)
    -  (matlab-shell-run-command (concat "dbclear in " (buffer-name))))
    +  (matlab-shell-run-command (concat "dbclear in " (buffer-name))))
     
     (defun tdh-matlab-no-debug-on-error ()
       (interactive)
    @@ -4289,7 +4358,7 @@ Provides nice functions such as:
     
     (defun tdh-matlab-go-to-file-directory ()
       (interactive)
    -  (matlab-shell-run-command (concat "cd " (file-name-directory buffer-file-name))))
    +  (matlab-shell-run-command (concat "cd " (file-name-directory buffer-file-name))))
     
    @@ -4297,7 +4366,7 @@ Provides nice functions such as:
    (map! :map matlab-mode-map
           (:prefix ("," . "prefix")
            :n "g" 'tdh-matlab-go-to-file-directory
    -       (:prefix ("d" . "Debug")
    +       (:prefix ("d" . "Debug")
             :n "de" 'tdh-matlab-debug-on-error
             :n "dE" 'tdh-matlab-no-debug-on-error
             :n "da" 'tdh-matlab-add-breakpoint
    @@ -4414,12 +4483,12 @@ This is a helper to help determine which account context I am in based on the fo
     
    (defun mu4e-message-maildir-matches (msg rx)
       (when rx
    -    (if (listp rx)
    +    (if (listp rx)
             ;; If rx is a list, try each one for a match
    -        (or (mu4e-message-maildir-matches msg (car rx))
    -            (mu4e-message-maildir-matches msg (cdr rx)))
    +        (or (mu4e-message-maildir-matches msg (car rx))
    +            (mu4e-message-maildir-matches msg (cdr rx)))
           ;; Not a list, check rx
    -      (string-match rx (mu4e-message-field msg :maildir)))))
    +      (string-match rx (mu4e-message-field msg :maildir)))))
     
    @@ -4430,23 +4499,23 @@ Choose account label to feed msmtp -a option based on From header in Message buf
    (defun choose-msmtp-account ()
       (if (message-mail-p)
           (save-excursion
    -        (let*
    -            ((from (save-restriction
    -                     (message-narrow-to-headers)
    -                     (message-fetch-field "from")))
    -             (account
    -              (cond
    -               ((string-match "dehaeze.thomas@gmail.com" from) "gmail")
    -               ((string-match "thomas.dehaeze@esrf.fr" from) "esrf"))))
    -          (setq message-sendmail-extra-arguments (list '"-a" account))))))
    +        (let*
    +            ((from (save-restriction
    +                     (message-narrow-to-headers)
    +                     (message-fetch-field "from")))
    +             (account
    +              (cond
    +               ((string-match "dehaeze.thomas@gmail.com" from) "gmail")
    +               ((string-match "thomas.dehaeze@esrf.fr" from) "esrf"))))
    +          (setq message-sendmail-extra-arguments (list '"-a" account))))))
     
    -
    -

    Basic Config

    -
    +
    +

    Basic Config

    +
    (use-package! mu4e
       :config
    @@ -4541,36 +4610,36 @@ Choose account label to feed msmtp -a option based on From header in Message buf
     
    (use-package! mu4e
       :config
       (setq mu4e-contexts
    -        `( ,(make-mu4e-context
    +        `( ,(make-mu4e-context
                  :name "gmail"
    -             :enter-func (lambda () (mu4e-message "Switch to the gmail context"))
    -             :match-func (lambda (msg) (when msg
    -                                         (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
    -             :leave-func (lambda () (mu4e-clear-caches))
    -             :vars '(
    -                     (user-mail-address . "dehaeze.thomas@gmail.com")
    -                     (user-full-name        . "Thomas Dehaeze")
    -                     (mu4e-sent-folder . "/gmail/Sent")
    -                     (mu4e-trash-folder . "/gmail/Trash")
    -                     (mu4e-drafts-folder . "/gmail/Drafts")
    -                     (mu4e-refile-folder . "/gmail/Archive")
    -                     (mu4e-compose-signature  . "Thomas Dehaeze\n")
    -                     ))
    -           ,(make-mu4e-context
    +             :enter-func (lambda () (mu4e-message "Switch to the gmail context"))
    +             :match-func (lambda (msg) (when msg
    +                                         (string-prefix-p "/gmail" (mu4e-message-field msg :maildir))))
    +             :leave-func (lambda () (mu4e-clear-caches))
    +             :vars '(
    +                     (user-mail-address . "dehaeze.thomas@gmail.com")
    +                     (user-full-name        . "Thomas Dehaeze")
    +                     (mu4e-sent-folder . "/gmail/Sent")
    +                     (mu4e-trash-folder . "/gmail/Trash")
    +                     (mu4e-drafts-folder . "/gmail/Drafts")
    +                     (mu4e-refile-folder . "/gmail/Archive")
    +                     (mu4e-compose-signature  . "Thomas Dehaeze\n")
    +                     ))
    +           ,(make-mu4e-context
                  :name "esrf"
    -             :enter-func (lambda () (mu4e-message "Switch to the esrf context"))
    -             :match-func (lambda (msg) (when msg
    -                                         (string-prefix-p "/esrf" (mu4e-message-field msg :maildir))))
    -             :leave-func (lambda () (mu4e-clear-caches))
    -             :vars '(
    -                     (user-mail-address . "thomas.dehaeze@esrf.fr")
    -                     (user-full-name        . "Thomas Dehaeze")
    -                     (mu4e-sent-folder . "/esrf/Sent")
    -                     (mu4e-trash-folder . "/esrf/Trash")
    -                     (mu4e-drafts-folder . "/esrf/Drafts")
    -                     (mu4e-refile-folder . "/esrf/Archive")
    -                     (mu4e-compose-signature  . "Thomas Dehaeze\n")
    -                     ))
    +             :enter-func (lambda () (mu4e-message "Switch to the esrf context"))
    +             :match-func (lambda (msg) (when msg
    +                                         (string-prefix-p "/esrf" (mu4e-message-field msg :maildir))))
    +             :leave-func (lambda () (mu4e-clear-caches))
    +             :vars '(
    +                     (user-mail-address . "thomas.dehaeze@esrf.fr")
    +                     (user-full-name        . "Thomas Dehaeze")
    +                     (mu4e-sent-folder . "/esrf/Sent")
    +                     (mu4e-trash-folder . "/esrf/Trash")
    +                     (mu4e-drafts-folder . "/esrf/Drafts")
    +                     (mu4e-refile-folder . "/esrf/Archive")
    +                     (mu4e-compose-signature  . "Thomas Dehaeze\n")
    +                     ))
                ))
       )
     
    @@ -4606,13 +4675,13 @@ Choose account label to feed msmtp -a option based on From header in Message buf
    (use-package! mu4e
       :config
    -  (setq mu4e-bookmarks `(,(make-mu4e-bookmark
    +  (setq mu4e-bookmarks `(,(make-mu4e-bookmark
                               :name "All Inboxes"
                               :query "maildir:/gmail/Inbox OR maildir:/esrf/Inbox"
    -                          :key ?i)
    -                         ("flag:unread" "Unread messages" ?u)
    -                         ("date:today..now" "Today's messages" ?t)
    -                         ("date:7d..now" "Last 7 days" ?w)))
    +                          :key ?i)
    +                         ("flag:unread" "Unread messages" ?u)
    +                         ("date:today..now" "Today's messages" ?t)
    +                         ("date:7d..now" "Last 7 days" ?w)))
       )
     
    @@ -4636,7 +4705,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf :ui doom ; what makes DOOM look the way it does deft - hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hydra modeline ophints ; highlight the region an operation acts on @@ -4697,7 +4766,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf (org ; organize your plain life in plain text +dragndrop ; drag & drop files/images into org buffers +hugo ; use Emacs for hugo blogging - +roam ; + +roam2 ; +gnuplot +present) ; using org-mode for presentations python ; beautiful is better than ugly @@ -4711,7 +4780,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf (mu4e +gmail) :app - calendar + ;; calendar ;;(rss +org) ; emacs as an RSS reader ;;write ; emacs for writers (fiction, notes, papers, etc.) @@ -4735,6 +4804,15 @@ Choose account label to feed msmtp -a option based on From header in Message buf
    +
    +
    (package! org-transclusion
    +  :recipe (:host github
    +           :repo "nobiot/org-transclusion"
    +           :branch "main"
    +           :files ("*.el")))
    +
    +
    +
    ;; Vimrc
     (package! vimrc-mode)
    @@ -4767,12 +4845,6 @@ Choose account label to feed msmtp -a option based on From header in Message buf
     
    -
    -
    ;; Major mode for SPICE
    -(package! spice-mode)
    -
    -
    -
    ;; Import file to Org-mode
     (package! org-pandoc-import
    @@ -4790,7 +4862,9 @@ Choose account label to feed msmtp -a option based on From header in Message buf
     
     
    ;; Connector between Org-roam, BibTeX-completion, and Org-ref
    -(package! org-roam-bibtex)
    +(package! org-roam-bibtex
    +  :recipe (:host github :repo "org-roam/org-roam-bibtex"))
    +(unpin! org-roam company-org-roam)
     
    @@ -4800,24 +4874,12 @@ Choose account label to feed msmtp -a option based on From header in Message buf
    -
    -
    ;; Org file tangling upon save
    -;; (package! org-auto-tangle)
    -
    -
    -
    ;; Alert notifications for org-agenda
     (package! org-wild-notifier)
     
    -
    -
    ;; Display Google Calendar in org-calendar
    -(package! org-gcal)
    -
    -
    -
    ;; Turn table into subfigure
     (package! ox-latex-subfigure
    @@ -4867,7 +4929,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf
     

    Author: Dehaeze Thomas

    -

    Created: 2021-05-02 dim. 11:26

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/emacs-snippets.html b/docs/emacs-snippets.html index 627d18d..0aaf607 100644 --- a/docs/emacs-snippets.html +++ b/docs/emacs-snippets.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Doom Emacs Configuration - + @@ -16,11 +16,11 @@ UP | HOME -
    +

    Doom Emacs Configuration

    -
    +

    Table of Contents

    -
    +
    • LaTeX
        @@ -905,7 +905,7 @@ $0

    Author: Dehaeze Thomas

    -

    Created: 2021-01-11 lun. 14:50

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/homelab.html b/docs/homelab.html new file mode 100644 index 0000000..4a3011b --- /dev/null +++ b/docs/homelab.html @@ -0,0 +1,2558 @@ + + + + + + +Home Server + + + + + + +
    + UP + | + HOME +
    +

    Home Server

    +
    +

    Table of Contents

    +
    + +
    +
    + +
    +

    Hardware

    +
    + + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Table 1: Home Server Hardware
    PartModel
    CaseFractal Design Node 804
    MotherboardASUS PRIME B450M-A
    CPUAMD Ryzen 3 3200G
    RAMCorsair Vengeance LPX 16Go (2x8Go) DDR4 3200MHz
    CoolerARCTIC Freezer 34 eSports DUO
    PSUCorsair SF450
    SSD M.2Samsung 970 EVO Plus 250Gb
    Disk DrivesVarious drives ranging from 3Tb to 8Tb
    +
    +
    + +
    +

    Installation

    +
    +
    +
    +

    Ubuntu

    +
    +
      +
    • Download Ubuntu Server 20.04 LTS (link).
    • +
    • Activate OpenSSH and add SSH Keys
    • +
    • Account: thomas, hostname: homelab
    • +
    +
    +
    + +
    +

    Install Important software

    +
    +
    +
    sudo apt install neovim tmux fd-find ripgrep fzf apache2-utils unrar ranger
    +
    +
    +
    +
    + +
    +

    Terminal Problem

    +
    +

    +On the local host, using Termite: +

    +
    +
    infocmp > termite.terminfo  # export Termite's Terminfo
    +scp termite.terminfo user@remote-host:~/  # or any other method to copy to the remote host
    +
    +
    + +

    +On the remote host, in the directory where you copied termite.terminfo: +

    +
    +
    tic -x termite.terminfo  # import Terminfo for current user
    +rm termite.terminfo  # optional: remove Terminfo file
    +
    +
    +
    +
    + +
    +

    Minor Modifications of ~/.inputrc

    +
    +

    +Modify ~/.inputrc, like so: +

    +
    +
    "\e[A": history-search-backward            # arrow up
    +"\e[B": history-search-forward             # arrow down
    +
    +
    +
    +
    + +
    +

    Partition and Format Disk Drives

    +
    +

    +A nice tutorial is available here. +

    + +
    +
    lsblk
    +
    +
    + +
    +
    sudo parted /dev/sda mklabel gpt
    +
    +
    + +
    +
    sudo parted -a opt /dev/sda mkpart "partitionname" ext4 0% 100%
    +
    +
    + +
    +
    sudo mkfs.ext4 -L partitionname /dev/sda1
    +
    +
    +
    +
    + +
    +

    MergerFS and FStab

    +
    +

    +MergerFS is a transparent layer that sits on top of the data drives providing a single mount point for reads / writes (link). +

    + +
    +
    sudo apt install mergerfs
    +
    +
    + +

    +Create mount points +

    +
    +
    sudo mkdir /mnt/disk0
    +sudo mkdir /mnt/disk1
    +sudo mkdir /mnt/parity
    +
    +
    + +

    +Create folder where disks will be merged. +

    +
    +
    sudo mkdir /srv/storage
    +
    +
    + +

    +Edit /etc/fstab. +

    +
    +
    /dev/disk/by-uuid/7fb7873c-83bd-4805-98ab-506e6c7b56fa /mnt/disk0  ext4 defaults 0 0
    +/dev/disk/by-uuid/6574b7ae-321c-4078-9793-bc41a4fa5588 /mnt/disk1  ext4 defaults 0 0
    +/dev/disk/by-uuid/6fcd38b9-0886-46bd-900d-cb1f170dbcee /mnt/parity ext4 defaults 0 0
    +
    +/mnt/disk* /srv/storage fuse.mergerfs direct_io,defaults,allow_other,minfreespace=50G,fsname=mergerfs 0 0
    +
    +
    +
    +
    + +
    +

    Automating with SnapRAID Runner

    +
    +

    +SnapRAID is a snapshot parity calculation tool which acts at the block level independent of filesystem (link). +

    + +

    +SnapRAID is here used inside a Docker container (link). +

    +
    +
    + +
    +

    Install Docker

    +
    +

    +The procedure is well explained here. +

    + +

    +If docker is already installed, remove it: +

    +
    +
    sudo apt remove docker
    +
    +
    +
    +
    + +
    +

    Executing the Docker Command Without Sudo

    +
    +
    +
    sudo usermod -aG docker ${USER}
    +
    +
    + +

    +To apply the new group membership, log out of the server and back in, or type the following: +

    +
    +
    su - ${USER}
    +
    +
    +
    +
    + +
    +

    Install Docker-Compose

    +
    +
    +
    sudo apt install docker-compose
    +
    +
    +
    +
    + +
    +

    Setup Docker Networks

    +
    +
    +
    docker network create --gateway 192.168.90.1 --subnet 192.168.90.0/24 t2_proxy
    +docker network create docker_default
    +
    +
    +
    +
    + +
    +

    Change Timezone

    +
    +
    +
    sudo timedatectl set-timezone Europe/Paris
    +
    +
    +
    +
    + +
    +

    Secure the Web Server

    +
    +

    +Most of it comes from here. +

    + +
      +
    • Set PasswordAuthentication no in /etc/ssh/sshd_config
    • +
    +
    +
    + +
    +

    Automatic Security Updates

    +
    +

    +The procedure is well explained here. +

    +
    +
    sudo apt install unattended-upgrades update-notifier-common
    +
    +
    + +

    +Edit /etc/apt/apt.conf.d/50unattended-upgrades, and change the following lines: +

    +
    +
    Unattended-Upgrade::Remove-Unused-Dependencies "true";
    +Unattended-Upgrade::Automatic-Reboot "true";
    +Unattended-Upgrade::Automatic-Reboot-Time "04:00";
    +
    +
    + +

    +Edit /etc/apt/apt.conf.d/20auto-upgrades: +

    +
    +
    APT::Periodic::Update-Package-Lists "1";
    +APT::Periodic::Unattended-Upgrade "1";
    +
    +
    +
    +
    + +
    +

    Setup cronjobs

    +
    +

    +Create a folder ~/cron with all the scripts and logs related to cron. +

    + +

    +To edit the cron jobs, type crontab -e and add a line like: +

    +
    +
    */5 * * * * /home/thomas/cron/caddy_update.sh >> /home/thomas/cron/caddy_update.log 2>&1
    +
    +
    + +

    +That will run every 5 minutes. +To check how the first part of the crontab works, check this website. +

    +
    +
    + +
    +

    Run docker-compose

    +
    +
    +
    cd ~/docker && docker-compose up -d
    +
    +
    +
    +
    + +
    +

    Docker config ~/.docker/config.json

    +
    +
    +
    {
    +  "psFormat": "table {{ .ID }}\\t{{ .Names }}\t{{ .Status }}"
    +}
    +
    +
    +
    +
    +
    + +
    +

    Maintenance - How To

    +
    +
    +
    +

    Update System/Packages

    +
    +
    +
    sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y'
    +
    +
    +
    +
    + +
    +

    Docker Commands

    +
    +
      +
    • Starting a container: $ docker start homeassistant
    • +
    • Stopping a container: $ docker stop homeassistant
    • +
    • Restarting a container: $ docker restart homeassistant
    • +
    • Listing the running containers: $ docker ps or $ cd ~/docker/ && docker-compose ps
    • +
    • View the logs of a container: $ docker logs -f homeassistant
    • +
    • Drop a shell into a container: $ docker exec -it homeassistant /bin/bash
    • +
    • Update specific container: docker-compose pull --ignore-pull-failures homeassistant
    • +
    + +

    +Update All Containers +

    +
    +
    cd ~/docker/ && docker-compose pull --ignore-pull-failures && docker-compose up -d
    +
    +
    + +

    +Clean up Docker environment +This will delete all unused images, volumes and networks. +

    +
    +
    docker system prune -f && docker image prune -f && docker volume prune -f
    +
    +
    +
    +
    + +
    +

    snapraid

    +
    +

    +To see all files “backed up” by snapraid, use: +

    +
    +
    docker exec -ti snapraid snapraid list | fzf
    +
    +
    + +

    +In reality, snapraid is ran from the docker container: +

    +
    +
    docker exec -ti snapraid snapraid fix -f <path_to_file>
    +
    +
    + +

    +The path to file should be relative: /srv/storage/Cloud/org/file.org -> Cloud/org/file.org +

    +
    +
    + +
    +

    Restore Online backup with restic

    +
    +

    +To list backups: +

    +
    +
    docker exec restic restic snapshots
    +
    +
    + +
    +ID        Time                 Host          Tags        Paths
    +--------------------------------------------------------------------------------
    +a7b98408  2020-09-03 21:18:00  4803c2af7d4e              /data/documents/manuals
    +088e31a4  2020-09-03 21:50:26  4803c2af7d4e              /data/documents/manuals
    +9cf0b480  2020-09-03 22:05:47  4803c2af7d4e              /data/documents/manuals
    +--------------------------------------------------------------------------------
    +3 snapshots
    +
    + + +

    +Force backup of folder: +

    +
    +
    docker exec restic restic backup /data/documents/manuals
    +
    +
    + +
    +
    +Files:           0 new,     2 changed,  8475 unmodified
    +Dirs:            0 new,     2 changed,     0 unmodified
    +Added to the repo: 1.010 KiB
    +
    +processed 8477 files, 589.800 MiB in 0:02
    +snapshot 9cf0b480 saved
    +
    + + +

    +Find the path to the file within the snapshot: +

    +
    +
    docker exec restic restic find file_name
    +
    +
    + +

    +Find files only for a specific snapshot: +

    +
    +
    docker exec restic restic find -s latest file_name
    +
    +
    + +

    +Restore files/folders (replace file/folders): +

    +
    +
    docker exec restic restic restore --include /data/documents/manuals --target / 088e31a4
    +
    +
    + +

    +You can use latest instead of the ID. +

    + +

    +If indeed, we want to make a copy of the file, we can use the backup folder +

    +
    +
    docker exec restic restic restore --include /data/documents/manuals --target /backup 088e31a4
    +
    +
    +
    +
    + +
    +

    Add wireguard client

    +
    +
    +
    +

    With an Android client

    +
    +

    +Show the QRcode corresponding the a specific peer with: +

    +
    +
    docker exec -it wireguard /app/show-peer 1
    +
    +
    + +

    +Then, simply scan the QRcode with the Wireguard application. +

    +
    +
    + +
    +

    With a Linux client

    +
    +

    +Copy the file $CONFIGDIR/wireguard/peeri/peeri.conf, e.g.: +

    +
    +
    [Interface]
    +Address = 10.13.13.4/24
    +DNS = 10.13.1.1
    +PrivateKey = ****
    +ListenPort = 51820
    +
    +[Peer]
    +PublicKey = ****
    +Endpoint = wireguard.tdehaeze.xyz:51820
    +AllowedIPs = 0.0.0.0/0, ::0/0
    +
    +
    + +

    +Then, paste the file to /etc/wireguard/interfacename.conf. +And then: +

    +
      +
    • sudo chmod 600 /etc/wireguard/interfacename.conf
    • +
    • sudo chown root:root /etc/wireguard/interfacename.conf
    • +
    + +

    +Then, start the tunnel with: +

    +
    +
    wg-quick up interfacename
    +
    +
    +
    +
    +
    +
    + +
    +

    Docker-Compose

    +
    +
    +
    version: "3.4"
    +
    +
    +
    + +
    +

    Networks

    +
    +
    +
    networks:
    +  t2_proxy:
    +    external:
    +      name: t2_proxy
    +  backend:
    +    external: false
    +  default:
    +    driver: bridge
    +
    +
    +
    +
    + +
    +

    Logging

    +
    +
    +
    x-logging:
    +  &default-logging
    +  driver: "json-file"
    +  options:
    +    max-size: "200k"
    +    max-file: "10"
    +
    +
    +
    +
    + +
    +

    traefik - Application proxy (link)

    +
    +
    +
    services:
    +
    +
    + +
    +
      traefik:
    +    container_name: traefik
    +    image: traefik:2.2.1
    +    restart: unless-stopped
    +    depends_on:
    +      - authelia
    +    networks:
    +      t2_proxy:
    +        ipv4_address: 192.168.90.254 # You can specify a static IP
    +    security_opt:
    +      - no-new-privileges:true
    +    ports:
    +      - 80:80 # http
    +      - 443:443 # https
    +      - 8448:8448 # Matrix
    +    volumes:
    +      - $CONFIGDIR/traefik2/rules:/rules
    +      - $CONFIGDIR/traefik2/acme/acme.json:/acme.json
    +      - $CONFIGDIR/traefik2/shared:/shared
    +      - $CONFIGDIR/traefik2/traefik.yaml:/etc/traefik/traefik.yaml
    +      - /var/log/traefik:/var/log
    +      - /var/run/docker.sock:/var/run/docker.sock:ro
    +    environment:
    +      - CF_API_EMAIL=$CLOUDFLARE_EMAIL
    +      - CF_API_KEY=$CLOUDFLARE_API_KEY
    +    labels:
    +      - "traefik.enable=true"
    +      # HTTP-to-HTTPS Redirect
    +      - "traefik.http.routers.http-catchall.entrypoints=http"
    +      - "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
    +      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
    +      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
    +      # HTTP Routers
    +      - "traefik.http.routers.traefik-rtr.entrypoints=https"
    +      - "traefik.http.routers.traefik-rtr.rule=Host(`traefik.$DOMAINNAME`)"
    +      - "traefik.http.routers.traefik-rtr.tls=true"
    +      - "traefik.http.routers.traefik-rtr.middlewares=authelia@docker"
    +      - "traefik.http.routers.traefik-rtr.service=traefik-svc"
    +      - "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME"
    +      - "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME"
    +      - "traefik.http.services.traefik-svc.loadbalancer.server.port=8080"
    +      # Services - API
    +      - "traefik.http.routers.traefik-rtr.service=api@internal"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    traefik.yaml

    +
    +
    +
    global:
    +  checkNewVersion: true
    +  sendAnonymousUsage: false
    +
    +entryPoints:
    +  http:
    +    address: :80
    +  https:
    +    address: :443
    +    forwardedHeaders:
    +      trustedIPs: 173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/12,172.64.0.0/13,131.0.72.0/22
    +  synapse:
    +    address: :8448
    +
    +api:
    +  dashboard: true
    +
    +log:
    +  level: ERROR
    +
    +accessLog:
    +  filePath: /var/log/access.log
    +  filters:
    +    statusCodes: 400-499
    +
    +providers:
    +  docker:
    +    endpoint: unix:///var/run/docker.sock
    +    defaultrule: Host(`{{ index .Labels "com.docker.compose.service" }}.$DOMAINNAME`)
    +    exposedByDefault: false
    +    network: t2_proxy
    +    swarmMode: false
    +  file:
    +    directory: /rules
    +    watch: true
    +
    +certificatesResolvers:
    +  dns-cloudflare:
    +    acme:
    +      email: $CLOUDFLARE_EMAIL
    +      storage: /acme.json
    +      dnsChallenge:
    +        provider: cloudflare
    +        resolvers: 1.1.1.1:53,1.0.0.1:53
    +
    +
    +
    +
    +
    + +
    +

    authelia - Single Sign-On Multi-Factor portal (link)

    +
    +
    +
      authelia:
    +    image: authelia/authelia:4.30
    +    container_name: authelia
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +      - backend
    +    volumes:
    +      - $CONFIGDIR/authelia:/config
    +      - /etc/timezone:/etc/timezone:ro
    +      - /etc/localtime:/etc/localtime:ro
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - AUTHELIA_NOTIFIER_SMTP_PASSWORD=$AUTHELIA_NOTIFIER_SMTP_PASSWORD
    +      - AUTHELIA_JWT_SECRET=$AUTHELIA_JWT_SECRET
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.authelia-rtr.entrypoints=https"
    +      - "traefik.http.routers.authelia-rtr.tls=true"
    +      - "traefik.http.routers.authelia-rtr.service=authelia-svc"
    +      - "traefik.http.routers.authelia-rtr.rule=Host(`login.$DOMAINNAME`)"
    +      - "traefik.http.services.authelia-svc.loadbalancer.server.port=9091"
    +      - "traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://login.$DOMAINNAME/"
    +      - "traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true"
    +      - "traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User, Remote-Groups, Remote-Name, Remote-Email"
    +      - "treafik.http.middlewares.chain-authelia.chain.middlewares=middlewares-rate-limit, middlewares-secure-headers, middlewares-authelia"
    +      - "traefik.docker.network=t2_proxy"
    +
    +
    +
    + +
    +

    configuration.yml

    +
    +
    +
    ---
    +###############################################################
    +#                   Authelia configuration                    #
    +###############################################################
    +
    +default_redirection_url: https://authelia.tdehaeze.xyz
    +
    +server:
    +  host: 0.0.0.0
    +  port: 9091
    +
    +log:
    +  level: debug
    +
    +totp:
    +  issuer: authelia.com
    +  period: 30
    +  skew: 1
    +
    +authentication_backend:
    +  file:
    +    path: /config/users_database.yml
    +    password:
    +      algorithm: argon2id
    +      iterations: 1
    +      salt_length: 16
    +      parallelism: 8
    +      memory: 1024
    +
    +access_control:
    +  default_policy: deny
    +  rules:
    +    - domain: traefik.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: zigbee2mqttassistant.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: scrutiny.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: portainer.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: syncthing.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: octoprint.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: uptime.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: joal.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +    - domain: down.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +      - ["group:friends"]
    +      - ["group:family"]
    +    - domain: qobuz.tdehaeze.xyz
    +      policy: one_factor
    +      subject:
    +      - ["group:admins"]
    +      - ["group:friends"]
    +      - ["group:family"]
    +
    +session:
    +  name: authelia_session
    +  expiration: 3600
    +  inactivity: 300
    +  domain: tdehaeze.xyz
    +
    +regulation:
    +  max_retries: 3
    +  find_time: 120
    +  ban_time: 300
    +
    +storage:
    +  local:
    +    path: /config/db.sqlite3
    +
    +notifier:
    +  smtp:
    +    username: tdehaeze.xyz@gmail.com
    +    host: smtp.gmail.com
    +    port: 587
    +    sender: tdehaeze.xyz@gmail.com
    +
    +
    +
    +
    +
    + +
    +

    lldap - LDAP Server (link)

    +
    +
    +
      lldap:
    +    image: nitnelave/lldap
    +    container_name: lldap
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +      - backend
    +    ports:
    +      - 3890:3890
    +    volumes:
    +      - $CONFIGDIR/lldap:/data
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.lldap-rtr.entrypoints=https"
    +      - "traefik.http.routers.lldap-rtr.rule=Host(`lldap.$DOMAINNAME`)"
    +      - "traefik.http.routers.lldap-rtr.tls=true"
    +      - "traefik.http.routers.lldap-rtr.service=lldap-svc"
    +      - "traefik.http.routers.lldap-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.lldap-svc.loadbalancer.server.port=17170"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    gotify - Notification service (link)

    +
    +

    +In order to have notifications on Linux desktop use gotify-dunst. +

    + +
    +
      gotify:
    +    container_name: gotify
    +    image: gotify/server
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - GOTIFY_DEFAULTUSER_NAME=$GOTIFY_DEFAULTUSER_NAME
    +      - GOTIFY_DEFAULTUSER_PASS=$GOTIFY_DEFAULTUSER_PASS
    +    volumes:
    +      - $CONFIGDIR/gotify:/app/data
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.gotify-rtr.entrypoints=https"
    +      - "traefik.http.routers.gotify-rtr.rule=Host(`gotify.$DOMAINNAME`)"
    +      - "traefik.http.routers.gotify-rtr.tls=true"
    +      - "traefik.http.routers.gotify-rtr.service=gotify-svc"
    +      - "traefik.http.services.gotify-svc.loadbalancer.server.port=80"
    +
    +
    +
    +
    + +
    +

    nginx - Root (used for Matrix)

    +
    +
    +
      root:
    +    container_name: root
    +    image: nginx
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/root/nginx.conf:/etc/nginx/nginx.conf
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.root-rtr.entrypoints=https"
    +      - "traefik.http.routers.root-rtr.rule=Host(`$DOMAINNAME`)"
    +      - "traefik.http.routers.root-rtr.tls=true"
    +      - "traefik.http.routers.root-rtr.service=root-svc"
    +      - "traefik.http.services.root-svc.loadbalancer.server.port=8080"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    nginx.conf

    +
    +
    +
    events {
    +
    +}
    +
    +http {
    +    server {
    +        server_name tdehaeze.xyz;
    +        listen 8080;
    +
    +        location /.well-known/matrix/client {
    +            proxy_pass https://matrix.tdehaeze.xyz/.well-known/matrix/client;
    +            proxy_set_header X-Forwarded-For $remote_addr;
    +        }
    +
    +        location /.well-known/matrix/server {
    +            proxy_pass https://matrix.tdehaeze.xyz/.well-known/matrix/server;
    +            proxy_set_header X-Forwarded-For $remote_addr;
    +        }
    +    }
    +}
    +
    +
    +
    +
    +
    + +
    +

    homer - Home page (link)

    +
    +
    +
      homer:
    +    container_name: homer
    +    image: b4bz/homer
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/homer/assets/:/www/assets
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.homer-rtr.entrypoints=https"
    +      - "traefik.http.routers.homer-rtr.rule=Host(`homer.$DOMAINNAME`)"
    +      - "traefik.http.routers.homer-rtr.tls=true"
    +      - "traefik.http.routers.homer-rtr.service=homer-svc"
    +      - "traefik.http.services.homer-svc.loadbalancer.server.port=8080"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    config.yml

    +
    +
    +
    ---
    +title: "Homepage"
    +subtitle: ""
    +logo: "assets/homer.png"
    +header: false
    +footer: false
    +
    +columns: "auto"
    +connectivityCheck: false
    +
    +theme: default
    +
    +links: []
    +
    +services:
    +  - name: "Websites"
    +    icon: "fas fa-desktop"
    +    items:
    +    - name: "Brain"
    +      logo: "/assets/tools/brain.png"
    +      subtitle: "Digital Brain"
    +      url: "https://brain.tdehaeze.xyz"
    +    - name: "Wiki"
    +      logo: "/assets/tools/wikijs.png"
    +      subtitle: "Shared Wiki"
    +      url: "https://wiki.tdehaeze.xyz"
    +    - name: "Research"
    +      logo: "/assets/tools/orgmode.png"
    +      subtitle: "Research Pages"
    +      url: "https://research.tdehaeze.xyz"
    +    - name: "Dotfiles"
    +      logo: "/assets/tools/dotfiles.png"
    +      subtitle: "My Literate Dotfiles"
    +      url: "https://dotfiles.tdehaeze.xyz"
    +    - name: "Miam"
    +      logo: "/assets/tools/miam.png"
    +      subtitle: "Personnal Recipes"
    +      url: "https://miam.tdehaeze.xyz"
    +  - name: "Multimedia"
    +    icon: "fas fa-photo-video"
    +    items:
    +    - name: "Jellyfin"
    +      logo: "/assets/tools/jellyfin.png"
    +      subtitle: "Media Library"
    +      url: "https://jellyfin.tdehaeze.xyz"
    +    - name: "Kavita"
    +      logo: "/assets/tools/kavita.png"
    +      subtitle: "Book Library"
    +      url: "https://kavita.tdehaeze.xyz"
    +  - name: "Cloud"
    +    icon: "fas fa-cloud"
    +    items:
    +    - name: "File Browser"
    +      logo: "/assets/tools/cloud.png"
    +      subtitle: "Simple Personnal Could"
    +      url: "https://cloud.tdehaeze.xyz"
    +    - name: "Syncthing"
    +      logo: "/assets/tools/syncthing.png"
    +      subtitle: "P2P Sync"
    +      url: "https://syncthing.tdehaeze.xyz"
    +    - name: "Radicale"
    +      logo: "/assets/tools/radicale.png"
    +      subtitle: "CalDAV/CardDAV Server"
    +      url: "https://radicale.tdehaeze.xyz"
    +    - name: "Miniflux"
    +      logo: "/assets/tools/miniflux.png"
    +      subtitle: "RSS Feeds"
    +      url: "https://rss.tdehaeze.xyz"
    +    - name: "Gitea"
    +      logo: "/assets/tools/gitea.png"
    +      subtitle: "Git Server"
    +      url: "https://git.tdehaeze.xyz"
    +  - name: "Download"
    +    icon: "fas fa-download"
    +    items:
    +    - name: "Down"
    +      logo: "/assets/tools/down.png"
    +      subtitle: "Torrent Download"
    +      url: "https://down.tdehaeze.xyz/"
    +    - name: "Qobuz"
    +      subtitle: "Music Download"
    +      logo: "/assets/tools/qobuz.png"
    +      url: "https://qobuz.tdehaeze.xyz"
    +    - name: "Transmission"
    +      logo: "/assets/tools/transmission.png"
    +      subtitle: "Torrent Client"
    +      url: "http://torrent.tdehaeze.xyz:9091/transmission/web/"
    +    - name: "Joal"
    +      logo: "/assets/tools/joal.png"
    +      subtitle: "Increase Ratio"
    +      url: "https://joal.tdehaeze.xyz/joal/ui/#/"
    +  - name: "Config"
    +    icon: "fas fa-cog"
    +    items:
    +    - name: "Portainer"
    +      logo: "/assets/tools/portainer.png"
    +      subtitle: "Manger Docker"
    +      url: "https://portainer.tdehaeze.xyz/#/containers"
    +    - name: "Traefik"
    +      logo: "/assets/tools/traefik.png"
    +      subtitle: "Reverse Proxy"
    +      url: "https://traefik.tdehaeze.xyz"
    +    - name: "Uptime"
    +      logo: "/assets/tools/uptime.png"
    +      subtitle: "Monitoring"
    +      url: "https://uptime.tdehaeze.xyz"
    +    - name: "Commento"
    +      logo: "/assets/tools/commento.png"
    +      subtitle: "Commenting System"
    +      url: "https://commento.tdehaeze.xyz"
    +    - name: "Gotify"
    +      logo: "/assets/tools/gotify.png"
    +      subtitle: "Messaging System"
    +      url: "https://gotify.tdehaeze.xyz"
    +    - name: "Scrutiny"
    +      logo: "/assets/tools/scrutiny.png"
    +      subtitle: "S.M.A.R.T"
    +      url: "http://scrutiny.tdehaeze.xyz/web/dashboard"
    +  - name: "Home"
    +    icon: "fas fa-home"
    +    items:
    +    - name: "OpenWRT"
    +      logo: "/assets/tools/openwrt.png"
    +      subtitle: "Router"
    +      url: "http://192.168.1.1/"
    +    - name: "Home Assistant"
    +      logo: "/assets/tools/homeassistant.png"
    +      subtitle: "Home Assistant"
    +      url: "http://home.tdehaeze.xyz:8123"
    +    - name: "Zigbee2MQTT"
    +      logo: "/assets/tools/zigbee2mqtt.png"
    +      subtitle: "Zigbee2MQTT Assistant"
    +      url: "https://zigbee2mqttassistant.tdehaeze.xyz/"
    +    - name: "OctoPrint"
    +      logo: "/assets/tools/octoprint.png"
    +      subtitle: "3D-Printing"
    +      url: "https://octoprint.tdehaeze.xyz/"
    +
    +
    +
    +
    +
    + +
    +

    snapraid - Manage local backup with parity disk (link)

    +
    +
    +
      snapraid:
    +    container_name: snapraid
    +    image: xagaba/snapraid
    +    restart: unless-stopped
    +    privileged: true
    +    volumes:
    +      - /mnt:/mnt
    +      - $CONFIGDIR/snapraid:/config
    +      - type: "bind"
    +        source: /dev/disk
    +        target: /dev/disk
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    snapraid.conf

    +
    +
    +
    # Defines the file to use as parity storage
    +# It must NOT be in a data disk
    +# Format: "parity FILE_PATH"
    +parity /mnt/parity/snapraid.parity
    +
    +# Defines the files to use as content list
    +# You can use multiple specification to store more copies
    +# You must have least one copy for each parity file plus one. Some more don't
    +# hurt
    +# They can be in the disks used for data, parity or boot,
    +# but each file must be in a different disk
    +# Format: "content FILE_PATH"
    +content /var/snapraid.content
    +content /mnt/disk0/.snapraid.content
    +content /mnt/disk1/.snapraid.content
    +
    +# Defines the data disks to use
    +# The order is relevant for parity, do not change it
    +# Format: "disk DISK_NAME DISK_MOUNT_POINT"
    +disk d0 /mnt/disk0
    +disk d1 /mnt/disk1
    +
    +# Excludes hidden files and directories (uncomment to enable).
    +#nohidden
    +
    +# Defines files and directories to exclude
    +# Remember that all the paths are relative at the mount points
    +# Format: "exclude FILE"
    +# Format: "exclude DIR/"
    +# Format: "exclude /PATH/FILE"
    +# Format: "exclude /PATH/DIR/"
    +exclude *.unrecoverable
    +exclude /tmp/
    +exclude /lost+found/
    +exclude *.!sync
    +exclude .AppleDouble
    +exclude ._AppleDouble
    +exclude .DS_Store
    +exclude ._.DS_Store
    +exclude .Thumbs.db
    +exclude .fseventsd
    +exclude .Spotlight-V100
    +exclude .TemporaryItems
    +exclude .Trashes
    +exclude .AppleDB
    +
    +
    +
    +
    + +
    +

    snapraid-runner.conf

    +
    +
    +
    [snapraid]
    +; path to the snapraid executable (e.g. /bin/snapraid)
    +executable = /usr/bin/snapraid
    +; path to the snapraid config to be used
    +config = /config/snapraid.conf
    +; abort operation if there are more deletes than this, set to -1 to disable
    +deletethreshold = -1
    +; if you want touch to be ran each time
    +touch = false
    +
    +[logging]
    +; logfile to write to, leave empty to disable
    +file = /config/snapraid.log
    +; maximum logfile size in KiB, leave empty for infinite
    +maxsize = 5000
    +
    +; [email]
    +; ; when to send an email, comma-separated list of [success, error]
    +; sendon = success,error
    +; ; set to false to get full programm output via email
    +; short = true
    +; subject = [SnapRAID] Status Report:
    +; from =
    +; to =
    +; ; maximum email size in KiB
    +; maxsize = 500
    +;
    +; [smtp]
    +; host =
    +; ; leave empty for default port
    +; port =
    +; ; set to "true" to activate
    +; ssl = false
    +; tls = false
    +; user =
    +; password =
    +
    +[scrub]
    +; set to true to run scrub after sync
    +enabled = false
    +percentage = 12
    +older-than = 10
    +
    +
    +
    +
    +
    + + +
    +

    portainer - Manage docker (link)

    +
    +
    +
      portainer:
    +    container_name: portainer
    +    image: portainer/portainer
    +    restart: unless-stopped
    +    command: -H unix:///var/run/docker.sock
    +    command: --no-auth
    +    networks:
    +      - t2_proxy
    +    security_opt:
    +      - no-new-privileges:true
    +    volumes:
    +      - /var/run/docker.sock:/var/run/docker.sock:ro
    +      - $CONFIGDIR/portainer:/data
    +    environment:
    +      - TZ=$TZ
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.portainer-rtr.entrypoints=https"
    +      - "traefik.http.routers.portainer-rtr.rule=Host(`portainer.$DOMAINNAME`)"
    +      - "traefik.http.routers.portainer-rtr.tls=true"
    +      - "traefik.http.routers.portainer-rtr.service=portainer-svc"
    +      - "traefik.http.routers.portainer-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.portainer-svc.loadbalancer.server.port=9000"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    wireguard - VPN (link)

    +
    +
    +
      wireguard:
    +    container_name: wireguard
    +    image: linuxserver/wireguard
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    cap_add:
    +      - NET_ADMIN
    +      - SYS_MODULE
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - SERVERURL=wireguard.tdehaeze.xyz
    +      - SERVERPORT=51820
    +      - PEERS=3
    +      - PEERDNS=auto
    +    volumes:
    +      - $CONFIGDIR/wireguard:/config
    +      - /lib/modules:/lib/modules
    +    ports:
    +      - 51820:51820/udp
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    gluetun - Provide VPN connection to other containers (link)

    +
    +
    +
      gluetun:
    +    image: qmcgaw/gluetun
    +    container_name: gluetun
    +    restart: unless-stopped
    +    cap_add:
    +      - NET_ADMIN
    +    network_mode: bridge
    +    ports:
    +      - 8065:8065 # For transmission
    +      - 9091:9091 # For transmission
    +      - 51413:51413 # For transmission
    +      - 51413:51413/udp # For transmission
    +    environment:
    +      - OPENVPN_USER=$NORDVPN_NAME
    +      - OPENVPN_PASSWORD=$NORDVPN_PASS
    +      - VPNSP=nordvpn
    +      - REGION=France
    +      - SERVER_NUMBER=776
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/gluetun:/config
    +
    +
    +
    +
    + +
    +

    transmission - Torrent client (link)

    +
    +
    +
      transmission:
    +    container_name: transmission
    +    image: ghcr.io/linuxserver/transmission
    +    restart: unless-stopped
    +    network_mode: container:gluetun
    +    depends_on:
    +      - gluetun
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - USER=$TRANSMISSION_NAME
    +      - PASS=$TRANSMISSION_PASS
    +    volumes:
    +      - $CONFIGDIR/transmission:/config
    +      - /srv/storage/Downloads:/downloads
    +      - /srv/storage/Downloads/watch:/watch
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    gitea - Git server (link)

    +
    +
    +
      gitea:
    +    container_name: git
    +    image: gitea/gitea:1.13.2
    +    depends_on:
    +      - gitea_db
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +      - backend
    +    volumes:
    +      - $CONFIGDIR/gitea:/data
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - SSH_PORT=$GITEA_SSH_PORT
    +    ports:
    +      - "2222:22"
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.git-rtr.entrypoints=https"
    +      - "traefik.http.routers.git-rtr.rule=Host(`git.$DOMAINNAME`)"
    +      - "traefik.http.routers.git-rtr.tls=true"
    +      - "traefik.http.routers.git-rtr.service=git-svc"
    +      - "traefik.http.services.git-svc.loadbalancer.server.port=3000"
    +    logging: *default-logging
    +
    +
    + +
    +
      gitea_db:
    +    container_name: gitea_db
    +    image: mariadb:10
    +    restart: unless-stopped
    +    networks:
    +      - backend
    +    ports:
    +      - 3306:3306
    +    environment:
    +      - MYSQL_ROOT_PASSWORD=$GITEA_DB_MYSQL_ROOT_PASSWORD
    +      - MYSQL_DATABASE=gitea
    +      - MYSQL_USER=gitea
    +      - MYSQL_PASSWORD=$GITEA_DB_MYSQL_PASSWORD
    +    volumes:
    +      - $CONFIGDIR/mariadb:/var/lib/mysql
    +
    +
    +
    +
    + +
    +

    wikijs - Wiki App (link)

    +
    +
    +
      wikijs:
    +    image: ghcr.io/linuxserver/wikijs:version-2.5.201
    +    container_name: wikijs
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/wikijs/config:/config
    +      - $CONFIGDIR/wikijs/data:/data
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.wikijs-rtr.entrypoints=https"
    +      - "traefik.http.routers.wikijs-rtr.rule=Host(`wiki.$DOMAINNAME`)"
    +      - "traefik.http.routers.wikijs-rtr.tls=true"
    +      - "traefik.http.routers.wikijs-rtr.service=wikijs-svc"
    +      - "traefik.http.services.wikijs-svc.loadbalancer.server.port=3000"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    research - Research Pages (link)

    +
    +
    +
      caddy:
    +    container_name: caddy
    +    image: abiosoft/caddy:1.0.3-no-stats
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - PLUGINS=git
    +    volumes:
    +      - $CONFIGDIR/caddy/Caddyfile:/etc/Caddyfile
    +      - $CONFIGDIR/web:/srv
    +        # - ~/.ssh:/root/.ssh
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.caddy-rtr.entrypoints=https"
    +      - "traefik.http.routers.caddy-rtr.rule=Host(`research.$DOMAINNAME`)"
    +      - "traefik.http.routers.caddy-rtr.tls=true"
    +      - "traefik.http.routers.caddy-rtr.service=caddy-svc"
    +      - "traefik.http.services.caddy-svc.loadbalancer.server.port=2015"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    Caddyfile

    +
    +
    +
    0.0.0.0:2015 {
    +    root /srv/www/
    +
    +    git {
    +        repo     https://git.tdehaeze.xyz/tdehaeze/research-home-page
    +        path     /srv/www/
    +        interval -1
    +        hook     /research-home-page/webhook QHZgAKjD8q2v54Ru
    +        then     git submodule update --init --recursive --merge
    +    }
    +}
    +
    +
    +
    +
    +
    + +
    +

    dotfiles - Dotfiles (link)

    +
    +
    +
      dotfiles:
    +    container_name: dotfiles
    +    image: abiosoft/caddy:1.0.3-no-stats
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - PLUGINS=git
    +    volumes:
    +      - $CONFIGDIR/dotfiles/Caddyfile:/etc/Caddyfile
    +      - $CONFIGDIR/dotfiles/www:/srv/www
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.dotfiles-rtr.entrypoints=https"
    +      - "traefik.http.routers.dotfiles-rtr.rule=Host(`dotfiles.$DOMAINNAME`)"
    +      - "traefik.http.routers.dotfiles-rtr.tls=true"
    +      - "traefik.http.routers.dotfiles-rtr.service=dotfiles-svc"
    +      - "traefik.http.services.dotfiles-svc.loadbalancer.server.port=2015"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    Caddyfile

    +
    +
    +
    0.0.0.0:2015 {
    +    root /srv/www/docs/
    +
    +    git {
    +        repo     https://git.tdehaeze.xyz/tdehaeze/literate-dotfiles
    +        path     /srv/www/
    +        interval -1
    +        hook     /literate-dotfiles/webhook QHZgAKjD8q2v54Ru
    +    }
    +}
    +
    +
    +
    +
    +
    + +
    +

    hugo - Wiki + Blog (link)

    +
    +
    +
      hugo:
    +    container_name: hugo
    +    image: tdehaeze/hugo-caddy
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +        - REPO=git.tdehaeze.xyz/tdehaeze/digital-brain
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.hugo-rtr.entrypoints=https"
    +      - "traefik.http.routers.hugo-rtr.rule=Host(`brain.$DOMAINNAME`)"
    +      - "traefik.http.routers.hugo-rtr.tls=true"
    +      - "traefik.http.routers.hugo-rtr.service=hugo-svc"
    +      - "traefik.http.services.hugo-svc.loadbalancer.server.port=2015"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    syncthing - File Synchronization (link)

    +
    +
    +
      syncthing:
    +    container_name: syncthing
    +    image: linuxserver/syncthing
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - UMASK_SET=022
    +    volumes:
    +      - $CONFIGDIR/syncthing:/config
    +      - /srv/storage/Cloud:/Cloud
    +      - /srv/storage/Cloud/pictures/phone:/Pictures
    +      - /srv/storage/Cloud/pdfs:/Onyx/Download
    +      - /srv/storage/Cloud/pdfs-notes:/Onyx/note
    +      - /srv/storage/Cloud/.stfolder:/Onyx/.stfolder
    +      - /srv/storage/.password-store:/.password-store
    +    ports:
    +      - 22000:22000
    +      - 21027:21027/udp
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.syncthing-rtr.entrypoints=https"
    +      - "traefik.http.routers.syncthing-rtr.rule=Host(`syncthing.$DOMAINNAME`)"
    +      - "traefik.http.routers.syncthing-rtr.tls=true"
    +      - "traefik.http.routers.syncthing-rtr.service=syncthing-svc"
    +      - "traefik.http.routers.syncthing-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.syncthing-svc.loadbalancer.server.port=8384"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    miniflux - RSS reader (link)

    +
    +
    +
      miniflux:
    +    container_name: miniflux
    +    image: miniflux/miniflux
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +      - backend
    +    depends_on:
    +      - miniflux_db
    +    environment:
    +      - DATABASE_URL=postgres://miniflux:SCJWWXqHwehP7f8g@miniflux_db/miniflux?sslmode=disable
    +      - RUN_MIGRATIONS=1
    +      - CREATE_ADMIN=1
    +      - ADMIN_USERNAME=$MINIFLUX_ADMIN_NAME
    +      - ADMIN_PASSWORD=$MINIFLUX_ADMIN_PASS
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.miniflux-rtr.entrypoints=https"
    +      - "traefik.http.routers.miniflux-rtr.rule=Host(`rss.$DOMAINNAME`)"
    +      - "traefik.http.routers.miniflux-rtr.tls=true"
    +      - "traefik.http.routers.miniflux-rtr.service=miniflux-svc"
    +      - "traefik.http.services.miniflux-svc.loadbalancer.server.port=8080"
    +    logging: *default-logging
    +
    +
    + +
    +
      miniflux_db:
    +    container_name: miniflux_db
    +    image: postgres:12
    +    restart: unless-stopped
    +    networks:
    +      - backend
    +    environment:
    +      - POSTGRES_USER=miniflux
    +      - POSTGRES_PASSWORD=$MINIFLUX_POSTGRES_PASSWORD
    +    volumes:
    +      - $CONFIGDIR/miniflux_db:/var/lib/postgresql/data
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    homeassistant - Home Automation (link)

    +
    +
    +
      homeassistant:
    +    container_name: homeassistant
    +    image: homeassistant/home-assistant
    +    restart: unless-stopped
    +    #networks:
    +    #  - t2_proxy
    +    #ports:
    +    #  - target: 8123
    +    #    published: 8123
    +    #    protocol: tcp
    +    #    mode: host
    +    privileged: true
    +    ports:
    +      - 8123:8123
    +    # network_mode: host
    +    volumes:
    +      - $CONFIGDIR/homeassistant:/config
    +      - /etc/localtime:/etc/localtime:ro
    +      - /dev/bus/usb:/dev/bus/usb
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.homeassistant-rtr.entrypoints=https"
    +      - "traefik.http.routers.homeassistant-rtr.rule=Host(`home.$DOMAINNAME`)"
    +      - "traefik.http.routers.homeassistant-rtr.tls=true"
    +      - "traefik.http.routers.homeassistant-rtr.service=homeassistant-svc"
    +      - "traefik.http.services.homeassistant-svc.loadbalancer.server.port=8123"
    +      # - "traefik.http.services.homeassistant-svc.loadbalancer.servers.url=http://172.17.0.1:8123"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    jellyfin - Media server (link)

    +
    +
    +
      jellyfin:
    +    container_name: jellyfin
    +    image: linuxserver/jellyfin
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    volumes:
    +      - $CONFIGDIR/jellyfin:/config
    +      - /srv/storage/TVShows:/data/tvshows
    +      - /srv/storage/Documentaries:/data/documentaries
    +      - /srv/storage/LiveMusic:/data/livemusic
    +      - /srv/storage/Animes:/data/animes
    +      - /srv/storage/Movies:/data/movies
    +      - /srv/storage/Music:/data/music
    +      - /srv/storage/StandUp:/data/standup
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    group-add:
    +      - 109
    +    devices:
    +      # VAAPI Devices
    +      - /dev/dri/renderD128:/dev/dri/renderD128
    +      - /dev/dri/card0:/dev/dri/card0
    +    ports:
    +      - 8096:8096
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.jellyfin-rtr.entrypoints=https"
    +      - "traefik.http.routers.jellyfin-rtr.rule=Host(`jellyfin.$DOMAINNAME`)"
    +      - "traefik.http.routers.jellyfin-rtr.tls=true"
    +      - "traefik.http.routers.jellyfin-rtr.service=jellyfin-svc"
    +      - "traefik.http.services.jellyfin-svc.loadbalancer.server.port=8096"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    jfa-go - Manage Jellyfin Users (link)

    +
    +
    +
      jfa:
    +    container_name: jfa
    +    image: hrfee/jfa-go
    +    restart: unless-stopped
    +    depends_on:
    +      - jellyfin
    +    networks:
    +      - t2_proxy
    +    volumes:
    +      - $CONFIGDIR/jfa:/data
    +      - $CONFIGDIR/jellyfin:/jf
    +      - /etc/localtime:/etc/localtime:ro
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.jfa-rtr.entrypoints=https"
    +      - "traefik.http.routers.jfa-rtr.rule=Host(`jfa.$DOMAINNAME`)"
    +      - "traefik.http.routers.jfa-rtr.tls=true"
    +      - "traefik.http.routers.jfa-rtr.service=jfa-svc"
    +      - "traefik.http.services.jfa-svc.loadbalancer.server.port=8056"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    audioserve - Audiobook server (link)

    +
    +
    +
      audioserve:
    +    container_name: audioserve
    +    image: izderadicka/audioserve
    +    restart: unless-stopped
    +    command: /audiobooks
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - AUDIOSERVE_SHARED_SECRET=$AUDIOSERVE_SHARED_SECRET
    +    volumes:
    +      - /srv/storage/AudioBooks:/audiobooks
    +      - /etc/localtime:/etc/localtime:ro
    +      - $CONFIGDIR/audioserve:/home/audioserve/.audioserve
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.audioserve-rtr.entrypoints=https"
    +      - "traefik.http.routers.audioserve-rtr.rule=Host(`audiobook.$DOMAINNAME`)"
    +      - "traefik.http.routers.audioserve-rtr.tls=true"
    +      - "traefik.http.routers.audioserve-rtr.service=audioserve-svc"
    +      - "traefik.http.services.audioserve-svc.loadbalancer.server.port=3000"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    filebrowser - Web file browser (link)

    +
    +
    +
      filebrowser:
    +    container_name: filebrowser
    +    image: filebrowser/filebrowser
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    volumes:
    +      - $CONFIGDIR/filebrowser/database.db:/database.db
    +      - $CONFIGDIR/filebrowser/.filebrowser.json:/.filebrowser.json
    +      - /srv/storage:/srv/storage
    +    user: "${PUID}:${PGID}"
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.filebrowser-rtr.entrypoints=https"
    +      - "traefik.http.routers.filebrowser-rtr.rule=Host(`cloud.$DOMAINNAME`)"
    +      - "traefik.http.routers.filebrowser-rtr.tls=true"
    +      - "traefik.http.routers.filebrowser-rtr.service=filebrowser-svc"
    +      - "traefik.http.services.filebrowser-svc.loadbalancer.server.port=80"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    .filebrowser.json

    +
    +
    +
    {
    +  "port": 80,
    +  "baseURL": "",
    +  "address": "",
    +  "log": "stdout",
    +  "database": "/database.db",
    +  "root": "/srv/storage"
    +}
    +
    +
    +
    +
    +
    + +
    +

    scrutiny - Hard drive monitoring (link)

    +
    +
    +
      scrutiny:
    +    container_name: scrutiny
    +    image: linuxserver/scrutiny
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    cap_add:
    +      - SYS_RAWIO
    +      - SYS_ADMIN
    +    environment:
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +      - SCRUTINY_WEB=true
    +      - SCRUTINY_COLLECTOR=false
    +    volumes:
    +      - $CONFIGDIR/scrutiny:/config
    +      - /run/udev:/run/udev:ro
    +    devices:
    +      - /dev/sda:/dev/sda
    +      - /dev/sdb:/dev/sdb
    +      - /dev/sdc:/dev/sdc
    +      - /dev/sdd:/dev/sdd
    +      - /dev/nvme0n1:/dev/nvme0n1
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.scrutiny-rtr.entrypoints=https"
    +      - "traefik.http.routers.scrutiny-rtr.rule=Host(`scrutiny.$DOMAINNAME`)"
    +      - "traefik.http.routers.scrutiny-rtr.tls=true"
    +      - "traefik.http.routers.scrutiny-rtr.service=scrutiny-svc"
    +      - "traefik.http.routers.scrutiny-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.scrutiny-svc.loadbalancer.server.port=8080"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    radicale - CalDAV/CardDAV server (link)

    +
    +
    +
      radicale:
    +    container_name: radicale
    +    image: tomsquest/docker-radicale:latest
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    volumes:
    +      - $CONFIGDIR/radicale/config:/config:ro
    +      - $CONFIGDIR/radicale/data:/data
    +    environment:
    +      - TZ=$TZ
    +      - UID=$PUID
    +      - GID=$PGID
    +    security_opt:
    +      - no-new-privileges:true
    +    cap_drop:
    +      - ALL
    +    cap_add:
    +      - SETUID
    +      - SETGID
    +      - CHOWN
    +      - KILL
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.radicale-rtr.entrypoints=https"
    +      - "traefik.http.routers.radicale-rtr.rule=Host(`radicale.$DOMAINNAME`)"
    +      - "traefik.http.routers.radicale-rtr.tls=true"
    +      - "traefik.http.routers.radicale-rtr.service=radicale-svc"
    +      - "traefik.http.services.radicale-svc.loadbalancer.server.port=5232"
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    config

    +
    +
    +
    [server]
    +hosts = 0.0.0.0:5232
    +
    +[auth]
    +type = htpasswd
    +htpasswd_filename = /config/users
    +htpasswd_encryption = md5
    +
    +[storage]
    +filesystem_folder = /data/collections
    +
    +
    +
    +
    +
    + +
    +

    restic - Automatic online backups (link)

    +
    +
    +
      restic:
    +    container_name: restic
    +    image: mazzolino/restic
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - BACKUP_CRON=0 30 0 * * *
    +      - RESTIC_REPOSITORY=b2:tdehaeze:/restic
    +      - RESTIC_PASSWORD=$RESTIC_PASSWORD
    +      - RESTIC_BACKUP_SOURCES=/source
    +      - RESTIC_FORGET_ARGS=--group-by tag --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
    +      - RESTIC_BACKUP_ARGS=--tag local --exclude-file /exclude.txt
    +      - B2_ACCOUNT_ID=$RESTIC_B2_ACCOUNT_ID
    +      - B2_ACCOUNT_KEY=$RESTIC_B2_ACCOUNT_KEY
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/restic/exclude.txt:/exclude.txt:ro
    +      - /srv/storage/Cloud/thesis:/source/Cloud/thesis:ro
    +      - /home/thomas/docker:/source/docker:ro
    +    logging: *default-logging
    +
    +
    +
    + +
    +

    exclude.txt - Exclude files

    +
    +
    +
    *.db
    +*.log
    +*.log.*
    +/source/docker/config/gitea/git/
    +/source/docker/config/guacamole/
    +/source/docker/config/guacamole_db/
    +/source/docker/config/mariadb/
    +/source/docker/config/miniflux_db/
    +/source/docker/config/jellyfin/data/
    +/source/docker/config/dotfiles/www/
    +/source/docker/config/web/www/
    +
    +
    +
    +
    +
    + +
    +

    octoprint - Web interface for 3D printing (link)

    +
    +
    +
      octoprint:
    +    container_name: octoprint
    +    image: octoprint/octoprint
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    privileged: true
    +    volumes:
    +      - $CONFIGDIR/octoprint:/octoprint
    +      - /dev/bus/usb:/dev/bus/usb
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.octoprint-rtr.entrypoints=https"
    +      - "traefik.http.routers.octoprint-rtr.rule=Host(`octoprint.$DOMAINNAME`)"
    +      - "traefik.http.routers.octoprint-rtr.tls=true"
    +      - "traefik.http.routers.octoprint-rtr.service=octoprint-svc"
    +      - "traefik.http.routers.octoprint-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.octoprint-svc.loadbalancer.server.port=80"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    mealie - Recipe Manager (link)

    +
    +
    +
      miam:
    +    container_name: miam
    +    image: hkotel/mealie
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - db_type=sqlite
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/mealie:/app/data
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.miam-rtr.entrypoints=https"
    +      - "traefik.http.routers.miam-rtr.rule=Host(`miam.$DOMAINNAME`)"
    +      - "traefik.http.routers.miam-rtr.tls=true"
    +      - "traefik.http.routers.miam-rtr.service=miam-svc"
    +      - "traefik.http.services.miam-svc.loadbalancer.server.port=80"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    diun - Notification for Docker image updates (link)

    +
    +
    +
      diun:
    +    container_name: diun
    +    image: crazymax/diun
    +    restart: unless-stopped
    +    networks:
    +      - backend
    +    environment:
    +      - TZ=$TZ
    +      - LOG_LEVEL=info
    +      - LOG_JSON=false
    +      - DIUN_WATCH_WORKERS=20
    +      - DIUN_WATCH_SCHEDULE=0 7 * * 6
    +      - DIUN_PROVIDERS_DOCKER=true
    +      - DIUN_PROVIDERS_DOCKER_WATCHBYDEFAULT=true
    +      - DIUN_NOTIF_GOTIFY_ENDPOINT=$GOTIFY_URL
    +      - DIUN_NOTIF_GOTIFY_TOKEN=$DIUN_GOTIFY_TOKEN
    +    volumes:
    +      - /var/run/docker.sock:/var/run/docker.sock:ro
    +      - $CONFIGDIR/diun:/data
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    commento - Commenting system (link)

    +
    +
    +
      commento:
    +    container_name: commento
    +    image: registry.gitlab.com/commento/commento
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +      - backend
    +    # ports:
    +    #   - 8080:8080
    +    environment:
    +      - TZ=$TZ
    +      - UID=$PUID
    +      - GID=$PGID
    +      - COMMENTO_ORIGIN=https://commento.tdehaeze.xyz/
    +      - COMMENTO_PORT=8080
    +      - COMMENTO_POSTGRES=postgres://postgres:$COMMENTO_DB_PASSWORD@commento_db:5432/commento?sslmode=disable
    +      - COMMENTO_SMTP_HOST=smtp.gmail.com
    +      - COMMENTO_SMTP_PORT=587
    +      - COMMENTO_SMTP_USERNAME=tdehaeze.xyz@gmail.com
    +      - COMMENTO_SMTP_PASSWORD=$GMAIL_PASS
    +      - COMMENTO_SMTP_FROM_ADDRESS=tdehaeze.xyz@gmail.com
    +    depends_on:
    +      - commento_db
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.commento-rtr.entrypoints=https"
    +      - "traefik.http.routers.commento-rtr.rule=Host(`commento.$DOMAINNAME`)"
    +      - "traefik.http.routers.commento-rtr.tls=true"
    +      - "traefik.http.routers.commento-rtr.service=commento-svc"
    +      - "traefik.http.services.commento-svc.loadbalancer.server.port=8080"
    +    logging: *default-logging
    +
    +
    + +
    +
      commento_db:
    +    container_name: commento_db
    +    image: postgres:13
    +    restart: unless-stopped
    +    networks:
    +      - backend
    +    environment:
    +      - POSTGRES_DB=commento
    +      - POSTGRES_USER=postgres
    +      - POSTGRES_PASSWORD=$COMMENTO_DB_PASSWORD
    +    volumes:
    +      - $CONFIGDIR/commento_db:/var/lib/postgresql/data
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    uptime-kuma - Monitoring Tool (link)

    +
    +
    +
      uptime-kuma:
    +    container_name: uptime-kuma
    +    image: louislam/uptime-kuma
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    volumes:
    +    environment:
    +      - TZ=$TZ
    +      - UID=$PUID
    +      - GID=$PGID
    +    volumes:
    +      - $CONFIGDIR/uptime-kuma:/app/data
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.uptime-rtr.entrypoints=https"
    +      - "traefik.http.routers.uptime-rtr.rule=Host(`uptime.$DOMAINNAME`)"
    +      - "traefik.http.routers.uptime-rtr.tls=true"
    +      - "traefik.http.routers.uptime-rtr.service=uptime-svc"
    +      - "traefik.http.routers.uptime-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.uptime-svc.loadbalancer.server.port=3001"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    kavita - Reading server (link)

    +
    +
    +
      kavita:
    +    container_name: kavita
    +    image: kizaing/kavita:latest
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - TZ=$TZ
    +      - UID=$PUID
    +      - GID=$PGID
    +    volumes:
    +      - $CONFIGDIR/kavita:/kavita/data
    +      - /srv/storage/Books:/books
    +      - /srv/storage/Scans:/scans
    +      - /srv/storage/Comics:/comics
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.kavita-rtr.entrypoints=https"
    +      - "traefik.http.routers.kavita-rtr.rule=Host(`kavita.$DOMAINNAME`)"
    +      - "traefik.http.routers.kavita-rtr.tls=true"
    +      - "traefik.http.routers.kavita-rtr.service=kavita-svc"
    +      - "traefik.http.services.kavita-svc.loadbalancer.server.port=5000"
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    mosquitto - MQTT broker (link)

    +
    +
    +
      mosquitto:
    +    container_name: mosquitto
    +    image: eclipse-mosquitto
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    expose:
    +      - 1883
    +      - 9001
    +    ports:
    +      - 1883:1883
    +      - 9001:9001
    +    volumes:
    +      - $CONFIGDIR/mosquitto/config:/mosquitto/config
    +      - $CONFIGDIR/mosquitto/log:/mosquitto/log
    +      - $CONFIGDIR/mosquitto/data:/mosquitto/data
    +    logging: *default-logging
    +
    +
    +
    +
    + +
    +

    zigbee2mqtt - Zigbee to MQTT bridge (link)

    +
    +
    +
      zigbee2mqtt:
    +    container_name: zigbee2mqtt
    +    image: koenkk/zigbee2mqtt
    +    restart: unless-stopped
    +    privileged: true
    +    depends_on:
    +      - mosquitto
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - UID=$PUID
    +      - GID=$PGID
    +      - TZ=$TZ
    +    volumes:
    +      - $CONFIGDIR/zigbee2mqtt:/app/data
    +      - /run/udev:/run/udev:ro
    +    devices:
    +      - /dev/ttyACM0:/dev/ttyACM0
    +
    +
    +
    +
    + +
    +

    zigbee2mqttassistant - GUI for Zigbee2Mqtt (link)

    +
    +
    +
      zigbee2mqttAssistant:
    +    container_name: zigbee2mqttassistant
    +    image: carldebilly/zigbee2mqttassistant
    +    restart: unless-stopped
    +    networks:
    +      - t2_proxy
    +    environment:
    +      - Z2MA_SETTINGS__MQTTSERVER=192.168.1.21:1883
    +      # - Z2MA_SETTINGS__MQTTUSERNAME={MQTTUSERNAME}
    +      # - Z2MA_SETTINGS__MQTTPASSWORD={MQTTPASSWORD}
    +      - PUID=$PUID
    +      - PGID=$PGID
    +      - TZ=$TZ
    +    labels:
    +      - "traefik.enable=true"
    +      - "traefik.http.routers.zigbee2mqttassistant-rtr.entrypoints=https"
    +      - "traefik.http.routers.zigbee2mqttassistant-rtr.rule=Host(`zigbee2mqttassistant.$DOMAINNAME`)"
    +      - "traefik.http.routers.zigbee2mqttassistant-rtr.tls=true"
    +      - "traefik.http.routers.zigbee2mqttassistant-rtr.service=zigbee2mqttassistant-svc"
    +      - "traefik.http.routers.zigbee2mqttassistant-rtr.middlewares=authelia@docker"
    +      - "traefik.http.services.zigbee2mqttassistant-svc.loadbalancer.server.port=80"
    +    logging: *default-logging
    +
    +
    +
    +
    +
    + +
    +

    Cron Jobs

    +
    +
    +
    +

    Caddy Update

    +
    +

    +Create a script ~/cron/caddy_update.sh with: +

    +
    +
    docker exec caddy /bin/sh -c "cd /srv/www && echo -e \"Update repo $(date)\" && git submodule update --recursive --remote --merge"
    +
    +
    + +

    +Type crontab -e and add this line: +

    +
    +
    */5 * * * * /home/thomas/cron/caddy_update.sh >> /home/thomas/cron/caddy_update.log 2>&1
    +
    +
    +
    +
    +
    +
    +
    +

    Author: Dehaeze Thomas

    +

    Created: 2021-10-25 lun. 14:33

    +
    + + diff --git a/docs/i3.html b/docs/i3.html index 215b527..0596c56 100644 --- a/docs/i3.html +++ b/docs/i3.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + I3 Configuration @@ -16,11 +16,11 @@ UP | HOME -
    +

    I3 Configuration

    -
    +

    Table of Contents

    -
    +
    • Mod Key
    • Border Style
    • @@ -247,10 +247,10 @@ set $ws8 8 for_window [class="Floating"] floating enable, resize set 800 600, move position 1100 460 for_window [class="mpv"] floating enable # Size/Position is defined in mpv.conf for_window [class="Sxiv"] floating enable, resize set 800 600, move position center -for_window [title="khal interactive"] floating enable, resize set 600 600, move position center +for_window [title="khal"] floating enable, resize set 600 600, move position center for_window [title="ncmpcpp"] floating enable, resize set 800 400, move position center +for_window [title="Sensors"] floating enable, resize set 800 400, move position center for_window [title="nmtui"] floating enable, resize set 800 600, move position center -for_window [title="linkding"] floating enable, resize set 800 600, move position center for_window [title="Xournal"] floating enable, resize set 1100 750, move position center
    @@ -293,7 +293,7 @@ exec --no-startup-id polybar top >>/tmp/polybar.log 2>&1 &

    Author: Dehaeze Thomas

    -

    Created: 2021-05-02 dim. 11:26

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/index.html b/docs/index.html index e70b3f4..5540917 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Dotfiles - Manjaro Linux @@ -37,7 +37,7 @@ There are Specific configuration files for:
  • Display Server: Xorg
  • Editors: Neovim and Emacs (Doom) (library of babel, snippets)
  • Shell: Bash
  • -
  • Terminal Emulator: Termite
  • +
  • Terminal Emulator: Alacritty
  • Terminal Multiplexer Tmux
  • Image Setup: Sxiv
  • Music Setup: Ncmpcpp, Mopidy and Beets
  • @@ -62,7 +62,7 @@ There are Specific configuration files for: I also have:

    -
    -

    termite - Terminal

    -
    +
    +

    alacritty - Terminal

    +

    -Termite is a very nice keyboard-centric terminal. +Alacritty is a very nice keyboard-centric terminal.

    It can be installed like so:

    -
      yay -S termite
    +
      yay -S alacritty
     

    -Its configuration file is described here. +Its configuration file is described here.

    - +@@ -967,9 +967,9 @@ Bitwarden https://github.com/bitwarde

    -
    Table 2: termite - CheatsheetTable 2: alacritty - Cheatsheet
    @@ -1141,9 +1141,9 @@ And then browse to http://127.0.0.1:5001.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S qutebrowser
     
    @@ -1155,9 +1155,9 @@ And then browse to http://127.0.0.1:5001.

    View Pdf inside qutebrowser with pdfjs

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S pdfjs
     
    @@ -1165,9 +1165,9 @@ And then browse to http://127.0.0.1:5001.
    -
    -

    Usage

    -
    +
    +

    Usage

    +

    When opening a pdf file on qutebrowser, you’ll be ask for options:

    @@ -1662,9 +1662,9 @@ This looks for contacts in all indexed emails.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S weechat
     
    @@ -1775,9 +1775,9 @@ Then we install some dependencies
    -
    -

    Configuration

    -
    +
    +

    Configuration

    + -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S python2-websocket-client
     
    @@ -2000,9 +2000,9 @@ It runs weechat inside tmux.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S isync
     
    @@ -2010,9 +2010,9 @@ It runs weechat inside tmux.
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    ~/.mbsyncrc

    @@ -2066,9 +2066,9 @@ systemctl --user start syncmail.timer

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S msmtp
     
    @@ -2094,9 +2094,9 @@ systemctl --user start syncmail.timer

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S neomutt
     
    @@ -2165,9 +2165,9 @@ Configuration files: https://github.com/ranger/ranger

    -
    -

    Installation

    -
    +
    +

    Installation

    +
    yay -S ranger
     
    @@ -2175,9 +2175,9 @@ Configuration files:
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    The configuration file is ~/.config/ranger/rc.conf.

    @@ -2221,9 +2221,9 @@ It works better with Urxvt.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S sxiv
     
    @@ -2241,9 +2241,9 @@ It works better with Urxvt.
    -
    -

    Cheatsheet

    -
    +
    +

    Cheatsheet

    +
    @@ -2316,9 +2316,9 @@ Configuration file: SXHKD.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S i3-gaps
     
    @@ -2326,9 +2326,9 @@ Configuration file: SXHKD.
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    ~/.i3/config

    @@ -2348,9 +2348,9 @@ Configuration file: SXHKD.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S polybar
     
    @@ -2371,9 +2371,9 @@ Configuration file: SXHKD.

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S picom
     
    @@ -2381,9 +2381,9 @@ Configuration file: SXHKD.
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    ~/.config/picom/picom.conf

    @@ -2413,9 +2413,9 @@ Compton is run from .xprofile config in the background:

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S dunst dunstify
     
    @@ -2423,18 +2423,18 @@ Compton is run from .xprofile config in the background:
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    ~/.config/dunst/dunstrc

    -
    -

    Usage

    -
    +
    +

    Usage

    +
      dunstify --replace=16549 "AppName" "Message"
     
    @@ -2881,9 +2881,9 @@ Configuration: https://pwmt.org/projects/zathura/

    -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S zathura
     
    @@ -2903,18 +2903,18 @@ It seems that mupdf is better that poppler to view pdf.
    -
    -

    Configuration

    -
    +
    +

    Configuration

    +

    ~/.config/zathura/zathurarc

    -
    -

    Cheatsheet

    -
    +
    +

    Cheatsheet

    +
    @@ -3017,9 +3017,9 @@ pdfpc is a great tool for showing pdf presentations. It support: -
    -

    Installation

    -
    +
    +

    Installation

    +
      yay -S pdfpc
     
    @@ -3037,9 +3037,9 @@ pdfpc is a great tool for showing pdf presentations. It support:
    -
    -

    Usage

    -
    +
    +

    Usage

    +
      pdfpc filename.pdf
     
    @@ -3303,9 +3303,9 @@ Configuration:
    -
    -

    Others

    -
    +
    +

    Others

    +

    maim=/=flameshot - Take Screenshots

    @@ -3377,7 +3377,7 @@ Configuration:

    trash-cli is used to manage the trash. -It is integrated with Ranger. +It is integrated with ranger and pcmanFM.

    @@ -3777,9 +3777,9 @@ Using command line:
    -
    -

    Others

    -
    +
    +

    Others

    +
    @@ -4489,7 +4489,7 @@ To see next timers

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-06-20 dim. 14:21

    diff --git a/docs/iot.html b/docs/iot.html new file mode 100644 index 0000000..c445fe0 --- /dev/null +++ b/docs/iot.html @@ -0,0 +1,719 @@ + + + + + + +IoT + + + + + + +
    + UP + | + HOME +
    +

    IoT

    + + + + + + +
    +

    ESPHome

    +
    +
    +
    +

    Sonoff S26 - Smart Socket

    + + +
    +

    Sonoff S26 1

    +
    +
    +
    esphome:
    +  name: sonoffs26_1
    +  platform: ESP8266
    +  board: esp01_1m
    +  board_flash_mode: dout
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +  ap:
    +    ssid: 'Sonoff S26 1 Fallback Hotspot'
    +    password: '<<get-password(passname="sonoff_s26/ap")>>'
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: false
    +logger:
    +
    +api:
    +  password: '<<get-password(passname="sonoff_s26/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_s26/ota")>>'
    +
    +web_server:
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff S26_1 Button"
    +    on_press:
    +      - switch.toggle: relay
    +  - platform: status
    +    name: "Sonoff S26_1 Status"
    +
    +sensor:
    +  - platform: wifi_signal
    +    name: "sonoffs26_1 WiFi Signal"
    +    update_interval: 60s
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff S26_1 Relay"
    +    pin: GPIO12
    +    id: 'relay'
    +  - platform: restart
    +    name: "sonoffs26_1 Restart"
    +
    +
    +
    +
    + +
    +

    Sonoff S26 2

    +
    +
    +
    esphome:
    +  name: sonoffs26_2
    +  platform: ESP8266
    +  board: esp01_1m
    +  board_flash_mode: dout
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +  ap:
    +    ssid: 'Sonoff S26 2 Fallback Hotspot'
    +    password: '<<get-password(passname="sonoff_s26/ap")>>'
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: false
    +logger:
    +
    +api:
    +  password: '<<get-password(passname="sonoff_s26/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_s26/ota")>>'
    +
    +web_server:
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff S26_2 Button"
    +    on_press:
    +      - switch.toggle: relay
    +  - platform: status
    +    name: "Sonoff S26_2 Status"
    +
    +sensor:
    +  - platform: wifi_signal
    +    name: "sonoffs26_2 WiFi Signal"
    +    update_interval: 60s
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff S26_2 Relay"
    +    pin: GPIO12
    +    id: 'relay'
    +  - platform: restart
    +    name: "sonoffs26_2 Restart"
    +
    +
    +
    +
    + +
    +

    Sonoff S26 3

    +
    +
    +
    esphome:
    +  name: sonoffs26_3
    +  platform: ESP8266
    +  board: esp01_1m
    +  board_flash_mode: dout
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +  ap:
    +    ssid: 'Sonoff S26 3 Fallback Hotspot'
    +    password: '<<get-password(passname="sonoff_s26/ap")>>'
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: false
    +logger:
    +
    +api:
    +  password: '<<get-password(passname="sonoff_s26/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_s26/ota")>>'
    +
    +web_server:
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff S26_3 Button"
    +    on_press:
    +      - switch.toggle: relay
    +  - platform: status
    +    name: "Sonoff S26_3 Status"
    +
    +sensor:
    +  - platform: wifi_signal
    +    name: "sonoffs26_3 WiFi Signal"
    +    update_interval: 60s
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff S26_3 Relay"
    +    pin: GPIO12
    +    id: 'relay'
    +  - platform: restart
    +    name: "sonoffs26_3 Restart"
    +
    +
    +
    +
    + +
    +

    Sonoff S26 4

    +
    +
    +
    esphome:
    +  name: sonoffs26_4
    +  platform: ESP8266
    +  board: esp01_1m
    +  board_flash_mode: dout
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +  ap:
    +    ssid: 'Sonoff S26 4 Fallback Hotspot'
    +    password: '<<get-password(passname="sonoff_s26/ap")>>'
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: false
    +logger:
    +
    +api:
    +  password: '<<get-password(passname="sonoff_s26/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_s26/ota")>>'
    +
    +web_server:
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff S26_4 Button"
    +    on_press:
    +      - switch.toggle: relay
    +  - platform: status
    +    name: "Sonoff S26_4 Status"
    +
    +sensor:
    +  - platform: wifi_signal
    +    name: "sonoffs26_4 WiFi Signal"
    +    update_interval: 60s
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff S26_4 Relay"
    +    pin: GPIO12
    +    id: 'relay'
    +  - platform: restart
    +    name: "sonoffs26_4 Restart"
    +
    +
    +
    +
    +
    + +
    +

    Anoopsyche SB14 - E27 Smart Bulb (Cold White / Warm White)

    + + +
    +

    Anoopsyche CWWW 1

    +
    +
    +
    esphome:
    +  name: anoopsyche_cwww_1
    +  platform: ESP8266
    +  board: esp01_1m
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +  ap:
    +    ssid: 'Anoopsyche CWWW 1'
    +    password: '<<get-password(passname="anoopsyche_cwww/ap")>>'
    +
    +captive_portal:
    +
    +# Enable logging
    +logger:
    +
    +# Enable Home Assistant API
    +api:
    +  password: '<<get-password(passname="anoopsyche_cwww/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="anoopsyche_cwww/ota")>>'
    +
    +output:
    +  - platform: esp8266_pwm
    +    id: output_cold_white
    +    pin: GPIO5
    +  - platform: esp8266_pwm
    +    id: output_warm_white
    +    pin: GPIO13
    +
    +light:
    +  - platform: cwww
    +    name: 'Anoopsyche CWWW 1'
    +    default_transition_length: 1s
    +    warm_white: output_warm_white
    +    cold_white: output_cold_white
    +    cold_white_color_temperature: 6000 K
    +    warm_white_color_temperature: 2700 K
    +
    +
    +
    +
    + +
    +

    Anoopsyche CWWW 2

    +
    +
    +
    esphome:
    +  name: anoopsyche_cwww_2
    +  platform: ESP8266
    +  board: esp01_1m
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +  ap:
    +    ssid: 'Anoopsyche CWWW 2'
    +    password: '<<get-password(passname="anoopsyche_cwww/ap")>>'
    +
    +captive_portal:
    +
    +# Enable logging
    +logger:
    +
    +# Enable Home Assistant API
    +api:
    +  password: '<<get-password(passname="anoopsyche_cwww/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="anoopsyche_cwww/ota")>>'
    +
    +output:
    +  - platform: esp8266_pwm
    +    id: output_cold_white
    +    pin: GPIO5
    +  - platform: esp8266_pwm
    +    id: output_warm_white
    +    pin: GPIO13
    +
    +light:
    +  - platform: cwww
    +    name: 'Anoopsyche CWWW 2'
    +    default_transition_length: 1s
    +    warm_white: output_warm_white
    +    cold_white: output_cold_white
    +    cold_white_color_temperature: 6000 K
    +    warm_white_color_temperature: 2700 K
    +
    +
    +
    +
    +
    + +
    +

    Sonoff BasicR2 - DIY Smart Socket

    + + +
    +

    Sonoff Basic 1

    +
    +
    +
    esphome:
    +  name: sonoffbasic_1
    +  platform: ESP8266
    +  board: esp8285
    +  arduino_version: 2.4.2
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +api:
    +  password: '<<get-password(passname="sonoff_basic/api")>>'
    +
    +logger:
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_basic/ota")>>'
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff Basic Button 1"
    +    on_press:
    +      - switch.toggle: relay
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff Basic Relay 1"
    +    pin: GPIO12
    +    id: relay
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: yes
    +
    +
    +
    +
    + +
    +

    Sonoff Basic 2

    +
    +
    +
    esphome:
    +  name: sonoffbasic_2
    +  platform: ESP8266
    +  board: esp8285
    +  arduino_version: 2.4.2
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +api:
    +  password: '<<get-password(passname="sonoff_basic/api")>>'
    +
    +logger:
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_basic/ota")>>'
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff Basic Button 2"
    +    on_press:
    +      - switch.toggle: relay
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff Basic Relay 2"
    +    pin: GPIO12
    +    id: relay
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: yes
    +
    +
    +
    +
    +
    +

    Sonoff Basic 3

    +
    +
    +
    esphome:
    +  name: sonoffbasic_3
    +  platform: ESP8266
    +  board: esp8285
    +  arduino_version: 2.4.2
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +api:
    +  password: '<<get-password(passname="sonoff_basic/api")>>'
    +
    +logger:
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_basic/ota")>>'
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff Basic Button 3"
    +    on_press:
    +      - switch.toggle: relay
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff Basic Relay 3"
    +    pin: GPIO12
    +    id: relay
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: yes
    +
    +
    +
    +
    +
    +

    Sonoff Basic 4

    +
    +
    +
    esphome:
    +  name: sonoffbasic_4
    +  platform: ESP8266
    +  board: esp8285
    +  arduino_version: 2.4.2
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +
    +api:
    +  password: '<<get-password(passname="sonoff_basic/api")>>'
    +
    +logger:
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_basic/ota")>>'
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff Basic Button 4"
    +    on_press:
    +      - switch.toggle: relay
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff Basic Relay 4"
    +    pin: GPIO12
    +    id: relay
    +
    +status_led:
    +  pin:
    +    number: GPIO13
    +    inverted: yes
    +
    +
    +
    +
    +
    + +
    +

    Sonoff POWR2 - DIY Power Monitoring Smart Socket

    + + +
    +

    Sonoff POWR2 1

    +
    +
    +
    esphome:
    +  name: sonoffpowr2_1
    +  platform: ESP8266
    +  board: esp01_1m
    +  board_flash_mode: dout
    +
    +wifi:
    +  ssid: 'Freebox-11A882'
    +  password: '<<get-password(passname="wifi/Freebox-11A882")>>'
    +  ap:
    +    ssid: 'Sonoff POWR2 1 Fallback Hotspot'
    +    password: 'gmHu3rQHZHwH'
    +
    +mqtt:
    +  broker: '192.168.1.11'
    +
    +logger:
    +
    +api:
    +  password: '<<get-password(passname="sonoff_powr2/api")>>'
    +
    +ota:
    +  password: '<<get-password(passname="sonoff_powr2/ota")>>'
    +
    +uart:
    +  rx_pin: RX
    +  baud_rate: 4800
    +
    +sensor:
    +  - platform: cse7766
    +    current:
    +      name: "Sonoff POWR2_1 Current"
    +    voltage:
    +      name: "Sonoff POWR2_1 Voltage"
    +    power:
    +      name: "Sonoff POWR2_1 Power"
    +
    +binary_sensor:
    +  - platform: gpio
    +    pin:
    +      number: GPIO0
    +      mode: INPUT_PULLUP
    +      inverted: True
    +    name: "Sonoff POWR2_1 Button"
    +    on_press:
    +      - switch.toggle: relay
    +
    +switch:
    +  - platform: gpio
    +    name: "Sonoff POWR2_1 Relay"
    +    pin: GPIO12
    +    id: 'relay'
    +
    +
    +
    +
    +
    +
    +
    +
    +

    Author: Dehaeze Thomas

    +

    Created: 2021-10-25 lun. 14:33

    +
    + + diff --git a/docs/mail.html b/docs/mail.html index 8f04bcf..95c304c 100644 --- a/docs/mail.html +++ b/docs/mail.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - +Mail Configuration @@ -16,17 +16,17 @@ UP | HOME -
    +

    Mail Configuration

    -
    +

    Table of Contents

    - -
    -

    Gmail Account

    -
    +
    +

    Gmail Account

    +
    IMAPAccount gmail
     Host imap.gmail.com
    @@ -224,8 +212,8 @@ Channel gmail-Trash
     Far :gmail-remote:"[Gmail]/Trash"
     Near :gmail-local:Trash
     
    -Channel gmail-All
    -Far :gmail-remote:"[Gmail]/All Mail"
    +Channel gmail-Archive
    +Far :gmail-remote:"[Imap]/Archive"
     Near :gmail-local:Archive
     
    @@ -241,12 +229,10 @@ Near :gmail-local: Patterns * Patterns !INBOX Patterns ![Gmail]* -Patterns !Archive Patterns !Drafts Patterns !Sent Mail Patterns !Trash -Patterns !Spam -Patterns !Starred +# Patterns ![Imap]/Archive
    @@ -263,9 +249,9 @@ Sync Pull
    -
    -

    ESRF Account

    -
    +
    +

    ESRF Account

    +
    IMAPAccount esrf
     Host imaps.esrf.fr
    @@ -480,9 +466,9 @@ tls_certcheck off
     
    -
    -

    Gmail Account

    -
    +
    +

    Gmail Account

    +
    account      gmail
     host         smtp.gmail.com
    @@ -496,9 +482,9 @@ passwordeval "pass email/dehaeze.thomas@gmail.com"
     
    -
    -

    ESRF Account

    -
    +
    +

    ESRF Account

    +
    account        esrf
     host           smtps.esrf.fr
    @@ -881,9 +867,9 @@ macro index q "<shell-escape>if [ $TMUX ]; then t
     
    -
    -

    Generic

    -
    +
    +

    Generic

    +
    bind generic Q exit
     
    @@ -919,6 +905,9 @@ bind generic,index,pager \Cy previous-line
     
    bind pager k  previous-line
     bind pager j  next-line
     
    +# Display mode information
    +bind pager i display-toggle-weed
    +
     bind index <space> collapse-thread
     
     bind index,pager K previous-entry
    @@ -1008,7 +997,7 @@ Open mail with Vim
     
    -
    # bind index,pager U toggle-new
    +
    bind index U toggle-new
     
    @@ -1057,9 +1046,9 @@ bind index,pager N search-opposite
    -
    -

    Attachments

    -
    +
    +

    Attachments

    +
    bind attach l view-attach
     
    @@ -1157,9 +1146,9 @@ bind browser q exit
     
    -
    -

    Generic

    -
    +
    +

    Generic

    +

    Enter Command

    @@ -1170,9 +1159,9 @@ Enter Command
    -
    -

    Sidebar

    -
    +
    +

    Sidebar

    +
    bind index,pager \Cp sidebar-prev
     bind index,pager \Cn sidebar-next
    @@ -1243,28 +1232,31 @@ macro index,pager gf "<change-folder-readonly>~/.
     
    Link mail to orgmode - Script
    +

    +https://orgmode.org/manual/The-capture-protocol.html#The-capture-protocol +

    +
    import sys
     import email
    +from email import policy
     import subprocess
     import urllib.parse
     
     # Parse the email from standard input
     message_bytes = sys.stdin.buffer.read()
    -message = email.message_from_bytes(message_bytes)
    +message = email.message_from_bytes(message_bytes, policy=policy.default)
     
     # Grab the relevant message headers
    -message_id = urllib.parse.quote(message['message-id'].strip()[1:-1])
    -subject = message['subject'].replace('[', '{').replace(']', '}').replace('\n', ' ')
    -subject = (subject[:75] + '..') if len(subject) > 75 else subject
    +message_id = urllib.parse.quote(message['message-id'][1:-1])
    +subject = message['subject']
    +message_to = message['to']
     
     # Ask emacsclient to save a link to the message
    -p = subprocess.Popen([
    +subprocess.Popen([
         'emacsclient',
    -    f'org-protocol://capture?template=pm&url={message_id}&title={subject}'
    +    f'org-protocol://capture?template=ps&url={message_id}&title={subject}&body={message_to}'
     ])
    -
    -p.wait()
     
    @@ -1275,172 +1267,66 @@ p.wait()

    Colors

    -
    -
    -

    Basic colors

    -
    -
    color normal      color021       color000
    -color error       color021       color000
    -color tilde       color021       color000
    -color message     color021       color000
    -color markers     color021       color000
    -color attachment  color021       color000
    -color search      color000       color003
    -color status      color016       color000
    -color indicator   color000       color021
    -color tree        color021       color000
    -color progress    color000       color021
    +
    color attachment  color109 color235
    +color bold        color229 color235
    +color error       color167 color235
    +color hdrdefault  color246 color235
    +color indicator   color223 color237
    +color markers     color243 color235
    +color normal      color223 color235
    +color prompt      color223 color235
    +color quoted      color250 color235
    +color quoted1     color108 color235
    +color quoted2     color250 color235
    +color quoted3     color108 color235
    +color quoted4     color250 color235
    +color quoted5     color108 color235
    +color search      color235 color208
    +color signature   color108 color235
    +color status      color245 color235
    +color tilde       color243 color235
    +color tree        color142 color235
    +color underline   color223 color239
     
    -# basic monocolor screen
    -mono  bold      bold
    -mono  underline underline
    -mono  indicator reverse
    -mono  error     bold
    +color sidebar_divider    color250 color235
    +color sidebar_new        color142 color235
    +
    +color index color142 color235 ~N
    +color index color108 color235 ~O
    +color index color109 color235 ~P
    +color index color214 color235 ~F
    +color index color175 color235 ~Q
    +color index color167 color235 ~=
    +color index color235 color223 ~T
    +color index color235 color167 ~D
    +
    +color header color214 color235 "^(To:|Cc:|Bcc:|From:)"
    +color header color142 color235 "^Subject:"
    +color header color108 color235 "^X-Spam-Status:"
    +color header color108 color235 "^Received:"
    +
    +color body color142 color235 "[a-z]{3,256}://[-a-zA-Z0-9@:%._\\+~#=/?&,]+"
    +color body color208 color235 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+"
    +color body color208 color235 "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+"
    +color body color235 color214 "[;:]-*[)>(<lt;|]"
    +color body color229 color235 "\\*[- A-Za-z]+\\*"
    +
    +color body color214 color235 "^-.*PGP.*-*"
    +color body color142 color235 "^gpg: Good signature from"
    +color body color167 color235 "^gpg: Can't.*$"
    +color body color214 color235 "^gpg: WARNING:.*$"
    +color body color167 color235 "^gpg: BAD signature from"
    +color body color167 color235 "^gpg: Note: This key has expired!"
    +color body color214 color235 "^gpg: There is no indication that the signature belongs to the owner."
    +color body color214 color235 "^gpg: can't handle these multiple signatures"
    +color body color214 color235 "^gpg: signature verification suppressed"
    +color body color214 color235 "^gpg: invalid node with packet of type"
     
    -
    -

    Index

    -
    -
    -
    color index color021       color000 "~A"      # All messages
    -color index brightcolor006 color000 "~N"      # New messages
    -color index color020       color000 "~O"      # Old messages
    -color index color020       color000 "~Q"      # messages that have been replied to
    -color index color021       color000 "~R"      # read messages
    -color index color006       color000 "~U"      # unread messages
    -color index color021       color000 "~R~p!~F" # messages to me
    -color index brightcolor006 color000 "~N~p!~F" # new messages to me
    -color index brightcolor006 color000 "~U~p!~F" # unread messages to me
    -color index color005       color000 "~F"      # flagged messages
    -color index color005       color000 "~F~p"    # flagged messages to me
    -color index brightcolor006 color000 "~N~F"    # new flagged messages
    -color index brightcolor006 color000 "~N~F~p"  # new flagged messages to me
    -color index brightcolor006 color000 "~U~F~p"  # new flagged messages to me
    -color index brightcolor000 color001 "~D"      # deleted messages
    -
    -color index brightcolor021 color019 "~v~(!~N)"    # collapsed thread with no unread
    -color index brightcolor006 color019 "~v~(~N)"     # collapsed thread with some unread
    -color index brightcolor006 color019 "~N~v~(~N)"   # collapsed thread with unread parent
    -color index brightcolor005 color019 "~v~(~F)!~N"  # collapsed thread with flagged, no unread
    -color index brightcolor006 color019 "~v~(~F~N)"   # collapsed thread with some unread & flagged
    -color index brightcolor006 color019 "~N~v~(~F~N)" # collapsed thread with unread parent & flagged
    -color index brightcolor005 color019 "~N~v~(~F)"   # collapsed thread with unread parent, no unread inside, but some flagged
    -color index brightcolor000 color001 "~v~(~D)"     # thread with deleted (doesn't differentiate between all or partial)
    -
    -
    -
    -
    - -
    -

    Sidebar

    -
    -
    -
     color sidebar_indicator color000       color021  # Mailbox is open
    - color sidebar_highlight color000       color003  # Mailbox is highlighted
    - color sidebar_new       brightcolor006 color000  # Mailbox contains new mail
    - color sidebar_ordinary  color021       color000  # Mailbox contains new mail
    -
    -
    -
    -
    - -
    -

    Message headers

    -
    -
    -
    color hdrdefault color006       color000
    -color header     brightcolor006 color000 "^(From)"
    -color header     brightcolor004 color000 "^(Subject)"
    -
    -
    -
    -
    - -
    -

    Attachments

    -
    -
    -
    # Color if the attachment is autoviewed
    -color   attach_headers     brightgreen     default    "Autoview"
    -# Color only the brackets around the headers
    -color   attach_headers     brightyellow    default    "^\\[--"
    -color   attach_headers     brightyellow    default    "--]$"
    -# Color the mime type and the size
    -color   attach_headers     green           default    "Type: [a-z]+/[a-z0-9\-]+"
    -color   attach_headers     green           default    "Size: [0-9\.]+[KM]"
    -# Color GPGME signature checks
    -color   attach_headers     brightgreen     default    "Good signature from.*"
    -color   attach_headers     brightred       default    "Bad signature from.*"
    -color   attach_headers     brightred       default    "BAD signature from.*"
    -color   attach_headers     brightred       default    "Note: This key has expired!"
    -color   attach_headers     brightmagenta   default    "Problem signature from.*"
    -color   attach_headers     brightmagenta   default    "WARNING: This key is not certified with a trusted signature!"
    -color   attach_headers     brightmagenta   default    "         There is no indication that the signature belongs to the owner."
    -color   attach_headers     brightmagenta   default    "can't handle these multiple signatures"
    -color   attach_headers     brightmagenta   default    "signature verification suppressed"
    -color   attach_headers     brightmagenta   default    "invalid node with packet of type"
    -
    -
    -
    -
    -
    -

    Body

    -
    -
    -
    color quoted        color002       color000
    -color quoted1       color003       color000
    -color quoted2       color004       color000
    -color quoted3       color005       color000
    -color quoted4       color006       color000
    -
    -color signature     color021       color000
    -color bold          brightcolor021 color000
    -color underline     brightcolor021 color000
    -color normal        color021       color000
    -
    -
    -
    -
    - -
    -

    PGP

    -
    -
    -
    color body  color001 color000         "(BAD signature)"
    -color body  color002 color000         "(Good signature)"
    -color body  color002 color000         "^gpg: Good signature .*"
    -color body  color002 color000         "^gpg: "
    -color body  color002 color000         "^gpg: BAD signature from.*"
    -
    -
    -
    -
    - -
    -

    Urls

    -
    -
    -
    color body color006 color000         "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
    -
    -
    -
    -
    - -
    -

    Emails

    -
    -
    -
    color body color006 color000 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])"
    -
    -
    -
    -
    -
    -

    Contacts with Mu

    @@ -1508,18 +1394,19 @@ macro index,pager gm "<change-folder>+gmail/Inbox

    Gmail

    -
    -
    Configuration
    -
    +
    +
    Configuration
    +
    set from     = "dehaeze.thomas@gmail.com"
     set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail"
     
     # Other special folders.
    -set mbox      = "+gmail/Archive"
    -unset record # Don't copy send message to Sent folder: Gmail does that for us
    +set mbox      = "+gmail/Archive" # Archive Box
     set postponed = "+gmail/Drafts"
     
    +unset record # Don't copy send message to Sent folder: Gmail does that for us
    +
     set signature = "~/.config/neomutt/accounts/gmail.signature"
     
     macro index,pager d \
    @@ -1534,9 +1421,9 @@ macro index,pager D \
     
    -
    -
    Signature
    -
    +
    +
    Signature
    +
    Thomas Dehaeze
     
    @@ -1556,9 +1443,9 @@ This empty code block is used to add a new line after signature

    ESRF

    -
    -
    Configuration
    -
    +
    +
    Configuration
    +
    set from     = "thomas.dehaeze@esrf.fr"
     set sendmail = "~/.config/neomutt/bin/send_mail.sh esrf"
    @@ -1582,9 +1469,9 @@ macro index,pager D \
     
    -
    -
    Signature
    -
    +
    +
    Signature
    +
    Thomas Dehaeze
     
    @@ -1604,9 +1491,9 @@ This empty code block is used to add a new line after signature

    ULG

    -
    -
    Configuration
    -
    +
    +
    Configuration
    +
    set from     = "thomas.dehaeze@doct.uliege.be"
     set sendmail = "~/.config/neomutt/bin/send_mail.sh ulg"
    @@ -1630,9 +1517,9 @@ macro index,pager D \
     
    -
    -
    Signature
    -
    +
    +
    Signature
    +
    Thomas Dehaeze
     
    @@ -1652,9 +1539,9 @@ This empty code block is used to add a new line after signature

    ULIEGE

    -
    -
    Configuration
    -
    +
    +
    Configuration
    +
    set from     = "tdehaeze@uliege.be"
     set sendmail = "~/.config/neomutt/bin/send_mail.sh uliege"
    @@ -1678,9 +1565,9 @@ macro index,pager D \
     
    -
    -
    Signature
    -
    +
    +
    Signature
    +
    Thomas Dehaeze
     
    @@ -1822,9 +1709,9 @@ hdr_order from: to: cc: date: subject: #
    -
    -

    Sidebar

    -
    +
    +

    Sidebar

    +

    General Config

    @@ -1931,9 +1818,9 @@ named-mailboxes "  Trash" =uliege/Trash
    -
    -

    Attachments

    -
    +
    +

    Attachments

    +

    Attachment View Options

    @@ -2062,8 +1949,15 @@ application/pdf; zathura %s & audio/*; /usr/bin/xdg-open %s; copiousoutput text/html; export DISPLAY=:0 && setsid qutebrowser %s; nametemplate=%s.html text/html; lynx -width ${COLUMNS:-80} -dump %s; nametemplate=%s.html; copiousoutput; -text/calendar; khal import --batch -a home %s && khal printics %s; copiousoutput; -application/ics; khal import --batch -a home %s && khal printics %s; copiousoutput; +
    +
    + +

    +For calendar output, a personal ics-add script is used. +

    +
    +
    text/calendar; ics-add %s; copiousoutput;
    +application/ics; ics-add %s; copiousoutput;
     
    @@ -2147,7 +2041,7 @@ text/rtf; libreoffice --nologo --writer '%s'; co

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/maintenance.html b/docs/maintenance.html new file mode 100644 index 0000000..3dffbfd --- /dev/null +++ b/docs/maintenance.html @@ -0,0 +1,210 @@ + + + + + + +System maintenance + + + + + + +
    + UP + | + HOME +
    +

    System maintenance

    + +

    +https://wiki.archlinux.org/title/System_maintenance +

    + +
    +

    Update

    +
    +
    +
    +

    System packages

    +
    +

    +To check packages to update: +

    +
    +
    paru -Qu
    +
    +
    + +

    +And then to perform the update: +

    +
    +
    paru
    +
    +
    +
    +
    + +
    +

    NPM

    +
    +

    +First update npm itself +

    +
    +
    sudo npm install npm@latest -g
    +
    +
    + +

    +Then, we can list outdated packages: +

    +
    +
    npm outdated -g --depth=0
    +
    +
    + +

    +And finally perform the update: +

    +
    +
    sudo npm update -g
    +
    +
    +
    +
    + +
    +

    PIP

    +
    +

    +First upgrade pip itself: +

    +
    +
    /usr/bin/python3 -m pip install --upgrade pip
    +
    +
    + +

    +Then list outdated packages: +

    +
    +
    pip3 list --outdated
    +
    +
    + +

    +And update everything with: +

    +
    +
    pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
    +
    +
    +
    +
    + +
    +

    Emacs and Vim

    +
    +

    +Update Doom emacs with: +

    +
    +
    doom up
    +
    +
    + +

    +And Vim packages with: +

    +
    +
    nvim -c PlugUpgrade -c PlugUpdate
    +
    +
    +
    +
    +
    + +
    +

    Check problems in the system

    +
    +

    +First check for failed services: +

    +
    +
    systemctl --failed
    +
    +
    + +

    +Same for user services: +

    +
    +
    systemctl --user --failed
    +
    +
    + +

    +Look for errors in the logs: +

    +
    +
    sudo journalctl -p 3 -b
    +
    +
    +
    +
    + +
    +

    Check orphan and dropped packages

    +
    +

    +Run the following to list all orphan packages: +

    +
    +
    pacman -Qtdq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)'
    +
    +
    + +

    +Then, either remove the unused packages or set the package to “explicitly installed” with: +

    +
    +
    sudo pacman -D --asexplicit package_name
    +
    +
    + +

    +Use the ancient-packages (link) command to list dropped packages (packages may longer in the remote repositories, but still on the local system): +

    +
    +
    ancient-packages
    +
    +
    +
    +
    +
    +
    +

    Author: Dehaeze Thomas

    +

    Created: 2021-10-25 lun. 14:33

    +
    + + diff --git a/docs/matlab.html b/docs/matlab.html index 7607d4d..bb99128 100644 --- a/docs/matlab.html +++ b/docs/matlab.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Matlab Configuration - + @@ -16,11 +16,11 @@ UP | HOME -
    +

    Matlab Configuration

    -
    +

    Table of Contents

    -
    +
    • Startup
        @@ -53,10 +53,10 @@

        Setup LaTeX as a default interpreter

        -
        set(groot, 'DefaultTextInterpreter', 'LaTeX');
        -set(groot, 'DefaultAxesTickLabelInterpreter', 'LaTeX');
        -set(groot, 'DefaultAxesFontName', 'LaTeX');
        -set(groot, 'DefaultLegendInterpreter', 'LaTeX');
        +
        set(groot, 'DefaultTextInterpreter', 'LaTeX');
        +set(groot, 'DefaultAxesTickLabelInterpreter', 'LaTeX');
        +set(groot, 'DefaultAxesFontName', 'LaTeX');
        +set(groot, 'DefaultLegendInterpreter', 'LaTeX');
         
        @@ -66,8 +66,8 @@

        Default Line Width

        -
        set(groot, 'DefaultLineLineWidth', 1.5);
        -set(groot, 'DefaultAxesLineWidth', 0.5);
        +
        set(groot, 'DefaultLineLineWidth', 1.5);
        +set(groot, 'DefaultAxesLineWidth', 0.5);
         
        @@ -77,9 +77,9 @@

        Default grids on all axis

        -
        set(groot, 'DefaultAxesXGrid','on');
        -set(groot, 'DefaultAxesYGrid','on');
        -set(groot, 'DefaultAxesZGrid','on');
        +
        set(groot, 'DefaultAxesXGrid','on');
        +set(groot, 'DefaultAxesYGrid','on');
        +set(groot, 'DefaultAxesZGrid','on');
         
        @@ -89,11 +89,11 @@

        Default Font Size

        -
        set(groot, 'DefaultTextFontUnits', 'points');
        -set(groot, 'DefaultTextFontSize', 10);
        -set(groot, 'DefaultAxesFontUnits', 'points');
        -set(groot, 'DefaultAxesFontSize', 10);
        -set(groot, 'DefaultUicontrolFontSize', 10);
        +
        set(groot, 'DefaultTextFontUnits', 'points');
        +set(groot, 'DefaultTextFontSize', 10);
        +set(groot, 'DefaultAxesFontUnits', 'points');
        +set(groot, 'DefaultAxesFontSize', 10);
        +set(groot, 'DefaultUicontrolFontSize', 10);
         
        @@ -103,8 +103,8 @@

        Default Fonts

        -
        set(groot, 'DefaultAxesFontName', 'Helvetica');
        -set(groot, 'DefaultTextFontName', 'Helvetica');
        +
        set(groot, 'DefaultAxesFontName', 'Helvetica');
        +set(groot, 'DefaultTextFontName', 'Helvetica');
         
        @@ -114,7 +114,7 @@

        Make figures into a Box

        -
        set(groot, 'DefaultAxesBox', 'on');
        +
        set(groot, 'DefaultAxesBox', 'on');
         
        @@ -124,11 +124,11 @@

        Default Colors

        -
        set(groot, 'DefaultAxesColor', 'w');
        -set(groot, 'DefaultAxesXColor', 'k');
        -set(groot, 'DefaultAxesYColor', 'k');
        +
        set(groot, 'DefaultAxesColor', 'w');
        +set(groot, 'DefaultAxesXColor', 'k');
        +set(groot, 'DefaultAxesYColor', 'k');
         
        -set(groot, 'DefaultFigureColor', 'w');
        +set(groot, 'DefaultFigureColor', 'w');
         
        @@ -138,15 +138,15 @@

        Default Plot Colors

        -
        c1 = [     0    0.4470    0.7410]; % Blue
        -c2 = [0.8500    0.3250    0.0980]; % Orange
        -c3 = [0.9290    0.6940    0.1250]; % Yellow
        -c4 = [0.4940    0.1840    0.5560]; % Purple
        -c5 = [0.4660    0.6740    0.1880]; % Green
        -c6 = [0.3010    0.7450    0.9330]; % Light Blue
        -c7 = [0.6350    0.0780    0.1840]; % Red
        +
        c1 = [     0    0.4470    0.7410]; % Blue
        +c2 = [0.8500    0.3250    0.0980]; % Orange
        +c3 = [0.9290    0.6940    0.1250]; % Yellow
        +c4 = [0.4940    0.1840    0.5560]; % Purple
        +c5 = [0.4660    0.6740    0.1880]; % Green
        +c6 = [0.3010    0.7450    0.9330]; % Light Blue
        +c7 = [0.6350    0.0780    0.1840]; % Red
         
        -set(groot, 'defaultAxesColorOrder', [c1; c2; c3; c4; c5; c6; c7])
        +set(groot, 'defaultAxesColorOrder', [c1; c2; c3; c4; c5; c6; c7])
         
        @@ -156,8 +156,8 @@ c7 = [0.6350 0.0780 0.1840]; % Red

        Figure paper and window style

        -
        set(groot, 'DefaultFigurePaperType', 'A4');
        -set(groot, 'DefaultFigureWindowStyle', 'normal');
        +
        set(groot, 'DefaultFigurePaperType', 'A4');
        +set(groot, 'DefaultFigureWindowStyle', 'normal');
         
        @@ -211,6 +211,14 @@ Converts MATLAB figures to TikZ (link). +

        +
        +
        addpath([toolboxes_path 'tensorlab'])
        +
        +
        +

        MATLAB toolbox for exporting publication quality figures (link).

        @@ -255,7 +263,7 @@ Some useful function (link).

        -
        % addpath([toolboxes_path 'Hinf-Toolbox/src'])
        +
        % addpath([toolboxes_path 'Hinf-Toolbox/src'])
         
        @@ -307,7 +315,7 @@ Import a nice color scheme.

    Author: Dehaeze Thomas

    -

    Created: 2021-01-08 ven. 01:43

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/music.html b/docs/music.html index ebfc016..a8fefc1 100644 --- a/docs/music.html +++ b/docs/music.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Music/Sound Configuration @@ -57,14 +57,7 @@

    mopidy - Music Server

    -
    [spotify]
    -username = dehaeze.thomas@gmail.com
    -password = <<get-password(passname="spotify.com/dehaeze.thomas@gmail.com")>>
    -client_id = 9dd02534-f038-46d8-946e-bfe72498204e
    -client_secret = <<get-password(passname="spotify/client_secret")>>
    -bitrate = 320
    -
    -[mpd]
    +
    [mpd]
     enabled = true
     hostname = 127.0.0.1
     port = 6600
    @@ -269,7 +262,7 @@ plugins: fromfilename discogs
     

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-06-20 dim. 14:22

    diff --git a/docs/polybar.html b/docs/polybar.html index 5f961d3..6e6c4d9 100644 --- a/docs/polybar.html +++ b/docs/polybar.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Polybar Configuration @@ -16,18 +16,17 @@ UP | HOME -
    +

    Polybar Configuration

    -
    +

    Table of Contents

    -
    + @@ -160,7 +165,7 @@
    [bar/top]
     enable-ipc = true
    -override-redirect = false
    +# override-redirect = false
     bottom = false
     fixed-center = false
     
    @@ -185,11 +190,11 @@
     font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
     font-2 = Weather Icons:size=10;1
     
    -modules-left = i3 bspwm xwindow
    +modules-left = i3 xwindow
     modules-center =
    -modules-right = pulseaudio wired-network wireless-network nordvpn bluetooth redshift lockscreen dunst packages unread_news unread_mail calendar temperature battery date
    +modules-right = pulseaudio wired-network wireless-network wireguard nordvpn bluetooth redshift cursor lockscreen dunst packages unread_news unread_mail calendar temperature battery date
     
    -wm-restack = i3
    +# wm-restack = i3
     
     tray-position = right
     tray-detached = true
    @@ -264,60 +269,13 @@
     
    -
    -

    BSPWM

    -
    -
    -
    [module/bspwm]
    -type = internal/bspwm
    -
    -pin-workspaces = true
    -enable-click = true
    -enable-scroll = false
    -
    -; Use fuzzy (partial) matching on labels when assigning
    -; icons to workspaces
    -; Example: code;♚ will apply the icon to all workspaces
    -; containing 'code' in the label
    -fuzzy-match = false
    -
    -
    -ws-icon-0 = code;
    -ws-icon-1 = web;
    -ws-icon-2 = mail;
    -ws-icon-3 = misc;
    -ws-icon-4 = figs;ﬧ
    -ws-icon-default =
    -
    -label-focused = %icon%
    -label-focused-foreground = ${colors.bg}
    -label-focused-background = ${colors.aqua}
    -label-focused-underline= ${colors.aqua}
    -label-focused-padding = 1
    -
    -label-occupied = %icon%
    -label-occupied-underline = ${colors.fg}
    -label-occupied-padding = 1
    -
    -label-urgent = %icon%
    -label-urgent-background = ${colors.red}
    -label-urgent-padding = 1
    -
    -label-empty = %icon%
    -label-empty-foreground = ${colors.fg}
    -label-empty-padding = 1
    -
    -
    -
    -
    -

    Music using MPD

    [module/mpd]
     type = internal/mpd
    -format-online = <icon-prev> <toggle> <icon-next> %{A1:$TERMINAL -e "ncmpcpp" &:}<label-song>%{A}
    +format-online = <icon-prev> <toggle> <icon-next> %{A1:$TERMINAL -e ncmpcpp &:}<label-song>%{A}
     
     format-online-spacing = 0
     format-online-padding = 0
    @@ -388,7 +346,7 @@
     format-prefix-foreground = ${colors.fg}
     format-underline = ${colors.bg}
     
    -label = %{A1:$TERMINAL -e "htop" &:}﬙ %percentage:2%%%{A}
    +label = %{A1:$TERMINAL -e htop &:}﬙ %percentage:2%%%{A}
     
    @@ -403,8 +361,8 @@ interval = 1 # Open google calendar on left right -date = %{A1:$TERMINAL -e "ikhal" &:} %d-%m%{A} -date-alt = "%{A1:$TERMINAL -e \"ikhal\" &:} %d-%m-%Y%{A}" +date = %{A1:$TERMINAL --title khal -e ikhal &:} %d-%m%{A} +date-alt = "%{A1:$TERMINAL --title khal -e ikhal &:} %d-%m-%Y%{A}" time =  %H:%M time-alt =  %H:%M:%S @@ -491,10 +449,11 @@ type = internal/temperature interval = 2 thermal-zone = 0 -warn-temperature = 70 -hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input +base-temperature = 50 +warn-temperature = 80 +hwmon-path = /sys/class/thermal/thermal_zone10/temp units = false -format = %{A1:$TERMINAL --class="Floating" -e "watch sensors" &:}<ramp> <label>%{A} +format = %{A1:$TERMINAL --title="Sensors" -e watch sensors &:}<ramp> <label>%{A} format-warn = <ramp> <label-warn> label = %temperature-c%°C label-warn = %temperature-c%°C @@ -563,7 +522,7 @@ checkmail -q && \

    Open Mails

    -
    $TERMINAL -e "tmux new-session -A -s neomutt neomutt"
    +
    $TERMINAL -e tmux new-session -A -s neomutt neomutt
     
    @@ -626,7 +585,7 @@ checkmail -q && \

    Open Newsboat

    -
    $TERMINAL -e "tmux new-session -A -s newsboat newsboat"
    +
    $TERMINAL -e tmux new-session -A -s newsboat newsboat
     
    @@ -685,7 +644,7 @@ checkmail -q && \

    Open Calendar

    -
    $TERMINAL --class="Floating" -e "khal interactive"
    +
    $TERMINAL --title=khal -e ikhal
     
    @@ -799,7 +758,7 @@ paru -Sy > /dev/null 2>&

    Packages Update

    -
    $TERMINAL -e "paru"
    +
    $TERMINAL -e paru
     
    @@ -951,7 +910,7 @@ paru -Sy > /dev/null 2>&

    Run Network Manager

    -
    $TERMINAL -e 'sudo nmtui'
    +
    $TERMINAL -e sudo nmtui
     
    @@ -1205,6 +1164,54 @@ The script is accessible here.
    +
    +

    High cursor

    +
    +
    +
    [module/cursor]
    +type = custom/script
    +
    +format-underline = ${colors.bg}
    +click-left = ~/.config/polybar/scripts/cursor-toggle.sh >/dev/null 2>%1 &
    +format = <label>
    +exec = ~/.config/polybar/scripts/cursor-status.sh
    +
    +interval = 2
    +
    +
    +
    + +
    +

    Cursor - Status

    +
    +
    +
    if pgrep -x "highlight-point" >/dev/null; then
    +    echo "%{F#859900}%{F-}";
    +else
    +    echo "";
    +fi
    +
    +
    +
    +
    + +
    +

    Toggle Cursor

    +
    +
    +
    if pgrep -x "highlight-point" >/dev/null; then
    +    killall highlight-point && \
    +        dunstify --replace=46492 "Cursor" "Turned off";
    +else
    +    nohup highlight-pointer -r 10 > /dev/null 2>&1 &
    +    dunstify --replace=46492 "Cursor" "Highlight...";
    +fi
    +
    +
    +
    +
    +
    +

    Screenshot

    @@ -1220,7 +1227,7 @@ The script is accessible here.

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/qutebrowser.html b/docs/qutebrowser.html index 62253bb..b5ed4b1 100644 --- a/docs/qutebrowser.html +++ b/docs/qutebrowser.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Qutebrowser Configuration @@ -16,11 +16,11 @@ UP | HOME -
    +

    Qutebrowser Configuration

    -
    +

    Table of Contents

    -
    + @@ -305,7 +310,6 @@ c.input.insert_mode.plugins =
    c.url.searchengines = {
         'DEFAULT': 'https://www.duckduckgo.org/?q={}',
    -    'aw': 'https://wiki.archlinux.org/?search={}',
         'wi': 'https://en.wikipedia.org/wiki/Special:Search?search={}',
         'go': 'https://www.google.com/search?q={}',
         'gc': 'https://scholar.google.fr/scholar?hl=fr&as_sdt=0%2C5&q={}&btnG=',
    @@ -318,9 +322,9 @@ c.input.insert_mode.plugins = 'sm': 'https://www.openstreetmap.org/search?query={}',
         'am': 'https://www.amazon.fr/s?k={}',
         'md': 'https://fr.mathworks.com/help/search.html?qdoc={}&submitsearch=',
    -    'js': 'https://developer.mozilla.org/en-US/search?q={}',
         'tf': 'https://translate.google.com/#view=home&op=translate&sl=en&tl=fr&text={}',
         'te': 'https://translate.google.com/#view=home&op=translate&sl=fr&tl=en&text={}',
    +    'lb': 'https://www.leboncoin.fr/recherche?text={}',
     }
     
    @@ -454,7 +458,8 @@ config.bind('gs', 'open Create a Password for the current website

    -
    config.bind(',P', 'spawn --userscript ~/.config/qutebrowser/userscripts/add-passowrd.sh')
    +
    c.aliases['Password_Add'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/add-passowrd.sh'
    +config.bind(',P', 'Password_Add')
     
    @@ -462,7 +467,17 @@ Create a Password for the current website Use Pass to fill password and username (configuration is done in ~/.config/qutebrowser/password_fill_rc)

    -
    config.bind(',p', 'spawn --userscript password_fill')
    +
    c.aliases['Password_Fill'] = 'spawn --userscript password_fill'
    +config.bind(',p', 'Password_Fill')
    +
    +
    + +

    +Get Two Factor Authentication number. +

    +
    +
    c.aliases['OTP'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/get-otp.sh'
    +config.bind(',2', 'OTP')
     
    @@ -470,8 +485,11 @@ Use Pass to fill password and username (configuration is done in ~/.config Open Youtube video using mpv

    -
    config.bind(',m', 'spawn --detach mpv --force-window yes {url}')
    -config.bind(',M', 'hint links spawn --detach mpv --force-window yes {hint-url}')
    +
    c.aliases['MPV_view'] = 'spawn --detach mpv --force-window yes {url}'
    +config.bind(',m', 'MPV_view')
    +
    +c.aliases['MPV_view_hint'] = 'hint links spawn --detach mpv --force-window yes {hint-url}'
    +config.bind(';m', 'MPV_view_hint')
     
    @@ -479,17 +497,20 @@ config.bind(',M', 'hint Download Youtube video / entire playlist

    -
    config.bind(',v', 'spawn --userscript ~/.config/qutebrowser/userscripts/yt-download.sh {url}')
    -config.bind(',V', 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/yt-download.sh {hint-url}')
    +
    c.aliases['Download_Youtube'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/yt-download.sh {url}'
    +config.bind(',v', 'Download_Youtube')
    +
    +c.aliases['Download_Youtube_hint'] = 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/yt-download.sh {hint-url}'
    +config.bind(';v', 'Download_Youtube_hint')
     

    -Add page to Bookmarks using buku +Add page to Bookmarks using linkding

    -
    config.bind(',b', 'spawn --userscript ~/.config/qutebrowser/userscripts/buku-add.sh')
    -config.bind(',B', 'spawn --userscript ~/.config/qutebrowser/userscripts/buku-rofi.sh')
    +
    c.aliases['Bookmark_Add'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/linkding-add.sh'
    +config.bind(',b', 'Bookmark_Add')
     
    @@ -497,16 +518,29 @@ config.bind(',B', 'spaw Download with aria2c

    -
    config.bind(',d', 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/aria2c-add.sh {hint-url}')
    -config.bind(',D', 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/aria2c-add-homelab.sh {hint-url}')
    +
    c.aliases['Download_Local'] = 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/aria2c-add.sh {hint-url}'
    +config.bind(',d', 'Download_Local')
    +
    +c.aliases['Download_Homelab'] = 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/aria2c-add-homelab.sh {hint-url}'
    +config.bind(',D', 'Download_Homelab')
     

    -Open bookmark using buku +Open bookmark using linkding

    -
    config.bind(',o', 'spawn ~/.local/bin/bukurun')
    +
    c.aliases['Open_Bookmark'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/linkding-open.sh'
    +config.bind(',o', 'Open_Bookmark')
    +
    +
    + +

    +Open with linkhandler +

    +
    +
    c.aliases['Open_Default'] = 'hint links spawn --detach linkhandler {hint-url}'
    +config.bind(',O', 'Open_Default')
     
    @@ -514,8 +548,11 @@ Open bookmark using buku Org Capture

    -
    config.bind(',r', 'spawn --userscript ~/.config/qutebrowser/userscripts/org-capture.sh')
    -config.bind(',R', 'hint links userscript ~/.config/qutebrowser/userscripts/org-capture.sh')
    +
    c.aliases['Org_Capture'] = 'spawn --userscript ~/.config/qutebrowser/userscripts/org-capture.sh'
    +config.bind(',r', 'Org_Capture')
    +
    +c.aliases['Org_Capture_hint'] = 'hint links userscript ~/.config/qutebrowser/userscripts/org-capture.sh'
    +config.bind(';R', 'Org_Capture_hint')
     
    @@ -523,8 +560,11 @@ config.bind(',R', 'hint Screenshot of webpage to png

    -
    config.bind(',s', 'spawn --userscript ~/.config/qutebrowser/userscripts/html-to-pdf.sh')
    -config.bind(',S', 'spawn --userscript ~/.config/qutebrowser/userscripts/html-to-png.sh')
    +
    c.aliases['Save_PDF'] = 'spawn --userscript html-to-pdf.sh'
    +config.bind(',s', 'Save_PDF')
    +
    +c.aliases['Save_PNG'] = 'spawn --userscript html-to-png.sh'
    +config.bind(',S', 'Save_PNG')
     
    @@ -532,7 +572,8 @@ config.bind(',S', 'spaw Download AES video

    -
    config.bind(',E', 'spawn --userscript ~/.config/qutebrowser/userscripts/aes-download.sh')
    +
    c.aliases['Download_AES'] = 'spawn --userscript aes-download.sh'
    +config.bind(',E', 'Download_AES')
     
    @@ -540,15 +581,8 @@ Download AES video Download a torrent

    -
    config.bind(',t', 'hint links spawn torrent-add {hint-url}')
    -
    -
    - -

    -Annotate with Hypothesis -

    -
    -
    config.bind(',a', "jseval javascript:(function(){window.hypothesisConfig=function(){return{showHighlights:true,appType:'bookmarklet'};};var d=document,s=d.createElement('script');s.setAttribute('src','https://hypothes.is/embed.js');d.body.appendChild(s)})();")
    +
    c.aliases['Download_Torrent_Homelab'] = 'hint links spawn torrent-add {hint-url}'
    +config.bind(',t', 'Download_Torrent_Homelab')
     
    @@ -556,7 +590,8 @@ Annotate with Hypothesis See Amazon price history using CamelCamelCamel

    -
    config.bind(',A', "open -t https://fr.camelcamelcamel.com/search?sq={url}")
    +
    c.aliases['CamelCamelCamel'] = 'open -t https://fr.camelcamelcamel.com/search?sq={url}'
    +config.bind(',A', 'CamelCamelCamel')
     
    @@ -564,12 +599,17 @@ See Amazon price history using CamelCamelCamel Org Roam Entry for the current page

    -
    config.bind(',R', "open javascript:void(location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title))")
    +
    c.aliases['Org_Roam_Save'] = "open javascript:void(location.href='org-protocol://roam-ref?template=r&ref='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title))"
    +config.bind(',R', 'Org_Roam_Save')
     
    +

    +Display Current URL as a QRcode (useful to open in on a phone). +

    -
    config.bind(',Z', "open -w https://bm.tdehaeze.xyz/bookmarks/new?url={url}&auto_close")
    +
    c.aliases['QRcode'] = "spawn --userscript ~/.config/qutebrowser/userscripts/url-to-qrcode.sh {url}"
    +config.bind(',q', 'QRcode')
     
    @@ -578,6 +618,9 @@ Org Roam Entry for the current page

    Userscripts

    +

    +Here is the documentation related to userscripts. +

    @@ -826,6 +869,52 @@ Send to Emacs
    +
    +

    Open Bookmark with Linkding

    +
    +
    +
    # Verify that environment variable are set
    +if [[ -z "${LINKDING_URL}" ]]; then
    +    LINKDING_URL=$(pass nas/linkding_url)
    +fi
    +
    +if [[ -z "${LINKDING_TOKEN}" ]]; then
    +    LINKDING_TOKEN=$(pass nas/linkding_token)
    +fi
    +
    +curl -H "Authorization: Token ${LINKDING_TOKEN}" ${LINKDING_URL}/api/bookmarks/ | jq '.results[] | "\(.title) - \(.url) - [#\((.tag_names | join(", #")))]"' -r | rofi -dmenu -no-custom | grep -Eo 'https?://[^ ]+' | head -1 | xargs -I {} echo "open -t {}" >> "$QUTE_FIFO"
    +
    +
    +
    +
    + +
    +

    Add Url to Linkding

    +
    +
    +
    # Verify that environment variable are set
    +if [[ -z "${LINKDING_URL}" ]]; then
    +    LINKDING_URL=$(pass nas/linkding_url)
    +fi
    +
    +if [[ -z "${LINKDING_TOKEN}" ]]; then
    +    LINKDING_TOKEN=$(pass nas/linkding_token)
    +fi
    +
    +title=$(echo "$QUTE_TITLE" | rofi -p "Title" -dmenu -lines 1)
    +existing_tags=$(curl -H "Authorization: Token ${LINKDING_TOKEN}" ${LINKDING_URL}/api/tags/ | jq '.results[].name' -r | rofi -multi-select -p "Existing tags" -dmenu)
    +new_tags=$(rofi -p "New tags" -dmenu)
    +
    +formated_tags=$(echo $existing_tags $new_tags | sed -E 's/(\w+)/"\1"/g;s/\s/,/g')
    +
    +curl -H "Authorization: Token ${LINKDING_TOKEN}" -H "Content-Type: application/json" -d "{\"url\": \"$QUTE_URL\", \"title\": \"$title\", \"tag_names\": [$formated_tags]}" ${LINKDING_URL}/api/bookmarks/ && \
    +    dunstify "Linkding" " Bookmark Added" || \
    +    dunstify --urgency=critical "Linkding" "Failed"
    +
    +
    +
    +
    +

    Add Url to Buku using Rofi

    @@ -876,9 +965,9 @@ buku --add "
    -
    -

    Screenshot

    -
    +
    +

    Save to PNG

    +
    filename=$(rofi -p "filename" -dmenu -lines 1)
     
    @@ -908,6 +997,21 @@ buku --add "
     
    +
    +

    Get OTP number

    +
    +
    +
    passname=$(ls ~/.password-store/totp-* | xargs -n 1 basename | sed -e 's/\..*$//' | rofi -p "TOPT" -dmenu)
    +
    +if [ -n "$passname" ]; then
    +    pass otp $passname | xsel -ib && \
    +        dunstify 'OTP' 'copied to clipboard.' &
    +fi
    +
    +
    +
    +
    +

    Download AES video

    @@ -926,11 +1030,21 @@ buku --add "
    + +
    +

    Display URL as a QRcode

    +
    +
    +
    qrencode -o /tmp/qrcode.png "$1" && sxiv /tmp/qrcode.png
    +
    +
    +
    +

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/ranger.html b/docs/ranger.html index 83c48d6..c033f77 100644 --- a/docs/ranger.html +++ b/docs/ranger.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ranger - + @@ -32,13 +32,14 @@
  • Define keys for the browser
  • -
  • Rifle
  • +
  • Rifle + +
  • Ranger Commands
    • Import
    • @@ -277,7 +291,7 @@ alias travel scout -aefiklst

      Some Custom Keybindings

      -Extract +Extract:

      map ,x shell ~/.config/ranger/scripts/extract.sh %f
      @@ -285,7 +299,7 @@ Extract
       

      -Compress +Compress:

      map ,z shell ~/.config/ranger/scripts/compress.sh %f
      @@ -293,7 +307,7 @@ Compress
       

      -Get Bibtex from PDF +Get Bibtex from PDF:

      map ,b shell pdf2bib %f
      @@ -301,15 +315,7 @@ Get Bibtex from PDF
       

      -Delete first page of pdf -

      -
      -
      map ,d shell pdf-delete-first-page %f
      -
      -
      - -

      -Convert images/pdf/… +Convert images/pdf/…:

      map ,c shell convert-file %f
      @@ -317,15 +323,7 @@ Convert images/pdf/…
       

      -Magit Status -

      -
      -
      map ,gs shell emacsclient -create-frame --alternate-editor="" -n --eval '(magit-status)'
      -
      -
      - -

      -Open SXIV on current directory +Open SXIV on current directory:

      map ,s shell nohup sxiv -t %d &
      @@ -333,16 +331,15 @@ Open SXIV on current directory
       

      -Upload with 0x0 / self hosted Tansfer.sh +Upload to https://0x0.st/:

      map ,t shell upload %f
      -map ,T shell share %f
       

      -Open current folder with PCManFM +Open current folder with PCManFM:

      map ,o shell nohup pcmanfm %d &
      @@ -350,15 +347,7 @@ Open current folder with PCManFM
       

      -Open with Emacs -

      -
      -
      map ,e shell emacsclient -create-frame --alternate-editor="" -n %f
      -
      -
      - -

      -Print on Rnice +Print on Rnice:

      map ,p shell print-rnice %f &
      @@ -366,12 +355,17 @@ Print on Rnice
       

      -Backup to NAS +Backup to NAS:

      map ,B shell ~/.config/ranger/scripts/backup-to-nas.sh %s &
       
      + +
      +
      map ,y shell ~/.config/ranger/scripts/copy-content.sh %s &
      +
      +
  • @@ -408,6 +402,16 @@ Backup to NAS
    +
    +

    Copy File Content

    +
    +
    +
    xclip -sel c < $1 && dunstify "Ranger" "Copied to clipboard"
    +
    +
    +
    +
    +

    Backup to NAS

    @@ -417,9 +421,9 @@ Backup to NAS
    if [ $TMUX ]; then
    -    tmux split -v -l 2 rsync -a --inplace --info=progress2 --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/ && tmux select-pane -U
    +    tmux split -v -l 2 rsync -a --inplace --info=progress2 --rsh='ssh ' "$@" homelab:/srv/storage/Backups/ && tmux select-pane -U
     else
    -    rsync -a --info=progress2 --inplace --rsh='ssh -p10022' "$@" nas:/volume1/Data/Downloads/Backup/
    +    rsync -a --info=progress2 --inplace --rsh='ssh' "$@" homelab:/srv/storage/Backups/
     fi
     
    @@ -451,9 +455,9 @@ Backup to NAS

    Define keys for the browser

    -
    -

    Basic

    -
    +
    +

    Basic

    +
    map Q quit!
     map q eval fm.execute_console("shell tmux detach") if 'TMUX' in os.environ.keys() else fm.execute_console("quit")
    @@ -584,7 +588,7 @@ map [     move_parent -1
     map gb cd ~/Cloud/brain
     map gm cd ~/Cloud/thesis
     map gp cd ~/Pictures
    -map gP cd ~/Cloud/personal
    +map gP cd ~/Cloud/pictures/phone
     map gT cd ~/.local/share/Trash/files
     map gd cd ~/Downloads
     map gc cd ~/Cloud
    @@ -766,14 +770,17 @@ map '<any>  enter_bookmark %any
     

    Define keys for the console

    -
    -

    Basic

    -
    +
    +

    Basic

    +
    cmap <tab>   eval fm.ui.console.tab()
     cmap <s-tab> eval fm.ui.console.tab(-1)
    +
     cmap <ESC>   eval fm.ui.console.close()
    +
     cmap <CR>    eval fm.ui.console.execute()
    +
     cmap <C-l>   redraw_window
     
     copycmap <ESC> <C-c>
    @@ -791,8 +798,6 @@ copycmap <CR>  <C-j>
     cmap <down>  eval fm.ui.console.history_move(1)
     cmap <left>  eval fm.ui.console.move(left=1)
     cmap <right> eval fm.ui.console.move(right=1)
    -cmap <home>  eval fm.ui.console.move(right=0, absolute=True)
    -cmap <end>   eval fm.ui.console.move(right=-1, absolute=True)
     
    @@ -815,9 +820,14 @@ copycmap <end> <C-e>
    -
    -

    Rifle

    -
    +
    +

    Rifle

    +
    +
    + +
    +

    Documentation

    +
    # This is the configuration file of "rifle", ranger's file executor/opener.
     # Each line consists of conditions and a command.  For each line the conditions
    @@ -866,165 +876,206 @@ copycmap <end>       <C-e>
     # implementation may differ.
     # Note: When using rifle in ranger, there is an additional flag "c" for
     # only running the current file even if you have marked multiple files.
    +
    +
    +
    +
    -#------------------------------------------- -# Websites -#------------------------------------------- -# Rarely installed browsers get higher priority; It is assumed that if you -# install a rare browser, you probably use it. Firefox/konqueror/w3m on the -# other hand are often only installed as fallback browsers. - -ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@" -ext x?html?, has firefox, X, flag f = firefox -- "$@" -ext x?html?, has elinks, terminal = elinks "$@" -ext x?html?, has links2, terminal = links2 "$@" -ext x?html?, has links, terminal = links "$@" -ext x?html?, has lynx, terminal = lynx -- "$@" -ext x?html?, has w3m, terminal = w3m "$@" - -#Spreadsheets for scim -ext sc|csv|sxc|xlsx?|xlt|xlw|gnm|gnumeric, = sc-im -- "$@" - -#------------------------------------------- -# Misc -#------------------------------------------- -ext org = emacsclient -c "$1" - -# Define the "editor" for text files as first action -mime ^text, label editor = $EDITOR -- "$@" +
    +

    Text Files

    +
    +

    +Define the $EDITOR for text files as first action: +

    +
    +
    mime ^text,  label editor = $EDITOR -- "$@"
     mime ^text,  label pager  = "$PAGER" -- "$@"
    -!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
    +
    +
    + +

    +Favorite editors: +

    +
    +
    mime ^text, has nvim,           flag f = nvim "$@"
    +mime ^text, has emacsclient, X, flag f = emacsclient -c "$@"
    +
    +
    + +

    +Org mode files +

    +
    +
    ext org, has emacsclient, X, flag f = emacsclient -c "$@"
    +
    +
    + +
    +
    !mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
     !mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
    -
    -ext 1                         = man "$1"
    -ext s[wmf]c, has zsnes, X     = zsnes "$1"
    -ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
    -ext nes, has fceux, X         = fceux "$1"
    -ext exe                       = wine "$1"
    -name ^[mM]akefile$            = make
    -
    -#--------------------------------------------
    -# Code
    -#-------------------------------------------
     ext py  = python -- "$1"
     ext pl  = perl -- "$1"
     ext rb  = ruby -- "$1"
     ext js  = node -- "$1"
     ext sh  = sh -- "$1"
     ext php = php -- "$1"
    +
    +
    +
    +
    -#-------------------------------------------- -# Video/Audio with a GUI -#------------------------------------------- -mime ^video, has mpv, X, flag f = mpv -- "$@" -mime ^video, has mpv, X, flag f = mpv --fs -- "$@" -mime ^video, has mpv, X, flag f = mpv --loop -- "$@" +
    +

    PDF, Epub and jdvu

    +
    +
    +
    ext pdf, has zathura, X, flag f = zathura -- "$@"
    +ext pdf, has mupdf,   X, flag f = mupdf "$@"
    +ext pdf,              X, flag f = "$BROWSER" "$@"
    +
    +
    -#-------------------------------------------- -# Audio without X -#------------------------------------------- -mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@" -mime ^audio|ogg$ = tag "$@" -mime ^audio|ogg$, terminal, has mpv = mpv -- "$@" +
    +
    ext epub, has zathura, X, flag f = zathura -- "$@"
    +ext epub, has mupdf,   X, flag f = mupdf "$@"
    +
    +
    -#-------------------------------------------- -# Video without X: -#------------------------------------------- -mime ^video, terminal, !X, has mpv = mpv -- "$@" -mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@" -mime ^video, terminal, !X, has mplayer = mplayer -- "$@" +
    +
    ext djvu, has zathura, X, flag f = zathura -- "$@"
    +ext djvu, has evince,  X, flag f = evince -- "$@"
    +ext djvu, has atril,   X, flag f = atril -- "$@"
    +
    +
    +
    +
    -#------------------------------------------- -# Documents -#------------------------------------------- -ext pdf, has zathura, X, flag f = zathura -- "$@" -ext pdf, has llpp, X, flag f = llpp "$@" -ext pdf, has mupdf, X, flag f = mupdf "$@" -ext pdf, has mupdf, X, flag f = mupdf -I "$@" -ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@" -ext pdf, has apvlv, X, flag f = apvlv -- "$@" -ext pdf, has xpdf, X, flag f = xpdf -- "$@" -ext pdf, has evince, X, flag f = evince -- "$@" -ext pdf, has atril, X, flag f = atril -- "$@" -ext pdf, has okular, X, flag f = okular -- "$@" -ext pdf, has epdfview, X, flag f = epdfview -- "$@" -ext pdf, has qpdfview, X, flag f = qpdfview "$@" +
    +

    Archives

    +
    +
    +
    ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,  has atool   = atool -- "$@" | "$PAGER"
    +ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool   = atool -- "$@" | "$PAGER"
     
    -ext epub, has zathura,  X, flag f = zathura -- "$@"
    -ext epub, has mupdf, X, flag f = mupdf "$@"
    -
    -
    -ext docx?, has wps, X, flag f = wps "$@"
    -ext docx?, has onlyoffice, X, flag f = onlyoffice "$@"
    -
    -ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has wpp,         X, flag f = wpp "$@"
    -ext                        sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric,    X, flag f = gnumeric -- "$@"
    -ext                        sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread,     X, flag f = kspread -- "$@"
    -ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
    -ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice,     X, flag f = soffice "$@"
    -ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice,     X, flag f = ooffice "$@"
    -
    -ext djvu, has zathura,X, flag f = zathura -- "$@"
    -ext djvu, has evince, X, flag f = evince -- "$@"
    -ext djvu, has atril,  X, flag f = atril -- "$@"
    -
    -#-------------------------------------------
    -# Image Viewing:
    -#-------------------------------------------
    -mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
    -mime ^image/svg, has display,  X, flag f = display -- "$@"
    -mime ^image/gif, has mpv, X, flag f = mpv --loop -- "$@"
    -mime ^image/gif, has viewnior, X, flag f = viewnior -- "$@"
    -mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
    -
    -ext xcf,                    X, flag f = gimp -- "$@"
    -mime ^image, has sxiv,      X, flag f = sxiv -- "$@"
    -mime ^image, has feh,       X, flag f = feh --scale-down --auto-zoom --image-bg black -- "$@"
    -mime ^image, has feh,       X, flag f = feh --scale-down --auto-zoom -- "$@"
    -mime ^image, has mirage,    X, flag f = mirage -- "$@"
    -mime ^image, has ristretto, X, flag f = ristretto "$@"
    -mime ^image, has eog,       X, flag f = eog -- "$@"
    -mime ^image, has eom,       X, flag f = eom -- "$@"
    -mime ^image, has gimp,      X, flag f = gimp -- "$@"
    -mime ^image, has pinta,     X, flag f = pinta -- "$@"
    -mime ^image, has mypaint,     X, flag f = mypaint -- "$@"
    -mime ^image, has kolourpaint,     X, flag f = kolourpaint -- "$@"
    -
    -#-------------------------------------------
    -# Archives
    -#-------------------------------------------
    -# This requires atool
    -ext jar = java -jar "$@"
    -
    -ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,  has als     = als -- "$@" | "$PAGER"
    -ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has als     = als -- "$@" | "$PAGER"
     ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz,  has aunpack = aunpack -- "$@"
     ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@"
     
    -# Fallback:
     ext tar|gz, has tar = tar vvtf "$@" | "$PAGER"
     ext tar|gz, has tar = tar vvxf "$@"
    +
    +
    +
    +
    -#------------------------------------------- -# Misc -#------------------------------------------- -label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1" -label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1" -label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1" -label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1" +
    +

    Websites

    +
    +
    +
    ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
    +ext x?html?, has firefox,     X, flag f = firefox -- "$@"
    +ext x?html?, has elinks,       terminal = elinks "$@"
    +ext x?html?, has w3m,          terminal = w3m "$@"
    +
    +
    +
    +
    -# Define the editor for non-text files + pager as last action +
    +

    Word, Excel and Presentation files

    +
    +
    +
    ext docx?, has onlyoffice,  X, flag f = onlyoffice "$@"
    +ext docx?, has wps,         X, flag f = wps "$@"
    +ext docx?, has libreoffice, X, flag f = libreoffice "$@"
    +
    +
    + +
    +
    ext pptx?, has onlyoffice,  X, flag f = onlyoffice "$@"
    +ext pptx?, has wps,         X, flag f = wps "$@"
    +ext pptx?, has libreoffice, X, flag f = libreoffice "$@"
    +
    +
    + +
    +
    ext csv|xlsx?, has sc-im                  = sc-im -- "$@"
    +ext csv|xlsx?, has onlyoffice,  X, flag f = onlyoffice "$@"
    +ext csv|xlsx?, has wps,         X, flag f = wps "$@"
    +ext csv|xlsx?, has libreoffice, X, flag f = libreoffice "$@"
    +
    +
    +
    +
    + +
    +

    Images

    +
    +
    +
    mime ^image/svg, has inkview,  X, flag f = inkview -- "$@"
    +mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
    +mime ^image/svg, has display,  X, flag f = display -- "$@"
    +
    +
    + +
    +
    mime ^image/gif, has mpv,         X, flag f = mpv --loop -- "$@"
    +mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
    +
    +
    + +
    +
    mime ^image, has sxiv, X, flag f = sxiv -- "$@"
    +mime ^image, has feh,  X, flag f = feh --scale-down --auto-zoom -- "$@"
    +
    +
    +
    +
    + +
    +

    Audio

    +
    +
    +
    mime ^audio|ogg$, terminal,  has mpv = mpv --no-audio-display -- "$@"
    +mime ^audio|ogg$, X, flag f, has vlc = vlc -- "$@"
    +
    +
    +
    +
    + +
    +

    Video

    +
    +
    +
    mime ^video, has mpv, X, flag f = mpv -- "$@"
    +mime ^video, has vlc, X, flag f = vlc -- "$@"
    +
    +
    +
    +
    + +
    +

    Misc

    +
    +
    +
    ext 1                         = man "$1"
    +ext s[wmf]c, has zsnes, X     = zsnes "$1"
    +ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
    +ext nes, has fceux, X         = fceux "$1"
    +ext exe                       = wine "$1"
    +name ^[mM]akefile$            = make
    +
    +
    + +
    +
    # Define the editor for non-text files + pager as last action
                   !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = ask
     label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = $EDITOR -- "$@"
     label pager,  !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = "$PAGER" -- "$@"
    -
    -ext blend, has blender, X, flag f =  blender -- "$@"
    -
     has dragon-drag-and-drop, X, flag f = dragon-drag-and-drop -a -x "$@"
     
    +

    Ranger Commands

    @@ -1083,7 +1134,7 @@ label wallpaper, number 14, mi

    Author: Dehaeze Thomas

    -

    Created: 2021-02-10 mer. 17:57

    +

    Created: 2021-06-20 dim. 14:21

    diff --git a/docs/router.html b/docs/router.html new file mode 100644 index 0000000..a7a6e18 --- /dev/null +++ b/docs/router.html @@ -0,0 +1,147 @@ + + + + + + +Open-WRT Router (Netgear R7000) + + + + + + +
    + UP + | + HOME +
    +

    Open-WRT Router (Netgear R7000)

    + + +
    +

    Installation

    +
    +
    + + +
    +

    Enable SSL

    +
    +

    +How can I enable SSL for the web admin gui? +In an SSH-command line, run opkg update, then install the package opkg install luci-ssl, then restart the router. Then you can access https://192.168.1.1 or https://openwrt with your favorite web browser +

    +
    +
    + +
    +

    Install useful packages

    +
    +
    +
    opkg update && opkg install luci-ssl-openssl luci-theme-material ipset curl diffutils speedtest-netperf kmod-ipt-nat6
    +
    +
    +
    +
    +
    + +
    +

    Update

    +
    +
    +
    opkg list-upgradable | cut -f 1 -d ' ' | xargs -r opkg upgrade
    +
    +
    +
    +
    + +
    +

    Configuration

    +
    +

    +https://openwrt.org/docs/guide-user/base-system/uci#common_principles +

    + +

    +Configuration files are in /etc/config. +

    + +
    + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FileDescription
    /etc/config/dhcpDnsmasq and odhcpd settings: DNS, DHCP, DHCPv6
    /etc/config/dropbearSSH server options
    /etc/config/firewallNAT, packet filter, port forwarding, etc.
    /etc/config/networkSwitch, interface and route configuration:
    /etc/config/systemMisc. system settings, NTP, RNG, Watchcat
    /etc/config/wirelessWireless settings and wifi network definition
    +
    +
    +
    +
    +

    Author: Dehaeze Thomas

    +

    Created: 2021-10-25 lun. 14:33

    +
    + + diff --git a/docs/sxhkd.html b/docs/sxhkd.html index da584cb..c10a5c5 100644 --- a/docs/sxhkd.html +++ b/docs/sxhkd.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Simple X Hotkey Daemon @@ -39,20 +39,20 @@
  • I3 related
  • @@ -232,7 +232,7 @@ super + Return # File Manager super + o - $TERMINAL -e "tmux new-session -A -s ranger ranger" + $TERMINAL -e tmux new-session -A -s ranger ranger # Browser super + i @@ -240,7 +240,7 @@ super + i # Mails with neomutt super + m - $TERMINAL -e "tmux new-session -A -s neomutt neomutt" + $TERMINAL -e tmux new-session -A -s neomutt neomutt # Emacs Client super + e @@ -256,7 +256,7 @@ super + e
    # Network Manager
     super + shift + w
    -  $TERMINAL -e 'sudo nmtui'
    +  $TERMINAL --title nmtui -e sudo nmtui
     
     # Bluetooth Manager
     super + shift + b
    @@ -269,11 +269,8 @@ super + shift + c
     # Sound Manager
     super + shift + s
       pavucontrol
    -
    -
    -
    -
    # Bookmarks
    +# Bookmarks
     super + shift + f
       bukurun
     
    @@ -291,11 +288,7 @@ super + shift + p
     
    # Command line Calendar Client (khal)
     super + space ; c
    -  $TERMINAL -e "khal interactive"
    -
    -# GUI Calendar (Google Calendar)
    -super + space ; shift + c
    -  $BROWSER https://calendar.google.com/
    +  $TERMINAL --title khal -e ikhal
     
     # pcmanfm: GUI file manager
     super + space ; o
    @@ -303,27 +296,19 @@ super + space ; o
     
     # Download with Aria2c
     super + space ; d
    -  $TERMINAL -e "tmux new-session -A -s aria2p aria2p --port 6800 --host http://dl.tdehaeze.xyz --secret $(pass dl.tdehaeze.xyz/tdehaeze | sed -n 1p)"
    +  $TERMINAL -e tmux new-session -A -s aria2p aria2p --port 6800 --host http://dl.tdehaeze.xyz --secret $(pass dl.tdehaeze.xyz/tdehaeze | sed -n 1p)
     
     # Run another instance of Neomutt in read-only mode
     super + space ; m
    -  $TERMINAL -e "neomutt -R"
    -
    -# Weechat
    -super + space ; w
    -  $TERMINAL -e "tmux new-session -A -s weechat weechat"
    +  $TERMINAL -e neomutt -R
     
     # News with newsboat
     super + space ; n
    -  $TERMINAL -e "tmux new-session -A -s newsboat newsboat"
    +  $TERMINAL -e tmux new-session -A -s newsboat newsboat
     
     # Music with ncmpcpp
     super + space ; p
    -  $TERMINAL -e "tmux new-session -A -s ncmpcpp ncmpcpp"
    -
    -# Print Screen
    -super + space ; shift + p
    -  $HOME/.local/bin/mopidy-restart
    +  $TERMINAL -e tmux new-session -A -s ncmpcpp ncmpcpp
     
     # Default Browser
     super + space ; i
    @@ -331,7 +316,7 @@ super + space ; i
     
     # Start Torrent Managaer
     super + space ; t
    -  $TERMINAL -e "tremc"
    +  $TERMINAL -e tremc
     
     # Emacs
     super + space ; e
    @@ -382,9 +367,9 @@ super + c
     
    -
    -

    Set the window State

    -
    +
    +

    Set the window State

    +
    # Set the window state to tiled
     super + t
    @@ -458,9 +443,9 @@ super + shift + {1-9}
     
    -
    -

    Preselect

    -
    +
    +

    Preselect

    +
    # preselect the direction
     super + ctrl + {h,j,k,l}
    @@ -478,9 +463,9 @@ bspc node -p cancel
     
    -
    -

    Resize

    -
    +
    +

    Resize

    +
    # expand a window by moving one of its side outward
     super + alt + {h,j,k,l}
    @@ -519,9 +504,9 @@ super + q
     
    -
    -

    Set the window State

    -
    +
    +

    Set the window State

    +
    # Set the window to full-screen
     super + f
    @@ -588,9 +573,9 @@ super + shift + {1-9}
     
    -
    -

    Preselect

    -
    +
    +

    Preselect

    +

    Preselect the direction

    @@ -607,9 +592,9 @@ super + ctrl + {j,k,Up,Down}
    -
    -

    Resize

    -
    +
    +

    Resize

    +

    Expand/Shrink a window

    @@ -634,7 +619,7 @@ super + alt + l

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-06-20 dim. 14:21

    diff --git a/docs/systemd.html b/docs/systemd.html index a703b0b..8ef9bb3 100644 --- a/docs/systemd.html +++ b/docs/systemd.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + -<code>systemd</code> services and timers - +=systemd= services and timers + @@ -24,50 +24,56 @@ @@ -81,9 +87,9 @@

    bukugit - Automatic commit and push new bookmarks

    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Sync Bookmarks every day
    @@ -98,9 +104,9 @@
     
    -
    -

    Timer

    -
    +
    +

    Timer

    +
    [Unit]
     Description=Sync All Mails every x hours
    @@ -121,9 +127,9 @@
     
    -
    -

    Script

    -
    +
    +

    Script

    +
    cd ~/.local/share/buku/
     
    @@ -150,9 +156,9 @@
     

    braingit - Automatic commit and push new brain pages

    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Sync Brain Website everyday
    @@ -167,9 +173,9 @@
     
    -
    -

    Timer

    -
    +
    +

    Timer

    +
    [Unit]
     Description=Sync Brain Website everyday
    @@ -190,9 +196,9 @@
     
    -
    -

    Script

    -
    +
    +

    Script

    +
    cd ~/Cloud/brain-website/
     
    @@ -212,9 +218,9 @@
     

    checkmail - Check new mails

    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Check new mails
    @@ -229,9 +235,9 @@
     
    -
    -

    Timer

    -
    +
    +

    Timer

    +
    [Unit]
     Description=Check Mail every x minutes
    @@ -255,9 +261,9 @@
     
    -
    -

    Script

    -
    +
    +

    Script

    +
    while [ -n "$1" ]; do # while loop starts
         case "$1" in
    @@ -322,9 +328,9 @@ mbsync $opt_all $syncmail - Synchronize all mails
     
    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Sync all mails
    @@ -339,9 +345,9 @@ mbsync $opt_all $
    -

    Timer

    -
    +
    +

    Timer

    +
    [Unit]
     Description=Sync All Mails every x hours
    @@ -370,9 +376,9 @@ mbsync $opt_all $vdirsyncer - Synchronize calendar and contacts
     
    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Synchronize calendars and contacts
    @@ -381,16 +387,16 @@ mbsync $opt_all $After=network-online.target
     
     [Service]
    -ExecStart=/usr/bin/vdirsyncer --verbosity "ERROR" sync
    +ExecStart=/home/thomas/.local/bin/vdirsyncer --verbosity "ERROR" sync
     Type=oneshot
     
    -
    -

    Timer

    -
    +
    +

    Timer

    +
    [Unit]
     Description=Synchronize vdirs
    @@ -412,9 +418,9 @@ mbsync $opt_all $ssh-agent - SSH Agent
     
    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=SSH key agent
    @@ -436,9 +442,9 @@ mbsync $opt_all $powertop - Powertop
     
    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Powertop tunings
    @@ -460,9 +466,9 @@ mbsync $opt_all $emacs - Emacs
     
    -
    -

    Service

    -
    +
    +

    Service

    +
    [Unit]
     Description=Emacs text editor
    @@ -482,10 +488,50 @@ mbsync $opt_all $
    +

    trash-empty - Empty the trash for files older than 30 days

    +
    +
    +
    +

    Service

    +
    +
    +
    [Unit]
    +Description=Empty the trash for files older than 30 days
    +Documentation=https://github.com/andreafrancia/trash-cli
    +
    +[Service]
    +ExecStart=/home/thomas/.local/bin/trash-empty 30
    +Type=oneshot
    +
    +
    +
    +
    + +
    +

    Timer

    +
    +
    +
    [Unit]
    +Description=Empty trash
    +
    +[Timer]
    +OnCalendar=*-*-* 16:00:00
    +Persistent=true
    +Unit=trash-empty
    +
    +[Install]
    +WantedBy=timers.target
    +
    +
    +
    +
    +

    Author: Dehaeze Thomas

    -

    Created: 2021-01-08 ven. 01:43

    +

    Created: 2021-06-20 dim. 14:22

    diff --git a/docs/video.html b/docs/video.html index 57dc676..2d4c229 100644 --- a/docs/video.html +++ b/docs/video.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + MPV Configuration - + @@ -16,11 +16,11 @@ UP | HOME -
    +

    MPV Configuration

    -
    +

    Table of Contents

    -
    +
    @@ -267,7 +269,7 @@ Z add sub-delay +0.1 #

    Author: Dehaeze Thomas

    -

    Created: 2021-01-08 ven. 01:43

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/vim.html b/docs/vim.html index e148609..93a1ca7 100644 --- a/docs/vim.html +++ b/docs/vim.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Vim Config @@ -16,11 +16,11 @@ UP | HOME -
    +

    Vim Config

    -
    +

    Table of Contents

    - -
    -

    LaTeX

    -
    +
    +

    LaTeX

    +
    Plug 'lervag/vimtex', { 'for': 'tex' } " A modern vim plugin for editing LaTeX files.
     
    @@ -351,9 +351,9 @@ Plug 'nelstrom/vim-markdown-folding'
    -
    -

    Matlab

    -
    +
    +

    Matlab

    +
    Plug 'tdehaeze/matlab-vim', { 'for': 'matlab' }     " Edit Matlab M-files in Vim editor
     Plug 'djoshea/vim-matlab-fold', { 'for': 'matlab' } " Vim code folding for Matlab files
    @@ -866,7 +866,7 @@ Taken from: 
     
    " Go back to last misspelled word and pick first suggestion.
    -inoremap <C-L> <C-G>u<Esc>[s1z=`]a<C-G>u
    +inoremap <C-L> <c-g>u<Esc>[s1z=`]a<c-g>u
     
     " Select last misspelled word (typing will edit).
     nnoremap <C-K> <Esc>[sve<C-G>
    @@ -882,9 +882,9 @@ Taken from: Filetypes
     
    -
    -

    Vim Which Key

    -
    +
    +

    Vim Which Key

    +
    @@ -916,9 +946,9 @@ Taken from: -

    LaTeX

    -
    +
    +

    LaTeX

    +
    au BufRead,BufNewFile *.tikz set filetype=tex
     let tex_no_error=1 " used to not highlight underscores
    @@ -1003,9 +1033,9 @@ Taken from: 
    -

    Matlab

    -
    +
    +

    Matlab

    +
    " Run Section (delimited by %%)
     au FileType matlab nmap <buffer> <localleader>mm <Plug>SlimeParagraphSend
    @@ -1050,9 +1080,9 @@ endfunc
     
    -
    -

    Save Which Key Configuration

    -
    +
    +

    Save Which Key Configuration

    +
    call which_key#register('<Space>', "g:which_key_map")
     
    @@ -1065,9 +1095,9 @@ endfunc

    Plugins Config

    -
    -

    junegunn/fzf

    -
    +
    +

    junegunn/fzf

    +
    " This is the default extra key bindings
     let g:fzf_action = {
    @@ -1105,9 +1135,9 @@ endfunc
     
    -
    -

    autozimu/LanguageClient-neovim

    -
    +
    +

    autozimu/LanguageClient-neovim

    +
    let g:LanguageClient_serverCommands = {
                 \ 'matlab': ['java', ' -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:/home/thomas/github/matlab-langserver/build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application'],
    @@ -1123,9 +1153,9 @@ endfunc
     
    -
    -

    JamshedVesuna/vim-markdown-preview

    -
    +
    +

    JamshedVesuna/vim-markdown-preview

    +
    let vim_markdown_preview_github=1
     let vim_markdown_preview_browser='Google Chrome'
    @@ -1136,9 +1166,9 @@ endfunc
     
    -
    -

    mhinz/vim-signify

    -
    +
    +

    mhinz/vim-signify

    +
    let g:signify_vcs_list = ['git']
     
    @@ -1148,9 +1178,9 @@ endfunc
     
    -
    -

    Deoplete

    -
    +
    +

    Deoplete

    +
    let g:deoplete#enable_at_startup = 1
     
    @@ -1164,9 +1194,9 @@ endfunc
     
    -
    -

    SirVer/ultisnips

    -
    +
    +

    SirVer/ultisnips

    +
    let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip'
     
    @@ -1179,9 +1209,9 @@ endfunc
     
    -
    -

    honza/vim-snippets

    -
    +
    +

    honza/vim-snippets

    +
    let g:snipMate = {}
     let g:snipMate.scope_aliases = {}
    @@ -1190,9 +1220,9 @@ endfunc
     
    -
    -

    itchyny/lightline.vim

    -
    +
    +

    itchyny/lightline.vim

    +
    function! LightlineObsession()
     return '%{ObsessionStatus("")}'
    @@ -1222,9 +1252,9 @@ endfunc
     
    -
    -

    Autopairs

    -
    +
    +

    Autopairs

    +
    " Incompatibilité entre auto-pairs et clang-complete
     let g:AutoPairsMapCR = 0
    @@ -1234,9 +1264,9 @@ endfunc
     
    -
    -

    Yggdroot/indentLine

    -
    +
    +

    Yggdroot/indentLine

    +
    " :IndentLinesToggle toggles lines on and off.
     let g:indentLine_color_term = 239
    @@ -1245,9 +1275,9 @@ endfunc
     
    -
    -

    ryanoasis/vim-devicons

    -
    +
    +

    ryanoasis/vim-devicons

    +
    let g:webdevicons_enable_ctrlp = 1
     
    @@ -1255,9 +1285,9 @@ endfunc
    -
    -

    junegunn/goyo.vim

    -
    +
    +

    junegunn/goyo.vim

    +
    let g:goyo_width=100
     let g:goyo_margin_top = 2
    @@ -1302,9 +1332,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    tpope/vim-surround

    -
    +
    +

    tpope/vim-surround

    +
    vmap Si S(i_<esc>f)
     au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
    @@ -1315,9 +1345,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    Vim-Markdown

    -
    +
    +

    Vim-Markdown

    +
    let g:vim_markdown_folding_disabled = 1
     let g:vim_markdown_conceal = 0
    @@ -1330,9 +1360,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    Neomake

    -
    +
    +

    Neomake

    +
    " Latex
     autocmd! BufWritePost *.tex Neomake
    @@ -1364,9 +1394,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    lervag/vimtex

    -
    +
    +

    lervag/vimtex

    +
    " let g:tex_conceal=""
     " autocmd FileType tex let b:vimtex_main = 'main.tex'
    @@ -1376,9 +1406,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    jpalardy/vim-slime

    -
    +
    +

    jpalardy/vim-slime

    +
    if exists('$TMUX')
         let g:slime_target = "tmux"
    @@ -1390,9 +1420,9 @@ Quit Vim if this is the only remaining buffer
     
    -
    -

    mhinz/vim-grepper

    -
    +
    +

    mhinz/vim-grepper

    +
    " nnoremap <leader>G :Grepper -tool ag<cr>
     " nmap gs  <plug>(GrepperOperator)
    @@ -1418,9 +1448,9 @@ Quit Vim if this is the only remaining buffer
     

    Bindings

    -
    -

    Vim Which Key

    -
    +
    +

    Vim Which Key

    +
    nnoremap <silent> <leader> :WhichKey '<Space>'<cr>
     
    @@ -2013,9 +2043,9 @@ endfun
     
    -
    -

    Save Which Key Configuration

    -
    +
    +

    Save Which Key Configuration

    +
    call which_key#register('<Space>', "g:which_key_map")
     
    @@ -2026,7 +2056,7 @@ endfun

    Author: Dehaeze Thomas

    -

    Created: 2021-04-25 dim. 19:10

    +

    Created: 2021-10-25 lun. 14:33

    diff --git a/docs/windows.html b/docs/windows.html index 9c2469a..4ac1882 100644 --- a/docs/windows.html +++ b/docs/windows.html @@ -3,11 +3,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Windows Config and Install - + @@ -16,20 +16,20 @@ UP | HOME -
    +

    Windows Config and Install

    -
    +

    Table of Contents

    -
    -
    -

    SSHFS

    -
    +
    +

    SSHFS

    +

    SSH Setup

    @@ -159,9 +159,9 @@ Finally, it should be possible to ssh to the server.
    -
    @@ -155,7 +155,7 @@ pdftk $1

    Author: Dehaeze Thomas

    -

    Created: 2021-02-10 mer. 17:57

    +

    Created: 2021-06-20 dim. 14:22