From d94383ec3cbde9140d0024b45c37d34c94f0179f Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Sat, 11 Jan 2020 22:04:45 +0100 Subject: [PATCH] Add Published HTML --- docs/applications.html | 508 +++ docs/bash.html | 971 ++++++ docs/binaries.html | 927 ++++++ docs/bookmarks.html | 299 ++ docs/bspwm.html | 348 +++ docs/calendar.html | 352 +++ docs/compositor.html | 406 +++ docs/config.html | 501 +++ docs/contacts.html | 328 ++ docs/doom/config.html | 4392 ++++++++++++++++++++++++++ docs/git.html | 533 ++++ docs/gtk.html | 321 ++ docs/i3.html | 607 ++++ docs/image.html | 284 ++ docs/index.html | 6460 +++++++++++++++++++++++++++++++++++++++ docs/mail.html | 2207 +++++++++++++ docs/music.html | 1432 +++++++++ docs/newsboat.html | 620 ++++ docs/notifications.html | 2316 ++++++++++++++ docs/pcmanfm.html | 324 ++ docs/polybar.html | 1253 ++++++++ docs/qutebrowser.html | 1568 ++++++++++ docs/ranger.html | 1560 ++++++++++ docs/rofi.html | 516 ++++ docs/scripts.html | 829 +++++ docs/spacemacs.html | 3992 ++++++++++++++++++++++++ docs/sxhkd.html | 848 +++++ docs/systemd.html | 852 ++++++ docs/termite.html | 401 +++ docs/tmux.html | 579 ++++ docs/video.html | 606 ++++ docs/vim.html | 2301 ++++++++++++++ docs/xconfig.html | 836 +++++ docs/zathura.html | 364 +++ docs/zsh.html | 302 ++ elisp/tangle.el | 19 - publish.org | 13 + readme.html | 6388 -------------------------------------- 38 files changed, 40956 insertions(+), 6407 deletions(-) create mode 100644 docs/applications.html create mode 100644 docs/bash.html create mode 100644 docs/binaries.html create mode 100644 docs/bookmarks.html create mode 100644 docs/bspwm.html create mode 100644 docs/calendar.html create mode 100644 docs/compositor.html create mode 100644 docs/config.html create mode 100644 docs/contacts.html create mode 100644 docs/doom/config.html create mode 100644 docs/git.html create mode 100644 docs/gtk.html create mode 100644 docs/i3.html create mode 100644 docs/image.html create mode 100644 docs/index.html create mode 100644 docs/mail.html create mode 100644 docs/music.html create mode 100644 docs/newsboat.html create mode 100644 docs/notifications.html create mode 100644 docs/pcmanfm.html create mode 100644 docs/polybar.html create mode 100644 docs/qutebrowser.html create mode 100644 docs/ranger.html create mode 100644 docs/rofi.html create mode 100644 docs/scripts.html create mode 100644 docs/spacemacs.html create mode 100644 docs/sxhkd.html create mode 100644 docs/systemd.html create mode 100644 docs/termite.html create mode 100644 docs/tmux.html create mode 100644 docs/video.html create mode 100644 docs/vim.html create mode 100644 docs/xconfig.html create mode 100644 docs/zathura.html create mode 100644 docs/zsh.html delete mode 100644 elisp/tangle.el create mode 100644 publish.org delete mode 100644 readme.html diff --git a/docs/applications.html b/docs/applications.html new file mode 100644 index 0000000..fa2ca08 --- /dev/null +++ b/docs/applications.html @@ -0,0 +1,508 @@ + + + + + + + + +Desktop file for the applications + + + + + + + + + + + + +
+ UP + | + HOME +
+

Desktop file for the applications

+ + +
+

Mime Applications

+
+
+
[Default Applications]
+text/plain=nvim.desktop
+x-scheme-handler/magnet=torrent.desktop;
+text/x-shellscript=nvim.desktop;
+image/png=img.desktop;
+image/jpeg=img.desktop;
+image/gif=img.desktop;
+application/rss+xml=rss.desktop
+x-scheme-handler/mailto=neomutt.desktop
+message/rfc822=neomutt.desktop
+application/x-bittorrent=deluge.desktop
+application/pdf=zathura.desktop
+x-scheme-handler/http=qutebrowser.desktop
+x-scheme-handler/https=qutebrowser.desktop
+x-scheme-handler/ftp=qutebrowser.desktop
+x-scheme-handler/chrome=qutebrowser.desktop
+text/html=qutebrowser.desktop
+application/x-extension-htm=qutebrowser.desktop
+application/x-extension-html=qutebrowser.desktop
+application/x-extension-shtml=qutebrowser.desktop
+application/xhtml+xml=qutebrowser.desktop
+application/x-extension-xhtml=qutebrowser.desktop
+application/x-extension-xht=qutebrowser.desktop
+
+[Added Associations]
+text/plain=mousepad.desktop;
+application/x-bittorrent=deluge.desktop;
+
+
+
+
+ +
+

Neomutt

+
+
+
[Desktop Entry]
+Name=Neomutt
+GenericName=Email client
+Exec=/usr/bin/termite -e neomutt %u
+Type=Application
+Icon=/usr/share/icons/Papirus/64x64/apps/mutt.svg
+Categories=Network;Email;
+MimeType=message/rfc822;x-scheme-handler/mailto;application/x-xpinstall;
+StartupNotify=true
+
+
+
+
+ +
+

Zathura

+
+
+
[Desktop Entry]
+Version=1.0
+Type=Application
+Name=Zathura
+Comment=A minimalistic document viewer
+Exec=zathura %U
+Icon=/usr/share/icons/Papirus/64x64/apps/zathura.svg
+Terminal=false
+Categories=Office;Viewer;
+Keywords=PDF;PS;PostScript;DjVU;document;presentation;viewer;
+
+
+
+
+ +
+

Weechat

+
+
+
[Desktop Entry]
+Encoding=UTF-8
+MultipleArgs=false
+Terminal=false
+Exec=termite --class=WeeChat -e 'weechat'
+StartupWMClass=WeeChat
+Icon=/usr/share/icons/Papirus/64x64/apps/weechat.svg
+Type=Application
+Categories=Network;IRCClient;
+StartupNotify=true
+Name=WeeChat
+GenericName=IRC Client
+
+
+
+
+ +
+

Matlab

+
+
+
[Desktop Entry]
+Version=R2019b
+Type=Application
+Terminal=false
+MimeType=text/x-matlab
+Exec=/usr/local/MATLAB/R2019b/bin/matlab -desktop
+Name=MATLAB
+Icon=matlab
+Categories=Development;Math;Science
+Comment=Scientific computing environment
+StartupNotify=true
+
+
+
+
+ +
+

Neovim

+
+
+
[Desktop Entry]
+Name=Neovim
+GenericName=Text Editor
+Comment=Edit text files
+Exec=nvim %F
+Terminal=true
+Type=Application
+Keywords=Text;editor;
+Icon=/usr/share/icons/Papirus/48x48/apps/nvim.svg
+Categories=Utility;TextEditor;
+StartupNotify=false
+MimeType=text/english;text/plain;text/x-makefile;
+
+
+
+
+ +
+

TODO Transmission

+
+
+
[Desktop Entry]
+Type=Application
+Name=Torrent
+Exec=/usr/bin/env transadd %U
+
+
+
+
+
+

Images

+
+
+
[Desktop Entry]
+Type=Application
+Name=Image viewer
+Exec=/usr/bin/sxiv -a %u
+
+
+
+
+ +
+

TODO RSS

+
+
+
[Desktop Entry]
+Type=Application
+Name=RSS feed addition
+Exec=/usr/bin/env rssadd %U
+
+
+
+
+
+

Qutebrowser

+
+
+
[Desktop Entry]
+Name=qutebrowser
+GenericName=Web Browser
+Comment=A keyboard-driven, vim-like browser based on PyQt5
+Icon=qutebrowser
+Type=Application
+Categories=Network;WebBrowser;
+Exec=qutebrowser %u
+Terminal=false
+StartupNotify=false
+MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/qute;
+Keywords=Browser
+Actions=new-window;preferences;
+
+
+
+
+
+

Org-Protocol

+
+
+
[Desktop Entry]
+Name=org-protocol
+Exec=emacsclient %u
+Type=Application
+Terminal=false
+Categories=System;
+MimeType=x-scheme-handler/org-protocol;
+
+
+
+
+
+

Ranger

+
+
+
[Desktop Entry]
+Type=Application
+Name=ranger
+Comment=Launches the ranger file manager
+Icon=utilities-terminal
+Terminal=true
+Exec=ranger
+Categories=ConsoleOnly;System;FileTools;FileManager
+MimeType=inode/directory;inode/mount-point;x-scheme-handler/ssh;x-scheme-handler/smb;x-scheme-handler/nfs;x-scheme-handler/ftp;
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:51

+
+ + diff --git a/docs/bash.html b/docs/bash.html new file mode 100644 index 0000000..2e4800b --- /dev/null +++ b/docs/bash.html @@ -0,0 +1,971 @@ + + + + + + + + +Bash Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Bash Configuration

+ + +
+

Bashrc

+
+
+ +
+

TODO What does that do?

+
+
+
[[ $- != *i* ]] && return
+
+
+
+
+ +
+

Bash Completion

+
+
+
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
+
+
+
+
+ +
+

Ignore case for autocompletion

+
+
+
bind "set completion-ignore-case on"
+bind "set show-all-if-ambiguous on"
+
+
+
+
+ +
+

Use Color

+
+
+
use_color=true
+alias ls='ls -hN --color=auto --group-directories-first'
+alias grep='grep --colour=auto'
+
+
+
+
+ +
+

TODO Set colorful PS1 only on colorful terminals.

+
+

+dircolors –print-database uses its own built-in database instead of using /etc/DIRCOLORS. Try to use the external file first to take advantage of user additions. Use internal bash globbing instead of external grep binary. +

+ +
+
safe_term=${TERM//[^[:alnum:]]/?}   # sanitize TERM
+match_lhs=""
+[[ -f ~/.dir_colors   ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
+[[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
+[[ -z ${match_lhs}    ]] \
+  && type -P dircolors >/dev/null \
+  && match_lhs=$(dircolors --print-database)
+[[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
+
+if ${use_color} ; then
+  # Enable colors for ls, etc.  Prefer ~/.dir_colors #64489
+  if type -P dircolors >/dev/null ; then
+    if [[ -f ~/.dir_colors ]] ; then
+      eval $(dircolors -b ~/.dir_colors)
+    elif [[ -f /etc/DIR_COLORS ]] ; then
+      eval $(dircolors -b /etc/DIR_COLORS)
+    fi
+  fi
+
+  if [[ ${EUID} == 0 ]] ; then
+    PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
+  else
+    PS1='\[\033[01;32m\][\u@\h\[\033[01;37m\] \W\[\033[01;32m\]]\$\[\033[00m\] '
+  fi
+else
+  if [[ ${EUID} == 0 ]] ; then
+    # show root@ when we don't have colors
+    PS1='\u@\h \W \$ '
+  else
+    PS1='\u@\h \w \$ '
+  fi
+fi
+
+
+ +
+
unset use_color safe_term match_lhs sh
+
+
+ +
+
xhost +local:root > /dev/null 2>&1
+
+complete -cf sudo
+
+# Line wrap on window resize
+shopt -s checkwinsize
+
+shopt -s expand_aliases
+
+# Auto "cd" when entering just a path
+shopt -s autocd
+
+# Enable history appending instead of overwriting
+shopt -s histappend
+
+
+
+
+ +
+

Prompt

+
+
+
export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]"
+
+
+
+
+ +
+

SSH Agent

+
+
+
# if ! pgrep -u "$USER" ssh-agent > /dev/null; then
+#     ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env"
+# fi
+# if [[ ! "$SSH_AUTH_SOCK" ]]; then
+#     eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")"
+# fi
+
+
+
+
+ +
+

Rebind up and down arrow keys to search through bash history

+
+
+
bind '"\e[A": history-search-backward'
+bind '"\e[B": history-search-forward'
+
+
+
+
+ +
+

TODO Aliases

+
+
+
+

Better defaults for some commands

+
+
+
alias cp="cp -i"     # confirm before overwriting something
+alias df='df -h'     # human-readable sizes
+alias free='free -m' # show sizes in MB
+alias mutt="neomutt"
+alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf'
+
+
+
+
+ +
+

One letter aliases

+
+
+
alias r="ranger"
+alias t="tmux"
+alias v="nvim"
+alias sv='sudo -E nvim'
+alias g="git"
+alias m="neomutt"
+alias y="yadm"
+alias o="xdg-open"
+alias x="sxiv -ft *"
+
+
+
+
+ +
+

Neovim

+
+
+
command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present.
+
+
+
+
+ +
+

Magit

+
+
+
# alias magit="emacsclient -create-frame --alternate-editor=\"\" --eval '(magit-status)'"
+alias magit="nvim -c MagitOnly"
+
+
+
+
+ +
+

Vim-like

+
+
+
alias :q=exit
+alias :e=nvim
+
+
+
+
+ +
+

Youtube

+
+
+
alias yt="youtube-dl --add-metadata -ic" # Download video link
+alias yta="yt -x -f bestaudio/best" # Download only audio
+
+
+
+
+ +
+

Print each PATH entry on a separate line

+
+
+
alias path='echo -e ${PATH//:/\\n}'
+
+
+
+
+ +
+

TODO IP addresses - Remove the use of dig and ifbashig

+
+

+Use addr instead +

+
+
# alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
+# alias localip="ip route get 8.8.4.4 | head -1 | awk '{print $7}'"
+# alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
+
+
+
+
+
+ +
+

TODO Functions

+
+
+
+

Display colors

+
+
+
colors() {
+  local fgc bgc vals seq0
+
+  printf "Color escapes are %s\n" '\e[${value};...;${value}m'
+  printf "Values 30..37 are \e[33mforeground colors\e[m\n"
+  printf "Values 40..47 are \e[43mbackground colors\e[m\n"
+  printf "Value  1 gives a  \e[1mbold-faced look\e[m\n\n"
+
+  # foreground colors
+  for fgc in {30..37}; do
+    # background colors
+    for bgc in {40..47}; do
+      fgc=${fgc#37} # white
+      bgc=${bgc#40} # black
+
+      vals="${fgc:+$fgc;}${bgc}"
+      vals=${vals%%;}
+
+      seq0="${vals:+\e[${vals}m}"
+      printf "  %-9s" "${seq0:-(default)}"
+      printf " ${seq0}TEXT\e[m"
+      printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m"
+    done
+    echo; echo
+  done
+}
+
+
+
+
+ +
+

TODO Meteo - Is Dig mandatory?

+
+

+To install dig, use yay -S bind-tools +

+ +
+
meteo() {
+  if [ -n "$*" ]; then
+    address="wttr.in/"
+    address+=$*
+    address+="?lang=fr"
+    curl "$address"
+  else
+    address="wttr.in/"
+    address+=$(ip)
+    address+="?lang=fr"
+    curl "$address"
+  fi
+}
+alias meteo=meteo
+
+
+
+
+ +
+

TODO Upload using transfer.sh

+
+
+
upload() {
+  # write to output to tmpfile because of progress bar
+  tmpfile=$(mktemp -t transferXXX)
+  # basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9]/-/g')
+  curl --progress-bar --upload-file "$1" "https://transfer.sh/" >> $tmpfile;
+  cat $tmpfile | xclip -selection clipboard;
+  echo "Copied:" $(cat $tmpfile);
+  rm -f $tmpfile;
+}
+alias upload=upload
+
+
+
+
+ +
+

TODO Upload alternative

+
+
+
transfer() {
+curl --progress-bar --upload-file "$1" https://transfer.sh/$(basename $1) | xclip -in -selection clipboard;
+}
+alias transfer=transfer
+
+
+
+
+ +
+

Extract archive

+
+

+usage: ex <file> +

+ +
+
ex ()
+{
+  if [ -f $1 ] ; then
+    case $1 in
+      *.tar.bz2)   tar xjf $1   ;;
+      *.tar.gz)    tar xzf $1   ;;
+      *.bz2)       bunzip2 $1   ;;
+      *.rar)       unrar x $1     ;;
+      *.gz)        gunzip $1    ;;
+      *.tar)       tar xf $1    ;;
+      *.tbz2)      tar xjf $1   ;;
+      *.tgz)       tar xzf $1   ;;
+      *.zip)       unzip $1     ;;
+      *.Z)         uncompress $1;;
+      *.7z)        7z x $1      ;;
+      *)           echo "'$1' cannot be extracted via ex()" ;;
+    esac
+  else
+    echo "'$1' is not a valid file"
+  fi
+}
+
+
+
+
+ +
+

Tree display

+
+

+tre is a shorthand for tree with hidden files and color enabled, ignoring +the .git directory, listing directories first. The output gets piped into +less with options to preserve color and line numbers, unless the output is +small enough for one screen. +

+ +
+
function tre() {
+  tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
+}
+
+
+
+
+ +
+

Create a new directory and enter it

+
+
+
function mkd() {
+  mkdir -p "$@" && cd "$_";
+}
+
+
+
+
+ +
+

Filesize of directory

+
+
+
function fs() {
+  if du -b /dev/null > /dev/null 2>&1; then
+    local arg=-sbh;
+  else
+    local arg=-sh;
+  fi
+  if [[ -n "$@" ]]; then
+    du $arg -- "$@";
+  else
+    du $arg .[^.]* ./*;
+  fi;
+}
+
+
+
+
+ +
+

Redirect both standard output and standard error, as well as sending to background

+
+
+
function nullify() {
+  "$@" >/dev/null 2>&1
+}
+
+
+
+
+ +
+

Send SMS

+
+

+https://doronbehar.com/articles/using-kdeconnect-to-comfortably-send-sms-messages-from-the-shell/#kdeconnects-builtin-sms-interface +

+
+
sms(){
+    local args="$@"
+    # local phone_number name phone_type
+    # khard phone --parsable | sort -u | fzf | IFS=$'\t' read -r phone_number name phone_type
+    local phone_number=$(khard phone --parsable | sort -u | fzf | cut -f1 -d$'\t')
+    if [[ -z "${phone_number}" ]]; then
+        echo No recipient was chosen >&2
+        return
+    else
+        # echo "${name}"$'\t'"${phone_number}"$'\t'"${phone_type}" > ${_KDECONNECT_SMS_LAST_RECIPIENT}
+        kdeconnect-cli --send-sms "${args}" --destination "${phone_number}" --device 4de3b5de2264a17c
+        # kdeconnect-cli --device ${_KDECONNECT_DEFAULT_DEVICE} --send-sms "${args}" --destination "${phone_number}" && \
+        # echo sent sms message to ${name} | fribidi
+    fi
+}
+
+
+
+
+
+
+
+

Bash History

+
+

+Undocumented feature which sets the size to “unlimited”. http://stackoverflow.com/questions/9457233/unlimited-bash-history +

+ +
+
export HISTFILESIZE=
+export HISTSIZE=
+export HISTTIMEFORMAT="[%F %T] "
+
+
+ +

+Change the file location because certain bash sessions truncate .bash_history file upon close. http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login +

+ +
+
export HISTFILE=~/.bash_eternal_history
+
+
+ +

+Force prompt to write history after every command. http://superuser.com/questions/20900/bash-history-loss +

+ +
+
PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
+
+
+
+
+
+ +
+

Bash Profile

+
+
+
[[ -f ~/.profile ]] && . ~/.profile
+[[ -f ~/.bashrc ]] && . ~/.bashrc
+
+
+
+
+ +
+

Profile

+
+
+ +
+

QT And GTK Themes

+
+
+
export QT_QPA_PLATFORMTHEME="qt5ct"
+export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
+
+
+
+
+ +
+

Gui program to ask for sudo password

+
+
+
export SUDO_ASKPASS=~/bin/askpass-rofi
+
+
+
+
+ +
+

Default

+
+
+
export EDITOR="nvim"
+export TERMINAL="termite"
+export BROWSER="qutebrowser"
+export READER="zathura"
+export FILE="ranger"
+
+
+
+
+ +
+

Exports

+
+
+
export TERM=xterm-256color
+
+
+
+ +
+

XDG Default

+
+
+
export XDG_CONFIG_HOME="$HOME/.config"
+
+
+
+
+ +
+

Better yaourt colors

+
+
+
export YAOURT_COLORS="nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35"
+
+
+
+
+ +
+

Use Ripgrep for FZF

+
+
+
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
+export FZF_DEFAULT_OPTS='--layout=reverse --height=20'
+
+
+
+
+ +
+

Goland

+
+
+
export GOPATH=$HOME/go
+
+
+
+
+ +
+

SSH Agent

+
+
+
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
+
+
+
+
+
+ +
+

Path

+
+
+
PATH=$HOME/appimages:$PATH
+PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH
+PATH=$GOPATH:$GOPATH/bin:$PATH
+PATH=~/bin:$PATH
+PATH=~/.emacs.d/bin:$PATH
+export PATH
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/binaries.html b/docs/binaries.html new file mode 100644 index 0000000..b857bd9 --- /dev/null +++ b/docs/binaries.html @@ -0,0 +1,927 @@ + + + + + + + + +Binaries + + + + + + + + + + + + +
+ UP + | + HOME +
+

Binaries

+ + +
+

Select Screen

+
+

+Script taken from Luke Smith. +

+ +
+
twoscreen() { # If multi-monitor is selected and there are two screens.
+
+    mirror=$(printf "no\\nyes" | dmenu -i -p "Mirror displays?")
+    # Mirror displays using native resolution of external display and a scaled
+    # version for the internal display
+    if [ "$mirror" = "yes" ]; then
+        external=$(echo "$screens" | dmenu -i -p "Optimize resolution for:")
+        internal=$(echo "$screens" | grep -v "$external")
+
+        res_external=$(xrandr --query | sed -n "/^$external/,/\+/p" | \
+                           tail -n 1 | awk '{print $1}')
+        res_internal=$(xrandr --query | sed -n "/^$internal/,/\+/p" | \
+                           tail -n 1 | awk '{print $1}')
+
+        res_ext_x=$(echo $res_external | sed 's/x.*//')
+        res_ext_y=$(echo $res_external | sed 's/.*x//')
+        res_int_x=$(echo $res_internal | sed 's/x.*//')
+        res_int_y=$(echo $res_internal | sed 's/.*x//')
+
+        scale_x=$(echo "$res_ext_x / $res_int_x" | bc -l)
+        scale_y=$(echo "$res_ext_y / $res_int_y" | bc -l)
+
+        xrandr --output "$external" --auto --scale 1.0x1.0 \
+               --output "$internal" --auto --same-as "$external" \
+               --scale "$scale_x"x"$scale_y"
+    else
+
+        primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
+        secondary=$(echo "$screens" | grep -v "$primary")
+        direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
+        xrandr --output "$primary" --auto --scale 1.0x1.0 --output "$secondary" --"$direction"-of "$primary" --auto --scale 1.0x1.0
+    fi
+}
+
+morescreen() { # If multi-monitor is selected and there are more than two screens.
+    primary=$(echo "$screens" | dmenu -i -p "Select primary display:")
+    secondary=$(echo "$screens" | grep -v "$primary" | dmenu -i -p "Select secondary display:")
+    direction=$(printf "left\\nright" | dmenu -i -p "What side of $primary should $secondary be on?")
+    tertiary=$(echo "$screens" | grep -v "$primary" | grep -v "$secondary" | dmenu -i -p "Select third display:")
+    xrandr --output "$primary" --auto --output "$secondary" --"$direction"-of "$primary" --auto --output "$tertiary" --"$(printf "left\\nright" | grep -v "$direction")"-of "$primary" --auto
+}
+
+multimon() { # Multi-monitor handler.
+    case "$(echo "$screens" | wc -l)" in
+        1) xrandr $(echo "$allposs" | grep -v "$screens" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;
+        2) twoscreen ;;
+        *) morescreen ;;
+    esac ;}
+
+# Get all possible displays
+allposs=$(xrandr -q | grep "connected")
+
+# Get all connected screens.
+screens=$(echo "$allposs" | grep " connected" | awk '{print $1}')
+
+# Get user choice including multi-monitor and manual selection:
+chosen=$(printf "%s\\ncancel\\nmulti-monitor\\nmanual selection" "$screens" | dmenu -i -p "Select display arangement:") &&
+    case "$chosen" in
+        "cancel") exit ;;
+        "manual selection") arandr ; exit ;;
+        "multi-monitor") multimon ;;
+        *) xrandr --output "$chosen" --auto --scale 1.0x1.0 $(echo "$allposs" | grep -v "$chosen" | awk '{print "--output", $1, "--off"}' | tr '\n' ' ') ;;
+    esac
+
+$HOME/.config/polybar/scripts/launch.sh # restart polybar
+pgrep -x dunst >/dev/null && killall dunst && setsid dunst & # Restart dunst to ensure proper location on screen
+
+
+
+
+ +
+

getbib

+
+
+
[ -z "$1" ] && echo "Give either a pdf file or a DOI as an argument." && exit
+
+if [ -f "$1" ]; then
+    # Try to get DOI from pdfinfo or pdftotext output.
+    doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
+        doi=$(pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1) ||
+        exit 1
+else
+    doi="$1"
+fi
+
+# Check crossref.org for the bib citation.
+curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n"
+
+
+
+
+ +
+

vpnToggle

+
+
+
if [[ $(nordvpn status) == *"Connected"* ]]; then
+  nordvpn disconnect && dunstify --replace=23198 "VPN" "Disconnected";
+else
+  country=`cat ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`;
+  dunstify --replace=23198 "VPN" "Connecting to $country...";
+  nordvpn connect $country && dunstify --replace=23198 "VPN" "Connected to $country";
+fi
+
+
+
+
+ +
+

bukurun

+
+
+
_rofi () {
+    rofi -dmenu -i -no-levenshtein-sort -width 1000 "$@"
+}
+
+# display settings
+display_type=1
+max_str_width=80
+
+# keybindings
+switch_view="Alt+Tab"
+new_bookmark="Alt+n"
+actions="Alt+a"
+edit="Alt+e"
+delete="Alt+d"
+
+# colors
+help_color="#334433"
+
+# source global config
+if [[ -f /etc/buku_run.config ]]
+then
+  source /etc/buku_run.config
+fi
+
+# source local config:
+if [[ -z $XDG_CONFIG_DIR ]]
+then
+  if [[ -f $HOME/.config/buku_run/config ]]
+  then
+    source $HOME/.config/buku_run/config
+  else
+    echo "User config file \'~/.config/buku_run/config\' not found. using global config"
+  fi
+else
+  if [[ -f "${XDG_CONFIG_DIR}/buku_run/config" ]]
+  then
+    source "${XDG_CONFIG_DIR}/buku_run/config"
+  else
+    echo "User config file \'~/.config/buku_run/config\' not found. using global config"
+  fi
+fi
+
+
+main () {
+    HELP="Welcome to Buku. Use <span color='${help_color}'>${new_bookmark}</span> to add a new Bookmark
+Use <span color='${help_color}'>${switch_view}</span> to switch View. <span color='${help_color}'>${actions}</span> for actions"
+    if [[ $mode == "bookmarks" ]]; then
+        content=$(parseBuku)
+        menu=$(echo "${content}" | _rofi -p '> ' -filter "${filter}" -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}")
+    elif [[ $mode == "tags" ]]; then
+        menu=$(buku --np --st | awk '{$NF=""; print $0}' | cut -d ' ' -f2-  | _rofi -p '> ' -mesg "${HELP}" -kb-custom-1 "${new_bookmark}" -kb-custom-2 "${switch_view}" -kb-custom-3 "${actions}" -kb-custom-4 "${edit}" -kb-custom-5 "${delete}")
+    fi
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 12 ]]; then
+        optionsMenu
+    elif [[ $val -eq 10 ]]; then
+        addMark
+    elif [[ $val -eq 14 ]]; then
+        deleteMenu
+    elif [[ $val -eq 13 ]]; then
+        editMenu
+    elif [[ $val -eq 11 ]]; then
+        if [[ $mode == "bookmarks" ]]; then
+            export mode="tags"
+            mode=tags main
+        elif [[ $mode == "tags" ]]; then
+            export mode="bookmarks"
+            mode=bookmarks main
+        fi
+    elif [[ $val -eq 0 ]]; then
+        if [[ $mode == "bookmarks" ]]; then
+            id=$(getId "$content" "$menu")
+            for bm in ${id}; do
+                buku -o "${bm}"
+            done
+        elif [[ $mode == "tags" ]]; then
+            filter="${menu}" mode="bookmarks" main
+        fi
+    fi
+}
+
+optionsMenu () {
+    if [[ $mode == "bookmarks" ]]; then
+        askmenu=$(echo -e "< Return\n---\n1. Edit\n2. Delete" | _rofi -p '> ' -mesg "Choose Action for bookmark")
+        val=$?
+        if [[ $val -eq 1 ]]; then
+            exit
+        elif [[ $val -eq 0 ]]; then
+            if [[ $askmenu == "< Return" ]]; then
+                export mode=bookmarks
+                main
+            elif [[ $askmenu == "1. Edit" ]]; then
+                editMenu
+            elif [[ $askmenu == "2. Delete" ]]; then
+                deleteMenu
+            fi
+        fi
+    elif [[ $mode == "tags" ]]; then
+        askmenu=$(echo -e "< Return\n---\n1. Replace Tag\n2. Delete Tag" | _rofi -p '> ' -mesg "Choose Action for tag \"${menu}\"")
+        val=$?
+        if [[ $val -eq 1 ]]; then
+            exit
+        elif [[ $val -eq 0 ]]; then
+            if [[ $askmenu == "< Return" ]]; then
+                export mode=tags
+                main
+            elif [[ $askmenu == "1. Replace Tag" ]]; then
+                newtag=$(echo | _rofi -p '> ' -mesg "Enter new tag name for tag \"${menu}\"")
+                val=$?
+                if [[ $val -eq 1 ]]; then
+                    exit
+                elif [[ $val -eq 0 ]]; then
+                    if [[ $newtag == "" ]]; then
+                        mode=tags main
+                    else
+                        buku -r "${menu}" "${newtag}"
+                        mode=tags main
+                    fi
+                fi
+            elif [[ $askmenu == "2. Delete Tag" ]]; then
+                delask=$(echo -e "1. Yes\n2. No" | _rofi -p '> ' -mesg "Really delete tag?")
+                val=$?
+                if [[ $val -eq 1 ]]; then
+                    exit
+                elif [[ $val -eq 0 ]]; then
+                    if [[ $delask == "1. Yes" ]]; then
+                        buku -r "${menu}"
+                        mode=tags main
+                    elif [[ $delask == "2. No" ]]; then
+                        mode=tags main
+                    fi
+                fi
+            fi
+        fi
+    fi
+}
+
+deleteMenu () {
+    id=$(getId "$content" "$menu")
+    delask=$(echo -e "1. Yes\n2. No" | _rofi -p '> ' -mesg "Really delete bookmark?")
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        if [[ $delask == "1. Yes" ]]; then
+            buku -d ${id} --tacit
+            mode=bookmarks main
+        elif [[ $delask == "2. No" ]]; then
+            optionsMenu
+        fi
+    fi
+}
+
+editMenu () {
+    id=$(getId "$content" "$menu")
+    title="$(getTitleFromId $id)"
+    bookmark="$(getUrlFromId $id)"
+    tags="$(getTagsFromId $id)"
+    content=$(echo -e "1. title: $title\n2. url: $bookmark\n3. tags: $tags")
+    editmenu=$(echo -e "< Return\n---\n${content}" | _rofi -p '> ')
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        if [[ $editmenu == "< Return" ]]; then
+            main
+        elif [[ $editmenu == "tags: NOTAG" ]]; then
+            addTags --update
+        elif [[ $editmenu =~ tags:* ]]; then
+            tags="${tags}" editTags
+        elif [[ $editmenu =~ url:* ]]; then
+            editBookmark
+        elif [[ $editmenu =~ title:* ]]; then
+            editTitle
+        fi
+    fi
+}
+
+editTags () {
+    edittagsmenu=$(echo | _rofi -filter "${tags}" -p '> ' -mesg "Edit Tags and hit Enter")
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        buku -u ${id} --tag "${edittagsmenu}"
+    fi
+    mode=bookmarks main
+}
+
+editBookmark () {
+    bmarkmenu=$(echo "" | _rofi -p "> " -filter "${bookmark}" -mesg "Edit Bookmark and hit Enter")
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        if [[ $bmarkmenu == "http"* ]]; then
+            buku -u "${id}" --url "${bmarkmenu}"
+        else
+            echo "" | rofi -e "Not a valid URI, Make sure URLs start with http"
+            editBookmark
+        fi
+    fi
+    mode=bookmarks main
+}
+
+editTitle () {
+  titlemenu=$(echo "" | _rofi -p "> " -filter "${title}" -mesg "Edit Title and hit Enter")
+  val=$?
+  if [[ $val -eq 1 ]]; then
+    exit
+  elif [[ $val -eq 0 ]]; then
+    buku -u "${id}" --title "${titlemenu}"
+  fi
+  mode=bookmarks main
+}
+
+addMark () {
+    inserturl=$(echo -e "$(xclip -o)" | _rofi -p '> ' -mesg "Use URL below or type manually")
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        addTags
+    fi
+}
+
+addTags () {
+    inserttags=$(buku --np --st | awk '{$NF=""; print $0}' | cut -d ' ' -f2- | _rofi -p '> ' -mesg "Add some tags. Separate tags with ', '")
+    val=$?
+    if [[ $val -eq 1 ]]; then
+        exit
+    elif [[ $val -eq 0 ]]; then
+        if [[ $(echo "${inserttags}" | wc -l) -gt 1 ]]; then
+            taglist=$(echo "${inserttags}" | tr '\n' ',')
+            tags=()
+            for tag in $taglist; do
+                tags+=("$tag")
+            done
+        else
+            tags=${inserttags}
+        fi
+        if [[ $1 == "--update" ]]; then
+            buku -u "${id}" --tag ${tags}
+        else
+            buku -a ${inserturl} ${tags}
+        fi
+    fi
+}
+
+parseBuku () {
+  echo "$(buku --nc -p | gawk -v max="$max_str_width" -v type="$display_type" '
+BEGIN {
+  RS=""
+  FS="\n"
+}
+{
+  if ($3 == "")
+    $3 = " # NOTAG"
+  id = gensub(/([0-9]+)\.(.*)/, "\\1", "g", $1)
+  url = substr(gensub(/\s+> (.*)/, "\\1", "g", $2),0,max)
+  tags = gensub(/\s+# (.*)/, "\\1", "g", $3)
+  title = substr(gensub(/[0-9]+\.\s*(.*)/, "\\1", "g", $1),0,max)
+
+  if (type == 1)
+    print id "\t" url "\t" tags
+  else
+    print id "\t" title "\t" tags
+    if (type == 3)
+      print " \t" url "\t "
+  print ""
+}
+' | column -t -s $'\t')"
+}
+
+getId () {
+  id=$(echo "${2%% *}")
+  if [ -z "$id" ]; then
+    prev=""
+    IFS=$'\n'
+    for line in $1; do
+      if [ "$2" = "$line" ]; then
+        id=$(echo "${prev%% *}")
+        break
+      else
+        prev="$line"
+      fi
+    done
+  fi
+  echo $id
+}
+
+getTitleFromId () {
+  echo "$(buku --nc -p $1 | gawk '
+  BEGIN {
+    RS=""
+    FS="\n"
+  }
+  {
+    print gensub(/[0-9]+\.\s*(.*)/, "\\1", "g", $1)
+  }
+  ')"
+}
+
+getUrlFromId () {
+  echo "$(buku --nc -p $1 | gawk '
+  BEGIN {
+    RS=""
+    FS="\n"
+  }
+  {
+    print gensub(/\s+> (.*)/, "\\1", "g", $2)
+  }
+  ')"
+}
+
+getTagsFromId () {
+  echo "$(buku --nc -p $1 | gawk '
+  BEGIN {
+    RS=""
+    FS="\n"
+  }
+  {
+    print gensub(/\s+# (.*)/, "\\1", "g", $3)
+  }
+  ')"
+}
+
+mode=bookmarks main
+
+
+
+
+
+

i3exit

+
+
+
# with openrc use loginctl
+case "$1" in
+    lock)
+        ~/scripts/lockscreen.sh
+        ;;
+    logout)
+        loginctl terminate-session `loginctl session-status | head -n 1 | awk '{print $1}'`
+        ;;
+    switch_user)
+        dm-tool switch-to-greeter
+        ;;
+    suspend)
+        systemctl suspend && ~/scripts/lockscreen.sh
+        ;;
+    hibernate)
+        systemctl hibernate && ~/scripts/lockscreen.sh
+        ;;
+    reboot)
+        systemctl reboot
+        ;;
+    shutdown)
+        systemctl poweroff
+        ;;
+    *)
+        echo "== ! i3exit: missing or invalid argument ! =="
+        echo "Try again with: lock | logout | switch_user | suspend | hibernate | reboot | shutdown"
+        exit 2
+esac
+
+exit 0
+
+
+
+
+ +
+

readbib

+
+
+
cd ~/Cloud/thesis/ressources/pdfs/ && ls | dmenu -l 20 | xargs -I {} zathura {}
+
+
+
+
+ +
+

readnotes

+
+
+
cd ~/Cloud/thesis/ressources/notes/ && ls *.pdf | dmenu -l 20 | xargs -I {} zathura {}
+
+
+
+
+ +
+

askpass

+
+

+Take password prompt from STDIN, print password to STDOUT. +The sed piece just removes the colon from the provided prompt: rofi -p already gives us a colon +

+
+
rofi -dmenu \
+     -password \
+     -no-fixed-num-lines \
+     -p "$(printf "$1" | sed s/://)"
+
+
+
+
+ +
+

Take Screenshot

+
+
+
status=$(echo -e "All\nGUI\nSelection\nCropped\nCopy\nShadow\nActive" | rofi -i -dmenu -p "Type")
+if [ -z "$status" ]; then
+  exit;
+fi
+
+name=$(echo -e "screenshot-$(date +"%m-%d-%y_%H-%M-%S")" | rofi -i -dmenu -p "Filename")
+if [ -z "$name" ]; then
+  exit;
+fi
+
+case "$status" in
+    "All")
+        maim ~/Pictures/$name.png ;;
+    "GUI")
+        flameshot gui -r > ~/Pictures/$name.png ;;
+    "Selection")
+        maim -s ~/Pictures/$name.png ;;
+    "Cropped")
+        maim -s ~/Pictures/$name.png && convert -trim ~/Pictures/$name.png ~/Pictures/$name.png;;
+    "Copy")
+        maim -s | xclip -selection clipboard -t image/png ;;
+    "Shadow")
+        maim -st 9999999 | convert - \( +clone -background black -shadow 80x3+5+5 \) +swap -background none -layers merge +repage ~/Pictures/$name.png ;;
+    "Active")
+        maim -i $(xdotool getactivewindow) ~/Pictures/$name.png ;;
+esac
+
+
+
+
+ +
+

Remote Desktop Connect

+
+
+
computer=$(echo -e 'RNICE\nPCMEL1\nPCNASS1\nPCMEG01' | dmenu -p 'Computer:' -l 20);
+
+case $computer in
+    PCMEL1)
+          rdesktop -a 16 -P -z -x m -r sound:off -g "80%" -u "ESRF\OPPEL" -p $(pass esrf/PCMEL1/OPPEL | sed -n 1p) pcmel1
+          ;;
+    PCMEG01)
+          rdesktop -a 16 -P -z -x m -r sound:off -g "80%" -u "ESRF\DEHAEZE" -p $(pass ssl.esrf.fr/dehaeze | sed -n 1p) pcmeg01
+          ;;
+    PCNASS1)
+          rdesktop -a 16 -P -z -x m -r sound:off -g "80%" -u "ESRF\DEHAEZE" -p $(pass ssl.esrf.fr/dehaeze | sed -n 1p) pcnass1
+          ;;
+    RNICE)
+          echo "Not yet implemented"
+          ;;
+    *)
+          echo "Not existing"
+          ;;
+esac
+
+
+
+
+ +
+

Toggle Network

+
+
+
result=$(nmcli device | sed '1d' | dmenu -l 20);
+
+interface=$(echo $result | awk -F ' ' '{print $1}');
+status=$(echo $result | awk -F ' ' '{print $3}');
+
+if [ $status == 'disconnected' ]; then
+  nmcli device connect $interface
+else
+  nmcli device disconnect $interface
+fi
+
+
+
+
+ +
+

Print on Rnice

+
+
+
nbpage=$(echo -e '1\n2\n4' | dmenu -p 'Number of pages per sheet' -l 20);
+sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | dmenu -p 'Two Sided:' -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
+  # Then print on Rnice
+  sshpass -p "$(pass ssl.esrf.fr/dehaeze | sed -n 1p)" ssh dehaeze@rnice "lpr -o media=A4 -o sides=$sides -o number-up=$nbpage -P ctb110c1u ~/Downloads/$1";
+  # Finally, delete the file
+else
+  echo "Command Failed"
+fi
+
+
+
+
+ +
+

Mount TMP14DAYS

+
+
+
sudo -A mkdir ~/tmp_14_days;
+sudo -A mount -o rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=160.103.232.103,mountvers=3,mountport=597,mountproto=tcp,local_lock=none,addr=160.103.232.103 rnice:/hz/tmp_14_days ~/tmp_14_days;
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/bookmarks.html b/docs/bookmarks.html new file mode 100644 index 0000000..25febca --- /dev/null +++ b/docs/bookmarks.html @@ -0,0 +1,299 @@ + + + + + + + + +Bukurun (Bookmark Manager) + + + + + + + + + + + + +
+ UP + | + HOME +
+

Bukurun (Bookmark Manager)

+ +
+
_rofi () {
+    rofi -dmenu -i -no-levenshtein-sort -width 1000 "$@"
+}
+
+
+ +

+Display settings +

+
+
display_type=1
+max_str_width=80
+
+
+ +

+Keybindings +

+
+
switch_view="Alt+Tab"
+new_bookmark="Alt+n"
+actions="Alt+a"
+edit="Alt+e"
+delete="Alt+d"
+
+
+ +

+Colors +

+
+
help_color="#2d7ed8"
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/bspwm.html b/docs/bspwm.html new file mode 100644 index 0000000..20c93be --- /dev/null +++ b/docs/bspwm.html @@ -0,0 +1,348 @@ + + + + + + + + +BSPWM + + + + + + + + + + + + +
+ UP + | + HOME +
+

BSPWM

+
+

Table of Contents

+ +
+ +
+

List Desktops

+
+
+
bspc monitor -d code web mail misc figs
+
+
+
+
+ +
+

Basic Config

+
+
+
bspc config border_width         1
+bspc config window_gap           8
+bspc config top_padding         27 # top_padding I set equal to polybar's height
+
+bspc config split_ratio          0.52
+bspc config borderless_monocle   true
+bspc config gapless_monocle      true
+
+bspc config focus_follows_pointer       true
+
+
+
+
+ +
+

Colors

+
+
+
bspc config normal_border_color \#32302f
+bspc config focused_border_color \#bdae93
+
+
+
+
+ +
+

Rules

+
+

+Use xprop to obtain information about the window. +

+ +
+
# If refreshing bspwm, remove all previous rules to prevent doubling up.
+bspc rule -r "*"
+
+bspc rule --add qutebrowser desktop='web' follow=on state=tiled
+bspc rule --add Emacs desktop='code' follow=on state=tiled
+
+bspc rule --add Zathura state=tiled
+
+bspc rule --add Pavucontrol state=floating
+bspc rule --add Blueman-manager state=floating
+
+
+
+
+ +
+

Run Polybar and SXHKD

+
+
+
$HOME/.config/polybar/scripts/launch.sh
+sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.bspwm &
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/calendar.html b/docs/calendar.html new file mode 100644 index 0000000..c592fdc --- /dev/null +++ b/docs/calendar.html @@ -0,0 +1,352 @@ + + + + + + + + +Calendar Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Calendar Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

Vdirsyncer

+
+
+
[general]
+status_path = "~/.config/vdirsyncer/status/"
+
+[pair google_calendar]
+a = "google_calendar_remote"
+b = "google_calendar_local"
+collections = ["dehaeze.thomas@gmail.com", "8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com"]
+conflict_resolution = "a wins"
+
+[storage google_calendar_remote]
+type = "google_calendar"
+token_file = "~/.config/dotfiles/private/token_file"
+client_id = "188415318767-802h28ig8gromo0f72blrbg6cgcop6m8.apps.googleusercontent.com"
+client_secret = "***REMOVED***"
+
+[storage google_calendar_local]
+type = "filesystem"
+path = "~/.calendars/google/"
+fileext = ".ics"
+
+
+[pair google_contacts]
+a = "google_contacts_remote"
+b = "google_contacts_local"
+collections = ["from a", "from b"]
+conflict_resolution = "a wins"
+
+[storage google_contacts_local]
+type = "filesystem"
+path = "~/.contacts/"
+fileext = ".vcf"
+
+[storage google_contacts_remote]
+type = "google_contacts"
+token_file = "~/.config/dotfiles/private/token_file_carddav"
+client_id = "188415318767-802h28ig8gromo0f72blrbg6cgcop6m8.apps.googleusercontent.com"
+client_secret = "***REMOVED***"
+
+
+
+
+ +
+

Khal

+
+

+:header-arg s: :tangle ~/.config/khal/config +:header-args+: :comments both :mkdirp yes +

+ +
+
[calendars]
+
+[[home]]
+path = ~/.calendars/google/dehaeze.thomas@gmail.com/
+color = "#B8BB26"
+
+[[work]]
+path = ~/.calendars/google/8kjmhe2ar0abnm054ill1fb0gc@group.calendar.google.com/
+color = "#FB4934"
+
+[highlight_days]
+multiple = "#FABD2F"
+
+[default]
+highlight_event_days = True
+
+[keybindings]
+delete = d
+today = .
+new = c
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/compositor.html b/docs/compositor.html new file mode 100644 index 0000000..13b93b8 --- /dev/null +++ b/docs/compositor.html @@ -0,0 +1,406 @@ + + + + + + + + +Picom (Compositor) + + + + + + + + + + + + +
+ UP + | + HOME +
+

Picom (Compositor)

+
+

Table of Contents

+ +
+ +
+

Shadow

+
+
+
shadow = true;
+shadow-radius = 12;
+shadow-offset-x = -12;
+shadow-offset-y = -12;
+shadow-opacity = 0.95;
+shadow-exclude = [
+  "name = 'Notification'",
+  "window_type = 'dock'",
+  "window_type = 'dnd'",
+  "class_g = 'VirtualBox'",
+  "class_g = 'Conky'",
+  "class_g ?= 'Notify-osd'",
+  "class_g = 'Tilda'",
+  "class_g = 'Firefox'",
+  "class_g = 'Opera'",
+  "class_g = 'CoverGloobus'",
+  "class_g = 'Cairo-clock'",
+  "class_g = 'dzen'",
+  "class_g = 'stalonetray'",
+  "_GTK_FRAME_EXTENTS@:c"
+];
+
+
+
+
+ +
+

Opacity

+
+
+
# menu-opacity = 0.92;
+# inactive-opacity = 0.92;
+# active-opacity = 0.92;
+# frame-opacity = 0.9;
+inactive-opacity-override = false;
+# inactive-dim = 0.2;
+# inactive-dim-fixed = true;
+# blur-background = true;
+# blur-background-frame = true;
+blur-kern = "3x3box";
+# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
+# blur-background-fixed = true;
+blur-background-exclude = [
+  "window_type = 'dock'",
+  "window_type = 'desktop'",
+  "class_g = 'CoverGloobus'",
+  "class_g = 'Opera'",
+  "_GTK_FRAME_EXTENTS@:c"
+];
+
+#opacity-rule = [ "80:class_g = 'XTerm'" ];
+#opacity-rule = [ "80:class_g = 'UXTerm'" ];
+#opacity-rule = [ "80:class_g = 'i3bar'" ];
+#opacity-rule = [ "90:class_g = 'dzen'" ];
+opacity-rule = [ "40:class_g = 'Bspwm' && class_i = 'presel_feedback'" ];
+
+
+
+
+ +
+

Fading

+
+
+
fading = false;
+fade-delta = 10.0;
+fade-in-step = 0.03;
+fade-out-step = 0.03;
+# no-fading-openclose = true;
+# no-fading-destroyed-argb = true;
+fade-exclude = [
+];
+
+
+
+
+ +
+

Other

+
+
+
backend = "xrender";
+mark-wmwin-focused = true;
+mark-ovredir-focused = true;
+# use-ewmh-active-win = true;
+detect-rounded-corners = true;
+detect-client-opacity = true;
+refresh-rate = 0;
+vsync = false;
+dbe = false;
+# sw-opti = true;
+# unredir-if-possible = true;
+# unredir-if-possible-delay = 5000;
+# unredir-if-possible-exclude = [ ];
+detect-transient = true;
+detect-client-leader = true;
+invert-color-include = [ ];
+# resize-damage = 1;
+
+
+
+
+ +
+

Window Type Setting

+
+
+
wintypes:
+{
+  tooltip = {
+    fade = true;
+    shadow = true;
+    opacity = 0.75;
+    focus = true;
+  };
+  fullscreen = {
+    fade = true;
+    shadow = false;
+    opacity = 1;
+    focus = true;
+  };
+};
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/config.html b/docs/config.html new file mode 100644 index 0000000..c64c13a --- /dev/null +++ b/docs/config.html @@ -0,0 +1,501 @@ + + + + + + + + +Configuration Files + + + + + + + + + + + + +
+ UP + | + HOME +
+

Configuration Files

+ + +
+

Font

+
+
+
<?xml version='1.0'?>
+<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+<fontconfig>
+
+<alias>
+    <family>serif</family>
+    <prefer><family>Linux Libertine</family></prefer>
+  </alias>
+  <alias>
+    <family>sans-serif</family>
+    <prefer><family>Linux Biolinum</family></prefer>
+  </alias>
+  <alias>
+    <family>sans</family>
+    <prefer><family>Linux Biolinum</family></prefer>
+  </alias>
+  <alias>
+    <family>monospace</family>
+    <prefer><family>SauceCodePro Nerd Font Mono</family></prefer>
+  </alias>
+
+</fontconfig>
+
+
+
+
+ +
+

Input

+
+
+
# Single tab for autocompletion
+set show-all-if-ambiguous on
+
+# Ignore case for completion
+set completion-ignore-case on
+
+
+ +
+
# VI mode (works in bash and zsh)
+set editing-mode vi
+
+# Show which mode (normal or insert)
+set show-mode-in-prompt on
+
+# Show the mode by changing the cursor
+set vi-ins-mode-string \1\e[6 q\2
+set vi-cmd-mode-string \1\e[2 q\2
+
+set keymap vi-command
+# these are for vi-command mode
+Control-l: clear-screen
+Control-a: beginning-of-line
+
+set keymap vi-insert
+# these are for vi-insert mode
+Control-l: clear-screen
+Control-a: beginning-of-line
+
+
+
+
+ +
+

GnuPG

+
+
+
max-cache-ttl 60480000
+default-cache-ttl 60480000
+
+
+
+
+ +
+

Redshift

+
+
+
[redshift]
+temp-day=5700
+temp-night=3500
+
+transition=1
+
+;brightness-day=0.7
+;brightness-night=0.4
+
+location-provider=manual
+
+adjustment-method=randr
+
+[manual]
+lat=45.1
+lon=5.7
+
+
+
+
+ +
+

dmenu

+
+
+
# define the font for dmenu to be used
+DMENU_FN="Hack Nerd Font 12"
+
+# background colour for unselected menu-items
+DMENU_NB="#222D31"
+
+# textcolour for unselected menu-items
+DMENU_NF="#F9FAF9"
+
+# background colour for selected menu-items
+DMENU_SB="#16A085"
+
+# textcolour for selected menu-items
+DMENU_SF="#F9FAF9"
+
+# command for the terminal application to be used:
+TERMINAL_CMD="terminal -e"
+
+# export our variables
+DMENU_OPTIONS="-fn $DMENU_FN -nb $DMENU_NB -nf $DMENU_NF -sf $DMENU_SF -sb $DMENU_SB"
+
+
+
+
+ +
+

Locale

+
+
+
LANG=en_US.UTF-8
+LC_CTYPE="en_US.UTF-8"
+LC_NUMERIC=fr_FR.UTF-8
+LC_TIME=fr_FR.UTF-8
+LC_COLLATE="en_US.UTF-8"
+LC_MONETARY=fr_FR.UTF-8
+LC_MESSAGES="en_US.UTF-8"
+LC_PAPER=fr_FR.UTF-8
+LC_NAME=fr_FR.UTF-8
+LC_ADDRESS=fr_FR.UTF-8
+LC_TELEPHONE=fr_FR.UTF-8
+LC_MEASUREMENT=fr_FR.UTF-8
+LC_IDENTIFICATION=fr_FR.UTF-8
+LC_ALL=
+
+
+
+
+ +
+

Pass Git Helper

+
+
+
[github.com*]
+target=github.com/tdehaeze
+
+
+
+
+ +
+

Clipit (Clipboard Manager)

+
+
+
[rc]
+use_copy=true
+use_primary=false
+synchronize=false
+automatic_paste=false
+show_indexes=false
+save_uris=false
+use_rmb_menu=false
+save_history=false
+history_limit=50
+items_menu=20
+statics_show=false
+statics_items=10
+hyperlinks_only=false
+confirm_clear=false
+single_line=false
+reverse_history=false
+item_length=50
+ellipsize=2
+history_key=
+actions_key=
+menu_key=
+search_key=
+offline_key=
+offline_mode=false
+
+
+
+
+ +
+

Nitrogen (Wallpaper manager)

+
+
+
[geometry]
+posx=560
+posy=65
+sizex=578
+sizey=591
+
+[nitrogen]
+view=list
+recurse=false
+sort=alpha
+icon_caps=false
+dirs=/home/thomas/.wallpapers;
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/contacts.html b/docs/contacts.html new file mode 100644 index 0000000..c0bc26d --- /dev/null +++ b/docs/contacts.html @@ -0,0 +1,328 @@ + + + + + + + + +Calendar Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Calendar Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

Khard

+
+
+
# example configuration file for khard version >= 0.13.0
+# place it under $HOME/.config/khard/khard.conf
+
+[addressbooks]
+[[google]]
+path = ~/.contacts/default/
+
+[general]
+debug = no
+default_action = list
+editor = vim
+merge_editor = vimdiff
+
+[contact table]
+# display names by first or last name: first_name / last_name
+display = first_name
+# group by address book: yes / no
+group_by_addressbook = no
+# reverse table ordering: yes / no
+reverse = no
+# append nicknames to name column: yes / no
+show_nicknames = no
+# show uid table column: yes / no
+show_uids = yes
+# sort by first or last name: first_name / last_name
+sort = last_name
+# localize dates: yes / no
+localize_dates = yes
+# set a comma separated list of preferred phone number types in descending priority
+# or nothing for non-filtered alphabetical order
+preferred_phone_number_type = pref, cell, home
+# set a comma separated list of preferred email address types in descending priority
+# or nothing for non-filtered alphabetical order
+preferred_email_address_type = pref, work, home
+
+[vcard]
+# extend contacts with your own private objects
+# these objects are stored with a leading "X-" before the object name in the vcard files
+# every object label may only contain letters, digits and the - character
+# example:
+#   private_objects = Jabber, Skype, Twitter
+private_objects = Jabber, Skype, Twitter
+# preferred vcard version: 3.0 / 4.0
+preferred_version = 3.0
+# Look into source vcf files to speed up search queries: yes / no
+search_in_source_files = no
+# skip unparsable vcard files: yes / no
+skip_unparsable = no
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/doom/config.html b/docs/doom/config.html new file mode 100644 index 0000000..7a26df5 --- /dev/null +++ b/docs/doom/config.html @@ -0,0 +1,4392 @@ + + + + + + + + +Doom Emacs Configuration + + + + + + +
+

Doom Emacs Configuration

+
+

Table of Contents

+
+ +
+
+ +

+https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b +https://noelwelsh.com/posts/2019-01-10-doom-emacs.html +https://dotdoom.netlify.com/config.html +

+ +

+Documentation: +

+ + +
+

Useful Bindings

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
spc :Execute command
spc <Switch to buffer
spc Xorg-capture
spc s sSearch in buffer with swiper
spc s pSearch in project
spc p pSwitch project
spc p tTODOs in project
spc o fCreate frame
spc o eToggle Eshell
spc n lStore link
spc g gMagit status
spc f rOpen recent file
spc b BSwitch to buffer
spc b dKill current buffer
spc b iibuffer
spc tab .Switch to workspace
spc tab nNew workspace
spc tab rRename workspace
spc m Aorg-archive-subtree
spc m Iorg-toggle-inline-images
spc m dorg-deadline
spc m eorg-export-dispatch
spc m oorg-set-property
spc m sorg-schedule
spc m torg-todo
+ + + + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
C-c C-v porg-babel-previous-src-block
C-c C-v norg-babel-next-src-block
C-c C-v eorg-babel-execute-maybe
C-c C-v oorg-babel-open-src-block-result
C-c C-v vorg-babel-expand-src-block
C-c C-v uorg-babel-goto-src-block-head
C-c C-v gorg-babel-goto-named-src-block
C-c C-v rorg-babel-goto-named-result
C-c C-v borg-babel-execute-buffer
C-c C-v sorg-babel-execute-subtree
C-c C-v dorg-babel-demarcate-block
C-c C-v torg-babel-tangle
C-c C-v forg-babel-tangle-file
C-c C-v corg-babel-check-src-block
C-c C-v jorg-babel-insert-header-arg
C-c C-v lorg-babel-load-in-session
C-c C-v iorg-babel-lob-ingest
C-c C-v Iorg-babel-view-src-block-info
C-c C-v zorg-babel-switch-to-session-with-code
C-c C-v aorg-babel-sha1-hash
C-c C-v horg-babel-describe-bindings
C-c C-v xorg-babel-do-key-sequence-in-edit-buffer
+
+
+ +
+

Personal Information

+
+
+
;; These are used for a number of things, particularly for GPG configuration,
+;; some email clients, file templates and snippets.
+(setq user-full-name "Dehaeze Thomas"
+      user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+

Doom Config

+
+
+
(setq doom-font (font-spec :family "Hack Nerd Font Mono" :size 12 :weight 'semi-light)
+      doom-variable-pitch-font (font-spec :family "Hack Nerd Font Mono")
+      doom-unicode-font (font-spec :family "Hack Nerd Font Mono" :size 12)
+      doom-big-font (font-spec :family "Hack Nerd Font Mono" :size 19))
+
+
+ +
+
;; There are two ways to load a theme. Both assume the theme is installed and
+;; available. You can either set `doom-theme' or manually load a theme with the
+;; `load-theme' function. These are the defaults.
+(setq doom-theme 'doom-gruvbox)
+
+
+ +
+
(setq display-line-numbers-type t)
+
+
+
+
+ +
+

Evil

+
+
+
(after! evil
+    (map! :m  "-"  #'dired-jump))
+
+
+ +
+
(map!
+ (:after evil
+   :en "C-h"   #'evil-window-left
+   :en "C-j"   #'evil-window-down
+   :en "C-k"   #'evil-window-up
+   :en "C-l"   #'evil-window-right))
+
+
+ +
+
(after! which-key
+  (setq which-key-idle-delay 0.5
+        which-key-idle-secondary-delay 0.01
+        which-key-sort-order 'which-key-key-order-alpha))
+
+
+
+
+ +
+

Basic

+
+
+
+

Visual

+
+

+Automatic line wrap. +

+
+
(global-visual-line-mode t)
+
+
+ +

+Turn off auto-fill mode that add line breaks. +

+
+
(auto-fill-mode -1)
+
+
+
+
+ +
+

Change default alert backend

+
+
+
(setq alert-default-style 'libnotify)
+
+
+
+
+ +
+

Lockfiles

+
+
+
(setq create-lockfiles nil)
+
+
+
+
+
+ +
+

Magit

+
+
+
(setenv "GIT_ASKPASS" "git-gui--askpass")
+
+(setq magit-diff-refine-hunk 'all)
+
+
+
+
+ +
+

Org Mode

+ + +
+

Make sure to load Org

+
+
+
(require 'org)
+
+
+
+
+ +
+

Org General Config

+
+
+
(setq org-directory "~/Cloud/org/")
+
+(setq org-default-notes-file "~/Cloud/org/refile.org")
+
+;; Highligh latex parts in org mode
+(setq org-highlight-latex-and-related '(native))
+
+;; The following setting hides blank lines between headings which keeps folded view nice and compact.
+(setq org-cycle-separator-lines 0)
+
+;; Indent according to the outline structure
+(setq org-startup-indented t)
+
+;; Record the information of when the task was marked as DONE
+(setq org-log-done 'time)
+
+
+ +

+TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with: +

+
+
(after! evil-org
+  (remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h))
+
+
+
+
+ +
+

Org latex fragment

+
+
+
(setq org-highlight-latex-and-related '(native))
+
+
+ +
+
  (defvar tdh/org-latex-fragment-last nil
+    "Holds last fragment/environment you were on.")
+
+  (defun tdh/org-in-latex-fragment-p ()
+    "Return the point where the latex fragment begins, if inside
+  a latex fragment. Else return false"
+    (let* ((el (org-element-context))
+           (el-type (car el)))
+      (and (or (eq 'latex-fragment el-type) (eq 'latex-environment el-type))
+          (org-element-property :begin el))))
+
+  (defun tdh/org-latex-fragment-toggle ()
+    "Toggle a latex fragment image "
+    (and (eq 'org-mode major-mode)
+   (let ((begin (tdh/org-in-latex-fragment-p)))
+           (cond
+            ;; were on a fragment and now on a new fragment
+            ((and
+              ;; fragment we were on
+              tdh/org-latex-fragment-last
+              ;; and are on a fragment now
+              begin
+
+              ;; but not on the last one this is a little tricky. as you edit the
+              ;; fragment, it is not equal to the last one. We use the begin
+              ;; property which is less likely to change for the comparison.
+              (not (and tdh/org-latex-fragment-last
+      (= begin
+         tdh/org-latex-fragment-last))))
+             ;; go back to last one and put image back, provided there is still a fragment there
+             (save-excursion
+               (goto-char tdh/org-latex-fragment-last)
+               (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment))
+
+               ;; now remove current image
+               (goto-char begin)
+               (let ((ov (loop for ov in (org--list-latex-overlays)
+                               if
+                               (and
+r       (<= (overlay-start ov) (point))
+        (>= (overlay-end ov) (point)))
+                               return ov)))
+     (when ov
+                   (delete-overlay ov)))
+               ;; and save new fragment
+               (setq tdh/org-latex-fragment-last begin)))
+
+            ;; were on a fragment and now are not on a fragment
+            ((and
+              ;; not on a fragment now
+              (not begin)
+              ;; but we were on one
+              tdh/org-latex-fragment-last)
+             ;; put image back on, provided that there is still a fragment here.
+             (save-excursion
+               (goto-char tdh/org-latex-fragment-last)
+               (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment)))
+
+             ;; unset last fragment
+             (setq tdh/org-latex-fragment-last nil))
+
+            ;; were not on a fragment, and now are
+            ((and
+              ;; we were not one one
+              (not tdh/org-latex-fragment-last)
+              ;; but now we are
+              begin)
+             ;; remove image
+             (save-excursion
+               (goto-char begin)
+               (let ((ov (loop for ov in (org--list-latex-overlays)
+                               if
+                               (and
+        (<= (overlay-start ov) (point))
+        (>= (overlay-end ov) (point)))
+                               return ov)))
+     (when ov
+                   (delete-overlay ov))))
+             (setq tdh/org-latex-fragment-last begin))))))
+
+
+
+
+ +
+

Org Links

+
+
+
(map! :map org-mode-map "C-c l" 'org-store-link)
+
+
+
+
+ +
+

Org Tagging

+
+
+
;; Align Tags and flush right
+(setq org-tags-column -80)
+;; Tags with fast selection keys
+(setq org-tag-alist (quote (("@home" . ?h)
+                            ("@work" . ?w)
+                            ("@christophe" . ?c)
+                            ("@veijo" . ?v))))
+
+
+
+
+ +
+

Org Refile

+
+
+
(setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
+
+
+
+
+ +
+

Org TODO

+
+
+
;; 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)" "|")
+                          ))
+
+;; 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
+
+
+
+
+ +
+

Archive subtrees under the same hierarchy as original in the archive files

+
+

+https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb +

+ +
+
(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)))
+                     1
+                   (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
+                       (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 ?*)
+                            " "
+                            heading
+                            "\n"))
+                  (cl-incf level)))
+              (widen)
+              (org-end-of-subtree t t)
+              (org-paste-subtree level tree-text))))))))
+
+
+
+
+ +
+

Org Agenda

+
+
+
+

General configuration

+
+
+
(map! :map org-mode-map "C-c a" 'org-agenda)
+
+;; File to save todo items
+(setq org-agenda-files (list "~/Cloud/org/"))
+
+;; Include archived files
+(setq org-agenda-archives-mode t)
+
+;; Set priority range from A to C with default A
+(setq org-highest-priority ?A)
+(setq org-lowest-priority ?C)
+(setq org-default-priority ?C)
+
+;; Set colours for priorities
+(setq org-priority-faces '((?A . (:foreground "#CC241D"))
+                           (?B . (:foreground "#D65D0E"))
+                           (?C . (:foreground "#D79921"))))
+
+;; Open agenda in current window
+(setq org-agenda-window-setup 'current-window)
+
+(setq org-agenda-prefix-format
+  '((agenda  . " %-12:c %?-12t% s")
+    (todo  . "") ;; Don't show the filename for reading agenda
+    (tags  . " %-12:c")
+    (search . " %-12:c"))
+)
+
+
+
+
(map! :map org-mode-map "C-c a" 'org-agenda)
+
+;; File to save todo items
+(setq org-agenda-files (list "~/Cloud/org/"))
+
+;; Include archived files
+(setq org-agenda-archives-mode t)
+
+;; Set priority range from A to C with default A
+(setq org-highest-priority ?A)
+(setq org-lowest-priority ?C)
+(setq org-default-priority ?C)
+
+;; Set colours for priorities
+(setq org-priority-faces '((?A . (:foreground "#CC241D"))
+                           (?B . (:foreground "#D65D0E"))
+                           (?C . (:foreground "#D79921"))))
+
+;; Open agenda in current window
+(setq org-agenda-window-setup 'current-window)
+
+(setq org-agenda-prefix-format
+  '((agenda  . " %-12:c %?-12t% s")
+    (todo  . "") ;; Don't show the filename for reading agenda
+    (tags  . " %-12:c")
+    (search . " %-12:c")))
+
+
+
+
+ +
+

Org Agenda Custom Views

+
+

+https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html +

+ +
+
(defun tdh/org-agenda-skip-scheduled ()
+  (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))
+
+(setq org-agenda-custom-commands
+      '(("w" "Work" tags-todo "@work") ;; All todos related to work
+        ("h" "Home" tags-todo "@home") ;; All todos not related to work
+        ("q" . "Questions to ask")
+        ("qc" "Questions to Cristophe" tags "@christophe/QUES" ((org-agenda-overriding-header "Questions to Christophe")))
+        ("qm" "Questions to Muriel"    tags "@muriel/QUES"     ((org-agenda-overriding-header "Questions to Muriel")))
+        ("qo" "Questions to Olivier"   tags "@olivier/QUES"    ((org-agenda-overriding-header "Questions to Olivier")))
+        ("qq" "All questions"          tags "/QUES" ((org-agenda-overriding-header "Other questions")))
+        ("n" "Next things to do"
+         ((tags "+PRIORITY+\"A\""
+                ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
+                 (org-agenda-overriding-header "High-priority unfinished tasks:")))
+          (agenda "")
+          (todo "NEXT" ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled)(org-agenda-overriding-header "Next thing to do that are not scheduled")))
+          (todo "MAIL" ((org-agenda-overriding-header "Email to write/reply")))
+          (todo "WAIT" ((org-agenda-overriding-header "Things Waiting")))))
+        ("u" "Unscheduled tasks" todo "TODO"
+         ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled)
+          (org-agenda-overriding-header "Unscheduled TODO entries: ")))
+        ("r" "Things to read"
+         ((todo "READ"   ((org-agenda-overriding-header "Things to read"))))
+         ((org-agenda-files '("~/Cloud/thesis/ressources/notes/")))))
+      )
+
+
+
+
+
+ +
+

Org Notification based on calendar event

+
+

+https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events +

+ +
+
(setq appt-message-warning-time 5)
+(defun my-org-agenda-to-appt ()
+  (interactive)
+  (setq appt-time-msg-list nil)
+  (org-agenda-to-appt))
+
+(my-org-agenda-to-appt)
+; Display appointments as a window manager notification
+(setq appt-disp-window-function 'my-appt-display)
+(setq appt-delete-window-function (lambda () t))
+
+(setq my-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification"))
+(defun my-appt-display (min-to-app new-time msg)
+  (if (atom min-to-app)
+      (start-process "my-appt-notification-app" nil my-appt-notification-app min-to-app msg)
+      (dolist (i (number-sequence 0 (1- (length min-to-app))))
+      (start-process "my-appt-notification-app" nil my-appt-notification-app (nth i min-to-app) (nth i msg)))))
+
+
+
+ +
+

appt-notification script

+
+
+
TIME="$1"TODO
+MSG="$2"
+
+dunstify --replace=85401 "Event in $TIME minutes" "$MSG"
+
+
+
+
+
+ +
+

Org Structure Template

+
+
+
(setq org-structure-template-alist
+      '(("c" . "center")
+        ("C" . "comment")
+        ("i" . "important")
+        ("e" . "example")
+        ("q" . "quote")
+        ("s" . "src"))
+)
+
+
+
+
+ +
+

Org Capture

+
+

+Documentation: +

+ + +
+
(map! :map org-mode-map "C-c c" 'org-capture)
+
+
+ +
+
(setq org-capture-templates
+      (quote (("t"    ; key
+               "todo" ; name
+               entry  ; type
+               (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
+               "** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n" ; template
+               )
+              ("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
+               )
+              ("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"
+               :immediate-finish t
+              )
+              ("pu"
+               "Org-Protocol Url"
+               entry
+               (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
+               "* [[%:link][%:description]]\nCaptured On: %U\n\n"
+               :immediate-finish t
+              )
+              ("pt"
+               "Org-Protocol text"
+               entry
+               (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
+               )
+              )))
+
+
+
+
+ +
+

Org Export

+
+
+
+

Basic

+
+
+
;; How many levels of headline to export
+(setq org-export-headline-levels 4)
+
+;; Authorize BIND to set local variables
+(setq org-export-allow-bind-keywords t)
+
+(setq org-odt-preferred-output-format "doc")
+
+;; Used to not export headings with :ignore: tag
+(require 'ox-extra)
+(ox-extras-activate '(ignore-headlines))
+
+
+
+
+ +
+

Ox Latex Subfigure package

+
+
+
(use-package! ox-latex-subfigure
+  :config (require 'ox-latex-subfigure))
+
+
+
+
+ +
+

Clear page before heading

+
+

+https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892 +

+ +
+
(defun org/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))))
+
+(defun org/ensure-latex-clearpage (headline backend info)
+  (when (org-export-derived-backend-p backend 'latex)
+    (let ((elmnt (org/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
+             'org/ensure-latex-clearpage)
+
+
+
+
+ +
+

TODO HTML Export

+
+
+
+
MathJax
+
+
+
(setq org-html-mathjax-template
+  "<script type=\"text/x-mathjax-config\">
+    MathJax.Hub.Config({
+        displayAlign: \"%ALIGN\",
+        displayIndent: \"%INDENT\",
+
+        \"HTML-CSS\": { scale: %SCALE,
+                        linebreaks: { automatic: \"%LINEBREAKS\" },
+                        webFont: \"%FONT\"
+                       },
+        SVG: {scale: %SCALE,
+              linebreaks: { automatic: \"%LINEBREAKS\" },
+              font: \"%FONT\"},
+        NativeMML: {scale: %SCALE},
+        TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
+               MultLineWidth: \"%MULTLINEWIDTH\",
+               TagSide: \"%TAGSIDE\",
+               TagIndent: \"%TAGINDENT\",
+               Macros: {
+                 bm: [\"{\\\\boldsymbol #1}\",1],
+               }
+             }
+});
+</script>
+<script type=\"text/javascript\"
+        src=\"%PATH\"></script>")
+
+
+
+
+ +
+
Export with css class instead of inline css
+
+
+
(setq org-html-htmlize-output-type 'css)
+
+
+
+
+ +
+
TODO MP4 movies
+
+
+
(setq org-html-html5-fancy t)
+(setq org-html-doctype "xhtml-strict")
+
+
+
+
+
+
+ +
+

Org LaTeX

+
+
+
+

Org CdLatex

+
+

+https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode +

+
+
(push "~/.config/doom/local/" load-path)
+(require 'cdlatex)
+(add-hook 'org-mode-hook 'turn-on-org-cdlatex)
+
+
+
+
+ +
+

LaTeX Classes

+
+
+
;; Custom classes to use when exporting to latex
+(add-to-list 'org-latex-classes
+          `("beamer"
+            ,(concat "\\documentclass[presentation]{beamer}\n"
+                     "[DEFAULT-PACKAGES]"
+                     "[PACKAGES]"
+                     "[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}"))
+             )
+(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}"))
+             )
+(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}"))
+             )
+(add-to-list 'org-latex-classes
+             '("scrreprt"
+               "\\documentclass{scrreprt}"
+               ("\\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}"))
+             )
+
+
+
+
+ +
+

Basic

+
+
+
;; Add packages by default
+(add-to-list 'org-latex-packages-alist '("" "siunitx" t))
+(add-to-list 'org-latex-packages-alist '("" "array" t))
+(add-to-list 'org-latex-packages-alist '("" "tabularx" t))
+(add-to-list 'org-latex-packages-alist '("" "booktabs" t))
+(add-to-list 'org-latex-packages-alist '("" "bm" t))
+(add-to-list 'org-latex-packages-alist '("most" "tcolorbox" t))
+
+;; Setup default option for image size when exporting to LaTeX
+(setq org-latex-image-default-option "scale=1")
+(setq org-latex-image-default-width nil)
+
+;; Use define labels instead of automatic generated ones
+(setq org-latex-prefer-user-labels t)
+
+;; Captions above the table
+(setq org-latex-caption-above '(table))
+
+;; Settings to export code with `minted' instead of `verbatim'.
+(setq org-latex-listings 'minted)
+
+;; Command used when exporting to pdf
+(setq org-latex-pdf-process
+      '("latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f"))
+
+
+
+
+ +
+

Beamer

+
+

+Bold Text +

+
+
(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...
+     "\\\\textbf"
+     contents)))
+
+(add-to-list 'org-export-filter-bold-functions 'tdh/my-beamer-bold)
+
+
+ + +

+Special Environments +

+
    +
  • [ ] Make some comment those special environments
  • +
+
+
(add-to-list 'org-beamer-environments-extra
+             '("cbox" ;; Name of environment
+               "m" ;; Selection key
+               "\\onslide%a{\\begin{cbox}[%h]%O"
+               "\\end{cbox}}\\vspace{0.5em}"))
+(add-to-list 'org-beamer-environments-extra
+             '("csubbox" ;; Name of environment
+               "M" ;; Selection key
+               "\\onslide%a{\\tcbsubtitle{%h}"
+               "}"))
+
+
+
+
+ +
+

TODO Latex Fragments

+
+
    +
  • [ ] The remove hook does not seems to work
  • +
+

+http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/ +

+ +
+
  (map! :map org-mode-map
+        ;; Activate Automatic LaTeX fragment
+        :n ",ol" '(lambda () (interactive) (add-hook 'post-command-hook 'tdh/org-latex-fragment-toggle t))
+        ;; ;; Disable Automatic LaTeX fragment
+        :n ",oL" '(lambda () (interactive) (remove-hook 'post-command-hook 'tdh/org-latex-fragment-toggle)))
+
+;; Use F9 to globally generate all the latex fragments
+  (map! :map org-mode-map :n "<f9>" (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 ("latex" "convert")
+                                           :description "pdf > png"
+                                           :message "you need to install the programs: latex and imagemagick."
+                                           :image-input-type "pdf"
+                                           :image-output-type "png"
+                                           :image-size-adjust (0.6 . 0.6)
+                                           :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f")
+                                           :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O"))
+                                          (pdf2svg
+                                           :programs ("latex" "pdf2svg")
+                                           :description "pdf > svg"
+                                           :message "you need to install the programs: pdflatex and pdf2svg."
+                                           :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 && pdftocairo -svg %f %O"))
+                                           ;; :image-converter ("pdf2svg %f %O"))
+                                          (dvisvgm
+                                           :programs ("latex" "dvisvgm")
+                                           :description "dvi > svg"
+                                           :message "you need to install the programs: latex and dvisvgm."
+                                           :image-input-type "dvi"
+                                           :image-output-type "svg"
+                                           :image-size-adjust (0.8 . 0.8)
+                                           :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
+                                           :image-converter ("dvisvgm %f -n -b min -c %S -o %O"))
+                                          ))
+
+  ;; Use imagemagick/dvisvgm to generate png from pdf
+  (setq org-preview-latex-default-process 'dvisvgm)
+
+
+
+
+ +
+

TODO Custom Export - Add Page and Label for LaTeX export

+
+

+https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1 +

+ +
+
(defcustom tdehaeze/org-property-mapping
+  '((latex ("CUSTOM_PAGE" . tdehaeze/insert-org-page-latex)
+           ("CUSTOM_LABEL" . tdehaeze/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)))))
+
+
+ +
+
(defun tdehaeze/replace-org-property (backend)
+  "Convert org properties using `tdehaeze/org-property-mapping'.
+Lookup BACKEND in `tdehaeze/org-property-mapping' for a list of
+(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 tdehaeze/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)))))))))
+
+(add-hook 'org-export-before-processing-hook #'tdehaeze/replace-org-property)
+
+
+ +
+
(defun tdehaeze/insert-org-label-latex (label)
+  "Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."
+  (search-forward-regexp org-property-end-re)
+  (forward-char 1)
+  (insert (format "\\label{%s}\n" label)))
+(defun tdehaeze/insert-org-page-latex (page)
+  "Insert \"\\\\page{PAGE}\\n\" after the :PROPERTY: drawer."
+  (search-forward-regexp org-property-end-re)
+  (forward-char 1)
+  (insert (format "\\page{%s}\n" page)))
+
+
+ +
+
(defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info)
+  "Default format function for a headline.
+   See `org-latex-format-headline-function' for details."
+  (concat
+   (and todo (format "{\\bfseries\\sffamily %s} " todo))
+   (and priority (format "\\framebox{\\#%c} " priority))
+   text
+   (and tags
+        (format "\\hfill{}\\textsc{%s}"
+                (mapconcat #'org-latex--protect-text tags ":")))
+   (and todo (format "{\n\\page{%s} " todo)))
+
+
+
+
+ +
+

Number Equations

+
+
+
(defun org-renumber-environment (orig-func &rest args)
+  "A function to inject numbers in LaTeX fragment previews."
+  (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))))
+      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))
+            ;; \\ is used for a new line. Each one leads to a number
+            (incf counter (count-matches "\\\\$"))
+            ;; unless there are nonumbers.
+            (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)))))
+
+  (apply orig-func args))
+
+(advice-add 'org-create-formula-image :around #'org-renumber-environment)
+
+
+
+
+
+ +
+

TODO View PDF in org mode

+
+
+
(defun tdh/org-include-img-from-pdf (&rest _)
+  "Convert pdf files to image files in org-mode bracket links.
+    # ()convertfrompdf:t # This is a special comment; tells that the upcoming
+                         # link points to the to-be-converted-to file.
+    # If you have a foo.pdf that you need to convert to foo.png, use the
+    # foo.png file name in the link.
+    [[./foo.png]]
+"
+  (interactive)
+  (if (executable-find "convert")
+      (save-excursion
+        (goto-char (point-min))
+        (while (re-search-forward "^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"
+                                  nil :noerror)
+          ;; Keep on going to the next line till it finds a line with bracketed
+          ;; file link.
+          (while (progn
+                   (forward-line 1)
+                   (not (looking-at org-bracket-link-regexp))))
+          ;; Get the sub-group 1 match, the link, from `org-bracket-link-regexp'
+          (let ((link (match-string-no-properties 1)))
+            (when (stringp link)
+              (let* ((imgfile (expand-file-name (file-name-sans-extension link)))
+                     (pdffile (expand-file-name
+                               (concat imgfile
+                                       "." "pdf")))
+                     (cmd (concat "pdftocairo -png -transp -singlefile "
+                                  pdffile " " imgfile)))
+
+                (message "%s" imgfile)
+                (when (and (file-readable-p pdffile)
+                           (file-newer-than-file-p pdffile imgfile))
+                  ;; This block is executed only if pdffile is newer than
+                  ;; imgfile or if imgfile does not exist.
+                  (shell-command cmd)
+                  (message "%s" cmd)))))))
+    (user-error "`convert' executable (part of Imagemagick) is not found")))
+  (add-hook 'org-export-before-processing-hook #'tdh/org-include-img-from-pdf)
+
+
+ +
+
(add-to-list 'image-type-file-name-regexps '("\\.pdf\\'" . imagemagick))
+(add-to-list 'image-file-name-extensions "pdf")
+(setq imagemagick-types-inhibit (remove 'PDF imagemagick-types-inhibit))
+(setq org-image-actual-width 600)
+
+
+ +
+
(defun my-latex-filter-nobreaks (text backend info)
+  "Ensure \" \" are properly handled in LaTeX export."
+  (when (org-export-derived-backend-p backend 'latex)
+    (replace-regexp-in-string " " "~" text)))
+
+(add-to-list 'org-export-filter-plain-text-functions
+            'my-latex-filter-nobreaks)
+
+
+ +
+
(setq image-file-name-extensions
+   (quote
+    ("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg" "pdf" "bmp")))
+
+(setq org-image-actual-width 600)
+
+(setq org-imagemagick-display-command "convert -density 600 \"%s\" -thumbnail \"%sx%s>\" \"%s\"")
+(defun org-display-inline-images (&optional include-linked refresh beg end)
+  "Display inline images.
+Normally only links without a description part are inlined, because this
+is how it will work for export.  When INCLUDE-LINKED is set, also links
+with a description part will be inlined.  This
+can be nice for a quick
+look at those images, but it does not reflect what exported files will look
+like.
+When REFRESH is set, refresh existing images between BEG and END.
+This will create new image displays only if necessary.
+BEG and END default to the buffer boundaries."
+  (interactive "P")
+  (unless refresh
+    (org-remove-inline-images)
+    (if (fboundp 'clear-image-cache) (clear-image-cache)))
+  (save-excursion
+    (save-restriction
+      (widen)
+      (setq beg (or beg (point-min)) end (or end (point-max)))
+      (goto-char beg)
+      (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
+                        (substring (org-image-file-name-regexp) 0 -2)
+                        "\\)\\]" (if include-linked "" "\\]")))
+            old file ov img)
+        (while (re-search-forward re end t)
+          (setq old (get-char-property-and-overlay (match-beginning 1)
+                                                   'org-image-overlay)
+        file (expand-file-name
+                      (concat (or (match-string 3) "") (match-string 4))))
+          (when (file-exists-p file)
+            (let ((file-thumb (format "%s%s_thumb.png" (file-name-directory file) (file-name-base file))))
+              (if (file-exists-p file-thumb)
+                  (let ((thumb-time (nth 5 (file-attributes file-thumb 'string)))
+                        (file-time (nth 5 (file-attributes file 'string))))
+                    (if (time-less-p thumb-time file-time)
+            (shell-command (format org-imagemagick-display-command
+                           file org-image-actual-width org-image-actual-width file-thumb) nil nil)))
+                (shell-command (format org-imagemagick-display-command
+                                         file org-image-actual-width org-image-actual-width file-thumb) nil nil))
+              (if (and (car-safe old) refresh)
+                  (image-refresh (overlay-get (cdr old) 'display))
+                (setq img (save-match-data (create-image file-thumb)))
+                (when img
+                  (setq ov (make-overlay (match-beginning 0) (match-end 0)))
+                  (overlay-put ov 'display img)
+                  (overlay-put ov 'face 'default)
+                  (overlay-put ov 'org-image-overlay t)
+                  (overlay-put ov 'modification-hooks
+                               (list 'org-display-inline-remove-overlay))
+                  (push ov org-inline-image-overlays))))))))))
+
+
+ +

+Two options: +

+
    +
  • work with .png file extension and only replace with .pdf when exporting to LaTeX if the corresponding file exists
  • +
  • work with .pdf file, add a special function to display .pdf files (using convert or pdftocairo). Change to .png when exporting to html
  • +
+ +

+Let’s try the first solution. +

+ +
+
(defun tdh/change-png-to-pdf (text backend info)
+  "Change png images to pdf images when existing"
+  (when (org-export-derived-backend-p backend 'latex)
+    (let ((text (replace-regexp-in-string "[^\\w]\\(:\\)[^\n\t\r]+\\(:\\)[^\\w]" "<mark>"  text nil nil 1 nil)))
+      (replace-regexp-in-string "[^\\w]\\(<mark>\\)[^\n\t\r]+\\(:\\)[^\\w]" "</mark>" text nil nil 2 nil))))
+
+(add-to-list 'org-export-filter-plain-text-fucntions 'my-html-mark-tag)
+
+
+ +
+
(save-excursion
+        (goto-char (point-min))
+        (while (re-search-forward "^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"
+                                  nil :noerror)
+          ;; Keep on going to the next line till it finds a line with bracketed
+          ;; file link.
+          (while (progn
+                   (forward-line 1)
+                   (not (looking-at org-bracket-link-regexp))))
+          ;; Get the sub-group 1 match, the link, from `org-bracket-link-regexp'
+          (let ((link (match-string-no-properties 1)))
+            (when (stringp link)
+              (let* ((imgfile (expand-file-name link))
+                     (pdffile (expand-file-name
+                               (concat (file-name-sans-extension imgfile)
+                                       "." "pdf")))
+                     (cmd (concat "convert -density 96 -quality 85 "
+                                  pdffile " " imgfile)))
+                (when (and (file-readable-p pdffile)
+                           (file-newer-than-file-p pdffile imgfile))
+                  ;; This block is executed only if pdffile is newer than
+                  ;; imgfile or if imgfile does not exist.
+                  (shell-command cmd)
+                  (message "%s" cmd)))))))
+
+
+
+
+ +
+

Org Ref

+
+

+Ressources: +

+ + +
+
;; Folder where the notes files are located (or file if just one Note file)
+(setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes")
+(setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes")
+
+;; Bibliography File
+(setq reftex-default-bibliography  '("~/Cloud/thesis/ressources/references.bib"))
+(setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
+
+;; Folder where all the pdf are located
+(setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs")
+
+;; 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)))))))
+
+;; Problem with speed: don't display broken links
+(setq org-ref-show-broken-links nil)
+;; Display information on the citation
+(setq org-ref-show-citation-on-enter t)
+
+
+
+
+ +
+

Org Noter

+
+ + +
+
(setq org-noter-always-create-frame nil)
+(setq org-noter-kill-frame-at-session-end nil)
+;; Fraction of the frame that the document window will occupy when split
+(setq org-noter-doc-split-fraction '(0.6 . 0.6))
+;; Save the last visited location automatically; when starting a new session, go to that location
+(setq org-noter-auto-save-last-location t)
+;; Add an empty line between each note's heading and content
+(setq org-noter-separate-notes-from-heading t)
+;; List of paths to check (non recursively) when searching for a notes file
+(setq org-noter-notes-search-path "~/Cloud/thesis/ressources/notes")
+
+
+
+
+ +
+

Custom key bindings

+
+

+Export to LaTeX +

+
+
(map! :map org-mode-map :n ",l" 'org-latex-export-to-latex)
+
+
+ +

+Open pdf externally. +

+
+
(defun tdh/open-org-pdf-externally ()
+  (interactive)
+  (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".pdf"))
+  )
+
+(map! :map org-mode-map :n ",vp" 'tdh/open-org-pdf-externally)
+
+
+ +

+Open HTML externally. +

+
+
(defun tdh/open-org-html-externally ()
+  (interactive)
+  (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html"))
+  )
+
+(map! :map org-mode-map :n ",vh" 'tdh/open-org-html-externally)
+
+
+
+
+ +
+

TODO Org-Contacts

+
+
+
(setq org-contacts-files (list "~/Cloud/org/contacts.org"))
+
+
+
+
+ +
+

TODO Org-Wunderlist

+
+
+
(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641"
+      org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"
+      org-wunderlist-file "~/Cloud/thesis/todos/wunderlist.org"
+      org-wunderlist-dir "~/.emacs.d/org-wunderlist/")
+
+
+
+
+ +
+

Automatically run startblock when opening org-mode files

+
+
+
(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))
+    nil
+    )
+  )
+
+(add-hook 'org-mode-hook 'tdh/eval-startblock)
+
+
+
+
+ +
+

TODO Insert ScreenShot or Picture from Phone

+
+

+http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/ +

+ +
    +
  • [ ] One function to move file from ~/Picture/ folder (where the screenshots are taken) to current directory and then insert and org link to the picture. Maybe ask if it should be copied in a sub directory (figs folder for instance).
  • +
  • [ ] One function to copy file from ~/Cloud/Photos/ folder (where the pictures from phone are taken) to current directory (and ask for the new name of the picture) and insert org link.
  • +
+ +
+
;; required libraries
+(require 'dash)
+;; (require 'swiper)
+(require 's)
+
+;; start directory
+(defvar tdh/image-dir (expand-file-name "/home/thomas/Pictures"))
+
+(defun tdh/insert-conference-image ()
+  "Insert image from conference directory, rename and add link in current file.
+
+The file is taken from a start directory set by `tdh/image-dir' and moved to the current directory, renamed and embedded at the point as an org-mode link. The user is presented with a list of files in the start directory, from which to select the file to move, sorted by most recent first."
+  (interactive)
+  (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)))
+
+    ;; Get target directory
+    (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))))))
+
+    ;; Use ivy to select start-file
+    (setq start-file (ivy-read
+                      (concat "Move selected file to " target-dir ":")
+                      file-list-sorted
+                      :re-builder #'ivy--regex
+                      :sort 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))
+
+    ;; final file name including path
+    (setq end-file-full
+          (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)))
+
+    ;; display image
+    (org-display-inline-images t t)))
+
+
+
+
+ +
+

TODO Render Tables

+
+

+https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/ +

+ +
+
(defun my-render-org-table-at-point ()
+  (interactive)
+  (save-excursion
+    (beginning-of-line)
+    ;; removes the overlay is already there
+    (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")
+
+          (while (not (eq 'table (org-element-type (org-element-at-point))))
+            (forward-line -1))
+          (my-render-org-table (org-element-at-point))
+          )))))
+
+
+(defun my-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)
+                ;; 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))
+    )
+
+
+(defun my-render-org-tables-in-buffer ()
+  (save-excursion
+    (org-element-map (org-element-parse-buffer) 'table 'my-render-org-table)))
+
+  ;; Use F9 to globally generate tables
+  (map! :map org-mode-map :n "<f8>" (lambda () (interactive) (my-render-org-table-at-point)))
+
+
+
+
+ +
+

Org Gcal

+
+ + +
+
(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) ))
+
+
+
+
+
+ +
+

Org Babel

+
+
+
+

Main configuration

+
+
+
;; Don't ask for confirmation when evalutating latex blocs
+(defun my-org-confirm-babel-evaluate (lang body)
+  (not (member lang '("emacs-lisp" "latex" "matlab" "sh"))))
+(setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
+
+
+ +
+
;; Use the current window for C-c ' source editing
+(setq org-src-window-setup 'current-window)
+
+
+
+
+ +
+

Special Shortcuts

+
+

+https://emacs.stackexchange.com/questions/13869/how-to-toggle-org-mode-source-code-block-eval-no-status +

+ +

+Remap ctrl-ret to execute the source block and go to the next source block +when inside a source block. Otherwise, keep the normal behavior for ctrl-ent. +

+ +
+
(defun tdh/ctrl-ret ()
+  (interactive)
+  (defun in-src-block-p ()
+    "Returns t when the point is inside a source code block"
+    (string= "src" (org-in-block-p '("src"))))
+
+  (defun in-src-block-function ()
+    "Function to do when inside the src block"
+     (progn
+      (org-babel-execute-src-block)
+      (org-babel-next-src-block)))
+
+  (if (in-src-block-p)
+      (in-src-block-function)
+    (+org--insert-item 'below)))
+
+ (map! :map evil-org-mode-map
+       :n "<C-return>" #'tdh/ctrl-ret)
+
+
+ +
+
;; (evil-define-minor-mode-key 'normal 'org-src-mode "q" 'org-edit-src-exit)
+
+
+ +

+Remap C-c C-c: +https://emacs.stackexchange.com/questions/22430/rebind-org-babel-execute-src-block-maybe-to-c-c-c-c/22530#22530 +

+
+
+ +
+

Library of Babel

+
+

+Add all named source blocks to org-babel-library-of-babel. +

+ +
+
(org-babel-lob-ingest "~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org")
+
+
+
+
+ +
+

Org-Babel Matlab

+
+
+
(setq org-babel-matlab-shell-command "/home/thomas/bin/matlab -nodesktop -nosplash")
+
+(setq org-babel-matlab-emacs-link-wrapper-method
+  "%s
+  if ischar(ans);
+    echo('test');
+    fid = fopen('%s', 'w');
+    fprintf(fid, '%s', ans);
+    fclose(fid);
+  else;
+    save -ascii %s ans;
+  end
+  delete('%s');
+  ")
+
+
+
+
+ +
+

Default options for Matlab code

+
+
+
(setq org-babel-default-header-args:matlab
+      '((:results . "none")
+        (:session . "*MATLAB*")
+        (:comments . "org")
+        (:exports . "both")
+        (:cache .   "no")
+        (:noweb . "no")
+        (:hlines . "no")
+        (:tangle . "no")
+        (:mkdir . "yes")
+        (:eval . "no-export")))
+
+
+
+
+ +
+

TODO Asynchronous execution

+
+
+
;; (push "~/.emacs.d/private/ob-session-async/lisp/" load-path)
+;; (require 'ob-session-async)
+
+
+ +
+
;; (with-eval-after-load "ob"
+;;   (require 'org-babel-eval-in-repl))
+
+
+ +
+
;; (with-eval-after-load "eval-in-repl"
+;;   (setq eir-jump-after-eval nil))
+
+
+
+
+ +
+

TODO Theme

+
+
+
;; (after! org
+;;   (require 'color)
+;;   (set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))
+;;   )
+
+
+
+
+ +
+

Indentation

+
+
+
(setq org-edit-src-content-indentation 2
+      org-src-tab-acts-natively nil
+      org-src-preserve-indentation nil)
+
+
+
+
+ +
+

Some functions for using Matlab with Org Babel

+
+
+
+

whos matlab function

+
+
+
(defun tdh/matlab-whos (&optional start end)
+"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"))))
+
+
+
+
+ +
+

help matlab function

+
+
+
(defun tdh/matlab-help (start end)
+"Get help on the selected function"
+  (interactive "r")
+  (let ((regionp (buffer-substring start end)))
+  (process-send-string "*MATLAB*" (concat "help " regionp "\n"))))
+
+
+
+
+ +
+

Execute selected text

+
+
+
(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*" regionp)))
+
+
+
+
+ +
+

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")))
+
+
+
+
+ +
+

Execute the current source block with no output

+
+
+
(defun tdh/org-babel-execute (&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))))
+    ;; 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)))
+         ;; Expand noweb references in BODY and remove any
+         ;; coderef.
+         (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))))
+               (make-directory d 'parents)
+               d))))
+         (cmd (intern (concat "org-babel-execute:" lang)))
+         result)
+        ;; (message "%s" body)
+        (process-send-string "*MATLAB*" (concat body "\n"))
+        result))
+     )))
+    )
+  )
+
+
+
+
+ +
+

Execute the source block and go to the next one

+
+
+
(defun tdh/org-babel-execute-goto-next (&optional arg info params)
+  (interactive)
+  (tdh/org-babel-execute arg info params)
+  (org-babel-next-src-block)
+  )
+
+
+
+
+ +
+

Org-Babel Tangle Subtree

+
+
+
(defun tdh/org-babel-tangle-subtree ()
+  "Tangle the current subtree"
+  (interactive)
+  (progn
+    (org-narrow-to-subtree)
+    (org-babel-tangle)
+    (widen))
+  )
+
+
+ +
+
(map! :map org-mode-map :n ",bT" 'tdh/org-babel-tangle-subtree)
+
+
+
+
+ +
+

Org-Babel Jump to Tangle File

+
+

+Actually this tangle the file and then go to the file. Maybe I would like to ignore the tangling phase. +

+ +
+
(defun tdh/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)))
+    (when file
+      (setq file (expand-file-name file))
+      (if (file-readable-p file)
+      (find-file file)
+    (error "Cannot open tangle file %S" file)))))
+
+
+ +
+
(map! :map org-mode-map :n ",bF" 'tdh/org-babel-jump-to-tangle-file)
+
+
+
+
+ +
+

Org-Babel Tangle File and Execute

+
+
+
(defun tdh/org-babel-execute-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)))
+    (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)))))
+
+
+
+
+
+
+ +
+

LaTeX

+ + +
+

Basic LaTeX configuration

+
+
+
(defun latex/clean ()
+  "Clean LaTeX output using latexmk"
+  (interactive)
+  (async-shell-command
+   ;; command and parameters
+   "latexmk -c "
+   (shell-quote-argument buffer-file-name)
+   " &"
+  ))
+
+(map! :map LaTeX-mode-map :n ",C" 'latex/clean)
+
+(add-hook 'TeX-mode-hook #'TeX-fold-mode)
+
+
+
+
+ +
+

Master file

+
+
+
(setq-default TeX-master nil)
+
+
+
+
+ +
+

Pdf Viewer

+
+
+
(setq TeX-view-program-selection '((output-pdf "Zathura")))
+(setq TeX-source-correlate-mode t)
+(setq TeX-source-correlate-start-server t)
+(setq TeX-source-correlate-method 'synctex)
+(setq TeX-view-program-list
+      '(("PDF Tools" TeX-pdf-tools-sync-view)))
+
+
+
+
+
+ +
+

Helm-Bibtex

+
+
+
+

General Config

+
+
+
;; Use "tags" field when looking for bib entries
+(setq helm-bibtex-additional-search-fields '(keywords))
+
+;; Display of bibtex entries with helm
+(setq bibtex-completion-display-formats
+      '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
+
+;; Special symbols for notes and pdf
+(setq bibtex-completion-pdf-symbol "⌘")
+(setq bibtex-completion-notes-symbol "✎")
+
+;; Bibliography file
+(setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib")
+
+;; Directory with all the pdfs
+(setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs")
+
+;; Directory with notes files
+(setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes")
+
+;; Template used when creating new Note file
+(setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n"
+                                                              ":DRAWER:\n"
+                                                              "#+LATEX_CLASS: biblioreport\n"
+                                                              "\n"
+                                                              "#+OPTIONS: toc:nil title:nil\n"
+                                                              "#+OPTIONS: ':t -:t\n"
+                                                              "\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"
+                                                              "#+LATEX_HEADER: \\newcommand{\\refKeywords}{${keywords}}\n"
+                                                              "#+LATEX_HEADER: \\input{config.tex}\n"
+                                                              "#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"
+                                                              "# #+TOC: headlines 2\n"
+                                                              ":END:\n"
+                                                              "\n"
+                                                              "#+BEGIN_abstract\n"
+                                                              "\n"
+                                                              "#+END_abstract\n"
+                                                              "\n"
+                                                              "* ${title} :ignore:\n"
+                                                              ":PROPERTIES:\n"
+                                                              ":CUSTOM_ID: ${=key=}\n"
+                                                              ":AUTHOR:    ${author}\n"
+                                                              ":TYPE:      ${=type=}\n"
+                                                              ":JOURNAL:   ${journal}\n"
+                                                              ":YEAR:      ${year}\n"
+                                                              ":VOLUME:    ${volume}\n"
+                                                              ":PAGES:     ${pages}\n"
+                                                              ":DOI:       ${DOI}\n"
+                                                              ":URL:       ${url}\n"
+                                                              ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
+                                                              ":END:\n"
+                                                              "\n"))
+
+;; Make "Edit notes" the default action
+(after! helm-bibtex
+  (helm-delete-action-from-source "Edit notes" helm-source-bibtex)
+  (helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0)
+)
+
+
+
+
+ +
+

Open pdf externally

+
+
+
(defun tdehaeze/open-pdf-externally (key)
+  (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
+
+;; Action to open the pdf with Zathura
+(after! helm-bibtex
+  (helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex)
+  (helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1)
+)
+
+
+
+
+ +
+

Special Commands

+
+
+
(defun helm-bibtex-favorites (&optional arg)
+  "Search Favorite BibTeX entries"
+  (interactive "P")
+  (helm-bibtex arg nil "favorite "))
+
+
+
+
+ +
+

List all element of the bibliography without pdf associated

+
+
+
(defun list-bib-without-pdf-associated ()
+  (interactive)
+  (bibtex-completion-init)
+  (setq candidates (bibtex-completion-candidates))
+
+  (defun canditate-is-pdf-present (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)))
+                                     candidates-without-pdf))
+
+  (with-output-to-temp-buffer "*bib-without-pdf*" (princ (string-join candidate-without-pdf-names "\n")))
+  (switch-to-buffer-other-window "*bib-without-pdf*")
+  )
+
+
+
+
+
+ +
+

TODO Matlab

+ + +
+

Setup Matlab Mode

+
+
+
(setq matlab-shell-command "/home/thomas/bin/matlab")
+(setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
+(setq mlint-programs '("mlint" "/home/thomas/bin/mlint"))
+
+
+
+
+ +
+

Setup Flycheck

+
+
+
(defvar mlint-executable "/home/thomas/bin/mlint")
+
+(flycheck-define-command-checker 'matlab-mlint
+  "A Matlab checker based on mlint."
+  :command `(,mlint-executable source)
+  :error-patterns
+  '((warning line-start "L " line " (C " (1+ digit)  "): " (message) line-end))
+  :modes '(matlab-mode))
+
+(add-to-list 'flycheck-checkers 'matlab-mlint)
+
+;; Automatic startup of flycheck for matlab
+(add-hook 'matlab-mode-hook 'flycheck-mode)
+
+
+ +
+
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
+  (let ((file-name (buffer-file-name))) ;; (1)
+    ad-do-it                            ;; (2)
+    (setq buffer-file-name file-name))) ;; (3)
+
+
+
+
+ +
+

TODO Setup Company - not working

+
+
+
;; (add-to-list 'company-backends 'company-matlab)
+
+
+
+
+ +
+

TODO Beautify code

+
+
+
(defun matlab-beautify-buffer ()
+  "Beautify Current Buffer"
+  (interactive)
+  (save-buffer)
+  (matlab-shell-run-command (concat "MBeautify.formatFile(\"" (buffer-file-name) "\")"))
+)
+
+
+
+
+ +
+

Key Bindings

+
+
+
(defun matlab-add-breakpoint ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbstop in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
+(defun matlab-remove-breakpoint ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbclear in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
+(defun matlab-list-breakpoints ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbstatus " (buffer-name))))
+(defun matlab-clear-breakpoints ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbclear in " (buffer-name))))
+(defun matlab-go-to-file-directory ()
+  (interactive)
+  (matlab-shell-run-command (concat "cd " (file-name-directory buffer-file-name))))
+
+
+ +
+
(map! :map matlab-mode-map
+      :n ",g" 'matlab-go-to-file-directory
+      :n ",da" 'matlab-add-breakpoint
+      :n ",dr" 'matlab-remove-breakpoint
+      :n ",dL" 'matlab-list-breakpoints
+      :n ",dc" 'matlab-clear-breakpoints
+      :n ",dl" 'gud-cont
+      :n ",ds" 'gud-step
+      :n ",dn" 'gud-next
+      :n ",dq" 'gud-finish)
+
+
+
+
+ +
+

Wrong highlight of comments

+
+
+
(add-hook 'matlab-mode-hook
+        ;; `highlight-numbers-mode' breaks MATLAB comment coloring --
+        ;; `highlight-numbers-mode' is mostly redundant with
+        ;; `rainbow-identifiers-mode' anyway
+        (lambda ()
+          (highlight-numbers-mode -1))
+        ;; We must append the above *after* `spacemacs/run-prog-mode-hooks'
+        ;; in `matlab-mode-hook', since the former hook enables
+        ;; `highlight-numbers-mode'. Note that
+        ;; `spacemacs/run-prog-mode-hooks' is manually added to
+        ;; `matlab-mode-hook' by Spacemacs since the upstream `matlab-mode'
+        ;; package does not derive `matlab-mode' from `prog-mode' (oddly --
+        ;; IIRC the author refused to do so for compatibility with XEmacs).
+        'append)
+
+
+
+
+
+ +
+

TODO Mails With Mu4e

+ + +
+

Set default mail user agent to mu4e

+
+
+
(setq mail-user-agent 'mu4e-user-agent)
+
+
+
+
+ +
+

Default config

+
+
+
+

Default behavior

+
+
+
(setq mu4e-maildir "~/.mail"
+      mu4e-update-interval nil
+      mu4e-compose-signature-auto-include t
+      mu4e-view-show-images t
+      mu4e-view-show-addresses t)
+
+
+
+
+ +
+

Default folders

+
+
+
(setq mu4e-sent-folder "/gmail/Sent"
+      mu4e-drafts-folder "/gmail/Drafts"
+      mu4e-trash-folder "/gmail/Trash"
+      mu4e-refile-folder "/gmail/Archive"
+      mu4e-compose-signature "Thomas Dehaeze\n"
+      user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+

Default signature and email address

+
+
+
(setq mu4e-compose-signature "Thomas Dehaeze\n"
+      user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+

Saving the attachment to Downloads directory

+
+
+
(setq mu4e-attachment-dir "~/Downloads")
+
+
+
+
+ +
+

A list of user’s e-mail addresses

+
+
+
(setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr" "thomas.dehaeze@doct.ulg.ac.be"))
+
+
+
+
+ +
+

Mail directory shortcuts

+
+
+
(setq mu4e-maildir-shortcuts
+      '(
+        ("/gmail/Inbox" . ?g)
+        ("/esrf/Inbox"  . ?e)
+        ("/ulg/Inbox"   . ?u)
+        ))
+
+
+
+
+
+ +
+

TODO Contexts - Email accounts

+
+
+
(setq mu4e-contexts
+      `( ,(make-mu4e-context
+           :name "gmail"
+           :enter-func (lambda () (mu4e-message "Entering Gmail context"))
+           :leave-func (lambda () (mu4e-message "Leaving Gmail context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/gmail" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (mu4e-sent-messages-behavior . (delete))
+                   (user-mail-address . "dehaeze.thomas@gmail.com")
+                   (mu4e-sent-folder . "/gmail/Sent")
+                   (mu4e-trash-folder . "/gmail/Trash")
+                   (mu4e-drafts-folder . "/gmail/Drafts")
+                   (mu4e-refile-folder . "/gmail/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ,(make-mu4e-context
+           :name "esrf"
+           :enter-func (lambda () (mu4e-message "Entering ESRF context"))
+           :leave-func (lambda () (mu4e-message "Leaving ESRF context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/esrf" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (user-mail-address . "thomas.dehaeze@esrf.fr")
+                   (mu4e-sent-folder . "/esrf/Sent")
+                   (mu4e-trash-folder . "/esrf/Trash")
+                   (mu4e-drafts-folder . "/esrf/Drafts")
+                   (mu4e-refile-folder . "/esrf/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ,(make-mu4e-context
+           :name "ulg"
+           :enter-func (lambda () (mu4e-message "Entering ULG context"))
+           :leave-func (lambda () (mu4e-message "Leaving ULG context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/ulg" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (user-mail-address . "thomas.dehaeze@doct.ulg.ac.be")
+                   (mu4e-sent-folder . "/ulg/Sent")
+                   (mu4e-trash-folder . "/ulg/Trash")
+                   (mu4e-drafts-folder . "/ulg/Drafts")
+                   (mu4e-refile-folder . "/ulg/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ))
+(setq mu4e-context-policy 'pick-first)
+
+
+
+
+ +
+

Receiving emails - Mbsync

+
+

+Let systemd get the mail, then pressing U will just run mu to reindex everything. +

+
+
(setq mu4e-get-mail-command "true")
+
+
+ +

+Fix for mbsync found here. +

+
+
(setq mu4e-change-filenames-when-moving t)
+
+
+
+
+ +
+

Sending emails - Msmtp

+
+
+
(setq smtpmail-default-smtp-server "smtp.gmail.com"
+      smtpmail-smtp-server "smtp.gmail.com"
+      smtpmail-smtp-service 587)
+
+(setq message-send-mail-function 'message-send-mail-with-sendmail
+      sendmail-program "msmtp"
+      user-full-name "Thomas Dehaeze")
+
+
+
+
+ +
+

Bookmarks

+
+
+
(setq mu4e-bookmarks
+      `(("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
+        ("date:today..now" "Today's messages" ?t)
+        ("date:7d..now" "Last 7 days" ?w)
+        ("mime:image/*" "Messages with images" ?p)
+        (,(mapconcat 'identity
+                     (mapcar
+                      (lambda (maildir)
+                        (concat "maildir:" (car maildir)))
+                      mu4e-maildir-shortcuts) " OR ")
+         "All inboxes" ?i)))
+
+
+
+
+ +
+

TODO Notifications

+
+
+
(with-eval-after-load 'mu4e-alert
+  (mu4e-alert-set-default-style 'libnotify))
+(mu4e-alert-enable-notifications)
+
+
+ +

+Mode-line notifications +

+
+
(setq mu4e-enable-mode-line t)
+
+
+
+
+ +
+

Use Org-Mode Tables In Emails

+
+
+
(add-hook 'message-mode-hook 'turn-on-orgtbl)
+(add-hook 'message-mode-hook 'turn-on-orgstruct++)
+
+
+
+
+ +
+

TODO Integration with Org-Mode

+
+

+Store link to message if in header view, not to header query +

+
+
(setq org-mu4e-link-query-in-headers-mode nil)
+
+
+
+
+ +
+

TODO When putting something on the Trash, it will be in the archive folder on gmail

+
+

+Even when totally deleting it. It will stay on gmail. How to fix that? +

+
+
+ +
+

TODO Verify that sending mails with gmail account works and that there is no duplicate

+
+

+Should check this variable: mu4e-sent-messages-behavior +

+
+
(setq mu4e-sent-messages-behavior 'delete)
+
+
+ +

+And here. +If I put it to delete, it works for gmail but not for the other ones… +Check here. +

+
+
+ +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
C-jNext mail
C-kPrevious mail
R/C/FReply/Compose/Forward
tMove to Archive
dMove to Trash
+
+
+
+ +
+

PDF-Tools

+
+
+
(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
+
+
+
+
+ +
+

Custom command and leader keys

+
+
+
+

Watch LaTeX file using latexmk

+
+
+
(defun tdh/latex/watch ()
+  "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))))
+(defun tdh/latex/watch/kill ()
+  "Kill the currently running TeX job."
+  (interactive)
+  (delete-process "latexmk-watch")
+  )
+
+(map! :map org-mode-map
+      :n ",ow" 'tdh/latex/watch
+      :n ",ok" 'tdh/latex/watch/kill)
+
+
+
+
+ +
+

Helm-Bibtex

+
+
+
(map! :map org-mode-map
+      :n ",ob" 'helm-bibtex
+      :n ",of" 'helm-bibtex-favorites
+      :n ",or" 'helm-resume)
+
+
+
+
+ +
+

Open terminal in current directory

+
+
+
(defun tdh/open-terminal-in-workdir ()
+  (interactive)
+  (call-process-shell-command
+  (concat "termite --directory=" default-directory) nil 0))
+
+(map! :map org-mode-map :n ",ot" 'tdh/open-terminal-in-workdir)
+
+
+
+
+ +
+

Open ranger in current directory

+
+
+
(defun open-ranger-in-workdir ()
+  (interactive)
+  (call-process-shell-command
+  (concat "termite --directory=" default-directory " --exec=ranger") nil 0))
+
+(map! :map org-mode-map :n ",oo" 'open-ranger-in-workdir)
+
+
+
+
+
+ +
+

Yassnippets

+
+
+
(push "~/.config/doom/snippets" yas-snippet-dirs)
+(yas-global-mode 1)
+
+
+
+
+ +
+

Path for Shell

+
+
+
;; (when (memq window-system '(mac ns x))
+;;   (exec-path-from-shell-initialize))
+
+
+
+
+ +
+

Proxy

+
+
+
(setq url-proxy-services
+   '(("http" . "proxy.esrf.fr:3128")
+     ("https" . "proxy.esrf.fr:3128")
+     ("no_proxy" . "^.*esrf.fr")))
+
+
+
+
+ +
+

TODO Slack

+
+
+
(slack-register-team
+  :name "emacs-slack"
+  :default t
+  :client-id "299050134212.316863429523"
+  :client-secret "7168a660375090e517fe812ea2d136e5"
+  :token "xoxp-299050134212-299063259042-715794254097-7c319fdd63315620e86f1fad42c126a2"
+  :subscribed-channels '())
+
+
+ +
+
(advice-add 'slack-counts-update :override #'ignore)
+
+
+ +
+
(setq slack-prefer-current-team t)
+
+
+
+
+ +
+

TODO Neomutt connection

+
+

+https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/ +

+ +
+
(require 'org-protocol)
+;; Call this function, which spawns neomutt, whenever org-mode
+;; tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com
+
+(defun tdh/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 -n 1 -f l i:%s" message-id))))
+      (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" ""
+                                          (file-name-directory mail-file)))
+      (message-id-escaped (regexp-quote message-id))
+      (mutt-keystrokes
+        (format "L~i %s\n\n" (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" "termite" "-e"
+                  (concat "neomutt -R -f " mail-dir " -e \"" (format "push '%s a l'\"" mutt-keystrokes)))))
+
+;; Hook up `message:...` style URLs
+(org-add-link-type "message" 'tdh/mutt-open-message)
+
+
+
+
+ +
+

Abbreviations

+
+

+Type the abbreviation and use C-x a - to create a new abbreviation. +

+ +
+
(setq-default abbrev-mode t)
+;; save abbreviations upon exiting xemacs
+(setq save-abbrevs t)
+;; set the file storing the abbreviations
+(setq abbrev-file-name "~/.config/doom/my-abbreviations.el")
+;; reads the abbreviations file on startup
+(quietly-read-abbrev-file)
+
+
+
+
+ +
+

Other

+
+

+Here are some additional functions/macros that could help you configure Doom: +

+ +
    +
  • `load!’ for loading external *.el files relative to this one
  • +
  • `use-package’ for configuring packages
  • +
  • `after!’ for running code after a package has loaded
  • +
  • `add-load-path!’ for adding directories to the `load-path’, where Emacs +looks when you load packages with `require’ or `use-package’.
  • +
  • `map!’ for binding new keys
  • +
+ +

+To get information about any of these functions/macros, move the cursor over +the highlighted symbol at press ’K’ (non-evil users must press ’C-c g k’). +This will open documentation for it, including demos of how they are used. +

+ +

+You can also try ’gd’ (or ’C-c g d’) to jump to their definition and see how +they are implemented. +

+
+
+ +
+

Snippets

+
+
+
+

LaTeX

+
+
+
+

Coordinate

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :coordinate
+# --
+\coordinate[${1:->}] (${2:name}) at (${3:pointcoordinate});
+$0
+
+
+
+
+ +
+

Draw

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :draw
+# --
+\draw[${1:->}] (${2:point1}) -- (${3:point2});
+$0
+
+
+
+
+ +
+

Node

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :node
+# --
+node[${1:below right}] (${2:name}) {${3:label}};
+$0
+
+
+
+
+ +
+

Path

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :path
+# --
+\path[${1}] (${2:point1}) -- (${3:point2});
+$0
+
+
+
+
+
+ +
+

Matlab

+
+
+
+

Clear

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :clear and close all
+# --
+clear; close all; clc;
+$0
+
+
+
+
+ +
+

Function

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :function
+# --
+function [${4:outputs}] = ${1:functionName}(${2:inputs}, ${3:opts_param})
+% $1 - Description
+%
+% Syntax: $1($2, $3)
+%
+% Inputs:
+%    - $2 -
+%    - $3 - Optionals parameters: structure with the following fields:
+%        -
+%
+% Outputs:
+%    - $4 -
+
+%% Default value for opts
+opts = struct(...
+    '${5:outputs}', ${6:default_value} ...
+);
+
+if exist('opts_param','var')
+    for opt = fieldnames($3)'
+        if sum(strcmp(fieldnames(opts), opt{1})) == 1
+            opts.(opt{1}) = $3.(opt{1});
+        else
+            warning(sprintf('%s is not a valid option.', opt{1}));
+        end
+    end
+end
+
+$0
+
+
+
+
+
+ +
+

Org Mode

+
+
+
+

Begin

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :LaTeX Environment
+# --
+\begin{${1:equation}}
+  $0
+\end{$1}
+
+
+
+
+ +
+

Block

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Org-Mode Block
+#key: block
+# --
+#+begin_${1:$$(let ((type (yas-choose-value '("src" "example" "quote" "verse" "center" "latex" "html" "ascii"))))
+               (if type (concat type (if (equal type "src")
+                                         (concat " " (yas-choose-value '("emacs-lisp" "latex" "python" "sh" "matlab")))))))}
+$0
+#+end_${1:$(car (split-string yas-text))}
+
+
+
+
+ +
+

Custom Box

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Custom Box
+# --
+#+attr_latex: :options [$1]{${2:blue}}{${3:ams nodisplayskip}}
+#+begin_cbox
+$0
+#+end_cbox
+
+
+
+
+ +
+

Latex Class

+
+
+
#name: latex-class
+#key: lc
+#expand-env: ((classes (mapcar 'car org-latex-classes)))
+# --
+#+latex_class: ${1:$$(yas-choose-value classes)}
+$0
+
+
+
+
+ +
+

Name Caption Figure

+
+
+
#name: name-caption-figure
+#key: ncf
+# --
+#+name: fig:${1:name}
+#+caption: ${2:Caption}
+[[${3:`(read-file-name "File: ")`}]]
+
+$0
+
+
+
+
+ +
+

Bibliography with completion

+
+
+
#name: bibliography with completion
+#key: bib
+# --
+bibliography:${1:$$(yas-choose-value (org-ref-find-bibliography))}
+
+
+
+
+ +
+

Cite

+
+
+
#name: org-ref cite link
+#key: cite
+# --
+cite:${1:$$(completing-read
+       "bibtex key: "
+       (let ((bibtex-files (org-ref-find-bibliography)))(bibtex-global-key-alist)))}
+
+
+
+
+ +
+

Ref

+
+
+
#name: org-ref ref link with completion
+#key: ref
+# --
+ref:${1:$$(completing-read "label: " (org-ref-get-labels))}
+
+
+
+
+ +
+

Beamer - CBOX

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Beamer Custom Box
+# --
+*** ${1:@@latex:@@}           :B_cbox:
+,:PROPERTIES:
+:BEAMER_env: cbox
+:BEAMER_opt: {${2:blue}}{${3:ams nodisplayskip}}
+:END:
+
+$0
+
+
+
+
+ +
+

Code

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Code
+# --
+#+caption: ${1:Listing Caption}
+#+label: lst:${2:listing_name}
+#+begin_src ${3:listing_language}
+$0
+#+end_src
+
+
+
+
+ +
+

Equation

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Equation
+# --
+#+name: eq:${1:equation_name}
+\begin{equation}
+$0
+\end{equation}
+
+
+
+
+ +
+

Figure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Figure
+# --
+#+name: fig:${1:figure_name}
+#+caption: ${2:Figure caption}
+#+attr_latex: :${3:scale 1}
+[[file:${4:figs/}$1.${5:pdf}]]
+$0
+
+
+
+
+ +
+

Frac

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :LaTeX Fraction
+# --
+\frac{$1}{$2} $0
+
+
+
+
+ +
+

Left

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Left Right mathematical delimitations
+# --
+\left$1 $0 \right$2
+
+
+
+
+ +
+

Mconfig

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Configuration-Header
+# --
+#+PROPERTY: header-args:matlab  :session *MATLAB*
+#+PROPERTY: header-args:matlab+ :tangle ${1:filename}.m
+#+PROPERTY: header-args:matlab+ :comments org
+#+PROPERTY: header-args:matlab+ :exports both
+#+PROPERTY: header-args:matlab+ :results none
+#+PROPERTY: header-args:matlab+ :eval no-export
+#+PROPERTY: header-args:matlab+ :noweb yes
+#+PROPERTY: header-args:matlab+ :mkdirp yes
+#+PROPERTY: header-args:matlab+ :output-dir ${2:figs}
+$0
+
+
+
+
+ +
+

Mdescription

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Measurement-Description
+# --
+* Measurement description
+** Setup                                                             :ignore:
+*Setup*:
+
+** Goal                                                              :ignore:
+*Goal*:
+
+** Measurements                                                      :ignore:
+*Measurements*:
+
+Three measurements are done:
+| Measurement File        | Description                  |
+|-------------------------+------------------------------|
+| =mat/data_${1:001}.mat= | $2                           |
+
+Each of the measurement =mat= file contains one =data= array with 3 columns:
+| Column number | Description       |
+|---------------+-------------------|
+|             1 | $3                |
+|             2 | $4                |
+|             3 | Time              |
+
+$0
+
+
+
+
+ +
+

Mfigure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Figure
+# --
+#+HEADER: :tangle no :exports results :results none :noweb yes
+#+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png")
+  <<plt-matlab>>$0
+#+end_src
+
+#+NAME: fig:$1
+#+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}
+[[file:$2/$1.png]]
+
+
+
+
+ +
+

Mfunction

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Function
+# --
+* ${1:Function Name}
+:PROPERTIES:
+:header-args:matlab+: :tangle src/${2:matlab_file_name}.m
+:header-args:matlab+: :comments none :mkdirp yes :eval no
+:END:
+<<sec:$2>>
+
+This Matlab function is accessible [[file:src/$2.m][here]].
+
+#+begin_src matlab
+  function [${4:in_data}] = $2(${3:in_data})
+  % $2 - $0
+  %
+  % Syntax: [$4] = $2($3)
+  %
+  % Inputs:
+  %    - $3 -
+  %
+  % Outputs:
+  %    - $4 -
+
+  end
+#+end_src
+
+
+
+
+ +
+

Mheader

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Header
+# --
+* ${1:Heading Name}
+:PROPERTIES:
+:header-args:matlab+: :tangle matlab/${2:matlab_file_name}.m
+:header-args:matlab+: :comments org :mkdirp yes
+:END:
+<<sec:$2>>
+
+** ZIP file containing the data and matlab files                     :ignore:
+#+begin_src bash :exports none :results none
+  if [ matlab/$2.m -nt data/$2.zip ]; then
+    cp matlab/$2.m $2.m;
+    zip data/$2 \
+        mat/data.mat \
+        $2.m
+    rm $2.m;
+  fi
+#+end_src
+
+#+begin_note
+  All the files (data and Matlab scripts) are accessible [[file:data/$2.zip][here]].
+#+end_note
+
+$0
+
+
+
+
+ +
+

Minipage

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :minipage
+# --
+#+BEGIN_EXPORT latex
+\begin{figure}[htbp]
+\centering
+\begin{minipage}[t]{0.49\linewidth}
+#+END_EXPORT
+#+attr_latex: :float nil :width 0.95\linewidth
+$0
+#+BEGIN_EXPORT latex
+\end{minipage}%
+\hfill%
+\begin{minipage}[t]{0.49\linewidth}
+#+END_EXPORT
+#+attr_latex: :float nil :width 0.95\linewidth
+
+#+BEGIN_EXPORT latex
+\end{minipage}
+\end{figure}
+#+END_EXPORT
+
+
+
+
+ +
+

Minit

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Init
+# --
+** Matlab Init                                             :noexport:ignore:
+#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
+  <<matlab-dir>>
+#+end_src
+
+#+begin_src matlab :exports none :results silent :noweb yes
+  <<matlab-init>>
+#+end_src
+
+$0
+
+
+
+
+ +
+

Mtable

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Table
+# --
+#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
+  data2orgtable(${1:data}, {${2:'rowlabel'}}, {${3:'collabel'}}, ' %.1f ');
+#+end_src
+$0
+
+
+
+
+ +
+

Multicolumn

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Multcolumn
+# --
+#+attr_latex: :float multicolumn
+$0
+
+
+
+
+ +
+

Subfigure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Subfigure
+# --
+#+name: fig:${1:figure_name}
+#+caption: ${2:figure caption}
+#+attr_latex: :environment subfigure :width 0.49\linewidth :align c
+| file:${3:sub_fig_name}.${4:pdf}       | file:${5:sub_fig_name}.${6:pdf} |
+| <<fig:$3>> ${7:sub figure caption}    | <<fig:$5>> ${8:sub figure caption}    |
+$0
+
+
+
+
+ +
+

Table

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Table
+# --
+#+name: tab:${1:table_name}
+#+caption: ${2:Table caption}
+#+attr_latex: :environment tabularx :width ${3:\linewidth} :align ${4:lXX}
+#+attr_latex: :center t :booktabs t :float t
+| $0  |   |   |
+|---+---+---|
+|   |   |   |
+
+
+
+
+ +
+

Tikz

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz figure
+# --
+#+begin_src latex :file ${1:figure_name}.pdf :post pdf2svg(file=*this*, ext="png") :exports both
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+
+
+
+ +
+

Tikzfig

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz Figure
+# --
+#+NAME: fig:${1:figure_name}
+#+HEADER: :headers '("\\\\usepackage{tikz}" "\\\\usepackage{import}" "\\\\import{$HOME/Cloud/thesis/LaTeX/}{config.tex}")
+#+HEADER: :imagemagick t :fit yes :iminoptions -scale 100% -density 150 :imoutoptions -quality 100
+#+HEADER: :results raw replace :buffer no :eval no-export :exports both :mkdirp yes
+#+HEADER: :output-dir ${2:figs}
+#+begin_src latex :file $1.pdf :post pdf2svg(file=*this*, ext="png") :exports both
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+#+NAME: fig:$1
+#+CAPTION: ${3:Caption}
+#+RESULTS: fig:$1
+
+
+
+
+ +
+

Tikzheader

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz Header
+# --
+* ${1:Title/Description of the figure}
+#+begin_src latex :file ${2:figure_name}.pdf :tangle figs/$2.tex :exports ${3:both}
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+#+name: fig:$2
+#+caption: $1 ([[./figs/$2.png][png]], [[./figs/$2.pdf][pdf]], [[./figs/$2.tex][tex]]).
+#+RESULTS:
+[[file:./figs/$2.png]]
+
+
+
+
+ +
+

User-config

+
+
+
# -*- mode: snippet -*-
+# name: user-config
+# key: uc
+# --
+#+begin_src emacs-lisp :tangle user-config.el
+$1
+#+end_src
+
+
+
+
+ +
+

User-init

+
+
+
# -*- mode: snippet -*-
+# name: user-init
+# key: ui
+# --
+#+begin_src emacs-lisp :tangle user-init.el
+$1
+#+end_src
+
+
+
+
+ +
+

Wrap

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Wrap
+# --
+#+attr_latex: :float wrap
+$0
+
+
+
+
+
+

Latex

+
+
+
+
Integral
+
+
+
# -*- mode: snippet -*-
+# name: latex integral
+# key: int
+# contributor: John Kitchin <jkitchin@andrew.cmu.edu>
+# --
+\int_{$1}^{$2} $3d$4$0
+
+
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/git.html b/docs/git.html new file mode 100644 index 0000000..ca037fb --- /dev/null +++ b/docs/git.html @@ -0,0 +1,533 @@ + + + + + + + + +Git Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Git Configuration

+ + +
+

Gitconfig

+
+
+ +
+

Aliases

+
+
+
[alias]
+  # View abbreviated SHA, description, and history graph of the latest 20 commits
+  l = log --pretty=oneline -n 20 --graph --abbrev-commit
+
+  # View the current working tree status using the short format
+  s = status -s
+
+  # Show the diff between the latest commit and the current state
+  d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
+
+  di = diff --cached --ignore-all-space
+
+  # Pull in remote changes for the current repository and all its submodules
+  p = !"git pull; git submodule foreach git pull origin master"
+
+  # Clone a repository including all submodules
+  c = clone --recursive
+
+  # Commit all changes
+  ca = !git add -A && git commit -av
+
+  # Switch to a branch, creating it if necessary
+  go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
+
+  # Show verbose output about tags, branches or remotes
+  tags = tag -l
+  branches = branch -a
+  remotes = remote -v
+
+  # Amend the currently staged files to the latest commit
+  amend = commit --amend --reuse-message=HEAD
+
+  # Credit an author on the latest commit
+  credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
+
+  # Interactive rebase with the given number of latest commits
+  reb = "!r() { git rebase -i HEAD~$1; }; r"
+
+  # Remove the old tag with this name and tag the latest commit with it.
+  retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
+
+  # Find branches containing commit
+  fb = "!f() { git branch -a --contains $1; }; f"
+
+  # Find tags containing commit
+  ft = "!f() { git describe --always --contains $1; }; f"
+
+  # Find commits by source code
+  fc = "!f() { git log --pretty=format:'%C(yellow)%h  %Cblue%ad  %Creset%s%Cgreen  [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
+
+  # Find commits by commit message
+  fm = "!f() { git log --pretty=format:'%C(yellow)%h  %Cblue%ad  %Creset%s%Cgreen  [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
+
+  # Remove branches that have already been merged with master
+  dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
+
+  # List contributors with number of commits
+  contributors = shortlog --summary --numbered
+
+  ec = config --global -e
+
+  # Pretty log output
+  hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all
+
+  pp = pull origin $(git_current_branch)
+  gg = push origin $(git_current_branch)
+  rhh = reset HEAD --hard
+
+  unstage = reset HEAD --
+  last = log -1 HEAD
+
+
+
+
+ +
+

Apply

+
+
+
[apply]
+  # Detect whitespace errors when applying a patch
+  whitespace = fix
+
+
+
+
+ +
+

Colors

+
+
+
[color]
+  # Use colors in Git commands that are capable of colored output when outputting to the terminal
+  ui = true
+
+[color "branch"]
+  current = yellow reverse
+  local = yellow
+  remote = green
+  HEAD = red bold
+
+[color "diff"]
+  meta = yellow bold
+  frag = magenta bold # line info
+  old = red # deletions
+  new = green # additions
+
+[color "status"]
+  added = green
+  changed = yellow
+  untracked = cyan
+
+[color "decorate"]
+  HEAD = red bold
+  branch = green
+  remoteBranch = cyan
+  tag = yellow
+  stash = bold yellow
+
+
+
+
+ +
+

Default Remote

+
+
+
# Use `origin` as the default remote on the `master` branch in all cases
+[branch "master"]
+  remote = origin
+  merge = refs/heads/master
+
+
+
+
+ +
+

Push Configuration

+
+
+
[push]
+  default = matching
+  # Make `git push` push relevant annotated tags when pushing branches out.
+  followTags = true
+
+
+
+
+ +
+

User

+
+
+
[user]
+  name = Thomas Dehaeze
+  email = dehaeze.thomas@gmail.com
+
+
+
+
+ +
+

Core configuration

+
+
+
[core]
+  # Use custom `.gitignore` and `.gitattributes`
+  excludesfile = ~/.gitignore_global
+
+  # Treat spaces before tabs and all kinds of trailing whitespace as an error
+  # [default] trailing-space: looks for spaces at the end of a line
+  # [default] space-before-tab: looks for spaces before tabs at the beginning of a line
+  whitespace = space-before-tab,-indent-with-non-tab,trailing-space
+
+  # Prevent showing files whose names contain non-ASCII symbols as unversioned.
+  # http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
+  precomposeunicode = false
+
+  pager = diff-so-fancy | less --tabs=4 -RFX
+
+  autocrlf = input
+
+  # Open vim, start Goyo and enter insert mode on the first line
+  editor = "nvim -c ':Goyo' -c 'goto 1' -c 'startinsert'"
+
+
+
+
+ +
+

Credentials using pass

+
+
+
[credential]
+    helper = !pass-git-helper $@
+
+[credential "https://github.com"]
+    username = tdehaeze
+
+
+
+
+ +
+

Diff-so-fancy

+
+
+
[diff-so-fancy]
+  markEmptyLines = false
+
+
+
+
+ +
+

Github

+
+
+
[github]
+  user = tdehaeze
+  oauth-token = 8cc5b41120f7e9a869c24fa3678667d3d8422e6f
+
+
+
+
+
+ +
+

Global Git Ignore

+
+
+
*~
+.DS_Store
+Session.vim
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/gtk.html b/docs/gtk.html new file mode 100644 index 0000000..d488953 --- /dev/null +++ b/docs/gtk.html @@ -0,0 +1,321 @@ + + + + + + + + +GTK Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

GTK Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

GTK-2.0

+
+
+
gtk-theme-name="Arc-Dark"
+gtk-icon-theme-name="Arc"
+gtk-font-name="Hack Nerd Font Mono 10"
+gtk-cursor-theme-name="xcursor-breeze"
+gtk-cursor-theme-size=0
+gtk-toolbar-style=GTK_TOOLBAR_BOTH
+gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
+gtk-button-images=1
+gtk-menu-images=1
+gtk-enable-event-sounds=1
+gtk-enable-input-feedback-sounds=1
+gtk-xft-antialias=1
+gtk-xft-hinting=1
+gtk-xft-hintstyle="hintfull"
+gtk-xft-rgba="rgb"
+
+
+
+
+ +
+

GTK-3.0

+
+
+
[Settings]
+gtk-theme-name=Arc-Dark
+gtk-icon-theme-name=Arc
+gtk-font-name=Hack Nerd Font Mono 10
+gtk-cursor-theme-name=xcursor-breeze
+gtk-cursor-theme-size=0
+gtk-toolbar-style=GTK_TOOLBAR_BOTH
+gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
+gtk-button-images=1
+gtk-menu-images=1
+gtk-enable-event-sounds=1
+gtk-enable-input-feedback-sounds=1
+gtk-xft-antialias=1
+gtk-xft-hinting=1
+gtk-xft-hintstyle=hintfull
+gtk-xft-rgba=rgb
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/i3.html b/docs/i3.html new file mode 100644 index 0000000..5169a10 --- /dev/null +++ b/docs/i3.html @@ -0,0 +1,607 @@ + + + + + + + + +I3 Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

I3 Configuration

+ + +
+

Basic configuration

+
+
+
+

Colors

+
+
+
set $bg  #32302f
+set $bg1 #3c3836
+set $bg2 #504945
+set $bg3 #665c54
+set $bg4 #7c6f64
+
+set $fg  #ebdbb2
+set $fg1 #ebdbb2
+set $fg2 #d5c4a1
+set $fg3 #bdae93
+set $fg4 #a89984
+
+set $gray   #a89984
+set $red    #cc241d
+set $green  #98971a
+set $yellow #d79921
+set $blue   #458588
+set $purple #b16286
+set $aqua   #689d6a
+set $orange #d65d0e
+
+
+
+
+ +
+

Mod Key

+
+

+Set mod key (Mod1=<Alt>, Mod4=<Super>) +

+
+
set $mod Mod4
+
+
+
+
+ +
+

Border Style

+
+
+
# Configure border style <normal|1pixel|pixel xx|none|pixel>
+new_window pixel 1
+new_float normal
+
+# Hide borders
+hide_edge_borders smart
+
+
+
+
+ +
+

Font for window titles

+
+
+
font Hack Nerd Font 11
+
+
+
+
+ +
+

Color palette used for the terminal ( ~/.Xresources file )

+
+

+Colors are gathered based on the documentation https://i3wm.org/docs/userguide.html#xresources. +

+ +
+
set_from_resource $darkred     color1  #000000
+set_from_resource $red         color9  #000000
+set_from_resource $darkgreen   color2  #000000
+set_from_resource $green       color10 #000000
+set_from_resource $darkyellow  color3  #000000
+set_from_resource $yellow      color11 #000000
+set_from_resource $darkblue    color4  #000000
+set_from_resource $blue        color12 #000000
+set_from_resource $darkmagenta color5  #000000
+set_from_resource $magenta     color13 #000000
+set_from_resource $darkcyan    color6  #000000
+set_from_resource $cyan        color14 #000000
+set_from_resource $darkwhite   color7  #000000
+set_from_resource $white       color15 #000000
+
+# Use custom colors for black
+set $black       #282828
+set $darkblack   #1d2021
+set $transparent #00000000
+
+# set_from_resource $term_background background
+# set_from_resource $term_foreground foreground
+# set_from_resource $term_color0     color0
+# set_from_resource $term_color1     color1
+# set_from_resource $term_color2     color2
+# set_from_resource $term_color3     color3
+# set_from_resource $term_color4     color4
+# set_from_resource $term_color5     color5
+# set_from_resource $term_color6     color6
+# set_from_resource $term_color7     color7
+# set_from_resource $term_color8     color8
+# set_from_resource $term_color9     color9
+# set_from_resource $term_color10    color10
+# set_from_resource $term_color11    color11
+# set_from_resource $term_color12    color12
+# set_from_resource $term_color13    color13
+# set_from_resource $term_color14    color14
+# set_from_resource $term_color15    color15
+
+
+
+
+ +
+

Theme colors

+
+
+
# class                 border  backgr. text    indic.   child_border
+client.focused          $blue   $blue   $fg     $blue
+client.focused_inactive $bg     $bg     $fg     $bg
+client.urgent           $bg     $bg     $fg     $bg
+client.unfocused        $bg     $bg     $fg     $bg
+client.placeholder      $bg     $bg     $fg     $bg
+
+client.background       #32302F
+
+
+
+
+ +
+

Settings for i3-gaps

+
+
+
# Set inner/outer gaps
+gaps inner 10
+gaps outer -2
+
+# Additionally, you can issue commands with the following syntax. This is useful to bind keys to changing the gap size.
+# gaps inner|outer current|all set|plus|minus <px>
+# gaps inner all set 10
+# gaps outer all plus 5
+
+# Smart gaps (gaps used if only more than one container on the workspace)
+# smart_gaps on
+
+# Smart borders (draw borders around container only if it is not the only container on this workspace)
+# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
+# smart_borders on
+
+# Press $mod+Shift+g to enter the gap mode. Choose o or i for modifying outer/inner gaps. Press one of + / - (in-/decrement for current workspace) or 0 (remove gaps for current workspace). If you also press Shift with these keys, the change will be global for all workspaces.
+set $mode_gaps Gaps: (o) outer, (i) inner
+set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
+set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
+bindsym $mod+Shift+g mode "$mode_gaps"
+
+mode "$mode_gaps" {
+  bindsym o      mode "$mode_gaps_outer"
+  bindsym i      mode "$mode_gaps_inner"
+  bindsym Return mode "default"
+  bindsym Escape mode "default"
+}
+mode "$mode_gaps_inner" {
+  bindsym plus  gaps inner current plus 5
+  bindsym minus gaps inner current minus 5
+
+  bindsym 0     gaps inner current set 0
+
+  bindsym Shift+plus  gaps inner all plus 5
+  bindsym Shift+minus gaps inner all minus 5
+  bindsym Shift+0     gaps inner all set 0
+
+  bindsym Return mode "default"
+  bindsym Escape mode "default"
+}
+mode "$mode_gaps_outer" {
+  bindsym plus  gaps outer current plus 5
+  bindsym minus gaps outer current minus 5
+  bindsym 0     gaps outer current set 0
+
+  bindsym Shift+plus  gaps outer all plus 5
+  bindsym Shift+minus gaps outer all minus 5
+  bindsym Shift+0     gaps outer all set 0
+
+  bindsym Return mode "default"
+  bindsym Escape mode "default"
+}
+
+
+
+
+ +
+

Workspace names

+
+

+To display names or symbols instead of plain workspace numbers you can use something like: set $ws1 1:mail and set $ws2 2:. +

+ +
+
set $ws1 1
+set $ws2 2
+set $ws3 3
+set $ws4 4
+set $ws5 5
+set $ws6 6
+set $ws7 7
+set $ws8 8
+
+
+
+
+ +
+

Use Mouse+$mod to drag floating windows

+
+
+
floating_modifier $mod
+
+
+
+
+ +
+

Back and Forth

+
+
+
workspace_auto_back_and_forth yes
+
+
+
+
+ +
+

Application Specific

+
+
+
+

Open applications on specific workspaces

+
+
+
# Matlab Figures
+assign[title="^Fig"] $ws6
+for_window [title="^Fig"] layout tabbed
+assign[title="^HG_Peer"] $ws6 # Name of window when export figure with matlab
+
+
+
+
+ +
+

Open specific applications in floating mode

+
+
+
for_window [title="File Transfer*"] floating enable
+for_window [class="GParted"] floating enable border normal
+for_window [title="i3_help"] floating enable sticky enable border normal
+for_window [class="Lightdm-settings"] floating enable
+for_window [class="Lxappearance"] floating enable sticky enable border normal
+for_window [class="Manjaro Settings Manager"] floating enable border normal
+for_window [class="Pamac-manager"] floating enable
+for_window [class="Pavucontrol"] floating enable
+for_window [class="qt5ct"] floating enable sticky enable border normal
+for_window [class="Qtconfig-qt4"] floating enable sticky enable border normal
+for_window [class="Simple-scan"] floating enable border normal
+for_window [class="(?i)System-config-printer.py"] floating enable border normal
+for_window [class="Timeset-gui"] floating enable border normal
+for_window [class="(?i)virtualbox"] floating enable border normal
+for_window [class="Xfburn"] floating enable
+for_window [title="^Documentation -"] floating enable border normal
+for_window [class="Yad"] floating enable
+for_window [title="Bluetooth Devices"] floating enable
+for_window [title="Simulink Library Browser"] floating enable
+
+
+
+
+
+ +
+

Scratchpad

+
+
+
# move the currently focused window to the scratchpad
+bindsym $mod+Shift+BackSpace move scratchpad
+
+# Show the next scratchpad window or hide the focused scratchpad window.
+# If there are multiple scratchpad windows, this command cycles through them.
+bindsym $mod+BackSpace scratchpad show
+
+
+
+
+
+ +
+

Run Polybar and SXHKD

+
+
+
exec_always --no-startup-id $HOME/.config/polybar/scripts/launch.sh
+exec_always --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/image.html b/docs/image.html new file mode 100644 index 0000000..ecf1f16 --- /dev/null +++ b/docs/image.html @@ -0,0 +1,284 @@ + + + + + + + + +SXIV Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

SXIV Configuration

+ +

+Press C-x to activate to key handler. +

+ +
+
while read file
+do
+    case "$1" in
+        "C-d")
+            mv "$file" ~/.trash ;;
+        "C-r")
+            convert -rotate 90 "$file" "$file" ;;
+        "C-c")
+            echo -n "$file" | xclip -selection clipboard ;;
+        "C-w")
+            nitrogen --save --set-zoom-fill "$file" ;;
+    esac
+done
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..cdb2354 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,6460 @@ + + + + + + + + + +Dotfiles - Manjaro Linux + + + + + + + + + + + + +
+ UP + | + HOME +
+

Dotfiles - Manjaro Linux

+
+

Table of Contents

+
+ +
+
+ + + +
+

Package Manager: yay

+ + +
+

Installation

+
+
+
sudo pacman -S yay
+
+
+
+
+ +
+

CheatSheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
yayPerform system upgrade
yay -Ss <package>Search
yay -S <package>Install
yay -Si <package>Get informations
yay -Rs <package>Uninstall
yay -YcClean unneeded dependencies
+ +

+To check all installed packages: +pacman -Qq | fzf --preview 'pacman -Qil {}' --layout=reverse --bind 'enter:execute(pacman -Qil {} | less)' +

+
+
+
+ +
+

Git Setup

+ + +
+

Installation

+
+
+
yay -S git
+
+
+
+
+ +
+

Configuration

+
+

+dotfiles/git.org +

+
    +
  • ~/.gitconfig
  • +
  • ~/.gitignore_global
  • +
+
+
+ +
+

Diff-So-Fancy

+ +
+

Installation

+
+
+
yay -S diff-so-fancy
+
+
+
+
+ +
+

Configuration

+
+
+
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
+
+
+
+
+
+ +
+

Credential Helper setup with Pass

+
+

+This is explained in a further part: Integration of Pass with Git. +

+
+
+
+ +
+

Terminal

+ +
+

Termite

+
+
+
+

Installation

+
+
+
yay -S termite
+
+
+
+
+ +
+

Configuration

+
+

+termite.org +

+
    +
  • ~/.config/termite/config
  • +
+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
ctrl-shift-xactivate url hints mode
ctrl-shift-ccopy to CLIPBOARD
ctrl-shift-vpaste from CLIPBOARD
ctrl-shift-spacestart selection mode
ctrl-shift-upscroll up a line
ctrl-shift-downscroll down a line
ctrl-+increase font size
ctrl--decrease font size
ctrl-=reset font size to default
+
+
+
+ +
+

TODO Unicode Rxvt

+
+
+
+

Installation

+
+
+
yay -S rxvt-unicode
+
+
+
+
+ +
+

Configuration

+
+

+Most of Urxvt configuration is done in ~/.Xresources +

+
+
+
+
+ +
+

TODO Shell: Bash

+ + +
+

Bash Completion

+
+
+
yay -S bash-completion
+
+
+
+
+ +
+

TODO Configuration

+
+
    +
  • ~/.bashrc
  • +
  • ~/.bash_profile
  • +
  • ~/.config/bash/
  • +
  • ~/.profile
  • +
+
+
+
+ +
+

TODO Terminal Multiplexer: Tmux

+ + +
+

Installation

+
+
+
yay -S tmux
+
+
+
+
+ +
+

Configuration

+
+

+After configuration is generated. +

+
+
tmux source-file ~/.tmux.conf
+
+
+
+
+ +
+

Session Manager - Tmuxinator

+ + +
+

Installation

+
+
+
yay -S tmuxinator
+
+
+
+
+ +
+

Special sessions

+
+

+Sessions are created using tmuxinator new session_name and edited using tmuxinator edit session_name. +

+
+
+ +
+

Mux: run terminal and tmux session

+
+

+~/bin/mux +

+ +

+To open a terminal and run tmux session automatically, run mux <session-name>. +This is used with rofi. +

+
+
+
+ +
+

TODO Multiple Tmux configuration

+
+
    +
  • one with no line for neomutt
  • +
  • one complete for coding
  • +
+
+
+ +
+

TODO Configuration: theme

+ +
+ + + +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
  
+
+
+
+ +
+

TODO Fonts

+
+
+
+

Installation

+
+
+
yay -S ttf-inconsolata nerd-fonts-complete ttf-linux-libertine ttf-emojione
+
+
+
+
+ +
+

TODO Default fonts

+
+

+SauceCodePro Nerd Font Mono +

+ +

+Maybe use: +

+
    +
  • Monospace Font: Inconsolata
  • +
  • Serif Font: Libertine
  • +
  • Sans Font: Linux Biolinum
  • +
+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
fc-listList all fonts available
+
+
+ +
+

Select font

+
+
+
yay -S gtk2fontsel
+
+
+
+
+
+ +
+

Text Editors

+
+
+
+

Neovim

+ + +
+

Installation

+
+
+
yay -S neovim
+
+
+
+
+ +
+

Configuration

+ +
+ +
+

Vim Anywhere with i3

+
+

+https://github.com/cknadler/vim-anywhere +

+ +
+
yay -S vim-anywhere-git
+
+
+ +

+Then, add the following to the i3 config: bindsym $mod+t exec vim-anywhere nvim termite +

+
+
+ +
+

Matlab Setup

+ +
+ + +
+ +
+

Emacs

+ + +
+

Installation

+
+
+
yay -S emacs
+
+
+
+
+ +
+

TODO Emacs Client/Server - I removed the systemd service to just run it with i3 startup

+
+

+Add a systemd service to automatically run Emacs deamon in the background on startup: +~/.config/systemd/user/emacs.service +

+ +

+Then run: +

+
+
systemctl enable --user emacs
+systemctl start --user emacs
+
+
+ +

+In order to open the emacs client: emacsclient -create-frame --alternate-editor“”= +

+ +

+Then, add a shortcut to i3 config to open an emacsclient. +

+
+
+ +
+

Configuration

+ +
+ +
+

SpellCheck with Aspell

+
+
+
yay -S aspell aspell-en aspell-fr
+
+
+
+
+
+
+ +
+

SSH setup

+
+
+
+

Generating a new SSH key

+
+
+
ssh-keygen -t rsa -b 4096 -C "dehaeze.thomas@gmail.com"
+
+
+
+
+ +
+

Start the ssh-agent in the background

+
+
+
eval "$(ssh-agent -s)"
+
+
+
+
+ +
+

Add the SSH key to the ssh-agent

+
+
+
ssh-add ~/.ssh/id_rsa
+
+
+
+
+
+ +
+

GnuPG

+ + +
+

Install the gnupg package:

+
+
+
yay -S gnupg
+
+
+
+
+ +
+

Create a key pair

+
+
+
gpg --full-gen-key
+
+
+
+
+ +
+

Configure the gpg-agent to cache the passphrase

+
+

+Edit the following file ~/.gnupg/gpg-agent.conf +

+ +
+max-cache-ttl 60480000
+default-cache-ttl 60480000
+
+
+
+
+ +
+

Launcher - Rofi

+ + +
+

Installation

+
+
+
yay -S rofi
+
+
+
+
+ +
+

Setup rofi as a dmenu replacement

+
+

+Setup rofi as a dmenu replacement in ~/.i3/config: +

+
+bindsym $mod+d exec --no-startup-id rofi -show run
+
+
+
+ +
+

Run sudo commands with rofi

+
+

+https://github.com/DaveDavenport/rofi/issues/584#issuecomment-384555551 +

+ +

+Use sudo -A, that will open a rofi prompt to ask for the password. +

+ +

+For that to work, we need to add the following code to ~/.profile: +

+
+
export SUDO_ASKPASS=~/bin/askpass-rofi
+
+
+ +

+The askpass script is: +

+
+
#!/bin/sh
+
+# Take password prompt from STDIN, print password to STDOUT
+# the sed piece just removes the colon from the provided
+# prompt: rofi -p already gives us a colon
+rofi -dmenu \
+     -password \
+     -no-fixed-num-lines \
+     -p "$(printf "$1" | sed s/://)"
+
+
+
+
+
+ +
+

Password Manager: Pass

+ + +
+

Install the pass package

+
+
+
yay -S pass
+
+
+
+
+ +
+

Initialize the password store as a git repository

+
+
+
pass git init
+pass git remote add origin https://github.com/tdehaeze/pass.git
+
+
+
+
+ +
+

Gui Manager

+
+

+https://github.com/IJHack/qtpass +

+ +
+
yay -S qtpass
+
+
+
+
+ +
+

Integration with Rofi

+ + +
+

Installation

+
+
+
yay -S rofi-pass
+
+
+ +

+Then we can add a shortcut to rofi-pass on i3 config. +

+
+
+ +
+

Alternative

+
+

+https://github.com/ibizaman/pass-clip +

+ +
+
yay -S pass-clip
+
+
+
+
+
+ +
+

Integration with Browsers

+
+

+This is explained here. +

+
+
+ +
+

Integration with Git

+ +
+

Installation

+
+
+
yay -S pass-git-helper
+
+
+
+
+ +
+

Configuration

+
+

+First, add the relation between repository addresses and entries in pass. This is done in the following config file .config/pass-git-helper/git-pass-mapping.ini: +

+
+[github.com*]
+target=github.com/tdehaeze
+
+ +

+Then, add the credential helper on the git configuration file ~/.gitconfig and add the default username for the repositories adresses. +

+
+[credential]
+    helper = !pass-git-helper $@
+
+[credential "https://github.com"]
+    username = tdehaeze
+
+
+
+
+ +
+

Integration with other programs

+
+

+Integrate pass in other programs is usually very easy, here are few examples: +

+
    +
  • ~/.msmtprc: +
      +
    • passwordeval "pass email/dehaeze.thomas@gmail.com"
    • +
  • +
  • ~/.mbsyncrc +
      +
    • PassCmd "pass email/dehaeze.thomas@gmail.com"
    • +
  • +
+
+
+
+ +
+

Bookmark Manager: Buku

+ + +
+

Installation

+
+
+
yay -S buku
+
+
+
+
+ +
+

Integration with Rofi

+ + +
+

Installation

+
+
+
wget https://raw.githubusercontent.com/carnager/buku_run/master/buku_run -o ~/bin/buku_run
+chmod +x ~/bin/buku_run
+
+
+
+
+ +
+

Configuration

+
+

+The configuration file is here: ~/.config/buku_run/config +

+
+
+ +
+

Key binding with i3

+
+

+Custom key binding in i3 config file ~/.i3/config: +

+ +
+bindsym $mod+Shift+f exec --no-startup-id buku_run
+
+
+
+
+ +
+

Integration with qutebrowser

+ +
+ +
+

Synchronization with a git repository

+
+

+The database is stored in ~/.local/share/buku/bookmarks.db. +

+ +

+We initialize a git repository in this folder: +

+
+
cd ~/.local/share/buku/bookmarks.db
+git init
+
+
+ +

+Then we create a script that will automatically add bookmarks.db and push to some repository: ~/scripts/buku_git_push.sh. +

+ +

+To automatically run the script every day, a systemd unit is used: ~/.config/systemd/user/bukugit.timer and ~/.config/systemd/user/bukugit.service +

+ +
+
systemctl start --user bukugit.timer
+systemctl enable --user bukugit.timer
+
+
+
+
+ +
+

Import Bookmarks from Firefox and Chrome

+
+

+From Firefox, export the bookmarks as html file. +Then import the bookmark file using buku -i bookmarks.html. +This will add a tag with current date to all bookmarks imported. +To remove them, use: buku --replace '2018dec20' '' +

+
+
+ +
+

Web Interface

+
+

+Run: +

+
+
bukuserver run --host 127.0.0.1 --port 5001
+
+
+ +

+And then browse to 127.0.0.1:5001. +

+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
bukuRun buku interactively
buku -pList all bookmarks
buku -w idEdit bookmark
buku -d idDelete bookmark
buku -s <>Search bookmarks
+
+
+ + +
+ +
+

TODO Browser: qutebrowser

+ + +
+

Installation

+
+
+
yay -S qutebrowser
+
+
+
+
+ +
+

View Pdf inside qutebrowser with pdfjs

+
+
+
+

Installation

+
+
+
yay -S pdfjs
+
+
+
+
+ +
+

Usage

+
+

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

+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
<return>Download the file
Ctrl-xDownload and open
Ctrl-pOpen with pdf.js
Alt-yYank the url
+
+
+
+ +
+

TODO Make it default browser

+
+
+

Integration with Pass: the password manager

+
+

+Add the key-binding on ~/.config/qutebrowser/config.py +

+ +
+config.bind(',p', 'spawn --userscript password_fill')
+
+ +

+The password_fill script can be found on github.com. +It is configured using the ~/.config/qutebrowser/password_fill_rc file. +

+
+
+ +
+

TODO Integration with Buku

+
+

+Custom key binding in ~/.config/qutebrowser/config.py +

+ +
+# Add current page to Buku (Bookmark Manager)
+config.bind('B', 'spawn buku -a {url}')
+
+
+ +
+

TODO Add an option to specify title, modify url? add tags?

+
+
+ + +
+

TODO Cast youtube to chromecast

+
+
+

Spell Checking

+
+
+
/usr/share/qutebrowser/scripts/dictcli.py install fr-FR
+/usr/share/qutebrowser/scripts/dictcli.py install en-US
+
+
+
+
+ + +
+

TODO Ressources

+
+ +
+
+
+ + + +
+

Sound Setup

+
+
+
yay -S pulseaudio pavucontrol
+
+
+
+
+
+

Music Setup

+
+
+
+

Sound Server - Pulse Audio

+
+

+https://wiki.archlinux.org/index.php/PulseAudio +

+ +

+Install +

+
+
yay -S pulseaudio pulseaudio-alsa pulseaudio-bluetooth
+
+
+ +

+If sound is not working, should run pulseaudio --kill to kill the deamon and then pulseaudio --daemonize to run it again. +

+ +

+https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/ +

+
+
+ +
+

Audio Server - MPD

+
+

+https://wiki.archlinux.org/index.php/Music_Player_Daemon +

+ +

+=> Now Mopidy is used instead of MPD +

+
+ +
+

Installation

+
+
+
yay -S mpd
+
+
+
+
+ +
+

Automatic Startup

+
+
+
systemctl start --user mpd.service
+systemctl enable --user mpd.service
+
+
+
+
+ +
+

Command line interface to MPD - MPC

+
+

+https://github.com/MusicPlayerDaemon/mpc +

+ +

+To install mpc: yay -S mpc. +

+ + + + +++ ++ + + + + + + + + + + + + + + + + + +
CommandUsage
mpc updateUpdate the library
mpc rescanRescan the library
+
+
+
+ +
+

TODO Audio Server with Spotify - Mopidy

+
+

+https://github.com/mopidy/mopidy +https://medium.com/@theos.space/using-mopidy-with-spotify-and-ncmpcpp-44352f4a2ce8 +

+ +
+
yay -S mopidy mopidy-spotify
+
+
+ +

+To update local files: +

+
+
mopidy local scan
+
+
+ +

+If mopidy is used, MPD should be disabled. (systemctl disable --user mpd.service) +Also, when using mopidy, when pausing a song, playing it again does not work. +=> is there a fix for that? +

+
+
+ +
+

MPD Client - ncmpcpp

+ + +
+

Installation

+
+
+
yay -S ncmpcpp
+
+
+
+
+ +
+

Config

+
+

+The main config is located here: ~/.ncmpcpp/config. +The key bindings can be configured here: ~/.ncmpcpp/bindings. +

+
+
+ +
+

Cheatsheet

+
+

+https://pkgbuild.com/~jelle/ncmpcpp/ +

+ + + +++ ++ + + + + + + +
CommandUsage
+
+
+
+ +
+

Library Manager - beets

+ + +
+

Installation

+
+
+
yay -S beets
+
+
+
+
+ +
+

Configuration

+
+

+Configuration folder: ~/.config/beets/ +

+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
beet import <folder>Import folder to Music folder
+
+
+
+
+ +
+

TODO Movies

+
+
+
+

Media Player - MPV

+
+
+
+

Installation

+
+
+
yay -S mpv
+
+
+
+
+ +
+

Key Bindings

+
+

+The configuration is set in /.config/mpv/input.conf. +

+
+
+ +
+

TODO CheatSheet

+
+ + + +++ ++ + + + + + + +
CommandUsage
+
+
+
+ +
+

Chromecast with castnow

+
+
+
+

Installation

+
+
+
yay -Ss castnow-git
+
+
+ +

+The configuration is ~/.castnowrc. +

+
+
+ +
+

TODO Configuration with Tmux/i3/polybar

+
+

+Make nice shortcuts or polybar element for that +

+
+
+
+ +
+

TODO Chromecast with CATT

+ + +
+

Installation

+
+
+
yay -S catt
+
+
+
+
+ +
+

Usage to cast videos to chromecast

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
catt cast “https://www.youtube.com/watch?v=dQw4w9WgXcQCast youtube video
catt cast ./myvideo.mp4Cast local video
catt add ./myvideo.mp4Add a video to the queue
catt cast -s ./mysubtitle.srt /myvideo.mp4Add sub title
catt castsite https://en.wikipedia.org/wiki/RickrollingCast website
+
+
+ +
+

Usage for controlling the device

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
ffwdFastforward a video by TIME duration
rewindRewind a video by TIME duration
seekSeek the video to TIME position
scanScan the local network and show all Chromecasts and their IPs
statusShow some information about the currently-playing video
pausePause a video
playResume a video after it has been paused
stopStop playing
skipSkip to end of content
saveSave the current state of the Chromecast for later use
restoreReturn Chromecast to saved state
volumeSet the volume to LVL [0-100]
volumedownTurn down volume by a DELTA increment
volumeupTurn up volume by a DELTA increment
+
+
+
+ +
+

TODO Popcorn Time or similar

+
+
+

TODO Movie Collection Manager - Filebot

+
+

+https://github.com/filebot/filebot +This is paid software, I should uninstall it and find alternative +

+
+
+

Installation

+
+
+
yay -S bilebot
+
+
+ +

+When runing filebot, if you obtain the following error: +/usr/bin/filebot: line 22: /usr/lib/jvm/java-8-openjdk/bin/java: No such file or directory. +You can simlink the java binary: +

+
+
sudo ln -s /usr/lib/jvm/java-8-openjdk/jre/bin/java /usr/lib/jvm/java-8-openjdk/bin/java
+
+
+
+
+ +
+

Usage

+
+
+

Configuration

+
+

+Configuration folder: ~/.config/filebot/ +

+
+
+ +
+

Documentation

+ +
+ + +
+ +
+

Subtitle Manager

+
+
+
+

subdl

+
+
+ +
+
+

TODO Contact Manager

+
+
+
+

Khard

+
+

+https://github.com/scheibler/khard +

+ +

+This is the command line interface for contact management. +

+
+
+ +
+

Contact synchronization

+
+

+Vdirsyncer is used for contact synchronization with Google. +

+
+
+ +
+

Mu

+
+

+This looks for contacts in all indexed emails. +mu cfind <name> +

+
+
+
+ +
+

Connect with Phone

+
+

+kdeconnect +

+
+
+ +
+

TODO Chat Application

+
+
+
+

Weechat

+ + +
+

Installation

+
+
+
yay -S weechat
+
+
+ +

+Then we install some dependencies +

+
+
yay -S tcl lua ruby
+
+
+
+
+ +
+

Enable mouse support

+
+
+
/mouse enable
+
+
+
+
+ +
+

Scripts

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
highmon.pl 
colorizenicks.py 
go.py 
autosort.py 
buddylist.pl 
colorizelines.pl 
multiline.pl 
+
+
+ +
+

Theme

+
+

+https://www.bfoliver.com/technology/2017/07/15/weechat/ +https://alexjj.com/blog/2016/9/setting-up-weechat/ +

+ +
+
/set weechat.look.prefix_same_nick "⤷"
+/set weechat.look.prefix_error "⚠"
+/set weechat.look.prefix_action "⚡"
+/set weechat.look.bar_more_down "▼▼"
+/set weechat.look.bar_more_left "◀◀"
+/set weechat.look.bar_more_right "▶▶"
+/set weechat.look.bar_more_up "▲▲"
+/set weechat.look.prefix_suffix "╡"
+/set weechat.color.chat_nick_colors red,green,brown,blue,magenta,cyan,white,lightred,lightgreen,yellow,lightblue,lightmagenta,lightcyan
+/set weechat.color.separator 31
+/set buffers.color.current_fg 31
+/set buffers.color.current_bg white
+/set buffers.color.hotlist_message_fg 229
+/set buffers.color.hotlist_private_fg 121
+/set buffers.color.hotlist_highlight_fg 163
+/set buffers.color.number 239
+/set buffers.color.number_char 245
+/set weechat.bar.title.conditions "${inactive}"
+/set weechat.bar.title.color_fg black
+/set weechat.bar.title.color_bg 31         #Or white if 31 does nothing
+
+
+
+
+ + + +
+

Multi-line messages

+
+

+Solution is provided here: https://github.com/wee-slack/wee-slack/issues/118 +It uses multiline.pl script. +Then alt-enter is bound to insert a new line: +

+
+
/set plugins.var.perl.multiline.magic_paste_only on
+/key bind meta-ctrl-M /input insert \x0a
+
+
+ +

+And enter is bound to magic_enter that directly sends the message if its one line, and if its multiple line, waits a little bit and then sends the message: +

+
+
/key bind ctrl-M /input magic_enter
+
+
+
+
+ +
+

Send message using $EDITOR

+
+

+https://github.com/keith/edit-weechat +

+
+
mkdir -p ~/.weechat/python/autoload
+cd ~/.weechat/python/autoload
+wget https://raw.githubusercontent.com/keith/edit-weechat/master/edit.py
+
+
+ +

+Then, on weechat, type /edit. +

+
+
+ +
+

CheatSheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
Ctlr-NNext channel
Ctlr-PPrevious channel
Esc-nToggle nicklist
alt-entNew line
+
+
+ +
+

Slack Integration

+ + +
+
Installation
+
+
+
yay -S python2-websocket-client
+
+
+ + +
+
cd ~/.weechat/python
+wget https://raw.githubusercontent.com/wee-slack/wee-slack/master/wee_slack.py
+ln -s ../wee_slack.py autoload
+
+
+
+
+ +
+
Add your Slack API key(s)
+
+

+Log in to Slack: +

+
+
/slack register
+
+
+

+This command prints a link you should open in your browser to authorize WeeChat with Slack. Once you’ve accomplished this, copy the “code” portion of the URL in the browser and pass it to this command: +

+ +
+
/slack register [CODE_FROM_URL]
+
+
+ +

+Your Slack team is now added, and you can complete setup by restarting the wee-slack script. +

+
+
/python reload slack
+
+
+ +

+If you don’t want to store your API token in plaintext you can use the secure features of weechat: +

+
+
/secure passphrase this is a super secret password
+/secure set slack_token [YOUR_SLACK_TOKEN]
+/set plugins.var.python.slack.slack_api_token ${sec.data.slack_token}
+
+
+
+
+
+ + + + + +
+

Deamon and Client

+
+

+Weechat is started with the systemd service weechat. +It runs weechat inside tmux. +

+
+
+
+ +
+

TODO Using Emacs

+
+
+
+

Redshift

+ + +
+

Installation

+
+
+
yay -S redshift
+
+
+
+
+
+ +
+

TODO Mail Setup

+
+
+
+

Synchronize Mailboxes - Mbsync

+ + +
+

Installation

+
+
+
yay -S isync
+
+
+
+
+ +
+

TODO Configuration

+
+

+~/.mbsyncrc +

+
+
+ +
+

Automation using systemd

+
+
+
+
Retreive New mails
+
+
    +
  • ~/scripts/checkmail.sh
  • +
  • ~/.config/systemd/user/checkmail.service
  • +
  • ~/.config/systemd/user/checkmail.timer
  • +
+ +
+
systemctl --user enable checkmail.timer
+systemctl --user start checkmail.timer
+
+
+
+
+ +
+
Synchronize all the mailboxes
+
+
    +
  • ~/.config/systemd/user/syncmail.service
  • +
  • ~/.config/systemd/user/syncmail.timer
  • +
+ +
+
systemctl --user enable syncmail.timer
+systemctl --user start syncmail.timer
+
+
+
+
+ + +
+ + +
+
+

Send Mails - Msmtp

+ + +
+

Installation

+
+
+
yay -S msmtp
+
+
+
+
+
+ +
+

Mail Indexer - Notmuch

+ + +
+

Installation

+
+
+
yay -S notmuch
+
+
+
+
+ +
+

Configuration

+
+

+Configuration file: ~/.notmuch-config +

+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + +
CommandUsage
notmuch setupInitial Setup
notmuch newIncorporate new email into notmuch database
+
+
+
+ +
+

TODO Mail Index, Search and Tagging - Mu

+ +
+ +
+

TODO Mail Client - NeoMutt

+ + +
+

Installation

+
+
+
yay -S neomutt
+
+
+
+
+ +
+

TODO Vim Bindings

+
+

+Unding toutes les touches (https://github.com/iagox86/mutt/blob/master/keybindings.conf) et rebind tout pour faire un truc coherent et documenté +Rajouter les keybindings de vim https://github.com/neomutt/neomutt/issues/56#issuecomment-250780838 +

+
+
+ +
+

TODO Mailcap configuration

+
+
+

Display html mails

+
+
+
yay -S w3m
+
+
+
+
+ +
+

Open PDF from mail

+
+

+~/scripts/openfile.sh +

+
+
+ +
+

TODO Integrate with contact manager

+
+ + + +
+

Attachments

+
+
+
+
Attach multiple files at once
+
+

+First, tag the files you want to send using t, then ; to apply the action on all tagged files and finally <enter> to add them all +

+
+
+
+
TODO Add attachment using GUI file manager
+
+
+
Cheatsheet
+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
<spc>Open the file
+
+
+
+ +
+

Open Url from mail

+
+
+
yay -S urlview
+
+
+
+
+ + + +
+

TODO Searching mails with notmuch

+ +
+ +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
  
+
+
+ +
+

TODO Integration with calendar application

+ +
+ + +
+ +
+

TODO Mu4e

+
+
+

TODO Notification system

+
+

+A script (~/scripts/checkmail.sh) is used to retreive new mails and use notify=send is there are new received mails. +

+
+
+
+ +
+

TODO File Manager

+
+
+
+

TODO Ranger

+ +
+

Installation

+
+
+
yay -S ranger
+
+
+
+
+ +
+

Configuration

+
+

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

+
+
+ +
+

Display pdf

+
+

+All the display of the files are defined in ~/.config/ranger/scope.sh. +

+ +

+It seems that Ranger is not working well with Termite. The screen is not refreshing after viewing one image (Github Issue). +

+ +

+It works better with Urxvt. +

+
+
+ +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + +
CommandUsage
XExtract archive
ZCompress file or folder
+
+
+
+ +
+

TODO nnn

+ + +
+

Installation

+
+
+
yay -S nnn
+
+
+
+
+
+ +
+

TODO GUI File Manager: pcmanfm

+ +
+
+ +
+

TODO Image viewer

+
+
+
+

TODO Write a script to open any type of image using the corresponding program

+
+ + + +++ ++ ++ + + + + + + + + + + + + + + +
Filetypepdfsvg
Programzathurainkview
+
+
+ +
+

sxiv

+ + +
+

Installation

+
+
+
yay -S sxiv
+
+
+
+
+ +
+

Open Gif

+
+
+
sxiv -a file.gif
+
+
+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
-tStart in Thumbmail mode
fToggle fullscreen
ReturnSwitch to thumbmail mode
<, >Rotate the image
\vert, _Flip the image
n, pNext, Previous image
+
+
+
+
+ +
+

TODO HotKeyManager - SXHKD

+
+
+

TODO Windows Manager - i3

+
+
+
+

TODO Installation

+
+
+
yay -S i3-gaps
+
+
+
+
+ +
+

TODO Packages to install/understand

+
+

+artwork-i3 +i3-wallpapers +

+
+
+ +
+

TODO Configuration

+
+

+~/.i3/config +

+
+
+ +
+

TODO Specific config per workspace

+
+

+https://github.com/i3/i3/blob/next/contrib/per-workspace-layout.pl +For instance, default to tabbed windows for workspace dealing with matlab figures. +

+
+
+

Figures / Matlab

+
+
+ +
+

TODO CheatSheet

+
+ + + +++ ++ + + + + + + +
CommandUsage
+
+
+
+ +
+

TODO Custom bar - Polybar

+ + +
+

Installation

+
+
+
yay -S polybar
+
+
+
+
+ +
+

TODO Configuration

+
+

+~/.config/polybar/config +

+ +

+Polybar is launched automatically from i3 config. +

+
+
+ +
+

TODO Add custom modules

+
+
    +
  • [ ] show passwords
  • +
  • [ ] show bibliography
  • +
  • [ ] show bookmarks
  • +
  • [ ] switch theme (dark/light)
  • +
  • [ ] suspend, restart, hibernate, lock
  • +
+
+
+ +
+

TODO Add Conky to polybar

+
+
+
+

TODO Compositor - Compton

+ + +
+

Installation

+
+
+
yay -S compton
+
+
+
+
+ +
+

TODO Configuration

+
+

+~/.config/compton.conf +

+
+
+ +
+

TODO GUI Configuration

+
+

+To install: +

+
+
yay -S compton-conf
+
+
+ +

+Then run compton-conf +

+
+
+ +
+

Automatic run as daemon

+
+

+Compton is run from i3 config in the background (-b option) +

+
+
exec --no-startup-id compton -b
+
+
+
+
+
+ +
+

TODO Notification Manager - Dunst

+ + +
+

Installation

+
+
+
yay -S dunst
+
+
+
+
+ +
+

Configuration

+
+

+~/.config/dunst/dunstrc +

+
+
+ +
+

TODO Special notifications

+
+
    +
  • [ ] Mails
  • +
  • [ ] New messages on slack
  • +
+
+
+ +
+

TODO How to merge similar notifications like new mails?

+
+
+
+

Office Suite

+
+
+
+

WPS Office

+
+
+
yay -S wps-office wps-office-extension-french-dictionary ttf-wps-fonts
+
+
+
+
+
+ +
+

SpreadSheet - SC-IM

+
+

+https://github.com/andmarti1424/sc-im +https://www.youtube.com/watch?v=K_8_gazN7h0 +

+ +

+It permits to open Excel files on the terminal very quickly. +

+ +
+
yay -S sc-im
+
+
+
+
+ +
+

Managing Theme

+
+
+
+

GTK Themes

+
+

+Gtk2 themes are managed using the file ~/.gtkrc-2.0 while Gtk3 themes are managed using ~/.config/gtk-3.0/settings.ini. +

+
+ +
+

Gui Manager

+
+

+To customize the look of the system using GUI application, run lxappearance. +

+ +

+Installation: +

+
+
yay -S lxappearance
+
+
+
+
+ +
+

Icons and themes

+
+
+
yay -S zukitwo-themes faenza-icon-theme
+
+
+ +
+
yay -S arc-gtk-theme
+
+
+
+
+
+ +
+

QT Themes

+
+

+Run qt5ct to manage QT Themes. +

+
+
+ +
+

XFT Themes

+
+

+Some configuration are located in ~/.Xresources. +

+
+
+
+ +
+

TODO Advanced config

+
+
+
+

TODO Printer

+
+

+https://wiki.archlinux.org/index.php/CUPS +Web based administration: http://localhost:631/ +

+ +

+system-config-printer +

+ +

+Check the queue +

+
+
lpq
+lpq -a # on all queues
+
+
+ +

+Clear the queue +

+
+
lprm   # remove last entry only
+lprm - # remove all entries
+
+
+ +

+Print a file +

+
+
lpr -P printer_name filename.pdf
+
+
+ +

+List available printers +

+
+
lpstat -a
+
+
+ +

+Stats about the printer +

+
+
lpstat -p printer_name
+
+
+
+ + +
+

TODO CheatSheet

+
+ + + +++ ++ + + + + + + +
CommandUsage
+
+
+
+ +
+

TODO Kernel Management

+ + +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + +
CommandUsage
mhwd-kernel -liDetermine which kernel is used
 Change current kernel
+
+
+
+ +
+

TODO Power Consumption

+ +
+ +
+

TODO Power Management Tool: TLP and Powertop

+ +
+ +
+

TODO Lid open/close

+
+

+Should automatic show lock screen +

+ +

+/etc/systemd/logind.conf +

+
+
+ +
+

Automatically Mount devices - Udiskie

+
+ +
+
yay -S udiskie
+
+
+ +

+And then, add that to .xinitrc +

+
+
+ +
+

TODO Format disks

+ +
+ +
+

TODO Bluetooth

+ +
+ +
+

TODO Temperature and Fan control

+
+
+
# Enable Automated Power Regulation
+yay -S tlp
+sudo systemctl enable tlp
+sudo systemctl start tlp
+sudo systemctl enable tlp-sleep
+sudo systemctl start tlp-sleep
+sudo tlp start
+
+# Enable thermald (overheat shutoff)
+yay -S thermald
+sudo systemctl enable thermald
+sudo systemctl start thermald
+
+
+
+
+ +
+

TODO Lock Screen

+ + +
+

Installation

+
+
+
yay -S betterlockscreen
+
+
+
+
+
+
+ +
+

TODO LaTeX

+
+
+
+

Installation

+
+
+
yay -S texlive-most
+
+
+ +

+Biber support for the bibliography: +

+
+
yay -S biber
+
+
+ +

+Support for source code using minted: +

+
+
yay -S minted
+
+
+
+
+ +
+

Personnal classes/packages

+
+

+Every custom class or packages can be put under ~/texmf/tex/latex/local/ folder. +

+ +

+In order for LaTeX to be aware of new packages/classes, run sudo texhash each time a new custom package is added. +

+
+
+ +
+

TODO From screenshot to latex math formula

+ + +
+

Installation

+
+
+
yay -S mathpix-snipping-tool
+
+
+
+
+ +
+

Usage

+
+

+First, you have to run mathpix-snipping-tool. That will add something in the tray. +

+ +

+Then, use <ctrl><alt>m and then select a part of the screen to convert that area to latex formula. +

+
+
+ +
+

TODO Think of a better way to run that program. Maybe disable the tray icon and add some polybar script that automatically run the program, and ask for selection of the screen.

+
+
+ +
+

TODO Custom script to select latex symbol

+
+

+https://github.com/superluserdo/Latex-picker +Maybe use that script for other things? +

+
+
+ + +
+ +
+

Mathematical Software

+
+
+
+

Insect

+ + +
+

Installation

+
+
+
yay -S insect
+
+
+
+
+ +
+

Usage

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
3 m/s to km/hConvert Unit
+
+
+
+ +
+

Matlab

+ + +
+

Installation

+
+
+
yay -S matlab
+
+
+ +

+If there is a problem when opening a Simulink file, check the solution here. +

+
+
+
+ + +
+ +
+

TODO Cloud Backup / Sync - Rclone

+
+

+https://github.com/ncw/rclone +https://rclone.org/docs/ +gui: https://martins.ninja/RcloneBrowser/ +

+ +

+Rclone is used to manage the online drives like Google Drive and Dropbox. +

+
+ +
+

Installation

+
+
+
yay -S rclone
+
+
+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
rclone configConfiguration
rclone listremotesList configured remotes
rclone aboutInformations about the remote
rclone copyCopy files from source to dest
rclone syncMake source and dest identical, modifying destination only
rclone checkCheck if the files in the source and destination match
rclone lsList all the objects in the path
rclone sizeReturn the total size and number of objects in remote:path
rclone cleanupClean up the remote if possible
+
+
+ +
+

Usefull commands

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
rclone sync ~/gdrive/ gdrive:/ -PMake Google Drive files to same as local ones
rclone copy gdrive:/directory/ ~/gdrive/directory/ -PCopy directory from Google Drive to local
rclone lsf gdrive:/ --max-depth 1List files and directory
+
+ +
+

Progress bar for long synchronizations

+
+

+Use --progress --stats-one-line. +

+
+
+
+
+ +
+

TODO Download Manager

+
+
+ +
+

TODO CLI Download Manager - Aria2

+
+
+
+

Installation

+
+
+
yay -S aria2
+
+
+
+
+
+

Usage

+
+
+ +
+

TODO Torrent Client - deluge

+ + +
+

Installation

+
+
+
yay -S deluge
+
+
+
+
+ +
+

Configuration

+
+

+~/.config/deluge/ +

+
+
+ +
+

Command Line Interface

+
+

+https://whatbox.ca/wiki/deluge_console_documentation +

+ +

+Start the daemon using deluge -d. +Then run the CLI client using deluge-console. +

+
+
+ +
+

GUI Client

+
+

+deluge +

+
+
+
+ +
+

TODO CLI Torrent Client - btpd

+ +
+ +
+

TODO Youtube-dl

+
+
+
yay -S youtube-dl
+
+
+
+
+

Download best audio

+
+
+
youtube-dl -f bestaudio url
+
+
+
+
+ +
+

Download best video with audio

+
+
+
youtube-dl -f best url
+
+
+
+
+ +
+

Download playlist

+
+
+
+ +
+

TODO Default Applications

+ +
+

Mailcap file

+
+
+

TODO XDG-OPEN

+
+

+~/.config/mimeapps.list +

+
+
+ +
+

TODO Make QuteBrowser the default browser

+
+
+
+

TODO Desktop files

+
+

+~/.local/share/applications/ +

+
+
+ +
+

TODO Bibliography Management

+ + + +
+

Papis

+ + +
+

Installation

+
+
+
sudo pip3 install papis
+
+
+
+
+
+
+ +
+

TODO Calendar

+
+
+
+

Vdirsyncer - Sync calendars

+ + +
+

Installation

+
+
+
yay -S vdirsyncer
+
+
+ +
+
sudo pip install requests-oauthlib
+
+
+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + +
CommandUsage
vdirsyncer syncSynchronize
+
+
+ +
+

Automation - Systemd

+
+

+First, run +

+
+
vdirsyncer discover google_calendar
+
+
+ +
+
systemctl --user enable vdirsyncer.timer
+systemctl --user start vdirsyncer.timer
+
+
+ +

+To check the status of the service: +

+
+
systemctl --user status vdirsyncer.service
+
+
+
+
+
+ +
+

TODO Calendar Client - Khal

+ + +
+

Installation

+
+
+
yay -S khal
+
+
+
+
+ +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + +
CommandUsage
+
+
+
+
+ +
+

TODO Presentation software

+
+
+
+

Multi-monitor pdf presentation - pdfpc

+
+

+https://github.com/pdfpc/pdfpc +

+ +

+pdfpc is a great tool for showing pdf presentations. It support: +

+
    +
  • screen splitting
  • +
  • support for videos in pdf presentations
  • +
  • support for notes
  • +
  • support for annotations
  • +
+
+ +
+

Installation

+
+
+
yay -S pdfpc
+
+
+
+
+ +
+

Video support

+
+
+
yay -S gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav
+
+
+
+
+ +
+

Usage

+
+
+
pdfpc filename.pdf
+
+
+
+
+
+ +
+

Beamer

+
+ +
+ +
+

TODO RSS Reader

+ + +
+

Newsboat

+ + +
+

Installation

+
+
+
yay -S newboat
+
+
+
+
+ +
+

Configuration

+ +
+ +
+

TODO Automatic Retrival of Feeds

+
+

+Make a systemd service. +

+
+
+ +
+

TODO Add reddit personnal RSS

+ +
+ +
+

CheatSheet

+ +
+
+
+ +
+

Manager Drives

+
+

+https://wiki.archlinux.org/index.php/NFS +sudo nvim /etc/fstab to auto-mount drives +

+
+
+ +
+

TODO Task Manager

+
+
+
+

OrgMode and Emacs

+
+
+

Wunderlist

+ +
+

Wunderline

+ + +
+
Installation
+
+
+
yay -S wunderline
+
+
+
+
+ +
+
Cheatsheet
+
+

+wunderline list +

+
+
wunderline inbox
+
+
+

+INBOX (5) +Appeler les impôts ☆ +Regarder les impôt Today ☆ +Remboursement abonnement tram ? ☆ +Prendre le Exploding Kittens / Seven Wonders Today ☆ +Appeler Maman Today ☆ +

+
+
+
+ + + + +
+
+
+

Background manager: nitrogen

+ + +
+

Configuration

+
+

+~/.config/nitrogen/nitrogen.cfg +

+
+
+ +
+

Wallpapers

+
+

+~/scripts/wallpaper.sh: script to automatically change wallpaper each x minutes. +

+
+
+
+ +
+

PDF Reader: Zathura

+ +
+

Installation

+
+
+
yay -S zathura
+
+
+ +

+Then add dependecies to view specific files: +

+
+
yay -S zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb
+
+
+ +

+It seems that mupdf is better that poppler to view pdf. +

+
+
+ +
+

Configuration

+
+

+~/.config/zathura/zathurarc +

+
+
+ +
+

Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
pPrint the current pdf
tabShow the outline
rReload
J/KNext/previous page
H/LZoom in/out
aFit height
sFit width
DDouble page
fFollow link
iNight Mode
<n>ggGo to page n
mmMark current location to m
'mGoto location m
+
+
+
+ +
+

TODO Theme manager

+
+

+The idea would be to have a command that changes the theme of all the system. +

+ +

+There would be at least one light and one dark theme. +Applications that could change: +

+ +

+It seems the color is due to this part of the script. Should then source this file somehow. +

+ +
+
BASE16_SHELL="$HOME/.base16-manager/chriskempson/base16-shell/"
+[ -n "$PS1" ] && \
+    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
+        eval "$("$BASE16_SHELL/profile_helper.sh")"
+
+
+ + + +

+Possible theme managers: +

+ +
+
+

TODO Theme script

+
+

+~/bin/theme +

+
+
+ +
+

TODO Base16

+ + +
+

Base16 Philosophy

+
+

+Define colors according to rules: http://chriskempson.com/projects/base16/ +Then we can use these colors multiple applications. +

+
+
+ +
+

Base16-shell

+
+

+https://github.com/chriskempson/base16-shell +

+ +

+This changes the shell colors. This should be added to ~/.bashrc: +

+
+
# Base16 Shell
+BASE16_SHELL="$HOME/.config/base16-shell/"
+[ -n "$PS1" ] && \
+    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
+        eval "$("$BASE16_SHELL/profile_helper.sh")"
+
+
+
+
+ +
+

Base16-manager

+
+

+https://github.com/AuditeMarlow/base16-manager +

+ +

+This help changes many applications colors at once. +

+
+
+
+
+ + + + + +
+

TODO Bugs

+
+
+
+

TODO Why the cursor is turning when on the background image?

+
+

+Because something is executing without the –no-startup-id option +

+
+
+
+ + +
+

TODO VPN Setup

+
+
+
+

NordVPN

+ + +
+

Installation

+
+
+
yay -S nordvpn-bin
+
+
+
+
+ +
+

Configuration

+
+
+
sudo systemctl enable nordvpnd.service
+sudo systemctl start nordvpnd.service
+
+
+
+
+ +
+

Usage

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
nordvpn login 
nordvpn connect country 
nordvpn disconnect 
nordvpn status 
nordvpn countries 
+
+
+
+ + +
+ +
+

TODO NAS setup

+
+

+Mount a shared drive +https://wiki.archlinux.org/index.php/NFS +

+
+
+ +
+

Others

+
+
+
+

Reddit on terminal: rtv

+
+
+
yay -S rtv
+
+
+
+
+ + + +
+

Take Screenshot

+
+

+https://github.com/naelstrof/maim +

+
+
yay -S maim
+
+
+ +
+
man maim
+
+
+
+
+ +
+

Utilities

+
+
+
yay -S fd ripgrep pdf2svg pdftk
+
+
+ +
+
yay -S unclutter
+
+
+
+
+
+ + +
+

TODO Usefull commands

+
+
+ + +
+

Show informations about the machine

+
+ +
+
+ +
+

Work with PDF

+
+

+pdftk +

+
+
+ +
+

Separate PDF

+
+

+pdfseparate -f 1 -l 6 file.pdf split%d.pdf +Will create split1.pdf to split6.pdf files corresponding to correct pages of file.pdf. +

+
+
+ +
+

Readline

+
+

+https://wiki.archlinux.org/index.php/Keyboard_shortcuts +

+ + + + +++ ++ + + + + + + + + + + + + +
KeyboardShortcut Description
Ctrl+lClear the screen
+
+ +
+

Cursor Movement

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyboardShortcut Description
Ctrl+bMove cursor one character to the left
Ctrl+fMove cursor one character to the right
Alt+bMove cursor one word to the left
Alt+fMove cursor one word to the right
Ctrl+aMove cursor to start of the line
Ctrl+eMove cursor to end of the line
+
+
+ +
+

Copy & Paste

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyboardShortcut Description
Ctrl+uCut everything from line start to cursor
Ctrl+kCut everything from the cursor to end of the line
Alt+dCut the current word after the cursor
Ctrl+wCut the current word before the cursor
Ctrl+yPaste the previous cut text
Alt+yPaste the second latest cut text
Alt+Ctrl+yPaste the first argument of the previous command
Alt+./Paste the last argument of the previous command
+
+
+ +
+

History

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyboardShortcut Description
Ctrl+pMove to the previous line
Ctrl+nMove to the next line
Ctrl+sSearch
Ctrl+rReverse search
Ctrl+jEnd search
Ctrl+gAbort search (restores original line)
Alt+rRestores all changes made to line
+
+
+ +
+

Completion

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + +
KeyboardShortcut Description
TabAuto-complete a name
Alt+?List all possible completions
Alt+*Insert all possible completions
+
+
+
+ +
+

Google translate from the command line

+
+
+
yay -S translate-shell
+
+
+ +
+
trans englishwork en:fr
+
+
+
+
+ +
+

Others

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
tldrCommunity-driven man pages
transfer.shupload and share files from the command line
ffsendshare files from the command line
wttr.inweather in terminal
rtvReddit in terminal
awkhttps://linuxhandbook.com/awk-command-tutorial/
zJump around
thefuckMagnificent app which corrects your previous console command
bash-sensibleAn attempt at saner Bash defaults
awmanArch Wiki man pages - Arch wiki offline
s-tuiTerminal based CPU stress and monitoring utility
glancesA top/htop alternative
asciinemaReccord you terminal
ncduSee what takes place on the disk
lightProgram to easily change brightness on backlight-controllers
maimTake screenshots
+ + + + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandDescription
meteoGet the meteo
sudo cputhrottle PID %PROCLimiter l’accès au proc pour un processus
nmap -sP “192.168.1.*"Check all ip addresses on local netword
rsync -a --progress source destCopy folders with stats
du -sh folderReturn the size of the folder
df -hReport disk usage
+
+
+ +
+

Archive and Extract

+
+

+Use apack and aunpack: +

+ + + +++ ++ + + + + + + + + + + + + + + + + + +
  
aunpack foobar.tar.gzextract all files from archive
apack myarchive.zip foo barcreate a zip archive of two files
+
+
+ +
+

Hardware

+
+ + + +++ ++ + + + + + + + + + + + + + + + + +
dmesgDetected hardware and boot messages
lshwDisplay information on hardware
lsusb -tvShow usb devices
+
+
+ +
+

Network

+
+ + + +++ ++ + + + + + + + + + + + + + + + + +
ip addr showShow all network interfaces and ip address
ethtooo eth0Tool to show ethernet status
netstat -tulpList all active listening ports
+
+
+
+ +
+

TODO Custom scripts

+
+
+
+

TODO Password completion with fzf

+
+

+Make a script to use FZF for autocompletion of password (with pass program) and then send to current line or copy. +Maybe use tmux pane for that. +

+
+
+
+
+

TODO Bash Snippets

+
+
+
+

For loop

+
+
+
for file in ./*; do
+  command ${file};
+done
+
+
+
+
+
+
+

Some notes

+
+

+To improve the startup time. +

+ +
+
sudo systemctl disable apparmor
+sudo systemctl disable snapd
+sudo systemctl disable systemd-backlight@backlight\:intel_backlight.service
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/mail.html b/docs/mail.html new file mode 100644 index 0000000..18f009b --- /dev/null +++ b/docs/mail.html @@ -0,0 +1,2207 @@ + + + + + + + + +Mail Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Mail Configuration

+ + +
+

Synchronize Mailboxes - Mbsync

+ + +
+

Global Defaults

+
+
+
# Automatically create missing mailboxes, both locally and on the server
+Create Both
+# Save the synchronization state files in the relevant directory
+SyncState *
+# Permanently remove all messages [on the Master/Slave] marked for deletion.
+Expunge Both
+
+
+
+
+ +
+

Gmail Account

+
+
+
IMAPAccount gmail
+Host imap.gmail.com
+User dehaeze.thomas@gmail.com
+PassCmd "pass email/dehaeze.thomas@gmail.com"
+SSLType IMAPS
+AuthMechs LOGIN
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+
+ +
+
IMAPStore gmail-remote
+Account gmail
+
+MaildirStore gmail-local
+Path ~/.mail/gmail/
+Inbox ~/.mail/gmail/Inbox
+
+Channel gmail-Home
+Master :gmail-remote:"INBOX"
+Slave :gmail-local:Inbox
+
+Channel gmail-Drafts
+Master :gmail-remote:"[Gmail]/Drafts"
+Slave :gmail-local:Drafts
+
+Channel gmail-Sent
+Master :gmail-remote:"[Gmail]/Sent Mail"
+Slave :gmail-local:Sent
+
+Channel gmail-Trash
+Master :gmail-remote:"[Gmail]/Trash"
+Slave :gmail-local:Trash
+
+Channel gmail-All
+Master :gmail-remote:"[Gmail]/All Mail"
+Slave :gmail-local:Archive
+
+
+ +
+
# Catch-all for everything else: note that the `Patterns` have to exclude both
+# the remote and local names for all the folders we want to exclude (except
+# "INBOX", which is special-cased, it would seem).
+Channel gmail
+Master :gmail-remote:
+Slave :gmail-local:
+# Exclude everything under the internal [Gmail] folder, except the interesting folders
+Patterns *
+Patterns !INBOX
+Patterns ![Gmail]*
+Patterns !Archive
+Patterns !Drafts
+Patterns !Sent Mail
+Patterns !Trash
+Patterns !Spam
+Patterns !Starred
+
+
+ +
+
# For doing a quick sync of just the INBOX with `mbsync gmail-download`.
+Channel gmail-download
+Master :gmail-remote:"INBOX"
+Slave :gmail-local:Inbox
+Create Slave
+Expunge Slave
+Sync Pull
+
+
+
+
+ +
+

ESRF Account

+
+
+
IMAPAccount esrf
+Host imaps.esrf.fr
+User dehaeze
+PassCmd "pass email/thomas.dehaeze@esrf.fr"
+SSLType IMAPS
+AuthMechs LOGIN
+
+
+ +
+
IMAPStore esrf-remote
+Account esrf
+
+MaildirStore esrf-local
+Path ~/.mail/esrf/
+Inbox ~/.mail/esrf/Inbox
+
+Channel esrf-Home
+Master :esrf-remote:"Inbox"
+Slave :esrf-local:Inbox
+
+Channel esrf-Drafts
+Master :esrf-remote:"Drafts"
+Slave :esrf-local:Drafts
+
+Channel esrf-Archive
+Master :esrf-remote:"Archive"
+Slave :esrf-local:Archive
+
+Channel esrf-Sent
+Master :esrf-remote:"Sent"
+Slave :esrf-local:Sent
+
+Channel esrf-Trash
+Master :esrf-remote:"Trash"
+Slave :esrf-local:Trash
+
+
+ +
+
Channel esrf
+Master :esrf-remote:
+Slave :esrf-local:
+
+
+ +

+For doing a quick sync of just the INBOX with `mbsync esrf-download`. +

+
+
Channel esrf-download
+Master :esrf-remote:"INBOX"
+Slave :esrf-local:Inbox
+Create Slave
+Expunge Slave
+Sync Pull
+
+
+
+
+ +
+

ULG Account

+
+
+
IMAPAccount ulg
+Host mail.ulg.ac.be
+User thomas.dehaeze@doct.uliege.be
+PassCmd "pass email/thomas.dehaeze@doct.uliege.be"
+SSLType IMAPS
+AuthMechs LOGIN
+
+
+ +
+
IMAPStore ulg-remote
+Account ulg
+
+MaildirStore ulg-local
+Path ~/.mail/ulg/
+Inbox ~/.mail/ulg/Inbox
+
+Channel ulg-Home
+Master :ulg-remote:"Inbox"
+Slave :ulg-local:Inbox
+
+Channel ulg-Drafts
+Master :ulg-remote:"Drafts"
+Slave :ulg-local:Drafts
+
+Channel ulg-Archive
+Master :ulg-remote:"Archive"
+Slave :ulg-local:Archive
+
+Channel ulg-Sent
+Master :ulg-remote:"Sent"
+Slave :ulg-local:Sent
+
+Channel ulg-Trash
+Master :ulg-remote:"Trash"
+Slave :ulg-local:Trash
+
+
+ +
+
Channel ulg
+Master :ulg-remote:
+Slave :ulg-local:
+
+
+ +

+For doing a quick sync of just the INBOX with `mbsync ulg-download`. +

+
+
Channel ulg-download
+Master :ulg-remote:"Inbox"
+Slave :ulg-local:Inbox
+Create Slave
+Expunge Slave
+Sync Pull
+
+
+
+
+
+ +
+

Send Mails - Msmtp

+ + +
+

Defaults

+
+
+
defaults
+auth          on
+tls           on
+tls_certcheck off
+
+
+
+
+ +
+

Gmail Account

+
+
+
account gmail
+host         smtp.gmail.com
+port         587
+protocol     smtp
+from         dehaeze.thomas@gmail.com
+user         dehaeze.thomas@gmail.com
+passwordeval "pass email/dehaeze.thomas@gmail.com"
+
+
+
+
+ +
+

ESRF Account

+
+
+
account esrf
+host           smtps.esrf.fr
+port           465
+protocol       smtp
+from           thomas.dehaeze@esrf.fr
+user           dehaeze
+tls_starttls   off
+passwordeval   "pass email/thomas.dehaeze@esrf.fr"
+
+
+
+
+ +
+

ULG Account

+
+
+
account ulg
+host           smtp.ulg.ac.be
+port           587
+protocol       smtp
+from           thomas.dehaeze@doct.uliege.be
+user           s177313
+tls_starttls   on
+passwordeval   "pass email/thomas.dehaeze@doct.uliege.be"
+
+
+
+
+ +
+

Default Account

+
+
+
account default : gmail
+
+
+
+
+
+ +
+

TODO Mail Indexer - Mu

+ + + +
+ +
+

Mail Client - NeoMutt

+
+

+https://neomutt.org/ +

+ +

+Documentation: +

+
+
man neomutt
+man neomuttrc
+
+
+
+ +
+

Bindings

+
+
+
+

Unding all the key bindings

+
+
+
bind generic,pager,editor,index a noop
+bind generic,pager,editor,index b noop
+bind generic,pager,editor,index c noop
+bind generic,pager,editor,index d noop
+bind generic,pager,editor,index e noop
+bind generic,pager,editor,index f noop
+bind generic,pager,editor,index g noop
+bind generic,pager,editor,index h noop
+bind generic,pager,editor,index i noop
+bind generic,pager,editor,index j noop
+bind generic,pager,editor,index k noop
+bind generic,pager,editor,index l noop
+bind generic,pager,editor,index m noop
+bind generic,pager,editor,index n noop
+bind generic,pager,editor,index o noop
+bind generic,pager,editor,index p noop
+bind generic,pager,editor,index q noop
+bind generic,pager,editor,index r noop
+bind generic,pager,editor,index s noop
+bind generic,pager,editor,index t noop
+bind generic,pager,editor,index u noop
+bind generic,pager,editor,index v noop
+bind generic,pager,editor,index w noop
+bind generic,pager,editor,index x noop
+bind generic,pager,editor,index y noop
+bind generic,pager,editor,index z noop
+bind generic,pager,editor,index A noop
+bind generic,pager,editor,index B noop
+bind generic,pager,editor,index C noop
+bind generic,pager,editor,index D noop
+bind generic,pager,editor,index E noop
+bind generic,pager,editor,index F noop
+bind generic,pager,editor,index G noop
+bind generic,pager,editor,index H noop
+bind generic,pager,editor,index I noop
+bind generic,pager,editor,index J noop
+bind generic,pager,editor,index K noop
+bind generic,pager,editor,index L noop
+bind generic,pager,editor,index M noop
+bind generic,pager,editor,index N noop
+bind generic,pager,editor,index O noop
+bind generic,pager,editor,index P noop
+bind generic,pager,editor,index Q noop
+bind generic,pager,editor,index R noop
+bind generic,pager,editor,index S noop
+bind generic,pager,editor,index T noop
+bind generic,pager,editor,index U noop
+bind generic,pager,editor,index V noop
+bind generic,pager,editor,index W noop
+bind generic,pager,editor,index X noop
+bind generic,pager,editor,index Y noop
+bind generic,pager,editor,index Z noop
+
+bind generic,pager,editor,index <Tab>      noop
+bind generic,pager,editor,index <Space>    noop
+bind generic,pager,editor,index <PageUp>   noop
+bind generic,pager,editor,index <PageDown> noop
+bind generic,pager,editor,index <Home>     noop
+bind generic,pager,editor,index <End>      noop
+bind generic,pager,editor,index <Insert>   noop
+bind generic,pager,editor,index <Delete>   noop
+bind generic,pager,editor,index <Up>       noop
+bind generic,pager,editor,index <Down>     noop
+bind generic,pager,editor,index <Left>     noop
+bind generic,pager,editor,index <Right>    noop
+bind generic,pager,editor,index <Enter>    noop
+bind generic,pager,editor,index <Return>   noop
+
+bind generic,pager,editor,index | noop
+
+bind generic,pager,editor,index 1 noop
+bind generic,pager,editor,index 2 noop
+bind generic,pager,editor,index 3 noop
+bind generic,pager,editor,index 4 noop
+bind generic,pager,editor,index 5 noop
+bind generic,pager,editor,index 6 noop
+bind generic,pager,editor,index 7 noop
+bind generic,pager,editor,index 8 noop
+bind generic,pager,editor,index 9 noop
+bind generic,pager,editor,index 0 noop
+bind generic,pager,editor,index ! noop
+bind generic,pager,editor,index @ noop
+bind generic,pager,editor,index $ noop
+bind generic,pager,editor,index % noop
+bind generic,pager,editor,index ^ noop
+bind generic,pager,editor,index & noop
+bind generic,pager,editor,index * noop
+bind generic,pager,editor,index ( noop
+bind generic,pager,editor,index ) noop
+
+bind generic,pager,editor,index \Ca noop
+bind generic,pager,editor,index \Cb noop
+bind generic,pager,editor,index \Cc noop
+bind generic,pager,editor,index \Cd noop
+bind generic,pager,editor,index \Ce noop
+bind generic,pager,editor,index \Cf noop
+bind generic,pager,editor,index \Cg noop
+bind generic,pager,editor,index \Ch noop
+bind generic,pager,editor,index \Ci noop
+bind generic,pager,editor,index \Cj noop
+bind generic,pager,editor,index \Ck noop
+bind generic,pager,editor,index \Cl noop
+bind generic,pager,editor,index \Cm noop
+bind generic,pager,editor,index \Cn noop
+bind generic,pager,editor,index \Co noop
+bind generic,pager,editor,index \Cp noop
+bind generic,pager,editor,index \Cq noop
+bind generic,pager,editor,index \Cr noop
+bind generic,pager,editor,index \Cs noop
+bind generic,pager,editor,index \Ct noop
+bind generic,pager,editor,index \Cu noop
+bind generic,pager,editor,index \Cv noop
+bind generic,pager,editor,index \Cw noop
+bind generic,pager,editor,index \Cx noop
+bind generic,pager,editor,index \Cy noop
+bind generic,pager,editor,index \Cz noop
+bind generic,pager,editor,index \CA noop
+bind generic,pager,editor,index \CB noop
+bind generic,pager,editor,index \CC noop
+bind generic,pager,editor,index \CD noop
+bind generic,pager,editor,index \CE noop
+bind generic,pager,editor,index \CF noop
+bind generic,pager,editor,index \CG noop
+bind generic,pager,editor,index \CH noop
+bind generic,pager,editor,index \CI noop
+bind generic,pager,editor,index \CJ noop
+bind generic,pager,editor,index \CK noop
+bind generic,pager,editor,index \CL noop
+bind generic,pager,editor,index \CM noop
+bind generic,pager,editor,index \CN noop
+bind generic,pager,editor,index \CO noop
+bind generic,pager,editor,index \CP noop
+bind generic,pager,editor,index \CQ noop
+bind generic,pager,editor,index \CR noop
+bind generic,pager,editor,index \CS noop
+bind generic,pager,editor,index \CT noop
+bind generic,pager,editor,index \CU noop
+bind generic,pager,editor,index \CV noop
+bind generic,pager,editor,index \CW noop
+bind generic,pager,editor,index \CX noop
+bind generic,pager,editor,index \CY noop
+bind generic,pager,editor,index \CZ noop
+
+bind generic,pager,editor,index \C<Tab>      noop
+bind generic,pager,editor,index \C<Space>    noop
+bind generic,pager,editor,index \C<PageUp>   noop
+bind generic,pager,editor,index \C<PageDown> noop
+bind generic,pager,editor,index \C<Home>     noop
+bind generic,pager,editor,index \C<End>      noop
+bind generic,pager,editor,index \C<Insert>   noop
+bind generic,pager,editor,index \C<Delete>   noop
+bind generic,pager,editor,index \C<Up>       noop
+bind generic,pager,editor,index \C<Down>     noop
+bind generic,pager,editor,index \C<Left>     noop
+bind generic,pager,editor,index \C<Right>    noop
+bind generic,pager,editor,index \C<Enter>    noop
+bind generic,pager,editor,index \C<Return>   noop
+
+bind generic,pager,editor,index \C1 noop
+bind generic,pager,editor,index \C2 noop
+bind generic,pager,editor,index \C3 noop
+bind generic,pager,editor,index \C4 noop
+bind generic,pager,editor,index \C5 noop
+bind generic,pager,editor,index \C6 noop
+bind generic,pager,editor,index \C7 noop
+bind generic,pager,editor,index \C8 noop
+bind generic,pager,editor,index \C9 noop
+bind generic,pager,editor,index \C0 noop
+bind generic,pager,editor,index \C! noop
+bind generic,pager,editor,index \C$ noop
+bind generic,pager,editor,index \C% noop
+bind generic,pager,editor,index \C^ noop
+bind generic,pager,editor,index \C& noop
+bind generic,pager,editor,index \C* noop
+bind generic,pager,editor,index \C( noop
+bind generic,pager,editor,index \C) noop
+
+bind generic,pager,editor,index <Esc>a noop
+bind generic,pager,editor,index <Esc>b noop
+bind generic,pager,editor,index <Esc>c noop
+bind generic,pager,editor,index <Esc>d noop
+bind generic,pager,editor,index <Esc>e noop
+bind generic,pager,editor,index <Esc>f noop
+bind generic,pager,editor,index <Esc>g noop
+bind generic,pager,editor,index <Esc>h noop
+bind generic,pager,editor,index <Esc>i noop
+bind generic,pager,editor,index <Esc>j noop
+bind generic,pager,editor,index <Esc>k noop
+bind generic,pager,editor,index <Esc>l noop
+bind generic,pager,editor,index <Esc>m noop
+bind generic,pager,editor,index <Esc>n noop
+bind generic,pager,editor,index <Esc>o noop
+bind generic,pager,editor,index <Esc>p noop
+bind generic,pager,editor,index <Esc>q noop
+bind generic,pager,editor,index <Esc>r noop
+bind generic,pager,editor,index <Esc>s noop
+bind generic,pager,editor,index <Esc>t noop
+bind generic,pager,editor,index <Esc>u noop
+bind generic,pager,editor,index <Esc>v noop
+bind generic,pager,editor,index <Esc>w noop
+bind generic,pager,editor,index <Esc>x noop
+bind generic,pager,editor,index <Esc>y noop
+bind generic,pager,editor,index <Esc>z noop
+bind generic,pager,editor,index <Esc>A noop
+bind generic,pager,editor,index <Esc>B noop
+bind generic,pager,editor,index <Esc>C noop
+bind generic,pager,editor,index <Esc>D noop
+bind generic,pager,editor,index <Esc>E noop
+bind generic,pager,editor,index <Esc>F noop
+bind generic,pager,editor,index <Esc>G noop
+bind generic,pager,editor,index <Esc>H noop
+bind generic,pager,editor,index <Esc>I noop
+bind generic,pager,editor,index <Esc>J noop
+bind generic,pager,editor,index <Esc>K noop
+bind generic,pager,editor,index <Esc>L noop
+bind generic,pager,editor,index <Esc>M noop
+bind generic,pager,editor,index <Esc>N noop
+bind generic,pager,editor,index <Esc>O noop
+bind generic,pager,editor,index <Esc>P noop
+bind generic,pager,editor,index <Esc>Q noop
+bind generic,pager,editor,index <Esc>R noop
+bind generic,pager,editor,index <Esc>S noop
+bind generic,pager,editor,index <Esc>T noop
+bind generic,pager,editor,index <Esc>U noop
+bind generic,pager,editor,index <Esc>V noop
+bind generic,pager,editor,index <Esc>W noop
+bind generic,pager,editor,index <Esc>X noop
+bind generic,pager,editor,index <Esc>Y noop
+bind generic,pager,editor,index <Esc>Z noop
+
+bind generic,pager,editor,index <Esc><Tab>      noop
+bind generic,pager,editor,index <Esc><Space>    noop
+bind generic,pager,editor,index <Esc><PageUp>   noop
+bind generic,pager,editor,index <Esc><PageDown> noop
+bind generic,pager,editor,index <Esc><Home>     noop
+bind generic,pager,editor,index <Esc><End>      noop
+bind generic,pager,editor,index <Esc><Insert>   noop
+bind generic,pager,editor,index <Esc><Delete>   noop
+bind generic,pager,editor,index <Esc><Up>       noop
+bind generic,pager,editor,index <Esc><Down>     noop
+bind generic,pager,editor,index <Esc><Left>     noop
+bind generic,pager,editor,index <Esc><Right>    noop
+bind generic,pager,editor,index <Esc><Enter>    noop
+bind generic,pager,editor,index <Esc><Return>   noop
+
+bind generic,pager,editor,index <Esc>1 noop
+bind generic,pager,editor,index <Esc>2 noop
+bind generic,pager,editor,index <Esc>3 noop
+bind generic,pager,editor,index <Esc>4 noop
+bind generic,pager,editor,index <Esc>5 noop
+bind generic,pager,editor,index <Esc>6 noop
+bind generic,pager,editor,index <Esc>7 noop
+bind generic,pager,editor,index <Esc>8 noop
+bind generic,pager,editor,index <Esc>9 noop
+bind generic,pager,editor,index <Esc>0 noop
+bind generic,pager,editor,index <Esc>! noop
+bind generic,pager,editor,index <Esc>@ noop
+bind generic,pager,editor,index <Esc>$ noop
+bind generic,pager,editor,index <Esc>% noop
+bind generic,pager,editor,index <Esc>^ noop
+bind generic,pager,editor,index <Esc>& noop
+bind generic,pager,editor,index <Esc>* noop
+bind generic,pager,editor,index <Esc>( noop
+bind generic,pager,editor,index <Esc>) noop
+
+
+
+
+ +
+

Quit Neomutt

+
+
+
bind index,pager,compose Q exit
+macro index q "<shell-escape>if [ $TMUX ]; then tmux detach; fi<enter>"
+
+
+
+
+ +
+

Generic

+
+
+
bind generic Q exit
+
+bind generic <Return> select-entry
+bind generic l select-entry
+
+bind generic,index k previous-entry
+bind generic,index j next-entry
+
+bind generic,index 0 first-entry
+bind generic,index $ last-entry
+
+bind generic,index \031 previous-entry # Mouse wheel
+bind generic,index \005 next-entry # Mouse wheel
+
+bind generic,index gg first-entry
+bind generic,index G last-entry
+
+bind generic,index,pager \Cu half-up
+bind generic,index,pager \Cd half-down
+
+bind generic,index,pager \Ce next-line
+bind generic,index,pager \Cy previous-line
+
+
+
+
+ +
+

Index and Pager

+
+
+
bind pager k  previous-line
+bind pager j  next-line
+
+bind index <space> collapse-thread
+
+bind index,pager K previous-entry
+bind index,pager J next-entry
+
+bind index l  display-message
+bind index <Return> display-message
+bind pager l view-attachments
+
+bind pager gg top
+bind pager 0 top
+
+bind pager G bottom
+bind pager $ bottom
+
+macro index h "<change-folder>?" "Go back to the list of mailboxes"
+bind pager h exit
+bind pager q exit
+
+macro index c "<change-folder>?<toggle-mailboxes>" "change folder"
+
+bind index,pager u undelete-message
+
+bind index,pager P print-message
+
+# Compose a new email (not a reply) to the sender
+bind index,pager @ compose-to-sender
+
+# Marl All message as read
+macro index \Cr \
+    "<tag-pattern>~N<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" \
+    "mark all new as read"
+
+
+ +
+
bind index za collapse-thread
+bind index zA collapse-all # Missing :folddisable/foldenable
+
+
+ + +

+Write/Reply/Forward mail +

+
+
bind index,pager p recall-message
+bind index,pager m mail
+bind index,pager r reply
+bind index,pager R group-reply
+bind index,pager b bounce-message
+bind index,pager f forward-message
+
+
+ +

+Sync Mailbox +

+
+
bind index,pager s sync-mailbox
+
+
+ +

+Sync email +

+
+
macro index,pager o "<shell-escape>$HOME/.config/neomutt/bin/get_new_mail.sh<enter>"
+macro index,pager O "<shell-escape>$HOME/.config/neomutt/bin/get_new_mail.sh -a<enter>"
+
+
+ +

+Make quick html view macro +

+
+
macro index,pager H "<view-attachments><search>html<enter><view-mailcap><exit>"
+
+
+ +

+Open mail with Vim +

+
+
macro index,pager V "<view-attachments><search>plain<enter><view-mailcap><exit>"
+
+
+ +
+
# bind index,pager U toggle-new
+
+
+ +

+Labels +

+
+
bind index,pager y edit-label
+bind index,pager Y modify-labels
+
+
+
+
+ +
+

Limit

+
+
+
bind index L limit
+macro index a <limit>all<enter>
+
+
+
+
+ +
+

Search

+
+
+
bind generic,index,pager / search
+
+bind index,pager n search-next
+bind index,pager N search-opposite
+
+
+
+
+ +
+

Attachments

+
+
+
bind attach l view-attach
+
+bind attach h exit
+bind attach q exit
+
+bind attach <return> view-mailcap
+
+macro attach W <save-entry><kill-line>~/Downloads/<enter>y "Save entry"
+
+
+ +

+Attach multiple files using ranger +

+
+
macro compose A "<shell-escape>bash $HOME/.config/neomutt/bin/rangerpick<enter><enter-command>source /tmp/rangerpick<enter><shell-escape>bash $HOME/.config/neomutt/bin/rangerpick clean<enter>" "Attach with Ranger"
+
+
+
+ +
+
Attach with Ranger Script
+
+
+
tmpfile=/tmp/rangerpick
+if [ -z "$1" ]; then
+   ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", "<attach-file>"$0"<enter>"}'  $tmpfile)" > $tmpfile
+elif [ $1 == "clean" ]; then
+  ls $tmpfile
+fi
+
+
+
+
+
+ +
+

TODO Compose

+
+
+
bind compose p postpone-message
+
+bind compose R rename-attachment
+
+bind compose a attach-file
+
+
+ +

+Write html emails using markdown +

+
+
# macro compose M "F pandoc -s -f markdown -t html \ny^T^Utext/html; charset=us-ascii\n"
+
+
+ +

+Open another instance of neomutt in readonly mode while composing +

+
+
macro compose M "<shell-escape>termite -e \"neomutt -R\"<enter>"
+
+
+
+
+ +
+

Browser

+
+
+
bind browser l select-entry
+
+macro browser h "<top-page><select-entry>"
+bind browser q exit
+
+
+
+
+ +
+

Generic

+
+

+Enter Command +

+
+
bind generic,index,pager : enter-command
+
+
+
+
+ +
+

Copy and move mails

+
+
+
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
+macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
+
+
+
+
+ +
+

Sidebar

+
+
+
bind index,pager \Ck sidebar-prev
+bind index,pager \Cj sidebar-next
+bind index,pager \Cl sidebar-open
+
+bind index,pager \Ch sidebar-toggle-visible
+
+
+
+
+ +
+

Reload Configuration

+
+
+
macro generic,index,pager,editor ,<Space> ":source ~/.config/neomutt/neomuttrc\n" "Reload mutt's configuration file"
+
+
+
+
+ +
+

urlview - Open URL in emails

+
+

+Use urlview to extract urls from the mail. +

+
+
macro attach,compose,index,pager \cw "\
+  :set my_tmp_pipe_decode=\$pipe_decode\n\
+  :set pipe_decode\n\
+  <pipe-message>urlview\n\
+  :set pipe_decode=\$my_tmp_pipe_decode\n\
+  :unset my_tmp_pipe_decode\n" \
+  'call urlview to extract URLs out of a message'
+
+
+
+
+ +
+

Searching using Mu

+
+
+
macro index,pager \Cf "<shell-escape>mu find --clearlinks --format=links --linksdir=~/.mail/search " \
+                         "mu find"
+macro index,pager gf "<change-folder-readonly>~/.mail/search<enter>" \
+                         "mu find results"
+
+
+
+
+ +
+

Link to Orgmode

+
+
+
macro index,pager S "<pipe-message>$HOME/scripts/mutt-save-org-link.py\n"
+
+
+
+ +
+
Link mail to orgmode - Script
+
+
+
import sys
+import email
+import subprocess
+import urllib.parse
+
+# Parse the email from standard input
+message_bytes = sys.stdin.buffer.read()
+message = email.message_from_bytes(message_bytes)
+
+# 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
+
+# Ask emacsclient to save a link to the message
+p = subprocess.Popen([
+    'emacsclient',
+    f'org-protocol://capture?template=pm&url={message_id}&title={subject}'
+])
+
+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
+
+# basic monocolor screen
+mono  bold      bold
+mono  underline underline
+mono  indicator reverse
+mono  error     bold
+
+
+
+
+ +
+

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

+
+
+
set query_command="mu cfind '%s' -o mutt-ab"
+
+bind editor <Tab> complete-query
+
+
+
+
+ +
+

Paths

+
+
+
set folder           = ~/.mail                         # mail location
+set alias_file       = ~/.config/neomutt/alias         # where to store aliases
+set header_cache     = ~/.config/neomutt/cache/headers # where to store headers
+set message_cachedir = ~/.config/neomutt/cache/bodies  # where to store bodies
+set certificate_file = ~/.config/neomutt/certificates  # where to store certs
+set mailcap_path     = ~/.config/neomutt/mailcap       # entries for filetypes
+set tmpdir           = ~/.config/neomutt/temp          # where to keep temp files
+
+
+
+
+ +
+

Print

+
+

+https://unix.stackexchange.com/questions/20456/pretty-print-mails-from-mutt +

+ +
+
# set print_command="/usr/bin/muttprint %s -p ctb110c1u"
+
+
+
+
+ +
+

Accounts

+
+
+
set spoolfile = "+gmail/Inbox" # Default inbox
+set realname = "Dehaeze Thomas"
+set from = "dehaeze.thomas@gmail.com"
+
+folder-hook gmail/* source ~/.config/neomutt/accounts/gmail
+folder-hook esrf/*  source ~/.config/neomutt/accounts/esrf
+folder-hook ulg/*   source ~/.config/neomutt/accounts/ulg
+
+macro index,pager gu "<change-folder>+ulg/Inbox<enter>" "go to inbox"
+macro index,pager ge "<change-folder>+esrf/Inbox<enter>" "go to inbox"
+macro index,pager gm "<change-folder>+gmail/Inbox<enter>" "go to inbox"
+
+
+
+ +
+

Gmail

+
+
+
+
Configuration
+
+
+
set from     = "dehaeze.thomas@gmail.com"
+set sendmail = "msmtp -a gmail"
+
+# Other special folders.
+set mbox      = "+gmail/Archive"
+unset record # Don't copy send message to Sent folder: Gmail does that for us
+set postponed = "+gmail/Drafts"
+
+set signature = "~/.config/neomutt/accounts/gmail.signature"
+
+macro index,pager d \
+  "<save-message>+gmail/Archive<enter>" \
+  "Move message to the Archive"
+
+macro index,pager D \
+  "<save-message>+gmail/Trash<enter>" \
+  "Move message to the Trash"
+
+
+
+
+ +
+
Signature
+
+
+
Thomas Dehaeze
+
+
+

+This empty code block is used to add a new line after signatude +

+
+
+
+
+
+
+
+ +
+

ESRF

+
+
+
+
Configuration
+
+
+
set from     = "thomas.dehaeze@esrf.fr"
+set sendmail = "msmtp -a esrf"
+
+# Other special folders.
+set mbox      = "+esrf/Archive"
+set record    = "+esrf/Sent"
+set postponed = "+esrf/Drafts"
+
+set signature = "~/.config/neomutt/accounts/esrf.signature"
+
+macro index,pager d \
+  "<save-message>+esrf/Archive<enter>" \
+  "Move message to the Archive"
+
+macro index,pager D \
+  "<save-message>+esrf/Trash<enter>" \
+  "Move message to the Trash"
+
+
+
+
+ +
+
Signature
+
+
+
Thomas Dehaeze
+
+
+

+This empty code block is used to add a new line after signatude +

+
+
+
+
+
+
+
+ +
+

ULG

+
+
+
+
Configuration
+
+
+
set from     = "thomas.dehaeze@doct.uliege.be"
+set sendmail = "msmtp -a ulg"
+
+# Other special folders.
+set mbox      = "+ulg/Archive"
+set record    = "+ulg/Sent"
+set postponed = "+ulg/Drafts"
+
+set signature = "~/.config/neomutt/accounts/ulg.signature"
+
+macro index,pager d \
+  "<save-message>+ulg/Archive<enter>" \
+  "Move message to the Archive"
+
+macro index,pager D \
+  "<save-message>+ulg/Trash<enter>" \
+  "Move message to the Trash"
+
+
+
+
+ +
+
Signature
+
+
+
Thomas Dehaeze
+
+
+

+This empty code block is used to add a new line after signatude +

+
+
+
+
+
+
+
+
+ +
+

Basic Options

+
+
+
set wait_key = no        # shut up, mutt
+set mbox_type = Maildir  # mailbox type
+set help = no            # No top bar
+set timeout = 3          # idle time before scanning
+set sleep_time = 0       # how long NeoMutt may wait after an error message
+set mail_check = 0       # minimum time between scans
+set delete               # don't ask, just do
+unset confirmappend      # don't ask, just do!
+set quit                 # don't ask, just do!!
+set mark_old = no        # read/new is good enough for me
+set beep_new             # bell on new mails
+# set pipe_decode          # strip headers and eval mimes when piping
+set thorough_search      # strip headers and eval mimes before searching
+set send_charset="us-ascii:utf-8:iso-8859-1"
+set use_from             # respect the From: address the editor sends back
+
+# Use Vim to compose email, with a few default options.
+set editor = "nvim -c '/\\n--' -c ':noh' -c 'startinsert' -c ':Goyo'"
+
+
+
+
+ +
+

View Options

+
+
+
+

Status Bar

+
+
+
set status_on_top = no
+set status_chars  = " *%A"
+set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
+
+
+
+
+ +
+

Index View Options

+
+
+
set date_format = "%d/%m/%y %H:%M"
+set index_format = "[%Z] %D %-20.20F %s"
+
+set sort = threads                         # like gmail
+set sort_aux = reverse-last-date-received  # like gmail
+set uncollapse_jump                        # don't collapse on an unread message
+set sort_re                                # thread based on regex
+set reply_regexp = "^(([Rr][Ee]?(\[[0-9]+\])?: *)?(\[[^]]+\] *)?)*"
+set folder_format = "%2C %t %N %8s %f"
+
+
+
+
+ +
+

Pager View Options

+
+
+
set pager_index_lines = 10 # number of index lines to show
+set pager_context = 3      # number of context lines to show
+set pager_stop             # don't go to next message automatically
+set menu_scroll            # scroll in menus
+set tilde                  # show tildes like in vim
+set markers = no           # no ugly plus signs
+set quote_regexp = "^( {0,4}[>|:#%]| {0,4}[a-z0-9]+[>|]+)+"
+
+auto_view text/html                                      # view html automatically
+alternative_order text/plain text/enriched text/html     # save html for last
+
+
+
+
+ +
+

Compose View Options

+
+
+
set envelope_from                    # which from?
+set sig_dashes                       # dashes before sig
+set sig_on_top                       # the signature is just below the response
+set edit_headers                     # show headers when composing
+set fast_reply                       # skip to compose when replying
+set askcc                            # ask for CC:
+set fcc_attach                       # save attachments with the body
+set mime_forward = yes               # forward attachments as part of body
+set forward_format = "Fwd: %s"       # format of subject when forwarding
+set forward_decode                   # decode when forwarding
+set attribution = "On %d, %n wrote:" # format of quoting header
+set reply_to                         # reply to Reply to: field
+set reverse_name                     # reply as whomever it was to
+set include                          # include message in replies
+set forward_quote                    # include message in forwards
+
+
+
+
+ +
+

Headers

+
+
+
ignore *                                # ignore all headers
+unignore from: to: cc: date: subject:   # show only these
+unhdr_order *
+hdr_order from: to: cc: date: subject:  # and in this order
+
+
+
+
+
+ +
+

Sidebar

+
+
+
+

General Config

+
+
+
# Should the Sidebar be shown?
+set sidebar_visible = yes
+
+# How wide should the Sidebar be in screen columns?
+# Note: Some characters, e.g. Chinese, take up two columns each.
+set sidebar_width = 20
+
+# Should the mailbox paths be abbreviated?
+set sidebar_short_path = yes
+
+# When abbreviating mailbox path names, use any of these characters as path
+# separators.  Only the part after the last separators will be shown.
+# For file folders '/' is good.  For IMAP folders, often '.' is useful.
+set sidebar_delim_chars = '/.'
+
+# If the mailbox path is abbreviated, should it be indented?
+set sidebar_folder_indent = yes
+
+# Indent mailbox paths with this string.
+set sidebar_indent_string = '  '
+
+# Make the Sidebar only display mailboxes that contain new, or flagged,
+# mail.
+set sidebar_new_mail_only = no
+
+# Any mailboxes that are whitelisted will always be visible, even if the
+# sidebar_new_mail_only option is enabled.
+# sidebar_whitelist '/home/user/mailbox1'
+# sidebar_whitelist '/home/user/mailbox2'
+
+# When searching for mailboxes containing new mail, should the search wrap
+# around when it reaches the end of the list?
+set sidebar_next_new_wrap = no
+
+# Show the Sidebar on the right-hand side of the screen
+set sidebar_on_right = no
+
+# The character to use as the divider between the Sidebar and the other Mutt
+# panels.
+# Note: Only the first character of this string is used.
+set sidebar_divider_char = '│'
+
+# Enable extended buffy mode to calculate total, new, and flagged
+# message counts for each mailbox.
+set mail_check_stats
+
+# Display the Sidebar mailboxes using this format string.
+# set sidebar_format = '%B %?N?(%N)?%* %S'
+set sidebar_format = '%B %* %?N?[%N]?'
+
+# Sort the mailboxes in the Sidebar using this method:
+#       count    - total number of messages
+#       flagged  - number of flagged messages
+#       new      - number of new messages
+#       path     - mailbox path
+#       unsorted - do not sort the mailboxes
+set sidebar_sort_method = 'unsorted'
+
+
+
+
+ +
+

Mailboxes to show in the sidebar.

+
+
+
# mailboxes \
+#     +search \
+#     +gmail/Inbox \
+#     +gmail/Archive \
+#     +gmail/Drafts \
+#     +gmail/Sent \
+#     +gmail/Trash \
+#     +esrf/Inbox \
+#     +esrf/Archive \
+#     +esrf/Drafts \
+#     +esrf/Sent \
+#     +esrf/Trash \
+#     +ulg/Inbox \
+#     +ulg/Archive \
+#     +ulg/Drafts \
+#     +ulg/Sent \
+#     +ulg/Trash \
+
+named-mailboxes "   Search" =search
+named-mailboxes " GMAIL" =empty/gmail
+named-mailboxes "   Inbox" =gmail/Inbox
+named-mailboxes "   Sent" =gmail/Sent
+named-mailboxes "   Drafts" =gmail/Drafts
+named-mailboxes " ﮊ  Archive" =gmail/Archive
+named-mailboxes "   Trash" =gmail/Trash
+named-mailboxes " ESRF" =empty/esrf
+named-mailboxes "   Inbox" =esrf/Inbox
+named-mailboxes "   Sent" =esrf/Sent
+named-mailboxes "   Drafts" =esrf/Drafts
+named-mailboxes " ﮊ  Archive" =esrf/Archive
+named-mailboxes "   Trash" =esrf/Trash
+named-mailboxes " ULG" =empty/ulg
+named-mailboxes "   Inbox" =ulg/Inbox
+named-mailboxes "   Sent" =ulg/Sent
+named-mailboxes "   Drafts" =ulg/Drafts
+named-mailboxes " ﮊ  Archive" =ulg/Archive
+named-mailboxes "   Trash" =ulg/Trash
+
+set sendmail_wait = 0 # no please don't silently fail, email is important
+unset move
+
+
+
+
+
+ +
+

Attachments

+
+
+
+

Attachment View Options

+
+
+
set attach_format = "[%D %t] %2n [%-7.7m/%10.10M] %.40d %> [%s] "
+
+
+
+
+ +
+

Open Attachment

+
+

+Program to open is defined in the mailcap file. +

+ +

+A script openfile.sh is used to open files with the default application using xdg-open. +

+
+
+ +
+

Attach multiple files at once

+
+

+First, tag the files you want to send using t, then ; to apply the action on all tagged files and finally <enter> to add them all. +

+
+
+ +
+

Forgotten Attachment

+
+
+
set abort_noattach = ask-yes
+set abort_noattach_regex = "\\<(attach(|ed|ments?)|(attaché|attachés|attache|attachons|joint|jointe|joints|jointes|joins|joignons))\\>"
+
+
+
+
+
+ +
+

Scripts and other config files

+
+
+
+

Sync Mail script

+
+
+
if [ $TMUX ]; then
+    tmux split -v -l 1 ~/scripts/checkmail.sh $1 && tmux select-pane -U
+else
+    ~/scripts/checkmail.sh $1
+fi
+
+
+
+
+ +
+

Openfile Scripts

+
+
+
base=$(basename "$1")
+ext="${base##*.}"
+
+file=$(mktemp -u --suffix=".$ext")
+
+rm -f "$file"
+
+cp "$1" "$file"
+
+setsid xdg-open "$file" >/dev/null 2>&1 &
+
+
+
+
+ +
+

urlview Config

+
+
+
REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]
+
+COMMAND nohup qutebrowser %s </dev/null &>/dev/null &
+
+
+
+
+ +
+

Mailcap

+
+

+Generic +

+
+
text/plain; nvim %s
+audio/*; /usr/bin/xdg-open %s; copiousoutput
+video/*; setsid mpv --quiet %s &; copiousoutput
+image/*; ~/.config/neomutt/bin/openfile.sh %s;
+application/pdf; ~/.config/neomutt/bin/openfile.sh %s;
+text/html; export DISPLAY=:0 && setsid qutebrowser %s; nametemplate=%s.html
+text/html; w3m -I %{charset} -T text/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;
+
+
+ +

+Libreoffice +

+
+
application/docx; libreoffice %s --nologo &; copiousoutput;
+application/doc; libreoffice --nologo %s &; copiousoutput;
+
+application/vnd.oasis.opendocument.database; libreoffice --nologo --base '%s'; copiousoutput
+application/vnd.oasis.opendocument.chart; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.oasis.opendocument.spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.oasis.opendocument.spreadsheet-template; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.oasis.opendocument.graphics; libreoffice --nologo --draw '%s'; copiousoutput
+application/vnd.oasis.opendocument.graphics-template; libreoffice --nologo --draw '%s'; copiousoutput
+application/vnd.oasis.opendocument.presentation; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.oasis.opendocument.presentation-template; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.oasis.opendocument.formula; libreoffice --nologo --math '%s'; copiousoutput
+application/vnd.oasis.opendocument.text; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.oasis.opendocument.text-master; libreoffice --nologo -global '%s'; copiousoutput
+application/vnd.oasis.opendocument.text-template; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.oasis.opendocument.text-web; libreoffice --nologo -web '%s'; copiousoutput
+application/vnd.sun.xml.base; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.sun.xml.calc; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.sun.xml.calc.template; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.sun.xml.draw; libreoffice --nologo --draw '%s'; copiousoutput
+application/vnd.sun.xml.draw.template; libreoffice --nologo --draw '%s'; copiousoutput
+application/vnd.stardivision.calc; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.stardivision.chart; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.stardivision.draw; libreoffice --nologo --draw '%s'; copiousoutput
+application/vnd.stardivision.impress; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.stardivision.math; libreoffice --nologo --math '%s'; copiousoutput
+application/vnd.stardivision.writer-global; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.stardivision.writer; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.sun.xml.impress; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.sun.xml.impress.template; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.sun.xml.math; libreoffice --nologo --math '%s'; copiousoutput
+application/vnd.sun.xml.writer; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.sun.xml.writer.global; libreoffice --nologo -global '%s'; copiousoutput
+application/vnd.sun.xml.writer.template; libreoffice --nologo --writer '%s'; copiousoutput
+text/csv; libreoffice --nologo --calc '%s'; copiousoutput
+text/spreadsheet; libreoffice --nologo --calc '%s'; copiousoutput
+application/x-quattropro; libreoffice --nologo --calc '%s'; copiousoutput
+application/x-dbf; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.ms-excel.sheet.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.ms-excel.template.macroEnabled.12; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.spreadsheetml.template; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.lotus-1-2-3; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.ms-excel; libreoffice --nologo --calc '%s'; copiousoutput
+application/msexcel; libreoffice --nologo --calc '%s'; copiousoutput
+application/x-dbase; libreoffice --nologo --calc '%s'; copiousoutput
+text/x-csv; libreoffice --nologo --calc '%s'; copiousoutput
+application/vnd.ms-powerpoint.presentation.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.ms-powerpoint.slideshow.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.ms-powerpoint.template.macroEnabled.12; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.presentationml.presentation; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.presentationml.slideshow; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.presentationml.template; libreoffice --nologo --impress '%s'; copiousoutput
+application/vnd.ms-powerpoint; libreoffice --nologo --impress '%s'; copiousoutput
+application/mspowerpoint; libreoffice --nologo --impress '%s'; copiousoutput
+text/mathml; libreoffice --nologo --math '%s'; copiousoutput
+application/rtf; libreoffice --nologo --writer '%s'; copiousoutput
+application/x-t602; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.ms-word.document.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.ms-word.template.macroEnabled.12; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.wordprocessingml.document; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.openxmlformats-officedocument.wordprocessingml.template; libreoffice --nologo --writer '%s'; copiousoutput
+application/vnd.ms-works; libreoffice --nologo --writer '%s'; copiousoutput
+application/msword; libreoffice --nologo --writer '%s'; copiousoutput
+application/wordperfect; libreoffice --nologo --writer '%s'; copiousoutput
+text/rtf; libreoffice --nologo --writer '%s'; copiousoutput
+
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/music.html b/docs/music.html new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/docs/music.html @@ -0,0 +1,1432 @@ + + + + + + + + +Music/Sound Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Music/Sound Configuration

+ + +
+

Pavu Control

+
+
+
[window]
+width=500
+height=400
+sinkInputType=1
+sourceOutputType=1
+sinkType=0
+sourceType=1
+showVolumeMeters=1
+
+
+
+
+ +
+

NCMPCPP

+ + +
+

Config

+
+
+
##############################################################################
+## This is the example configuration file. Copy it to $HOME/.ncmpcpp/config ##
+## or $XDG_CONFIG_HOME/ncmpcpp/config and set up your preferences.          ##
+##############################################################################
+#
+##### directories ######
+##
+## Directory for storing ncmpcpp related files.  Changing it is useful if you
+## want to store everything somewhere else and provide command line setting for
+## alternative location to config file which defines that while launching
+## ncmpcpp.
+##
+#
+ncmpcpp_directory = ~/.config/ncmpcpp
+#
+##
+## Directory for storing downloaded lyrics. It defaults to ~/.lyrics since other
+## MPD clients (eg. ncmpc) also use that location.
+##
+#
+#lyrics_directory = ~/.lyrics
+#
+##### connection settings #####
+#
+mpd_host = localhost
+
+mpd_port = 6600
+
+#mpd_connection_timeout = 5
+
+## Needed for tag editor and file operations to work.
+##
+mpd_music_dir = ~/Music
+#
+#mpd_crossfade_time = 5
+#
+##### music visualizer #####
+##
+## Note: In order to make music visualizer work you'll need to use mpd fifo
+## output, whose format parameter has to be set to 44100:16:1 for mono
+## visualization or 44100:16:2 for stereo visualization. Example configuration
+## (it has to be put into mpd.conf):
+##
+## audio_output {
+##        type            "fifo"
+##        name            "Visualizer feed"
+##        path            "/tmp/mpd.fifo"
+##        format          "44100:16:2"
+## }
+##
+#
+#visualizer_fifo_path = /tmp/mpd.fifo
+#
+##
+## Note: Below parameter is needed for ncmpcpp to determine which output
+## provides data for visualizer and thus allow syncing between visualization and
+## sound as currently there are some problems with it.
+##
+#
+#visualizer_output_name = Visualizer feed
+#
+##
+## If you set format to 44100:16:2, make it 'yes'.
+##
+#visualizer_in_stereo = yes
+#
+##
+## Note: Below parameter defines how often ncmpcpp has to "synchronize"
+## visualizer and audio outputs.  30 seconds is optimal value, but if you
+## experience synchronization problems, set it to lower value.  Keep in mind
+## that sane values start with >=10.
+##
+#
+#visualizer_sync_interval = 30
+#
+##
+## Note: To enable spectrum frequency visualization you need to compile ncmpcpp
+## with fftw3 support.
+##
+#
+## Available values: spectrum, wave, wave_filled, ellipse.
+##
+#visualizer_type = wave
+#
+#visualizer_look = ●▮
+#
+#visualizer_color = blue, cyan, green, yellow, magenta, red
+#
+## Alternative subset of 256 colors for terminals that support it.
+##
+#visualizer_color = 41, 83, 119, 155, 185, 215, 209, 203, 197, 161
+#
+##### system encoding #####
+##
+## ncmpcpp should detect your charset encoding but if it failed to do so, you
+## can specify charset encoding you are using here.
+##
+## Note: You can see whether your ncmpcpp build supports charset detection by
+## checking output of `ncmpcpp --version`.
+##
+## Note: Since MPD uses UTF-8 by default, setting this option makes sense only
+## if your encoding is different.
+##
+#
+#system_encoding = ""
+#
+##### delays #####
+#
+## Time of inactivity (in seconds) after playlist highlighting will be disabled
+## (0 = always on).
+##
+#playlist_disable_highlight_delay = 5
+#
+## Defines how long messages are supposed to be visible.
+##
+#message_delay_time = 5
+#
+##### song format #####
+##
+## For a song format you can use:
+##
+## %l - length
+## %f - filename
+## %D - directory
+## %a - artist
+## %A - album artist
+## %t - title
+## %b - album
+## %y - date
+## %n - track number (01/12 -> 01)
+## %N - full track info (01/12 -> 01/12)
+## %g - genre
+## %c - composer
+## %p - performer
+## %d - disc
+## %C - comment
+## %P - priority
+## $R - begin right alignment
+##
+## If you want to make sure that a part of the format is displayed only when
+## certain tags are present, you can archieve it by grouping them with brackets,
+## e.g. '{%a - %t}' will be evaluated to 'ARTIST - TITLE' if both tags are
+## present or '' otherwise.  It is also possible to define a list of
+## alternatives by providing several groups and separating them with '|',
+## e.g. '{%t}|{%f}' will be evaluated to 'TITLE' or 'FILENAME' if the former is
+## not present.
+##
+## Note: If you want to set limit on maximal length of a tag, just put the
+## appropriate number between % and character that defines tag type, e.g. to
+## make album take max. 20 terminal cells, use '%20b'.
+##
+## In addition, formats support markers used for text attributes.  They are
+## followed by character '$'. After that you can put:
+##
+## - 0 - default window color (discards all other colors)
+## - 1 - black
+## - 2 - red
+## - 3 - green
+## - 4 - yellow
+## - 5 - blue
+## - 6 - magenta
+## - 7 - cyan
+## - 8 - white
+## - 9 - end of current color
+## - b - bold text
+## - u - underline text
+## - r - reverse colors
+## - a - use alternative character set
+##
+## If you don't want to use a non-color attribute anymore, just put it again,
+## but this time insert character '/' between '$' and attribute character,
+## e.g. {$b%t$/b}|{$r%f$/r} will display bolded title tag or filename with
+## reversed colors.
+##
+## If you want to use 256 colors and/or background colors in formats (the naming
+## scheme is described below in section about color definitions), it can be done
+## with the syntax $(COLOR), e.g. to set the artist tag to one of the
+## non-standard colors and make it have yellow background, you need to write
+## $(197_yellow)%a$(end). Note that for standard colors this is interchangable
+## with attributes listed above.
+##
+## Note: colors can be nested.
+##
+#
+#song_list_format = {%a - }{%t}|{$8%f$9}$R{$3(%l)$9}
+#
+#song_status_format = {{%a{ "%b"{ (%y)}} - }{%t}}|{%f}
+#
+#song_library_format = {%n - }{%t}|{%f}
+#
+#alternative_header_first_line_format = $b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b
+#
+#alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}
+#
+#current_item_prefix = $(yellow)$r
+#
+#current_item_suffix = $/r$(end)
+#
+#current_item_inactive_column_prefix = $(white)$r
+#
+#current_item_inactive_column_suffix = $/r$(end)
+#
+#now_playing_prefix = $b
+#
+#now_playing_suffix = $/b
+#
+#browser_playlist_prefix = "$2playlist$9 "
+#
+#selected_item_prefix = $6
+#
+#selected_item_suffix = $9
+#
+#modified_item_prefix = $3> $9
+#
+##
+## Note: attributes are not supported for the following variables.
+##
+#song_window_title_format = {%a - }{%t}|{%f}
+##
+## Note: Below variables are used for sorting songs in browser.  The sort mode
+## determines how songs are sorted, and can be used in combination with a sort
+## format to specify a custom sorting format.  Available values for
+## browser_sort_mode are "name", "mtime", "format" and "noop".
+##
+#
+#browser_sort_mode = name
+#
+#browser_sort_format = {%a - }{%t}|{%f} {(%l)}
+#
+##### columns settings #####
+##
+## syntax of song columns list format is "column column etc."
+##
+## - syntax for each column is:
+##
+## (width of the column)[color of the column]{displayed tag}
+##
+## Note: Width is by default in %, if you want a column to have fixed size, add
+## 'f' after the value, e.g. (10)[white]{a} will be the column that take 10% of
+## screen (so the real width will depend on actual screen size), whereas
+## (10f)[white]{a} will take 10 terminal cells, no matter how wide the screen
+## is.
+##
+## - color is optional (if you want the default one, leave the field empty).
+##
+## Note: You can give a column additional attributes by putting appropriate
+## character after displayed tag character. Available attributes are:
+##
+## - r - column will be right aligned
+## - E - if tag is empty, empty tag marker won't be displayed
+##
+## You can also:
+##
+## - give a column custom name by putting it after attributes, separated with
+##   character ':', e.g. {lr:Length} gives you right aligned column of lengths
+##   named "Length".
+##
+## - define sequence of tags, that have to be displayed in case predecessor is
+##   empty in a way similar to the one in classic song format, i.e. using '|'
+##   character, e.g. {a|c|p:Owner} creates column named "Owner" that tries to
+##   display artist tag and then composer and performer if previous ones are not
+##   available.
+##
+#
+#song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l}
+#
+##### various settings #####
+#
+##
+## Note: Custom command that will be executed each time song changes. Useful for
+## notifications etc.
+##
+execute_on_song_change = dunstify --replace=19845 "Now Playing ♫" "$(mpc current)"
+
+#
+##
+## Note: Custom command that will be executed each time player state
+## changes. The environment variable MPD_PLAYER_STATE is set to the current
+## state (either unknown, play, pause, or stop) for its duration.
+##
+#
+#execute_on_player_state_change = ""
+#
+#playlist_show_mpd_host = no
+#
+#playlist_show_remaining_time = no
+#
+#playlist_shorten_total_times = no
+#
+#playlist_separate_albums = no
+#
+##
+## Note: Possible display modes: classic, columns.
+##
+#playlist_display_mode = columns
+#
+#browser_display_mode = classic
+#
+#search_engine_display_mode = classic
+#
+#playlist_editor_display_mode = classic
+#
+#discard_colors_if_item_is_selected = yes
+#
+#show_duplicate_tags = yes
+#
+#incremental_seeking = yes
+#
+#seek_time = 1
+#
+#volume_change_step = 2
+#
+#autocenter_mode = no
+#
+#centered_cursor = no
+#
+##
+## Note: You can specify third character which will be used to build 'empty'
+## part of progressbar.
+##
+#progressbar_look = =>
+#
+## Available values: database, playlist.
+##
+#default_place_to_search_in = database
+#
+## Available values: classic, alternative.
+##
+#user_interface = classic
+#
+#data_fetching_delay = yes
+#
+## Available values: artist, album_artist, date, genre, composer, performer.
+##
+#media_library_primary_tag = artist
+#
+#media_library_albums_split_by_date = yes
+#
+## Available values: wrapped, normal.
+##
+#default_find_mode = wrapped
+#
+#default_tag_editor_pattern = %n - %t
+#
+#header_visibility = yes
+#
+#statusbar_visibility = yes
+#
+#titles_visibility = yes
+#
+#header_text_scrolling = yes
+#
+#cyclic_scrolling = no
+#
+#lines_scrolled = 2
+#
+#lyrics_fetchers = lyricwiki, azlyrics, genius, sing365, lyricsmania, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, internet
+#
+#follow_now_playing_lyrics = no
+#
+#fetch_lyrics_for_current_song_in_background = no
+#
+#store_lyrics_in_song_dir = no
+#
+#generate_win32_compatible_filenames = yes
+#
+#allow_for_physical_item_deletion = no
+#
+##
+## Note: If you set this variable, ncmpcpp will try to get info from last.fm in
+## language you set and if it fails, it will fall back to english. Otherwise it
+## will use english the first time.
+##
+## Note: Language has to be expressed as an ISO 639 alpha-2 code.
+##
+#lastfm_preferred_language = en
+#
+#space_add_mode = add_remove
+#
+#show_hidden_files_in_local_browser = no
+#
+##
+## How shall screen switcher work?
+##
+## - "previous" - switch between the current and previous screen.
+## - "screen1,...,screenN" - switch between given sequence of screens.
+##
+## Screens available for use: help, playlist, browser, search_engine,
+## media_library, playlist_editor, tag_editor, outputs, visualizer, clock,
+## lyrics, last_fm.
+##
+#screen_switcher_mode = playlist, browser
+#
+##
+## Note: You can define startup screen by choosing screen from the list above.
+##
+#startup_screen = playlist
+#
+##
+## Note: You can define startup slave screen by choosing screen from the list
+## above or an empty value for no slave screen.
+##
+#startup_slave_screen = ""
+#
+#startup_slave_screen_focus = no
+#
+##
+## Default width of locked screen (in %).  Acceptable values are from 20 to 80.
+##
+#
+#locked_screen_width_part = 50
+#
+#ask_for_locked_screen_width_part = yes
+#
+#jump_to_now_playing_song_at_start = yes
+#
+#ask_before_clearing_playlists = yes
+#
+#clock_display_seconds = no
+#
+#display_volume_level = yes
+#
+#display_bitrate = no
+#
+#display_remaining_time = no
+#
+## Available values: none, basic, extended, perl.
+##
+#regular_expressions = perl
+#
+##
+## Note: if below is enabled, ncmpcpp will ignore leading "The" word while
+## sorting items in browser, tags in media library, etc.
+##
+#ignore_leading_the = no
+#
+##
+## Note: if below is enabled, ncmpcpp will ignore diacritics while searching and
+## filtering lists. This takes an effect only if boost was compiled with ICU
+## support.
+##
+#ignore_diacritics = no
+#
+#block_search_constraints_change_if_items_found = yes
+#
+#mouse_support = yes
+#
+#mouse_list_scroll_whole_page = yes
+#
+#empty_tag_marker = <empty>
+#
+#tags_separator = " | "
+#
+#tag_editor_extended_numeration = no
+#
+#media_library_sort_by_mtime = no
+#
+#enable_window_title = yes
+#
+##
+## Note: You can choose default search mode for search engine. Available modes
+## are:
+##
+## - 1 - use mpd built-in searching (no regexes, pattern matching)
+##
+## - 2 - use ncmpcpp searching (pattern matching with support for regexes, but
+##       if your mpd is on a remote machine, downloading big database to process
+##       it can take a while
+##
+## - 3 - match only exact values (this mode uses mpd function for searching in
+##       database and local one for searching in current playlist)
+##
+#
+#search_engine_default_search_mode = 1
+#
+#external_editor = nano
+#
+## Note: set to yes if external editor is a console application.
+##
+#use_console_editor = yes
+#
+##### colors definitions #####
+##
+## It is possible to set a background color by setting a color value
+## "<foreground>_<background>", e.g. red_black will set foregound color to red
+## and background color to black.
+##
+## In addition, for terminals that support 256 colors it is possible to set one
+## of them by using a number in range [1, 256] instead of color name,
+## e.g. numerical value corresponding to red_black is 2_1. To find out if the
+## terminal supports 256 colors, run ncmpcpp and check out the bottom of the
+## help screen for list of available colors and their numerical values.
+##
+## What is more, there are two special values for the background color:
+## "transparent" and "current". The first one explicitly sets the background to
+## be transparent, while the second one allows you to preserve current
+## background color and change only the foreground one. It's used implicitly
+## when background color is not specified.
+##
+## Moreover, it is possible to attach format information to selected color
+## variables by appending to their end a colon followed by one or more format
+## flags, e.g. black:b or red:ur. The following variables support this syntax:
+## visualizer_color, color1, color2, empty_tag_color, volume_color,
+## state_line_color, state_flags_color, progressbar_color,
+## progressbar_elapsed_color, player_state_color, statusbar_time_color,
+## alternative_ui_separator_color.
+##
+## Note: due to technical limitations of older ncurses version, if 256 colors
+## are used there is a possibility that you'll be able to use only colors with
+## transparent background.
+#
+#colors_enabled = yes
+#
+#empty_tag_color = cyan
+#
+#header_window_color = default
+#
+#volume_color = default
+#
+#state_line_color = default
+#
+#state_flags_color = default:b
+#
+#main_window_color = yellow
+#
+#color1 = white
+#
+#color2 = green
+#
+#progressbar_color = black:b
+#
+#progressbar_elapsed_color = green:b
+#
+#statusbar_color = default
+#
+#statusbar_time_color = default:b
+#
+#player_state_color = default:b
+#
+#alternative_ui_separator_color = black:b
+#
+#window_border_color = green
+#
+#active_window_border = red
+#
+
+
+
+
+ +
+

Bindings

+
+
+
def_key "g"
+  move_home
+def_key "G"
+  move_end
+def_key "j"
+  scroll_down
+def_key "k"
+  scroll_up
+def_key "ctrl-u"
+  page_up
+def_key "ctrl-d"
+  page_down
+def_key "l"
+  enter_directory
+def_key "h"
+  jump_to_parent_directory
+def_key "."
+  show_lyrics
+def_key "n"
+  next_found_item
+def_key "N"
+  previous_found_item
+def_key "J"
+  move_sort_order_down
+def_key "K"
+  move_sort_order_up
+def_key "d"
+  delete_playlist_items
+def_key "+"
+  volume_up
+def_key "-"
+  volume_down
+
+
+
+
+
+
+ +
+

MPD

+ + +
+

Files and directories

+
+
+
# This setting controls the top directory which MPD will search to discover the
+# available audio files and add them to the daemon's online database. This
+# setting defaults to the XDG directory, otherwise the music directory will be
+# be disabled and audio files will only be accepted over ipc socket (using
+# file:// protocol) or streaming files over an accepted protocol.
+music_directory     "~/Music"
+
+# This setting sets the MPD internal playlist directory. The purpose of this
+# directory is storage for playlists created by MPD. The server will use
+# playlist files not created by the server but only if they are in the MPD
+# format. This setting defaults to playlist saving being disabled.
+playlist_directory      "~/.config/mpd/playlists"
+
+# This setting sets the location of the MPD database. This file is used to
+# load the database at server start up and store the database while the
+# server is not up. This setting defaults to disabled which will allow
+# MPD to accept files over ipc socket (using file:// protocol) or streaming
+# files over an accepted protocol.
+#
+db_file         "~/.config/mpd/database"
+
+# These settings are the locations for the daemon log files for the daemon.
+# These logs are great for troubleshooting, depending on your log_level
+# settings.
+#
+# The special value "syslog" makes MPD use the local syslog daemon. This
+# setting defaults to logging to syslog, otherwise logging is disabled.
+log_file            "~/.config/mpd/log"
+
+# This setting sets the location of the file which stores the process ID
+# for use of mpd --kill and some init scripts. This setting is disabled by
+# default and the pid file will not be stored.
+#
+pid_file            "~/.config/mpd/pid"
+
+# This setting sets the location of the file which contains information about
+# most variables to get MPD back into the same general shape it was in before
+# it was brought down. This setting is disabled by default and the server
+# state will be reset on server start up.
+state_file          "~/.config/mpd/state"
+
+# The location of the sticker database.  This is a database which
+# manages dynamic information attached to songs.
+#sticker_file           "~/.config/mpd/sticker.sql"
+
+
+
+
+ +
+

General music daemon options

+
+
+
# This setting specifies the user that MPD will run as. MPD should never run as
+# root and you may use this setting to make MPD change its user ID after
+# initialization. This setting is disabled by default and MPD is run as the
+# current user.
+#
+#user               "nobody"
+#
+# This setting specifies the group that MPD will run as. If not specified
+# primary group of user specified with "user" setting will be used (if set).
+# This is useful if MPD needs to be a member of group such as "audio" to
+# have permission to use sound card.
+#
+#group              "nogroup"
+#
+# This setting sets the address for the daemon to listen on. Careful attention
+# should be paid if this is assigned to anything other then the default, any.
+# This setting can deny access to control of the daemon. Not effective if
+# systemd socket activiation is in use.
+#
+# For network
+#bind_to_address        "any"
+#
+# And for Unix Socket
+#bind_to_address        "~/.mpd/socket"
+#
+# This setting is the TCP port that is desired for the daemon to get assigned
+# to.
+#
+#port               "6600"
+#
+# This setting controls the type of information which is logged. Available
+# setting arguments are "default", "secure" or "verbose". The "verbose" setting
+# argument is recommended for troubleshooting, though can quickly stretch
+# available resources on limited hardware storage.
+#
+#log_level          "default"
+#
+# Setting "restore_paused" to "yes" puts MPD into pause mode instead
+# of starting playback after startup.
+#
+#restore_paused "no"
+#
+# This setting enables MPD to create playlists in a format usable by other
+# music players.
+#
+#save_absolute_paths_in_playlists   "no"
+#
+# This setting defines a list of tag types that will be extracted during the
+# audio file discovery process. The complete list of possible values can be
+# found in the user manual.
+#metadata_to_use    "artist,album,title,track,name,genre,date,composer,performer,disc"
+#
+# This example just enables the "comment" tag without disabling all
+# the other supported tags:
+#metadata_to_use "+comment"
+#
+# This setting enables automatic update of MPD's database when files in
+# music_directory are changed.
+#
+#auto_update    "yes"
+#
+# Limit the depth of the directories being watched, 0 means only watch
+# the music directory itself.  There is no limit by default.
+#
+#auto_update_depth "3"
+#
+
+
+
+
+ +
+

Symbolic link behavior

+
+
+
# If this setting is set to "yes", MPD will discover audio files by following
+# symbolic links outside of the configured music_directory.
+#
+#follow_outside_symlinks    "yes"
+#
+# If this setting is set to "yes", MPD will discover audio files by following
+# symbolic links inside of the configured music_directory.
+#
+#follow_inside_symlinks     "yes"
+#
+
+
+
+
+ +
+

Zeroconf / Avahi Service Discovery

+
+
+
# If this setting is set to "yes", service information will be published with
+# Zeroconf / Avahi.
+#
+#zeroconf_enabled       "yes"
+#
+# The argument to this setting will be the Zeroconf / Avahi unique name for
+# this MPD server on the network. %h will be replaced with the hostname.
+#
+#zeroconf_name          "Music Player @ %h"
+#
+
+
+
+
+ +
+

Permissions

+
+
+
# If this setting is set, MPD will require password authorization. The password
+# setting can be specified multiple times for different password profiles.
+#
+#password                        "password@read,add,control,admin"
+#
+# This setting specifies the permissions a user has who has not yet logged in.
+#
+#default_permissions             "read,add,control,admin"
+#
+
+
+
+
+ +
+

Database

+
+
+
#database {
+#       plugin "proxy"
+#       host "other.mpd.host"
+#       port "6600"
+#}
+
+
+
+
+ +
+

Input

+
+
+
input {
+        plugin "curl"
+#       proxy "proxy.isp.com:8080"
+#       proxy_user "user"
+#       proxy_password "password"
+}
+
+
+
+
+ +
+

Audio Output

+
+
+
# MPD supports various audio output types, as well as playing through multiple
+# audio outputs at the same time, through multiple audio_output settings
+# blocks. Setting this block is optional, though the server will only attempt
+# autodetection for one sound card.
+#
+# An example of an ALSA output:
+#
+#audio_output {
+#    type       "alsa"
+#    name       "My ALSA Device"
+#    period_time "50000"
+##  device      "hw:0,0"    # optional
+##  mixer_type      "hardware"  # optional
+##  mixer_device    "default"   # optional
+##  mixer_control   "PCM"       # optional
+##  mixer_index "0"     # optional
+#}
+
+# For NCMPCPP Visualizer
+audio_output {
+       type            "fifo"
+       name            "Visualizer feed"
+       path            "/tmp/mpd.fifo"
+       format          "44100:16:2"
+}
+
+#
+# An example of an OSS output:
+#
+#audio_output {
+#   type        "oss"
+#   name        "My OSS Device"
+##  device      "/dev/dsp"  # optional
+##  mixer_type      "hardware"  # optional
+##  mixer_device    "/dev/mixer"    # optional
+##  mixer_control   "PCM"       # optional
+#}
+#
+# An example of a shout output (for streaming to Icecast):
+#
+#audio_output {
+#   type        "shout"
+#   encoder     "vorbis"        # optional
+#   name        "My Shout Stream"
+#   host        "localhost"
+#   port        "8000"
+#   mount       "/mpd.ogg"
+#   password    "hackme"
+#   quality     "5.0"
+#   bitrate     "128"
+#   format      "44100:16:1"
+##  protocol    "icecast2"      # optional
+##  user        "source"        # optional
+##  description "My Stream Description" # optional
+##  url     "http://example.com"    # optional
+##  genre       "jazz"          # optional
+##  public      "no"            # optional
+##  timeout     "2"         # optional
+##  mixer_type      "software"      # optional
+#}
+#
+# An example of a recorder output:
+#
+#audio_output {
+#   type        "recorder"
+#   name        "My recorder"
+#   encoder     "vorbis"        # optional, vorbis or lame
+#   path        "/var/lib/mpd/recorder/mpd.ogg"
+##  quality     "5.0"           # do not define if bitrate is defined
+#   bitrate     "128"           # do not define if quality is defined
+#   format      "44100:16:1"
+#}
+#
+# An example of a httpd output (built-in HTTP streaming server):
+#
+#audio_output {
+#   type        "httpd"
+#   name        "My HTTP Stream"
+#   encoder     "vorbis"        # optional, vorbis or lame
+#   port        "8000"
+#   bind_to_address "0.0.0.0"       # optional, IPv4 or IPv6
+##  quality     "5.0"           # do not define if bitrate is defined
+#   bitrate     "128"           # do not define if quality is defined
+#   format      "44100:16:1"
+#   max_clients "0"         # optional 0=no limit
+#}
+#
+# An example of a pulseaudio output (streaming to a remote pulseaudio server)
+#
+audio_output {
+  type      "pulse"
+  name      "My Pulse Output"
+#  server   "localhost"     # optional
+#   sink        "remote_server_sink"    # optional
+}
+#
+# An example of a winmm output (Windows multimedia API).
+#
+#audio_output {
+#   type        "winmm"
+#   name        "My WinMM output"
+##  device      "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
+#       or
+##  device      "0"     # optional
+##  mixer_type  "hardware"  # optional
+#}
+#
+# An example of an openal output.
+#
+#audio_output {
+#   type        "openal"
+#   name        "My OpenAL output"
+##  device      "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
+#}
+#
+# An example of an sndio output.
+#
+#audio_output {
+#   type        "sndio"
+#   name        "sndio output"
+#   mixer_type  "hardware"
+#}
+#
+# An example of an OS X output:
+#
+#audio_output {
+#   type        "osx"
+#   name        "My OS X Device"
+##  device      "Built-in Output"   # optional
+##  channel_map      "-1,-1,0,1"    # optional
+#}
+#
+## Example "pipe" output:
+#
+#audio_output {
+#   type        "pipe"
+#   name        "my pipe"
+#   command     "aplay -f cd 2>/dev/null"
+## Or if you're want to use AudioCompress
+#   command     "AudioCompress -m | aplay -f cd 2>/dev/null"
+## Or to send raw PCM stream through PCM:
+#   command     "nc example.org 8765"
+#   format      "44100:16:2"
+#}
+#
+## An example of a null output (for no audio output):
+#
+#audio_output {
+#   type        "null"
+#   name        "My Null Output"
+#   mixer_type      "none"          # optional
+#}
+#
+
+
+
+
+ +
+

Normalization automatic volume adjustments

+
+
+
# This setting specifies the type of ReplayGain to use. This setting can have
+# the argument "off", "album", "track" or "auto". "auto" is a special mode that
+# chooses between "track" and "album" depending on the current state of
+# random playback. If random playback is enabled then "track" mode is used.
+# See <http://www.replaygain.org> for more details about ReplayGain.
+# This setting is off by default.
+#
+#replaygain         "album"
+#
+# This setting sets the pre-amp used for files that have ReplayGain tags. By
+# default this setting is disabled.
+#
+#replaygain_preamp      "0"
+#
+# This setting sets the pre-amp used for files that do NOT have ReplayGain tags.
+# By default this setting is disabled.
+#
+#replaygain_missing_preamp  "0"
+#
+# This setting enables or disables ReplayGain limiting.
+# MPD calculates actual amplification based on the ReplayGain tags
+# and replaygain_preamp / replaygain_missing_preamp setting.
+# If replaygain_limit is enabled MPD will never amplify audio signal
+# above its original level. If replaygain_limit is disabled such amplification
+# might occur. By default this setting is enabled.
+#
+#replaygain_limit       "yes"
+#
+# This setting enables on-the-fly normalization volume adjustment. This will
+# result in the volume of all playing audio to be adjusted so the output has
+# equal "loudness". This setting is disabled by default.
+#
+#volume_normalization       "no"
+#
+
+
+
+
+ +
+

Character Encoding

+
+
+
# If file or directory names do not display correctly for your locale then you
+# may need to modify this setting.
+#
+#filesystem_charset     "UTF-8"
+
+
+
+
+
+ +
+

Beets

+
+

+http://beets.io/ +

+ +
+
directory: ~/Music
+library: ~/Music/musiclibrary.db
+
+import:
+  move: yes
+
+
+
+
+
+

Mopidy

+
+
+
[spotify]
+username = dehaeze.thomas@gmail.com
+password = ***REMOVED***
+client_id = 3b740ab1-f26f-4c38-aee0-4dcb9e58b375
+client_secret = ***REMOVED***
+bitrate = 320
+
+[mpd]
+enabled = true
+hostname = 127.0.0.1
+port = 6600
+password =
+max_connections = 20
+connection_timeout = 60
+zeroconf = Mopidy MPD server on $hostname
+command_blacklist = listall,listallinfo
+default_playlist_scheme = m3u
+
+[audio]
+output = tee name=t t. ! queue ! autoaudiosink t. ! queue ! audioresample ! audioconvert ! audio/x-raw,rate=44100,channels=2,format=S16LE ! wavenc ! filesink location=/tmp/mpd.fifo
+
+
+
+
+ +
+

Radio with curseradio

+
+
+
[opml]
+root = http://opml.radiotime.com/
+
+[playback]
+command = /usr/bin/mpv
+
+[interface]
+keymap = vi
+
+[keymap.vi]
+up = k
+down = j
+start = 0
+end = $
+pageup = u
+pagedown = d
+enter = l
+stop = p
+exit = q
+favourite = f
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/newsboat.html b/docs/newsboat.html new file mode 100644 index 0000000..795a456 --- /dev/null +++ b/docs/newsboat.html @@ -0,0 +1,620 @@ + + + + + + + + +Newsboat Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Newsboat Configuration

+ + +

+https://wiki.archlinux.org/index.php/Newsboat +https://newsboat.org/releases/2.12/docs/newsboat.html +

+ +
+

Config

+
+
+ +
+

Reload configuration

+
+
+
# All feeds will be automatically reloaded after a certain time has passed
+auto-reload yes
+
+# The number of minutes between automatic reloads.
+reload-time 180
+
+# The number of parallel reload threads that shall be started when all feeds are reloaded.
+reload-threads 3
+
+# If set to yes, then the first automatic reload will be suppressed if auto-reload is set to yes.
+suppress-first-reload yes
+
+
+
+
+ +
+

Basic configuration

+
+
+
confirm-exit no
+
+external-url-viewer "urlscan -dc -r 'linkhandler {}'"
+
+goto-first-unread no
+goto-next-feed no
+
+save-path "~/Saved Articles"
+download-path "~/Downloads"
+
+# If set to no, then the keymap hints on the bottom of screen will not be displayed.
+show-keymap-hint no
+
+feed-sort-order none
+
+player "mpv"
+
+
+
+
+ +
+

Notifications

+
+
+
notify-format "%n unread articles"
+notify-program ~/scripts/newsboat-notify.sh
+notify-always no
+
+
+
+ +
+

Notification Script

+
+
+
dunstify -replace=38492 "Newsbeuter " "$1"
+
+
+
+
+
+ +
+

Bindings

+
+
+
bind-key j down
+bind-key k up
+bind-key j next articlelist
+bind-key k prev articlelist
+bind-key J next-feed articlelist
+bind-key K prev-feed articlelist
+bind-key G end
+bind-key g home
+bind-key d pagedown
+bind-key u pageup
+
+bind-key l open
+bind-key h quit
+
+bind-key a toggle-article-read
+
+bind-key n next-unread
+bind-key N prev-unread
+
+bind-key D pb-download
+
+bind-key U show-urls
+
+# bind-key x pb-delete
+
+bind-key t set-tag
+bind-key T clear-tag
+
+bind-key r reload # Reload the currently selected feed
+bind-key R reload-all # Reload all feeds
+
+
+
+
+ +
+

Macros - Starts with , key

+
+
+
# Default Browser
+browser "qutebrowser %u"
+
+# Open in Browser
+macro , open-in-browser
+
+# Download Video with Youtube-DL
+# TODO - Should write a script for that? Maybe open a tmux script if newsboat is in tmux pane?
+macro t set browser "~/scripts/download-video.sh %u" ; open-in-browser ; set browser "qutebrowser %u"
+
+# Download Audio with Youtube-DL
+macro a set browser "~/scripts/download-audio.sh %u" ; open-in-browser ; set browser "qutebrowser %u"
+
+# Open Video with MPV
+macro v set browser "setsid nohup mpv %u &> /dev/null &" ; open-in-browser ; set browser "qutebrowser %u"
+
+# Open With W3M
+macro w set browser "w3m %u" ; open-in-browser ; set browser "qutebrowser %u"
+
+# Copy Address to clipboard
+macro c set browser "xsel -b <<<" ; open-in-browser ; set browser "qutebrowser %u"
+
+
+
+
+ +
+

hide articles matching

+
+
+
ignore-article "*" "title =~ \"Sponsor\""
+ignore-article "*" "title =~ \"Advertisement\""
+ignore-mode "display"
+
+
+
+
+ +
+

Feedlist and Article Format

+
+
+
feedlist-format "%4i %n %11u %t"
+feedlist-title-format "N %V - Your feeds (%u unread, %t total)%?T? - tag `%T'&?"
+
+articlelist-format "%3i %f %D  %?T?|%-17T| ?%t"
+articlelist-title-format "%N %V - Articles in feed '%T' (%u unread, %t total) - %U"
+
+itemview-title-format "Article '%T'"
+
+
+
+
+ +
+

Color Scheme

+
+
+
include "~/.config/newsboat/colors"
+
+
+
+
+
+ +
+

Colors

+
+
+
highlight feedlist    "^  *[0-9]+  *N  "                    cyan     cyan
+highlight articlelist "^  *[0-9]+  *N  "                    cyan     cyan
+
+highlight article     "(^Feed:.*|^Title:.*|^Author:.*)"     red      default
+highlight article     "(^Link:.*|^Date:.*)"                 white    default
+highlight article     "^Podcast Download URL:.*"            cyan     default
+highlight article     "^Links:"                             magenta  black    underline
+highlight article     "https?://[^ ]+"                      green    default
+highlight article     "^(Title):.*$"                        blue     default
+highlight article     "\\[[0-9][0-9]*\\]"                   magenta  default  bold
+highlight article     "\\[image\\ [0-9]+\\]"                green    default  bold
+highlight article     "\\[embedded flash: [0-9][0-9]*\\]"   green    default  bold
+highlight article     ":.*\\(link\\)$"                      cyan     default
+highlight article     ":.*\\(image\\)$"                     blue     default
+highlight article     ":.*\\(embedded flash\\)$"            magenta  default
+
+color background                                            default   default
+color listnormal                                            default   default
+color listnormal_unread                                     white     default
+color listfocus                                             color255  cyan   bold
+color listfocus_unread                                      color255  cyan   bold
+color info                                                  cyan      black
+color article                                               default   default
+
+
+
+
+ +
+

URLS

+
+
+ +
+

NEWSFEEDS

+
+
+
+

Linux

+
+
+
https://itsfoss.com/feed/ "~NEWSFEED: It's Foss" linux
+https://lukesmith.xyz/rss.xml "~NEWSFEED: Lukesmith" linux
+
+https://lord.re/index.xml "~NEWSFEED: /home/lord" linux
+http://feeds.cyberciti.biz/Nixcraft-LinuxFreebsdSolarisTipsTricks "~NEWSFEED: nixCraft" linux
+http://frederic.bezies.free.fr/blog/?feed=rss2 "~NEWSFEED: Le Weblog de Frederic Bezies" linux
+https://addy-dclxvi.github.io/index.xml "~NEWSFEED: Addy's Blog" linux
+http://feeds.feedburner.com/linoxideblog "~NEWSFEED: LinOxide" linux
+
+
+
+
+ +
+

Emacs

+
+
+
http://www.planet.emacsen.org/atom.xml "~NEWSFEED: Planet Emacs" emacs
+http://sachachua.com/blog/feed/ "~NEWSFEED: Sacha Chua" emacs
+https://scripter.co/categories/org/index.xml "~NEWSFEED: Scripter" emacs
+http://kitchingroup.cheme.cmu.edu/blog/feed "~NEWSFEED: The Kitchin Research Group" emacs
+http://irreal.org/blog/?feed=rss2 "~NEWSFEED: Irreal" emacs
+https://emacs.cafe/feed.xml "~NEWSFEED: Emacs café" emacs
+http://pragmaticemacs.com/feed/ "~NEWSFEED: Pragmatic Emacs" emacs
+https://pinecast.com/feed/emacscast "~NEWSFEED: EmacsCast" emacs
+http://feeds.feedburner.com/CestLaZ "~NEWSFEED: c'est la Z" emacs
+https://joshrollinswrites.com/index.xml "~NEWSFEED: The Art of Not Asking Why" emacs
+http://howardism.org/index.xml "~NEWSFEED: Howardism" emacs
+
+
+
+
+ +
+

Other

+
+
+
http://xkcd.com/rss.xml "~NEWSFEED: XKCD" fun
+https://undocumentedmatlab.com/feed/ "~NEWSFEED: undocumentedmatlab" matlab
+http://feeds.feedburner.com/mathworks/pick?format=xml "~NEWSFEED: Matlab Pick of the Week" matlab
+
+
+
+
+
+ +
+

Radio

+
+
+
http://radiofrance-podcast.net/podcast09/rss_12494.xml "~RADIO: France Inter - Journal 7h" radio
+http://radiofrance-podcast.net/podcast09/rss_11736.xml "~RADIO: France Inter - Journal 19h" radio
+http://radiofrance-podcast.net/podcast09/rss_18911.xml "~RADIO: France Inter - Journal 19h we" radio
+
+
+
+
+ +
+

Youtube

+
+
+
https://www.youtube.com/feeds/videos.xml?channel_id=UCkK9UDm_ZNrq_rIXCz3xCGA "~YOUTUBE: Bryan Lunduke" youtube unix
+https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~YOUTUBE: Luke Smith" youtube unix
+https://www.youtube.com/feeds/videos.xml?channel_id=UCXPHFM88IlFn68OmLwtPmZA "~YOUTUBE: Greg Hurrell" youtube unix
+https://www.youtube.com/feeds/videos.xml?channel_id=UCUR1pFG_3XoZn3JNKjulqZg "~YOUTUBE: Thoughtbot" youtube unix
+
+https://www.youtube.com/feeds/videos.xml?channel_id=UCOuIgj0CYCXCvjWywjDbauw "~YOUTUBE: Chat sceptique" youtube science
+https://www.youtube.com/feeds/videos.xml?channel_id=UCMFcMhePnH4onVHt2-ItPZw "~YOUTUBE: Hygiène Mentale" youtube science
+https://www.youtube.com/feeds/videos.xml?channel_id=UCxqAWLTk1CmBvZFPzeZMd9A "~YOUTUBE: Domain of Science" youtube science
+https://www.youtube.com/feeds/videos.xml?channel_id=UC2LZO6swZ9SLUEOks3WnsfA "~YOUTUBE: 2veritasium" youtube science
+https://www.youtube.com/feeds/videos.xml?channel_id=UCaNlbnghtwlsGF-KzAFThqA "~YOUTUBE: ScienceEtonnante" youtube science
+https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA "~YOUTUBE: Veritasium" youtube science
+
+https://www.youtube.com/feeds/videos.xml?channel_id=UCEfFUaIkjbI06PhALdcXNVA "~YOUTUBE: EmacsCast" youtube emacs
+https://www.youtube.com/feeds/videos.xml?channel_id=UCkRmQ_G_NbdbCQMpALg6UPg "~YOUTUBE: Emacsrocks" youtube emacs
+https://www.youtube.com/feeds/videos.xml?channel_id=UCQp2VLAOlvq142YN3JO3y8w "~YOUTUBE: John Kitchin" youtube emacs
+
+https://www.youtube.com/feeds/videos.xml?channel_id=UCq0imsn84ShAe9PBOFnoIrg "~YOUTUBE: Brian Douglas" youtube control
+https://www.youtube.com/feeds/videos.xml?channel_id=UCm5mt-A4w61lknZ9lCsZtBw "~YOUTUBE: Steve Brunton" youtube control
+https://www.youtube.com/feeds/videos.xml?channel_id=UC7vVhkEfw4nOGp8TyDk7RcQ "~YOUTUBE: BostonDynamics" youtube control
+https://www.youtube.com/feeds/videos.xml?channel_id=UCmkP178NasnhR3TWQyyP4Gw "~YOUTUBE: How To Mechatronics" youtube control
+
+https://www.youtube.com/feeds/videos.xml?channel_id=UCSqyMHDUsc1gs6wz4sUy91w "~YOUTUBE: Jipihorn" youtube acoustic
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/notifications.html b/docs/notifications.html new file mode 100644 index 0000000..52d0200 --- /dev/null +++ b/docs/notifications.html @@ -0,0 +1,2316 @@ + + + + + + + + +Dunst (Notification Manager) + + + + + + + + + + + + +
+ UP + | + HOME +
+

Dunst (Notification Manager)

+
+

Table of Contents

+ +
+ +
+

Global

+
+
+
[global]
+
+
+
+
+

Display

+
+
+
# Which monitor should the notifications be displayed on.
+monitor = 0
+
+# Display notification on focused monitor.  Possible modes are:
+#   mouse: follow mouse pointer
+#   keyboard: follow window with keyboard focus
+#   none: don't follow anything
+#
+# "keyboard" needs a windowmanager that exports the
+# _NET_ACTIVE_WINDOW property.
+# This should be the case for almost all modern windowmanagers.
+#
+# If this option is set to mouse or keyboard, the monitor option
+# will be ignored.
+follow = keyboard
+
+# The geometry of the window:
+#   [{width}]x{height}[+/-{x}+/-{y}]
+# The geometry of the message window.
+# The height is measured in number of notifications everything else
+# in pixels.  If the width is omitted but the height is given
+# ("-geometry x2"), the message window expands over the whole screen
+# (dmenu-like).  If width is 0, the window expands to the longest
+# message displayed.  A positive x is measured from the left, a
+# negative from the right side of the screen.  Y is measured from
+# the top and down respectevly.
+# The width can be negative.  In this case the actual width is the
+# screen width minus the width defined in within the geometry option.
+geometry = "250x50-10+37"
+
+# Show how many messages are currently hidden (because of geometry).
+indicate_hidden = yes
+
+# Shrink window if it's smaller than the width.  Will be ignored if
+# width is 0.
+shrink = no
+
+# The transparency of the window.  Range: [0; 100].
+# This option will only work if a compositing windowmanager is
+# present (e.g. xcompmgr, compiz, etc.).
+transparency = 0
+
+# The height of the entire notification.  If the height is smaller
+# than the font height and padding combined, it will be raised
+# to the font height and padding.
+notification_height = 0
+
+# Draw a line of "separator_height" pixel height between two
+# notifications.
+# Set to 0 to disable.
+separator_height = 4
+
+# Padding between text and separator.
+padding = 16
+
+# Horizontal padding.
+horizontal_padding = 16
+
+# Defines width in pixels of frame around the notification window.
+# Set to 0 to disable.
+frame_width = 2
+
+# Defines color of the frame around the notification window.
+frame_color = "#32302f"
+
+# Define a color for the separator.
+# possible values are:
+#  * auto: dunst tries to find a color fitting to the background;
+#  * foreground: use the same color as the foreground;
+#  * frame: use the same color as the frame;
+#  * anything else will be interpreted as a X color.
+separator_color = frame
+
+# Don't remove messages, if the user is idle (no mouse or keyboard input)
+# for longer than idle_threshold seconds.
+# Set to 0 to disable.
+# default 120
+idle_threshold = 120
+
+# Sort messages by urgency.
+sort = yes
+
+
+
+
+
+

Text

+
+
+
font = Hack Nerd Font 10
+
+# The height of a single line.  If the height is smaller than the
+# font height, it will get raised to the font height.
+# This adds empty space above and under the text.
+line_height = 4
+
+# Possible values are:
+# full: Allow a small subset of html markup in notifications:
+#        <b>bold</b>
+#        <i>italic</i>
+#        <s>strikethrough</s>
+#        <u>underline</u>
+#
+#        For a complete reference see
+#        <http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
+#
+# strip: This setting is provided for compatibility with some broken
+#        clients that send markup even though it's not enabled on the
+#        server. Dunst will try to strip the markup but the parsing is
+#        simplistic so using this option outside of matching rules for
+#        specific applications *IS GREATLY DISCOURAGED*.
+#
+# no:    Disable markup parsing, incoming notifications will be treated as
+#        plain text. Dunst will not advertise that it has the body-markup
+#        capability if this is set as a global setting.
+#
+# It's important to note that markup inside the format option will be parsed
+# regardless of what this is set to.
+markup = full
+
+# The format of the message.  Possible variables are:
+#   %a  appname
+#   %s  summary
+#   %b  body
+#   %i  iconname (including its path)
+#   %I  iconname (without its path)
+#   %p  progress value if set ([  0%] to [100%]) or nothing
+#   %n  progress value if set without any extra characters
+# Markup is allowed
+format = "<b>%s</b>\n%b"
+
+# Alignment of message text.
+# Possible values are "left", "center" and "right".
+alignment = left
+
+# Show age of message if message is older than show_age_threshold
+# seconds.
+# Set to -1 to disable.
+show_age_threshold = 300
+
+# Split notifications into multiple lines if they don't fit into
+# geometry.
+word_wrap = yes
+
+# Ignore newlines '\n' in notifications.
+ignore_newline = no
+
+# Merge multiple notifications with the same content
+stack_duplicates = false
+
+# Hide the count of merged notifications with the same content
+hide_duplicate_count = false
+
+# Display indicators for URLs (U) and actions (A).
+show_indicators = yes
+
+
+
+
+
+ +
+

Icons

+
+
+
# Align icons left/right/off
+icon_position = off
+
+# Limit icons size.
+max_icon_size=32
+
+# Paths to default icons.
+icon_path = /usr/share/icons/Arc/16x16/status/:/usr/share/icons/Arc/16x16/devices/
+
+
+
+
+ +
+

History

+
+
+
# Should a notification popped up from history be sticky or timeout
+# as if it would normally do.
+sticky_history = yes
+
+# Maximum amount of notifications kept in history
+history_length = 20
+
+
+
+
+ +
+

Misc/Advanced

+
+
+
# dmenu path.
+dmenu = /usr/bin/dmenu -p dunst:
+
+# Browser for opening urls in context menu.
+browser = qutebrowser
+
+# Always run rule-defined scripts, even if the notification is suppressed
+always_run_script = true
+
+# Define the title of the windows spawned by dunst
+title = Dunst
+
+# Define the class of the windows spawned by dunst
+class = Dunst
+
+# Print a notification on startup.
+# This is mainly for error detection, since dbus (re-)starts dunst
+# automatically after a crash.
+startup_notification = false
+
+
+
+
+
+ +
+

Shortcuts

+
+
+
[shortcuts]
+# Shortcuts are specified as [modifier+][modifier+]...key
+# Available modifiers are "ctrl", "mod1" (the alt-key), "mod2",
+# "mod3" and "mod4" (windows-key).
+
+# Close notification.
+close = mod1+space
+
+# Close all notifications.
+# close_all = mod1+shift+space
+
+# Redisplay last message(s).
+# On the US keyboard layout "grave" is normally above TAB and left
+# of "1". Make sure this key actually exists on your keyboard layout,
+# e.g. check output of 'xmodmap -pke'
+history = mod1+grave
+
+# Context menu.
+context = mod1+shift+period
+
+
+
+
+ +
+

Urgency

+
+
+
[urgency_low]
+background = "#32302f"
+foreground = "#ebdbb2"
+timeout = 4
+
+[urgency_normal]
+background = "#32302f"
+foreground = "#ebdbb2"
+timeout = 6
+
+[urgency_critical]
+background = "#32302f"
+foreground = "#cc241d"
+timeout = 0
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/pcmanfm.html b/docs/pcmanfm.html new file mode 100644 index 0000000..6957b37 --- /dev/null +++ b/docs/pcmanfm.html @@ -0,0 +1,324 @@ + + + + + + + + +PCMANFM + + + + + + + + + + + + +
+ UP + | + HOME +
+

PCMANFM

+
+

Table of Contents

+
+ +
+
+ +
+

Config

+
+
+
[config]
+bm_open_method=0
+
+
+
+
+ +
+

Volume

+
+
+
[volume]
+mount_on_startup=0
+mount_removable=0
+autorun=0
+
+
+
+
+ +
+

UI

+
+
+
[ui]
+always_show_tabs=0
+max_tab_chars=32
+win_width=1263
+win_height=690
+splitter_pos=150
+media_in_new_tab=0
+desktop_folder_new_win=0
+change_tab_on_drop=1
+close_on_unmount=1
+focus_previous=0
+side_pane_mode=places
+view_mode=icon
+show_hidden=0
+sort=mtime;descending;
+toolbar=newtab;navigation;home;
+show_statusbar=1
+pathbar_mode_buttons=0
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/polybar.html b/docs/polybar.html new file mode 100644 index 0000000..d2263f3 --- /dev/null +++ b/docs/polybar.html @@ -0,0 +1,1253 @@ + + + + + + + + +Polybar Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Polybar Configuration

+ + +
+

Colors

+
+
+
[colors]
+base00 = ${xrdb:color0:#000000}
+base01 = ${xrdb:color10:#000000}
+base02 = ${xrdb:color11:#000000}
+base03 = ${xrdb:color8:#000000}
+base04 = ${xrdb:color12:#000000}
+base05 = ${xrdb:color7:#000000}
+base06 = ${xrdb:color13:#000000}
+base07 = ${xrdb:color15:#000000}
+base08 = ${xrdb:color1:#000000}
+base09 = ${xrdb:color9:#000000}
+base0A = ${xrdb:color3:#000000}
+base0B = ${xrdb:color2:#000000}
+base0C = ${xrdb:color6:#000000}
+base0D = ${xrdb:color4:#000000}
+base0E = ${xrdb:color5:#000000}
+base0F = ${xrdb:color14:#000000}
+
+; based on  http://chriskempson.com/projects/base16/
+background = ${colors.base00}
+background-light = ${colors.base01}
+background-selection = ${colors.base02}
+comments = ${colors.base03}
+foreground-dark = ${colors.base04}
+foreground = ${colors.base05}
+foreground-light = ${colors.base06}
+foreground-light-bis = ${colors.base07}
+red = ${colors.base08}
+orange = ${colors.base09}
+brown = ${colors.base0A}
+green = ${colors.base0B}
+turquoise = ${colors.base0C}
+blue = ${colors.base0D}
+purple = ${colors.base0E}
+magenta = ${colors.base0F}
+black = ${#000000}
+
+
+
+
+ +
+

VM

+
+
+
[global/wm]
+margin-top = 0
+margin-bottom = 0
+
+
+
+
+ +
+

Top Bar

+
+
+
[bar/top]
+enable-ipc = true
+override-redirect = false
+bottom = false
+fixed-center = false
+
+width = 100%
+height = 27
+radius = 0.0
+
+background = ${colors.background}
+foreground = ${colors.foreground}
+
+line-size = 2
+
+border-size = 0
+
+padding-left = 2
+padding-right = 16
+
+module-margin-left = 1
+module-margin-right = 1
+
+font-0 = Hack Nerd Font:style=Medium,Regular:pixelsize=10;1
+font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
+font-2 = Weather Icons:size=10;1
+
+modules-left = i3 bspwm xwindow
+modules-center =
+modules-right = pulseaudio xbacklightredshift nordvpn lockscreen dunst unread_mail cpu battery temperature date
+
+wm-restack = bspwm
+
+tray-position = right
+tray-detached = true
+tray-padding = 0
+tray-background = ${colors.background}
+
+
+
+
+ +
+

Show Windows Title

+
+
+
[module/xwindow]
+type = internal/xwindow
+label = %title:0:30:...%
+
+
+
+
+ +
+

I3 - Information about workspaces and active one

+
+
+
[module/i3]
+type = internal/i3
+
+enable-scroll = false
+wrapping-scroll = false
+
+
+ +
+
format = <label-state> <label-mode>
+index-sort = true
+
+
+ +
+
label-mode-foreground = ${colors.background}
+label-mode-background = ${colors.foreground}
+label-mode-padding = 1
+
+# focused = Active workspace on focused monitor
+label-focused = %icon% %index%
+label-focused-foreground = ${colors.foreground}
+label-focused-background = ${colors.background}
+label-focused-underline = ${colors.turquoise}
+label-focused-padding = 1
+
+# unfocused = Inactive workspace on any monitor
+label-unfocused = %icon% %index%
+label-unfocused-foreground = ${colors.foreground}
+label-unfocused-background = ${colors.background}
+label-unfocused-underline = ${colors.background}
+label-unfocused-padding = 1
+
+# visible = Active workspace on unfocused monitor
+label-visible = %icon% %index%
+label-visible-background = ${colors.background}
+label-visible-underline = ${colors.turquoise}
+label-visible-padding = 1
+
+# urgent = Workspace with urgency hint set
+label-urgent = %icon% %index%
+label-urgent-background = ${colors.red}
+label-urgent-padding = 1
+
+
+
+
+ +
+

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.background}
+label-focused-background = ${colors.turquoise}
+label-focused-underline= ${colors.turquoise}
+label-focused-padding = 1
+
+label-occupied = %icon%
+label-occupied-underline = ${colors.foreground}
+label-occupied-padding = 1
+
+label-urgent = %icon%
+label-urgent-background = ${colors.red}
+label-urgent-padding = 1
+
+label-empty = %icon%
+label-empty-foreground = ${colors.foreground}
+label-empty-padding = 1
+
+
+
+
+ +
+

Music using MPD

+
+
+
[module/mpd]
+type = internal/mpd
+format-online = <icon-prev> <toggle> <icon-next> %{A1:termite -e "ncmpcpp" &:}<label-song>%{A}
+
+format-online-spacing = 0
+format-online-padding = 0
+
+label-offline = mpd is offline
+format-offline = <label-offline>
+format-offline-foreground = #777
+
+label-song = %artist% - %title%
+label-song-maxlen = 30
+label-song-ellipsis = true
+
+icon-prev = 寧
+icon-stop = 栗
+icon-play = 契
+icon-pause = 
+icon-next = 嶺
+icon-random = 咽
+icon-repeat = 凌
+
+# Used to display the state of random/repeat/repeatone/single
+# Only applies if <icon-[random|repeat|repeatone|single]> is used
+toggle-on-foreground = ${colors.foreground-light}
+toggle-off-foreground = ${colors.comments}
+
+bar-progress-width = 15
+bar-progress-indicator = |
+bar-progress-fill = ─
+bar-progress-empty = ─
+
+
+
+
+ +
+

Backlight level

+
+
+
[module/xbacklight]
+type = internal/xbacklight
+
+format = <ramp>
+ramp-0 = 
+ramp-1 = 
+ramp-2 = 
+ramp-3 = 
+ramp-4 = 
+ramp-5 = 
+ramp-6 = 
+ramp-7 = 
+ramp-8 = 
+ramp-9 = 
+ramp-10 = 
+ramp-11 = 
+
+
+
+
+ +
+

CPU Usage

+
+
+
[module/cpu]
+type = internal/cpu
+interval = 2
+
+format-prefix-foreground = ${colors.foreground}
+
+format-underline = ${colors.background}
+
+label = %{A1:termite -e "htop" &:} ﬙ %percentage:2%% %{A}
+
+
+
+
+ +
+

Date

+
+
+
[module/date]
+type = internal/date
+interval = 1
+
+# Open google calendar on left right
+date = %{A1:termite -e "ikhal" &:} %d-%m%{A}
+date-alt = "%{A1:termite -e \"ikhal\" &:} %d-%m-%Y%{A}"
+
+time =  %H:%M
+time-alt =  %H:%M:%S
+
+label = %date% %time%
+
+
+
+
+ +
+

Sound Volume

+
+
+
[module/pulseaudio]
+type = internal/pulseaudio
+
+sink = alsa_output.pci-0000_00_1f.3.analog-stereo
+
+# Open pavucontrol on left right
+format-volume =%{A1:pavucontrol &:}<label-volume> <bar-volume>%{A}
+
+label-volume = %percentage%%
+label-volume-foreground = ${root.foreground}
+
+label-muted = ﱝ muted
+
+bar-volume-width = 10
+bar-volume-foreground-0 = ${colors.green}
+bar-volume-foreground-1 = ${colors.green}
+bar-volume-foreground-2 = ${colors.blue}
+bar-volume-foreground-3 = ${colors.blue}
+bar-volume-foreground-4 = ${colors.red}
+bar-volume-foreground-5 = ${colors.red}
+bar-volume-foreground-6 = ${colors.red}
+bar-volume-gradient = false
+bar-volume-indicator = |
+bar-volume-indicator-font = 2
+bar-volume-fill = ─
+bar-volume-fill-font = 2
+bar-volume-empty = ─
+bar-volume-empty-font = 2
+bar-volume-empty-foreground = ${colors.foreground}
+
+
+
+
+ +
+

Battery

+
+
+
[module/battery]
+type = internal/battery
+
+battery = BAT0
+adapter = ADP1
+full-at = 95
+
+format-charging = %{A1:xfce4-power-manager-settings &:}<ramp-capacity> <label-charging>%{A}
+format-charging-underline = ${colors.blue}
+
+format-discharging = %{A1:xfce4-power-manager-settings &:}<ramp-capacity> <label-discharging>%{A}
+format-discharging-underline = ${colors.red}
+
+format-full-prefix = %{A1:xfce4-power-manager-settings &:} %{A}
+format-full-prefix-foreground = ${colors.foreground}
+format-full-underline = ${colors.background}
+
+ramp-capacity-0 = 
+ramp-capacity-1 = 
+ramp-capacity-2 = 
+ramp-capacity-3 = 
+ramp-capacity-4 = 
+ramp-capacity-foreground = ${colors.foreground}
+
+animation-charging-0 = 
+animation-charging-1 = 
+animation-charging-2 = 
+animation-charging-3 = 
+animation-charging-4 = 
+animation-charging-foreground = ${colors.foreground}
+animation-charging-framerate = 750
+
+animation-discharging-0 = 
+animation-discharging-1 = 
+animation-discharging-2 = 
+animation-discharging-3 = 
+animation-discharging-4 = 
+animation-discharging-foreground = ${colors.foreground}
+animation-discharging-framerate = 750
+
+
+
+
+ +
+

Temperature

+
+
+
[module/temperature]
+type = internal/temperature
+
+interval = 5
+thermal-zone = 0
+warn-temperature = 70
+;; Temperature off one cpu core
+hwmon-path = /sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input
+
+format = %{A1:termite -e "watch sensors" &:}<ramp> <label>%{A}
+format-underline = ${colors.background}
+format-warn = <ramp> <label-warn>
+format-warn-underline = ${colors.red}
+
+label = %temperature-c%
+label-warn = %temperature-c%
+label-warn-foreground = ${colors.red}
+
+ramp-0 = 
+ramp-1 = 
+ramp-2 = 
+ramp-3 = 
+ramp-4 = 
+ramp-foreground = ${colors.foreground}
+
+
+
+
+ +
+

Unread Mails

+
+
+
[module/unread_mail]
+type = custom/script
+
+label-font = 2
+format-underline = ${colors.background}
+click-left = ~/.config/polybar/scripts/mail-open.sh
+format = <label>
+exec = ~/.config/polybar/scripts/mail-status.sh
+interval = 1
+
+
+
+ +
+

Unread Mail Scripts

+
+
+
mails=$(du -a ~/.mail/*/Inbox/new/* 2>/dev/null | sed -n '$=')
+
+if [[ -z "$mails" ]]; then
+    echo ""
+else
+    echo "%{F#859900}%{F-}"
+fi
+
+
+
+
+ +
+

Open Mails

+
+
+
termite -e "tmux -L neomutt attach" &
+
+
+
+
+
+ +
+

Redshift

+
+
+
[module/redshift]
+type = custom/script
+
+label-font = 2
+format-underline = ${colors.background}
+click-left = ~/.config/polybar/scripts/redshift-toggle.sh
+format = <label>
+exec = ~/.config/polybar/scripts/redshift-status.sh
+interval = 2
+
+
+
+ +
+

Redshift Scripts

+
+
+
if pgrep -x "redshift" >/dev/null; then
+    echo "望";
+else
+    echo "盛";
+fi
+
+
+
+
+ +
+

Toggle Redshift

+
+
+
if pgrep -x "redshift" >/dev/null; then
+    killall redshift;
+else
+    nohup redshift > /dev/null 2>&1 &
+fi
+
+
+
+
+
+ +
+

NordVPN

+
+
+
[module/nordvpn]
+type = custom/script
+
+format-underline = ${colors.background}
+click-left = ~/.config/polybar/scripts/nordvpn-toggle.sh
+format = <label>
+exec = ~/.config/polybar/scripts/nordvpn-status.sh
+interval = 2
+
+
+
+ +
+

Nordvpn Status script

+
+
+
vpnstatus=`nordvpn status`;
+
+if [[ ${vpnstatus} == *"Connected"* ]]; then
+  # country=`nordvpn status | sed '/Country/!d ; s/Country: //'`
+  # echo "%{F#859900}%{F-} $country";
+  echo "%{F#859900}%{F-}";
+else
+  echo "";
+fi
+
+
+
+
+ +
+

Nordvpn Toggle

+
+
+
if [[ $(nordvpn status) == *"Connected"* ]]; then
+  nordvpn disconnect && dunstify --replace=23198 "VPN" "Disconnected";
+else
+  country=`cat ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`;
+  dunstify --replace=23198 "VPN" "Connecting to $country...";
+  nordvpn connect $country && dunstify --replace=23198 "VPN" "Connected to $country";
+fi
+
+
+
+
+
+ +
+

Dunst

+
+
+
[module/dunst]
+type = custom/script
+
+format-underline = ${colors.background}
+click-left = ~/.config/polybar/scripts/dunst-toggle.sh
+format = <label>
+exec = ~/.config/polybar/scripts/dunst-status.sh
+interval = 2
+
+
+
+ +
+

Dunst Status script

+
+
+
tmpfile="/tmp/dunststatus";
+
+if [ -f $tmpfile ]; then
+  if grep -q "on" $tmpfile; then
+    echo "";
+  elif grep -q "off" $tmpfile; then
+    echo "";
+  fi
+else
+  echo "";
+fi
+
+
+
+
+ +
+

Dunst Toggle

+
+
+
tmpfile="/tmp/dunststatus";
+
+if [ -f $tmpfile ]; then
+  if grep -q "on" $tmpfile; then
+    killall -SIGUSR1 dunst && echo "off" > $tmpfile;
+  elif grep -q "off" $tmpfile; then
+    killall -SIGUSR2 dunst && echo "on" > $tmpfile;
+    dunstify --replace=16549 "Dunst" "Activated";
+  fi
+else
+  killall -SIGUSR1 dunst && echo "off" > $tmpfile;
+fi
+
+
+
+
+
+ +
+

Lock Screen

+
+
+
[module/lockscreen]
+type = custom/script
+
+format-underline = ${colors.background}
+click-left = ~/.config/polybar/scripts/lockscreen-toggle.sh
+click-right = ~/scripts/lockscreen.sh
+format = <label>
+exec = ~/.config/polybar/scripts/lockscreen-status.sh
+
+interval = 2
+
+
+
+ +
+

Lock screen Status script

+
+
+
if pgrep -x "xautolock" >/dev/null
+then
+    echo "";
+else
+    echo "";
+fi
+
+
+
+
+ +
+

Toggle Automatic Lock Screen

+
+
+
if pgrep -x "xautolock" >/dev/null
+then
+    pkill xautolock;
+    dunstify --replace=13602 'Lock Screen' 'Desactivated'
+else
+    xautolock -locker "~/scripts/lockscreen.sh" -detectsleep -time 30 -notify 60 -notifier "dunstify --replace=31846 -u critical -t 10000 -- 'Locking Screen' '60 seconds'" &
+    dunstify --replace=13602 'Lock Screen' 'Activated'
+fi
+
+
+
+
+
+ +
+

Weather

+
+

+https://github.com/x70b1/polybar-scripts/tree/master/polybar-scripts/openweathermap-fullfeatured +

+ +
+
[module/weather]
+type = custom/script
+
+exec = ~/.config/polybar/scripts/weather-status.sh
+click-left = ~/.config/polybar/scripts/weather-open.sh
+
+interval = 600
+label-font = 3
+
+
+
+ +
+

Script to retrieve the weather

+
+
+
get_icon() {
+    case $1 in
+        01d) icon="";;
+        01n) icon="";;
+        02d) icon="";;
+        02n) icon="";;
+        03*) icon="";;
+        04*) icon="";;
+        09d) icon="";;
+        09n) icon="";;
+        10d) icon="";;
+        10n) icon="";;
+        11d) icon="";;
+        11n) icon="";;
+        13d) icon="";;
+        13n) icon="";;
+        50d) icon="";;
+        50n) icon="";;
+        *) icon="";
+    esac
+
+    echo $icon
+}
+
+get_duration() {
+
+    osname=$(uname -s)
+
+    case $osname in
+        *BSD) date -r "$1" -u +%H:%M;;
+        *) date --date="@$1" -u +%H:%M;;
+    esac
+
+}
+
+KEY="a705adc4ce0e271801051b9460ecb1cd"
+CITY=""
+UNITS="metric"
+SYMBOL="°"
+
+API="https://api.openweathermap.org/data/2.5"
+
+if [ -n "$CITY" ]; then
+    if [ "$CITY" -eq "$CITY" ] 2>/dev/null; then
+        CITY_PARAM="id=$CITY"
+    else
+        CITY_PARAM="q=$CITY"
+    fi
+
+    current=$(curl -sf "$API/weather?appid=$KEY&$CITY_PARAM&units=$UNITS")
+    forecast=$(curl -sf "$API/forecast?appid=$KEY&$CITY_PARAM&units=$UNITS&cnt=1")
+else
+    location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
+
+    if [ -n "$location" ]; then
+        location_lat="$(echo "$location" | jq '.location.lat')"
+        location_lon="$(echo "$location" | jq '.location.lng')"
+
+        current=$(curl -sf "$API/weather?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS")
+        forecast=$(curl -sf "$API/forecast?appid=$KEY&lat=$location_lat&lon=$location_lon&units=$UNITS&cnt=1")
+    fi
+fi
+
+if [ -n "$current" ] && [ -n "$forecast" ]; then
+    current_temp=$(echo "$current" | jq ".main.temp" | cut -d "." -f 1)
+    current_icon=$(echo "$current" | jq -r ".weather[0].icon")
+
+    forecast_temp=$(echo "$forecast" | jq ".list[].main.temp" | cut -d "." -f 1)
+    forecast_icon=$(echo "$forecast" | jq -r ".list[].weather[0].icon")
+
+
+    if [ "$current_temp" -gt "$forecast_temp" ]; then
+        trend="" #
+    elif [ "$forecast_temp" -gt "$current_temp" ]; then
+        trend="" #
+    else
+        trend="" #
+    fi
+
+
+    sun_rise=$(echo "$current" | jq ".sys.sunrise")
+    sun_set=$(echo "$current" | jq ".sys.sunset")
+    now=$(date +%s)
+
+    if [ "$sun_rise" -gt "$now" ]; then
+        daytime=" $(get_duration "$((sun_rise-now))")"
+    elif [ "$sun_set" -gt "$now" ]; then
+        daytime=" $(get_duration "$((sun_set-now))")"
+    else
+        daytime=" $(get_duration "$((sun_rise-now))")"
+    fi
+
+    echo "$(get_icon "$current_icon") $current_temp$SYMBOL  $trend  $(get_icon "$forecast_icon") $forecast_temp$SYMBOL   $daytime"
+fi
+
+
+
+
+ +
+

TODO Open Weather Webpage

+
+
    +
  • [ ] Find a way to open a web page with detailed forecast with the current location
  • +
+ +
+
# location=$(curl -sf https://location.services.mozilla.com/v1/geolocate?key=geoclue)
+
+# if [ -n "$location" ]; then
+#     location_lat="$(echo "$location" | jq '.location.lat')"
+#     location_lon="$(echo "$location" | jq '.location.lng')"
+# else
+
+# fi
+$BROWSER https://www.yahoo.com/news/weather/france/grenoble/grenoble-593720
+
+
+
+
+
+ +
+

Network

+
+
+
[module/wired-network]
+type = internal/network
+interface = enp0s20f0u9u4
+
+label-connected = %local_ip%
+label-connected-foreground = ${colors.foreground}
+
+format-connected-prefix = " "
+format-connected = <label-connected>
+
+label-disconnected = ""
+label-disconnected-foreground = ${colors.comments}
+
+format-disconnected = <label-disconnected>
+
+[module/wireless-network]
+type = internal/network
+interface = wlp2s0
+
+label-connected = %essid%
+label-connected-foreground = ${colors.foreground}
+
+format-connected-prefix = " "
+format-connected = <label-connected>
+
+label-disconnected = ""
+label-disconnected-foreground = ${colors.comments}
+
+format-disconnected = <label-disconnected>
+
+
+
+
+ +
+

Screenshot

+
+
+
[module/screenshot]
+type = custom/text
+content = ""
+click-left = ~/bin/screenshot
+
+
+
+
+ +
+

Scripts

+
+
+
+

Launch

+
+
+
# Terminate already running bar instances
+killall -q polybar
+
+# Wait until the processes have been shut down
+while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
+
+# Launch Polybar, using default config location ~/.config/polybar/config
+polybar top &
+# polybar bottom &
+
+echo "Polybar launched..."
+
+
+
+
+ +
+

Toggle

+
+
+
# Usage : toggle.sh top
+
+pid=$(pgrep -f "polybar $1")
+
+if [ ! -z "$pid" ]; then
+    polybar-msg -p $pid cmd toggle >/dev/null 2>&1
+fi
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/qutebrowser.html b/docs/qutebrowser.html new file mode 100644 index 0000000..00bcc75 --- /dev/null +++ b/docs/qutebrowser.html @@ -0,0 +1,1568 @@ + + + + + + + + +Qutebrowser Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Qutebrowser Configuration

+ + +
+

Import

+
+
+
from qutebrowser.config.configfiles import ConfigAPI
+from qutebrowser.config.config import ConfigContainer
+
+import sys, os
+
+
+
+
+ +
+

General config

+
+
+
# This is here so configs done via the GUI are still loaded.
+# Remove it to not load settings done via the GUI.
+# config.load_autoconfig()
+
+# Aliases for commands. The keys of the given dictionary are the
+c.aliases = {'w': 'session-save', 'q': 'quit', 'wq': 'quit --save'}
+
+# Time interval (in milliseconds) between auto-saves of config/cookies/etc.
+c.auto_save.interval = 15000
+
+# Always restore open sites when qutebrowser is reopened.
+c.auto_save.session = False
+
+# Backend to use to display websites
+c.backend = 'webengine'
+
+# Require a confirmation before quitting the application.
+# Valid values:
+#   - always: Always show a confirmation.
+#   - multiple-tabs: Show a confirmation if multiple tabs are opened.
+#   - downloads: Show a confirmation if downloads are running
+#   - never: Never show a confirmation.
+c.confirm_quit = ['downloads']
+
+
+
+
+ +
+

Content

+
+
+
# Automatically start playing `<video>` elements
+c.content.autoplay = False
+
+c.content.notifications = False
+
+# Allow websites to request geolocations.
+c.content.geolocation = 'ask'
+
+# Show javascript alerts.
+c.content.javascript.alert = True
+
+# Allow JavaScript to read from or write to the clipboard
+c.content.javascript.can_access_clipboard = True
+
+# Allow websites to record audio/video.
+c.content.media_capture = 'ask'
+
+# Allow pdf.js to view PDF files in the browser
+c.content.pdfjs = False
+
+# Proxy to use. In addition to the listed values, you can use a
+# `socks://...` or `http://...` URL.
+# Valid values:
+#   - system: Use the system wide proxy.
+#   - none: Don't use any proxy
+c.content.proxy = 'system'
+
+
+
+
+ +
+

Downloads

+
+
+
# Directory to save downloads to
+c.downloads.location.directory = '$HOME/Downloads/'
+
+# Prompt the user for the download location
+c.downloads.location.prompt = True
+
+# Remember the last used download directory.
+c.downloads.location.remember = True
+
+# What to display in the download filename input.
+# Valid values:
+#   - path: Show only the download path.
+#   - filename: Show only download filename.
+#   - both: Show download path and filename.
+c.downloads.location.suggestion = 'path'
+
+# Where to show the downloaded files.
+c.downloads.position = 'bottom'
+
+# Duration (in milliseconds) to wait before removing finished downloads
+c.downloads.remove_finished = 10000
+
+
+
+
+ +
+

Fonts

+
+
+
# Default monospace fonts
+c.fonts.monospace = '"Hack Nerd Font Mono" "xos4 Terminus", Terminus, Monospace, "DejaVu Sans Mono", Monaco, "Bitstream Vera Sans Mono", "Andale Mono", "Courier New", Courier, "Liberation Mono", monospace, Fixed, Consolas, Terminal'
+
+# Font used for prompts.
+c.fonts.prompts = '10pt monospace'
+
+# Font used in the statusbar.
+c.fonts.statusbar = '10pt monospace'
+
+# Font used in the tab bar.
+c.fonts.tabs = '10pt monospace'
+
+
+
+
+ +
+

Hints

+
+
+
# When a hint can be automatically followed without pressing Enter.
+# Valid values:
+#   - always: Auto-follow whenever there is only a single hint on a page.
+#   - unique-match: Auto-follow whenever there is a unique non-empty match in either the hint string (word mode) or filter (number mode).
+#   - full-match: Follow the hint when the user typed the whole hint (letter, word or number mode) or the element's text (only in number mode).
+#   - never: The user will always need to press Enter to follow a hint.
+# c.hints.auto_follow = 'unique-match'
+
+# Duration (in milliseconds) to ignore normal-mode key bindings after a
+# successful auto-follow.
+# c.hints.auto_follow_timeout = 0
+
+# CSS border value for hints.
+# c.hints.border = '1px solid #E3BE23'
+
+# Characters used for hint strings.
+# c.hints.chars = 'asdfghjkl'
+
+# Dictionary file to be used by the word hints.
+# c.hints.dictionary = '/usr/share/dict/words'
+
+# Which implementation to use to find elements to hint.
+# Valid values:
+#   - javascript: Better but slower
+#   - python: Slightly worse but faster
+# c.hints.find_implementation = 'python'
+
+# Hide unmatched hints in rapid mode.
+# c.hints.hide_unmatched_rapid_hints = True
+
+# Minimum number of characters used for hint strings.
+# c.hints.min_chars = 1
+
+# Mode to use for hints.
+# Valid values:
+#   - number: Use numeric hints. (In this mode you can also type letters from the hinted element to filter and reduce the number of elements that are hinted.)
+#   - letter: Use the characters in the `hints.chars` setting.
+#   - word: Use hints words based on the html elements and the extra words.
+# c.hints.mode = 'letter'
+
+# Comma-separated list of regular expressions to use for 'next' links.
+# c.hints.next_regexes = ['\\bnext\\b', '\\bmore\\b', '\\bnewer\\b', '\\b[>→≫]\\b', '\\b(>>|»)\\b', '\\bcontinue\\b']
+
+# Comma-separated list of regular expressions to use for 'prev' links.
+# c.hints.prev_regexes = ['\\bprev(ious)?\\b', '\\bback\\b', '\\bolder\\b', '\\b[<←≪]\\b', '\\b(<<|«)\\b']
+
+# Scatter hint key chains (like Vimium) or not (like dwb). Ignored for
+# number hints.
+# c.hints.scatter = True
+
+# Make characters in hint strings uppercase.
+# c.hints.uppercase = False
+
+
+
+
+ +
+

Input

+
+
+
# Enter insert mode if an editable element is clicked.
+c.input.insert_mode.auto_enter = True
+
+# Leave insert mode if a non-editable element is clicked.
+c.input.insert_mode.auto_leave = True
+
+# Automatically enter insert mode if an editable element is focused
+# after loading the page.
+c.input.insert_mode.auto_load = False
+
+# Switch to insert mode when clicking flash and other plugins.
+# c.input.insert_mode.plugins = False
+
+# Include hyperlinks in the keyboard focus chain when tabbing.
+# c.input.links_included_in_focus_chain = True
+
+# Timeout (in milliseconds) for partially typed key bindings. If the
+# current input forms only partial matches, the keystring will be
+# cleared after this time.
+# c.input.partial_timeout = 5000
+
+# Enable Opera-like mouse rocker gestures. This disables the context
+# menu.
+# c.input.rocker_gestures = False
+
+# Enable spatial navigation. Spatial navigation consists in the ability
+# to navigate between focusable elements in a Web page, such as
+# hyperlinks and form controls, by using Left, Right, Up and Down arrow
+# keys. For example, if the user presses the Right key, heuristics
+# determine whether there is an element he might be trying to reach
+# towards the right and which element he probably wants.
+# c.input.spatial_navigation = False
+
+
+
+
+ +
+

Keyhint

+
+
+
# Keychains that shouldn't be shown in the keyhint dialog. Globs are
+# supported, so `;*` will blacklist all keychains starting with `;`. Use
+# `*` to disable keyhints.
+# c.keyhint.blacklist = []
+
+# Time (in milliseconds) from pressing a key to seeing the keyhint
+# dialog.
+# c.keyhint.delay = 500
+
+# Rounding radius (in pixels) for the edges of the keyhint dialog.
+# c.keyhint.radius = 6
+
+
+
+
+ +
+

Messages

+
+
+
# Duration (in milliseconds) to show messages in the statusbar for. Set
+# to 0 to never clear messages.
+# c.messages.timeout = 2000
+
+
+
+
+ +
+

New Instance Options

+
+
+
# How to open links in an existing instance if a new one is launched.
+# This happens when e.g. opening a link from a terminal. See
+# `new_instance_open_target_window` to customize in which window the
+# link is opened in.
+# Valid values:
+#   - tab: Open a new tab in the existing window and activate the window.
+#   - tab-bg: Open a new background tab in the existing window and activate the window.
+#   - tab-silent: Open a new tab in the existing window without activating the window.
+#   - tab-bg-silent: Open a new background tab in the existing window without activating the window.
+#   - window: Open in a new window.
+# c.new_instance_open_target = 'tab'
+
+# Which window to choose when opening links as new tabs. When
+# `new_instance_open_target` is not set to `window`, this is ignored.
+# Valid values:
+#   - first-opened: Open new tabs in the first (oldest) opened window.
+#   - last-opened: Open new tabs in the last (newest) opened window.
+#   - last-focused: Open new tabs in the most recently focused window.
+#   - last-visible: Open new tabs in the most recently visible window.
+# c.new_instance_open_target_window = 'last-focused'
+
+
+
+
+ +
+

Prompt

+
+
+
# Show a filebrowser in upload/download prompts.
+# c.prompt.filebrowser = True
+
+# Rounding radius (in pixels) for the edges of prompts.
+# c.prompt.radius = 8
+
+
+
+
+ +
+

Qt

+
+
+
# Additional arguments to pass to Qt, without leading `--`. With
+# QtWebEngine, some Chromium arguments (see
+# https://peter.sh/experiments/chromium-command-line-switches/ for a
+# list) will work.
+# c.qt.args = []
+
+# Force a Qt platform to use. This sets the `QT_QPA_PLATFORM`
+# environment variable and is useful to force using the XCB plugin when
+# running QtWebEngine on Wayland.
+# c.qt.force_platform = None
+
+# Force software rendering for QtWebEngine. This is needed for
+# QtWebEngine to work with Nouveau drivers and can be useful in other
+# scenarios related to graphic issues.
+# Valid values:
+#   - software-opengl: Tell LibGL to use a software implementation of GL (`LIBGL_ALWAYS_SOFTWARE` / `QT_XCB_FORCE_SOFTWARE_OPENGL`)
+#   - qt-quick: Tell Qt Quick to use a software renderer instead of OpenGL. (`QT_QUICK_BACKEND=software`)
+#   - chromium: Tell Chromium to disable GPU support and use Skia software rendering instead. (`--disable-gpu`)
+#   - none: Don't force software rendering.
+# c.qt.force_software_rendering = 'none'
+
+# Turn on Qt HighDPI scaling. This is equivalent to setting
+# QT_AUTO_SCREEN_SCALE_FACTOR=1 in the environment. It's off by default
+# as it can cause issues with some bitmap fonts. As an alternative to
+# this, it's possible to set font sizes and the `zoom.default` setting.
+# c.qt.highdpi = False
+
+# When to use Chromium's low-end device mode. This improves the RAM
+# usage of renderer processes, at the expense of performance.
+# Valid values:
+#   - always: Always use low-end device mode.
+#   - auto: Decide automatically (uses low-end mode with < 1 GB available RAM).
+#   - never: Never use low-end device mode.
+# c.qt.low_end_device_mode = 'auto'
+
+# Which Chromium process model to use. Alternative process models use
+# less resources, but decrease security and robustness. See the
+# following pages for more details:    -
+# https://www.chromium.org/developers/design-documents/process-models
+# - https://doc.qt.io/qt-5/qtwebengine-features.html#process-models
+# Valid values:
+#   - process-per-site-instance: Pages from separate sites are put into separate processes and separate visits to the same site are also isolated.
+#   - process-per-site: Pages from separate sites are put into separate processes. Unlike Process per Site Instance, all visits to the same site will share an OS process. The benefit of this model is reduced memory consumption, because more web pages will share processes. The drawbacks include reduced security, robustness, and responsiveness.
+#   - single-process: Run all tabs in a single process. This should be used for debugging purposes only, and it disables `:open --private`.
+# c.qt.process_model = 'process-per-site-instance'
+
+
+
+
+ +
+

Scrolling

+
+
+
# When to show the scrollbar.
+# Valid values:
+#   - always: Always show the scrollbar.
+#   - never: Never show the scrollbar.
+#   - when-searching: Show the scrollbar when searching for text in the webpage. With the QtWebKit backend, this is equal to `never`.
+# c.scrolling.bar = 'when-searching'
+
+# Enable smooth scrolling for web pages. Note smooth scrolling does not
+# work with the `:scroll-px` command.
+# c.scrolling.smooth = False
+
+
+
+
+ +
+

Search

+
+
+
# When to find text on a page case-insensitively.
+# Valid values:
+#   - always: Search case-insensitively.
+#   - never: Search case-sensitively.
+#   - smart: Search case-sensitively if there are capital characters.
+# c.search.ignore_case = 'smart'
+
+# Find text on a page incrementally, renewing the search for each typed
+# character.
+# c.search.incremental = True
+
+
+
+
+ +
+

Session

+
+
+
# Name of the session to save by default. If this is set to null, the
+# session which was last loaded is saved.
+# c.session.default_name = None
+
+# Load a restored tab as soon as it takes focus.
+# c.session.lazy_restore = False
+
+
+
+
+ +
+

Spell Check

+
+

+Languages to use for spell checking. You can check for available +languages and install dictionaries using scripts/dictcli.py. Run the +script with -h/–help for instructions. +Valid values: +

+
    +
  • af-ZA: Afrikaans (South Africa)
  • +
  • bg-BG: Bulgarian (Bulgaria)
  • +
  • ca-ES: Catalan (Spain)
  • +
  • cs-CZ: Czech (Czech Republic)
  • +
  • da-DK: Danish (Denmark)
  • +
  • de-DE: German (Germany)
  • +
  • el-GR: Greek (Greece)
  • +
  • en-AU: English (Australia)
  • +
  • en-CA: English (Canada)
  • +
  • en-GB: English (United Kingdom)
  • +
  • en-US: English (United States)
  • +
  • es-ES: Spanish (Spain)
  • +
  • et-EE: Estonian (Estonia)
  • +
  • fa-IR: Farsi (Iran)
  • +
  • fo-FO: Faroese (Faroe Islands)
  • +
  • fr-FR: French (France)
  • +
  • he-IL: Hebrew (Israel)
  • +
  • hi-IN: Hindi (India)
  • +
  • hr-HR: Croatian (Croatia)
  • +
  • hu-HU: Hungarian (Hungary)
  • +
  • id-ID: Indonesian (Indonesia)
  • +
  • it-IT: Italian (Italy)
  • +
  • ko: Korean
  • +
  • lt-LT: Lithuanian (Lithuania)
  • +
  • lv-LV: Latvian (Latvia)
  • +
  • nb-NO: Norwegian (Norway)
  • +
  • nl-NL: Dutch (Netherlands)
  • +
  • pl-PL: Polish (Poland)
  • +
  • pt-BR: Portuguese (Brazil)
  • +
  • pt-PT: Portuguese (Portugal)
  • +
  • ro-RO: Romanian (Romania)
  • +
  • ru-RU: Russian (Russia)
  • +
  • sh: Serbo-Croatian
  • +
  • sk-SK: Slovak (Slovakia)
  • +
  • sl-SI: Slovenian (Slovenia)
  • +
  • sq: Albanian
  • +
  • sr: Serbian
  • +
  • sv-SE: Swedish (Sweden)
  • +
  • ta-IN: Tamil (India)
  • +
  • tg-TG: Tajik (Tajikistan)
  • +
  • tr-TR: Turkish (Turkey)
  • +
  • uk-UA: Ukrainian (Ukraine)
  • +
  • vi-VN: Vietnamese (Viet Nam)
  • +
+ +
+
c.spellcheck.languages = ['en-US', 'fr-FR']
+
+
+
+
+ +
+

Status Bar

+
+
+
# Hide the statusbar unless a message is shown.
+# c.statusbar.hide = False
+
+# Padding (in pixels) for the statusbar.
+# c.statusbar.padding = {'top': 1, 'bottom': 1, 'left': 0, 'right': 0}
+
+# Position of the status bar.
+# Valid values:
+#   - top
+#   - bottom
+# c.statusbar.position = 'bottom'
+
+# List of widgets displayed in the statusbar.
+# Valid values:
+#   - url: Current page URL.
+#   - scroll: Percentage of the current page position like `10%`.
+#   - scroll_raw: Raw percentage of the current page position like `10`.
+#   - history: Display an arrow when possible to go back/forward in history.
+#   - tabs: Current active tab, e.g. `2`.
+#   - keypress: Display pressed keys when composing a vi command.
+#   - progress: Progress bar for the current page loading.
+# c.statusbar.widgets = ['keypress', 'url', 'scroll', 'history', 'tabs', 'progress']
+
+
+
+
+ +
+

Tabs

+
+
+
# Open new tabs (middleclick/ctrl+click) in the background.
+c.tabs.background = True
+
+# Mouse button with which to close tabs.
+c.tabs.close_mouse_button = 'right'
+
+# How to behave when the close mouse button is pressed on the tab bar.
+# Valid values:
+#   - new-tab: Open a new tab.
+#   - close-current: Close the current tab.
+#   - close-last: Close the last tab.
+#   - ignore: Don't do anything.
+# c.tabs.close_mouse_button_on_bar = 'new-tab'
+
+# Width (in pixels) of the progress indicator (0 to disable).
+# c.tabs.indicator.width = 3
+
+# How to behave when the last tab is closed.
+# Valid values:
+#   - ignore: Don't do anything.
+#   - blank: Load a blank page.
+#   - startpage: Load the start page.
+#   - default-page: Load the default page.
+#   - close: Close the window.
+c.tabs.last_close = 'close'
+
+# When switching tabs, what input mode is applied.
+# Valid values:
+#   - persist: Retain the current mode.
+#   - restore: Restore previously saved mode.
+#   - normal: Always revert to normal mode.
+# c.tabs.mode_on_change = 'normal'
+
+# Switch between tabs using the mouse wheel.
+c.tabs.mousewheel_switching = False
+
+# Position of new tabs opened from another tab.
+# Valid values:
+#   - prev: Before the current tab.
+#   - next: After the current tab.
+#   - first: At the beginning.
+#   - last: At the end.
+# c.tabs.new_position.related = 'next'
+
+# Position of new tabs which aren't opened from another tab.
+# Valid values:
+#   - prev: Before the current tab.
+#   - next: After the current tab.
+#   - first: At the beginning.
+#   - last: At the end.
+# c.tabs.new_position.unrelated = 'last'
+
+# Padding (in pixels) around text for tabs.
+# c.tabs.padding = {'top': 0, 'bottom': 0, 'left': 5, 'right': 5}
+
+# Shrink pinned tabs down to their contents.
+# c.tabs.pinned.shrink = True
+
+# Position of the tab bar.
+c.tabs.position = 'left'
+
+# Which tab to select when the focused tab is removed.
+c.tabs.select_on_remove = 'next'
+
+# Format to use for the tab title. The following placeholders are
+# defined:  * `{perc}`: Percentage as a string like `[10%]`. *
+# `{perc_raw}`: Raw percentage, e.g. `10`. * `{title}`: Title of the
+# current web page. * `{title_sep}`: The string ` - ` if a title is set,
+# empty otherwise. * `{index}`: Index of this tab. * `{id}`: Internal
+# tab ID of this tab. * `{scroll_pos}`: Page scroll position. *
+# `{host}`: Host of the current web page. * `{backend}`: Either
+# ''webkit'' or ''webengine'' * `{private}`: Indicates when private mode
+# is enabled. * `{current_url}`: URL of the current web page. *
+# `{protocol}`: Protocol (http/https/...) of the current web page. *
+# `{audio}`: Indicator for audio/mute status.
+# c.tabs.title.format = '{audio}{index}: {title}'
+
+# Width (in pixels or as percentage of the window) of the tab bar if it's vertical.
+c.tabs.width = 30
+
+# Wrap when changing tabs.
+c.tabs.wrap = False
+
+
+
+
+ +
+

Urls

+
+
+
# What search to start when something else than a URL is entered.
+# Valid values:
+#   - naive: Use simple/naive check.
+#   - dns: Use DNS requests (might be slow!).
+#   - never: Never search automatically.
+# c.url.auto_search = 'naive'
+
+# URL segments where `:navigate increment/decrement` will search for a
+# number.
+# Valid values:
+#   - host
+#   - port
+#   - path
+#   - query
+#   - anchor
+# c.url.incdec_segments = ['path', 'query']
+
+# Search engines which can be used via the address bar. Maps a search
+# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
+# placeholder. The placeholder will be replaced by the search term, use
+# `{{` and `}}` for literal `{`/`}` signs. The search engine named
+# `DEFAULT` is used when `url.auto_search` is turned on and something
+# else than a URL was entered to be opened. Other search engines can be
+# used by prepending the search engine name to the search term, e.g.
+# `:open google qutebrowser`.
+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=',
+    'gm': 'https://www.google.com/maps/search/{}/',
+    'yt': 'https://www.youtube.com/results?search_query={}',
+    'gh': 'https://github.com/search?q={}',
+    're': 'https://www.reddit.com/search?q={}',
+    'lb': 'http://188.240.208.184/search.php?req={}',
+    'la': 'http://188.240.208.184/scimag/index.php?s={}',
+    'sm': 'https://www.openstreetmap.org/search?query={}',
+    'am': 'https://www.amazon.fr/s?k={}',
+    'md': 'https://fr.mathworks.com/help/search.html?qdoc={}&submitsearch=',
+}
+
+# Page(s) to open at the start.
+c.url.start_pages = ['https://start.duckduckgo.com']
+
+
+
+
+ +
+

Window

+
+
+
# Hide the window decoration.  This setting requires a restart on
+# Wayland.
+# c.window.hide_decoration = False
+
+# Format to use for the window title. The same placeholders like for
+# `tabs.title.format` are defined.
+# c.window.title_format = '{perc}{title}{title_sep}qutebrowser'
+
+
+
+
+ +
+

Bindings

+
+
+
+

Normal Mode

+
+
+
# config.bind("'", 'enter-mode jump_mark')
+
+# config.bind('+', 'zoom-in')
+# config.bind('-', 'zoom-out')
+
+# config.bind('.', 'repeat-command')
+# config.bind('/', 'set-cmd-text /')
+# config.bind(':', 'set-cmd-text :')
+
+# config.bind(';I', 'hint images tab')
+# config.bind(';O', 'hint links fill :open -t -r {hint-url}')
+# config.bind(';R', 'hint --rapid links window')
+# config.bind(';Y', 'hint links yank-primary')
+# config.bind(';b', 'hint all tab-bg')
+# config.bind(';d', 'hint links download')
+# config.bind(';f', 'hint all tab-fg')
+# config.bind(';h', 'hint all hover')
+# config.bind(';i', 'hint images')
+# config.bind(';o', 'hint links fill :open {hint-url}')
+# config.bind(';r', 'hint --rapid links tab-bg')
+# config.bind(';t', 'hint inputs')
+# config.bind(';y', 'hint links yank')
+
+# config.bind('<Alt-1>', 'tab-focus 1')
+# config.bind('<Alt-2>', 'tab-focus 2')
+# config.bind('<Alt-3>', 'tab-focus 3')
+# config.bind('<Alt-4>', 'tab-focus 4')
+# config.bind('<Alt-5>', 'tab-focus 5')
+# config.bind('<Alt-6>', 'tab-focus 6')
+# config.bind('<Alt-7>', 'tab-focus 7')
+# config.bind('<Alt-8>', 'tab-focus 8')
+# config.bind('<Alt-9>', 'tab-focus -1')
+# config.bind('<Alt-m>', 'tab-mute')
+
+# config.bind('<Ctrl-A>', 'navigate increment')
+
+# config.bind('<Ctrl-Alt-p>', 'print')
+
+# config.bind('<Ctrl-B>', 'scroll-page 0 -1')
+# config.bind('<Ctrl-D>', 'scroll-page 0 0.5')
+# config.bind('<Ctrl-F5>', 'reload -f')
+# config.bind('<Ctrl-F>', 'scroll-page 0 1')
+# config.bind('<Ctrl-N>', 'open -w')
+# config.bind('<Ctrl-PgDown>', 'tab-next')
+# config.bind('<Ctrl-PgUp>', 'tab-prev')
+# config.bind('<Ctrl-Q>', 'quit')
+# config.bind('<Ctrl-Return>', 'follow-selected -t')
+# config.bind('<Ctrl-Shift-N>', 'open -p')
+# config.bind('<Ctrl-Shift-T>', 'undo')
+# config.bind('<Ctrl-Shift-Tab>', 'nop')
+# config.bind('<Ctrl-Shift-W>', 'close')
+# config.bind('<Ctrl-T>', 'open -t')
+# config.bind('<Ctrl-Tab>', 'tab-focus last')
+# config.bind('<Ctrl-U>', 'scroll-page 0 -0.5')
+# config.bind('<Ctrl-V>', 'enter-mode passthrough')
+# config.bind('<Ctrl-W>', 'tab-close')
+# config.bind('<Ctrl-X>', 'navigate decrement')
+# config.bind('<Ctrl-^>', 'tab-focus last')
+# config.bind('<Ctrl-h>', 'home')
+# config.bind('<Ctrl-p>', 'tab-pin')
+# config.bind('<Ctrl-s>', 'stop')
+# config.bind('<Escape>', 'clear-keychain ;; search ;; fullscreen --leave')
+# config.bind('<F11>', 'fullscreen')
+# config.bind('<F5>', 'reload')
+# config.bind('<Return>', 'follow-selected')
+# config.bind('<back>', 'back')
+# config.bind('<forward>', 'forward')
+# config.bind('=', 'zoom')
+# config.bind('?', 'set-cmd-text ?')
+# config.bind('@', 'run-macro')
+# config.bind('B', 'set-cmd-text -s :quickmark-load -t')
+# config.bind('D', 'tab-close -o')
+# config.bind('F', 'hint all tab')
+# config.bind('G', 'scroll-to-perc')
+# config.bind('H', 'back')
+# config.bind('J', 'tab-next')
+# config.bind('K', 'tab-prev')
+# config.bind('L', 'forward')
+# config.bind('M', 'bookmark-add')
+# config.bind('N', 'search-prev')
+# config.bind('O', 'set-cmd-text -s :open -t')
+# config.bind('PP', 'open -t -- {primary}')
+# config.bind('Pp', 'open -t -- {clipboard}')
+# config.bind('R', 'reload -f')
+# config.bind('Sb', 'open qute://bookmarks#bookmarks')
+# config.bind('Sh', 'open qute://history')
+# config.bind('Sq', 'open qute://bookmarks')
+# config.bind('Ss', 'open qute://settings')
+# config.bind('T', 'tab-focus')
+# config.bind('ZQ', 'quit')
+# config.bind('ZZ', 'quit --save')
+# config.bind('[[', 'navigate prev')
+# config.bind(']]', 'navigate next')
+# config.bind('`', 'enter-mode set_mark')
+# config.bind('ad', 'download-cancel')
+# config.bind('b', 'set-cmd-text -s :quickmark-load')
+# config.bind('cd', 'download-clear')
+# config.bind('co', 'tab-only')
+# config.bind('d', 'tab-close')
+# config.bind('f', 'hint')
+# config.bind('g$', 'tab-focus -1')
+# config.bind('g0', 'tab-focus 1')
+# config.bind('gB', 'set-cmd-text -s :bookmark-load -t')
+# config.bind('gC', 'tab-clone')
+# config.bind('gD', 'tab-give')
+# config.bind('gO', 'set-cmd-text :open -t -r {url:pretty}')
+# config.bind('gU', 'navigate up -t')
+# config.bind('g^', 'tab-focus 1')
+# config.bind('ga', 'open -t')
+# config.bind('gb', 'set-cmd-text -s :bookmark-load')
+# config.bind('gd', 'download')
+# config.bind('gf', 'view-source')
+# config.bind('gg', 'scroll-to-perc 0')
+# config.bind('gi', 'hint inputs --first')
+# config.bind('gl', 'tab-move -')
+# config.bind('gm', 'tab-move')
+# config.bind('go', 'set-cmd-text :open {url:pretty}')
+# config.bind('gr', 'tab-move +')
+# config.bind('gt', 'set-cmd-text -s :buffer')
+# config.bind('gu', 'navigate up')
+
+# Move tabs around
+config.bind('gK', 'tab-move -')
+config.bind('gJ', 'tab-move +')
+
+# config.bind('h', 'scroll left')
+# config.bind('i', 'enter-mode insert')
+# config.bind('j', 'scroll down')
+# config.bind('k', 'scroll up')
+# config.bind('l', 'scroll right')
+# config.bind('m', 'quickmark-save')
+# config.bind('n', 'search-next')
+# config.bind('o', 'set-cmd-text -s :open')
+# config.bind('pP', 'open -- {primary}')
+# config.bind('pp', 'open -- {clipboard}')
+# config.bind('q', 'record-macro')
+# config.bind('r', 'reload')
+# config.bind('sf', 'save')
+# config.bind('sk', 'set-cmd-text -s :bind')
+# config.bind('sl', 'set-cmd-text -s :set -t')
+# config.bind('ss', 'set-cmd-text -s :set')
+# config.bind('tIH', 'config-cycle -p -u *://*.{url:host}/* content.images ;; reload')
+# config.bind('tIh', 'config-cycle -p -u *://{url:host}/* content.images ;; reload')
+# config.bind('tIu', 'config-cycle -p -u {url} content.images ;; reload')
+# config.bind('tPH', 'config-cycle -p -u *://*.{url:host}/* content.plugins ;; reload')
+# config.bind('tPh', 'config-cycle -p -u *://{url:host}/* content.plugins ;; reload')
+# config.bind('tPu', 'config-cycle -p -u {url} content.plugins ;; reload')
+# config.bind('tSH', 'config-cycle -p -u *://*.{url:host}/* content.javascript.enabled ;; reload')
+# config.bind('tSh', 'config-cycle -p -u *://{url:host}/* content.javascript.enabled ;; reload')
+# config.bind('tSu', 'config-cycle -p -u {url} content.javascript.enabled ;; reload')
+# config.bind('th', 'back -t')
+# config.bind('tiH', 'config-cycle -p -t -u *://*.{url:host}/* content.images ;; reload')
+# config.bind('tih', 'config-cycle -p -t -u *://{url:host}/* content.images ;; reload')
+# config.bind('tiu', 'config-cycle -p -t -u {url} content.images ;; reload')
+# config.bind('tl', 'forward -t')
+# config.bind('tpH', 'config-cycle -p -t -u *://*.{url:host}/* content.plugins ;; reload')
+# config.bind('tph', 'config-cycle -p -t -u *://{url:host}/* content.plugins ;; reload')
+# config.bind('tpu', 'config-cycle -p -t -u {url} content.plugins ;; reload')
+# config.bind('tsH', 'config-cycle -p -t -u *://*.{url:host}/* content.javascript.enabled ;; reload')
+# config.bind('tsh', 'config-cycle -p -t -u *://{url:host}/* content.javascript.enabled ;; reload')
+# config.bind('tsu', 'config-cycle -p -t -u {url} content.javascript.enabled ;; reload')
+# config.bind('u', 'undo')
+# config.bind('v', 'enter-mode caret')
+# config.bind('wB', 'set-cmd-text -s :bookmark-load -w')
+# config.bind('wO', 'set-cmd-text :open -w {url:pretty}')
+# config.bind('wP', 'open -w -- {primary}')
+# config.bind('wb', 'set-cmd-text -s :quickmark-load -w')
+# config.bind('wf', 'hint all window')
+# config.bind('wh', 'back -w')
+# config.bind('wi', 'inspector')
+# config.bind('wl', 'forward -w')
+# config.bind('wo', 'set-cmd-text -s :open -w')
+# config.bind('wp', 'open -w -- {clipboard}')
+# config.bind('xO', 'set-cmd-text :open -b -r {url:pretty}')
+# config.bind('xo', 'set-cmd-text -s :open -b')
+# config.bind('yD', 'yank domain -s')
+# config.bind('yP', 'yank pretty-url -s')
+# config.bind('yT', 'yank title -s')
+# config.bind('yY', 'yank -s')
+# config.bind('yd', 'yank domain')
+# config.bind('yp', 'yank pretty-url')
+# config.bind('yt', 'yank title')
+# config.bind('yy', 'yank')
+# config.bind('{{', 'navigate prev -t')
+# config.bind('}}', 'navigate next -t')
+
+
+
+ +
+

Go to specific websites

+
+
+
config.bind('gy', 'open -o https://www.youtube.com/feed/subscriptions')
+config.bind('gr', 'open -o https://www.reddit.com/')
+
+
+
+
+
+ +
+

Caret mode

+
+
+
# config.bind('$', 'move-to-end-of-line', mode='caret')
+# config.bind('0', 'move-to-start-of-line', mode='caret')
+# config.bind('<Ctrl-Space>', 'drop-selection', mode='caret')
+# config.bind('<Escape>', 'leave-mode', mode='caret')
+# config.bind('<Return>', 'yank selection', mode='caret')
+# config.bind('<Space>', 'toggle-selection', mode='caret')
+# config.bind('G', 'move-to-end-of-document', mode='caret')
+# config.bind('H', 'scroll left', mode='caret')
+# config.bind('J', 'scroll down', mode='caret')
+# config.bind('K', 'scroll up', mode='caret')
+# config.bind('L', 'scroll right', mode='caret')
+# config.bind('Y', 'yank selection -s', mode='caret')
+# config.bind('[', 'move-to-start-of-prev-block', mode='caret')
+# config.bind(']', 'move-to-start-of-next-block', mode='caret')
+# config.bind('b', 'move-to-prev-word', mode='caret')
+# config.bind('c', 'enter-mode normal', mode='caret')
+# config.bind('e', 'move-to-end-of-word', mode='caret')
+# config.bind('gg', 'move-to-start-of-document', mode='caret')
+# config.bind('h', 'move-to-prev-char', mode='caret')
+# config.bind('j', 'move-to-next-line', mode='caret')
+# config.bind('k', 'move-to-prev-line', mode='caret')
+# config.bind('l', 'move-to-next-char', mode='caret')
+# config.bind('v', 'toggle-selection', mode='caret')
+# config.bind('w', 'move-to-next-word', mode='caret')
+# config.bind('y', 'yank selection', mode='caret')
+# config.bind('{', 'move-to-end-of-prev-block', mode='caret')
+# config.bind('}', 'move-to-end-of-next-block', mode='caret')
+
+
+
+
+ +
+

Bindings for command mode

+
+
+
# config.bind('<Alt-B>', 'rl-backward-word', mode='command')
+# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='command')
+# config.bind('<Alt-D>', 'rl-kill-word', mode='command')
+# config.bind('<Alt-F>', 'rl-forward-word', mode='command')
+# config.bind('<Ctrl-?>', 'rl-delete-char', mode='command')
+# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='command')
+# config.bind('<Ctrl-B>', 'rl-backward-char', mode='command')
+# config.bind('<Ctrl-C>', 'completion-item-yank', mode='command')
+# config.bind('<Ctrl-D>', 'completion-item-del', mode='command')
+# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='command')
+# config.bind('<Ctrl-F>', 'rl-forward-char', mode='command')
+# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='command')
+# config.bind('<Ctrl-K>', 'rl-kill-line', mode='command')
+# config.bind('<Ctrl-N>', 'command-history-next', mode='command')
+# config.bind('<Ctrl-P>', 'command-history-prev', mode='command')
+# config.bind('<Ctrl-Return>', 'command-accept --rapid', mode='command')
+# config.bind('<Ctrl-Shift-C>', 'completion-item-yank --sel', mode='command')
+# config.bind('<Ctrl-Shift-Tab>', 'completion-item-focus prev-category', mode='command')
+# config.bind('<Ctrl-Tab>', 'completion-item-focus next-category', mode='command')
+# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='command')
+# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='command')
+# config.bind('<Ctrl-Y>', 'rl-yank', mode='command')
+# config.bind('<Down>', 'completion-item-focus --history next', mode='command')
+# config.bind('<Escape>', 'leave-mode', mode='command')
+# config.bind('<Return>', 'command-accept', mode='command')
+# config.bind('<Shift-Delete>', 'completion-item-del', mode='command')
+# config.bind('<Shift-Tab>', 'completion-item-focus prev', mode='command')
+# config.bind('<Tab>', 'completion-item-focus next', mode='command')
+# config.bind('<Up>', 'completion-item-focus --history prev', mode='command')
+
+
+
+
+ +
+

Bindings for hint mode

+
+
+
# config.bind('<Ctrl-B>', 'hint all tab-bg', mode='hint')
+# config.bind('<Ctrl-F>', 'hint links', mode='hint')
+# config.bind('<Ctrl-R>', 'hint --rapid links tab-bg', mode='hint')
+# config.bind('<Escape>', 'leave-mode', mode='hint')
+# config.bind('<Return>', 'follow-hint', mode='hint')
+
+
+
+
+ +
+

Bindings for insert mode

+
+
+
# config.bind('<Ctrl-E>', 'open-editor', mode='insert')
+# config.bind('<Escape>', 'leave-mode', mode='insert')
+# config.bind('<Shift-Ins>', 'insert-text {primary}', mode='insert')
+
+
+
+
+ +
+

Bindings for passthrough mode

+
+
+
# config.bind('<Shift-Escape>', 'leave-mode', mode='passthrough')
+
+
+
+
+ +
+

Bindings for prompt mode

+
+
+
# config.bind('<Alt-B>', 'rl-backward-word', mode='prompt')
+# config.bind('<Alt-Backspace>', 'rl-backward-kill-word', mode='prompt')
+# config.bind('<Alt-D>', 'rl-kill-word', mode='prompt')
+# config.bind('<Alt-F>', 'rl-forward-word', mode='prompt')
+# config.bind('<Alt-Shift-Y>', 'prompt-yank --sel', mode='prompt')
+# config.bind('<Alt-Y>', 'prompt-yank', mode='prompt')
+# config.bind('<Ctrl-?>', 'rl-delete-char', mode='prompt')
+# config.bind('<Ctrl-A>', 'rl-beginning-of-line', mode='prompt')
+# config.bind('<Ctrl-B>', 'rl-backward-char', mode='prompt')
+# config.bind('<Ctrl-E>', 'rl-end-of-line', mode='prompt')
+# config.bind('<Ctrl-F>', 'rl-forward-char', mode='prompt')
+# config.bind('<Ctrl-H>', 'rl-backward-delete-char', mode='prompt')
+# config.bind('<Ctrl-K>', 'rl-kill-line', mode='prompt')
+# config.bind('<Ctrl-P>', 'prompt-open-download --pdfjs', mode='prompt')
+# config.bind('<Ctrl-U>', 'rl-unix-line-discard', mode='prompt')
+# config.bind('<Ctrl-W>', 'rl-unix-word-rubout', mode='prompt')
+# config.bind('<Ctrl-X>', 'prompt-open-download', mode='prompt')
+# config.bind('<Ctrl-Y>', 'rl-yank', mode='prompt')
+# config.bind('<Down>', 'prompt-item-focus next', mode='prompt')
+# config.bind('<Escape>', 'leave-mode', mode='prompt')
+# config.bind('<Return>', 'prompt-accept', mode='prompt')
+# config.bind('<Shift-Tab>', 'prompt-item-focus prev', mode='prompt')
+# config.bind('<Tab>', 'prompt-item-focus next', mode='prompt')
+# config.bind('<Up>', 'prompt-item-focus prev', mode='prompt')
+
+
+
+
+ +
+

Bindings for register mode

+
+
+
# config.bind('<Escape>', 'leave-mode', mode='register')
+
+
+
+
+ +
+

Bindings for yesno mode

+
+
+
# config.bind('<Alt-Shift-Y>', 'prompt-yank --sel', mode='yesno')
+# config.bind('<Alt-Y>', 'prompt-yank', mode='yesno')
+# config.bind('<Escape>', 'leave-mode', mode='yesno')
+# config.bind('<Return>', 'prompt-accept', mode='yesno')
+# config.bind('n', 'prompt-accept no', mode='yesno')
+# config.bind('y', 'prompt-accept yes', mode='yesno')
+
+
+
+
+ +
+

Custom Bindings

+
+
+
+

Use Pass to fill password and username (configuration is done in ~/.config/qutebrowser/password_fill_rc).

+
+
+
config.bind(',p', 'spawn --userscript password_fill')
+# config.bind(',P', 'spawn --userscript qute-bitwarden')
+
+
+
+
+ +
+

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}')
+
+
+
+
+ +
+

Cast Youtube to Chromecast

+
+
+
config.bind(',c', 'spawn --userscript ~/.config/qutebrowser/userscripts/cast.sh {url}')
+config.bind(',C', 'hint links spawn --userscript ~/.config/qutebrowser/userscripts/cast.sh {hint-url}')
+
+
+
+
+ +
+

Add url to refile.org

+
+
+
config.bind(',r', 'spawn --userscript ~/.config/qutebrowser/userscripts/add-to-orgmode-refile.sh')
+
+
+
+
+ +
+

Add page to Bookmarks

+
+
+
config.bind(',b', 'spawn buku -a {url}')
+config.bind(',B', 'spawn --userscript ~/.config/qutebrowser/userscripts/buku-rofi.sh')
+
+
+
+
+ +
+

Open bookmark using buku

+
+
+
config.bind(',o', 'spawn ~/bin/bukurun')
+
+
+
+
+ +
+

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')
+# config.bind(",c", "spawn --userscript org-store-link")
+# config.bind(";c", "hint links userscript org-store-link")
+# config.bind(",w", "spawn --userscript org-capture-web")
+# config.bind(";w", "hint links userscript org-capture-web")
+
+
+
+
+ +
+

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)})();")
+
+
+
+
+ +
+

See price in CamelCamelCamel

+
+
+
config.bind(',P', ":open -t https://fr.camelcamelcamel.com/search?sq={url}")
+
+
+
+
+
+
+ +
+

Userscripts

+
+
+
+

Cast Youtube to Chromecast

+
+
+
youtube-dl -o - $1 | castnow --quiet -
+
+
+
+
+ +
+

Add url to refile.org

+
+

+Add the date and time of add to properties. +

+
+
echo "* TODO $QUTE_TITLE" >> ~/Dropbox/org/refile.org
+echo "$QUTE_URL" >> ~/Dropbox/org/refile.org
+echo "message-info 'Added to refile.org'" >> "$QUTE_FIFO"
+
+
+
+
+ +
+

Passwordfillrc

+
+
+
# Show all password fields in the menu
+query_entries() {
+    # safe queried url for choose_entry
+    # the subdomains are removed
+    export queried_url=$(expr match ".$1" '.*\.\(.*\..*\)')
+    mapfile -t files < <(find -L "$PREFIX" -iname '*.gpg' -printf '%P\n' |sed 's,\.gpg$,,')
+}
+
+# Even if there is only one entry, always show a menu
+# for user confirmation.
+choose_entry() {
+    MENU_COMMAND=(
+        rofi -dmenu
+            -p "qutebrowser> "
+            -filter "$queried_url"
+            -mesg $'Pick a password entry for <b>'"${QUTE_URL//&/&amp;}"'</b>'
+    )
+    file=$( printf "%s\n" "${files[@]}" | "${MENU_COMMAND[@]}" )
+}
+
+
+
+
+
+

Org-Capture

+
+
+
readonly CAPTURE_SCRIPT=~/scripts/org-protocol-capture-html.sh
+
+if [[ "$QUTE_MODE" = "hints" ]]; then
+    # if we start with hints, we juste want to capture the URL
+    $CAPTURE_SCRIPT --template "pu" --url "${QUTE_URL}"
+elif [[ -n "$QUTE_SELECTED_TEXT" ]]; then
+    # if text is selected, we want to capture the text
+    $CAPTURE_SCRIPT --template "pt" --heading "${QUTE_TITLE}" --url "${QUTE_URL}" "${QUTE_SELECTED_TEXT}"
+else
+    # if no text is selected, we want to capture the url
+    $CAPTURE_SCRIPT --template "pu" --heading "${QUTE_TITLE}" --url "${QUTE_URL}"
+fi
+
+
+
+
+
+

Add Url to Buku using Rofi

+
+
+
title=$(echo "$QUTE_TITLE" | rofi -p "Title" -dmenu -lines 1)
+tags=$(buku -t --nc --np | sed -e 's/\s*[[:digit:]]*\.\s*\(.*\)\s*([[:digit:]]*)\s*/\1/' -e '/^\s*$/d' | sort | uniq | rofi -p "Tags" -dmenu)
+
+buku --add "$QUTE_URL" --tag "$tags" --title "$title"
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/ranger.html b/docs/ranger.html new file mode 100644 index 0000000..82da0b6 --- /dev/null +++ b/docs/ranger.html @@ -0,0 +1,1560 @@ + + + + + + + + +Ranger Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Ranger Configuration

+ + +
+

Config

+
+
+ +
+

Options

+
+
+
# Which viewmode should be used?  Possible values are:
+#     miller: Use miller columns which show multiple levels of the hierarchy
+#     multipane: Midnight-commander like multipane view showing all tabs next
+#                to each other
+set viewmode miller
+#set viewmode multipane
+
+# How many columns are there, and what are their relative widths?
+set column_ratios 1,1
+
+# Which files should be hidden? (regular expression)
+#set hidden_filter ^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$
+set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)$|^lost\+found$|^__(py)?cache__$
+
+# Show hidden files? You can toggle this by typing 'zh'
+set show_hidden false
+
+# Ask for a confirmation when running the "delete" command?
+# Valid values are "always", "never", "multiple" (default)
+# With "multiple", ranger will ask only if you delete multiple files at once.
+set confirm_on_delete multiple
+
+# Which script is used to generate file previews?
+# ranger ships with scope.sh, a script that calls external programs (see
+# README.md for dependencies) to preview images, archives, etc.
+set preview_script ~/.config/ranger/scope.sh
+
+# Use the external preview script or display simple plain text or image previews?
+set use_preview_script true
+
+# Automatically count files in the directory, even before entering them?
+set automatically_count_files true
+
+# Open all images in this directory when running certain image viewers
+# like feh or sxiv?  You can still open selected files by marking them.
+# TODO
+set open_all_images true
+
+# Be aware of version control systems and display information.
+set vcs_aware false
+
+# State of the three backends git, hg, bzr. The possible states are
+# disabled, local (only show local info), enabled (show local and remote
+# information).
+set vcs_backend_git enabled
+set vcs_backend_hg disabled
+set vcs_backend_bzr disabled
+
+# Use one of the supported image preview protocols
+set preview_images true
+
+# Set the preview image method
+# TODO
+set preview_images_method w3m
+
+# Use a unicode "..." character to mark cut-off filenames?
+set unicode_ellipsis false
+
+# Show dotfiles in the bookmark preview box?
+set show_hidden_bookmarks true
+
+# Which colorscheme to use?  These colorschemes are available by default:
+# default, jungle, snow, solarized
+set colorscheme default
+
+# Preview files on the rightmost column?
+# And collapse (shrink) the last column if there is nothing to preview?
+set preview_files true
+set preview_directories true
+set collapse_preview true
+
+# Save the console history on exit?
+set save_console_history false
+
+# Draw the status bar on top of the browser window (default: bottom)
+set status_bar_on_top false
+
+# Draw a progress bar in the status bar which displays the average state of all
+# currently running tasks which support progress bars?
+set draw_progress_bar_in_status_bar true
+
+# Draw borders around columns?
+set draw_borders true
+
+# Display the directory name in tabs?
+set dirname_in_tabs false
+
+# Enable the mouse support?
+set mouse_enabled true
+
+# Display the file size in the main column or status bar?
+set display_size_in_main_column true
+set display_size_in_status_bar true
+
+# Display files tags in all columns or only in main column?
+set display_tags_in_all_columns true
+
+# Set a title for the window?
+set update_title false
+
+# Set the title to "ranger" in the tmux program?
+set update_tmux_title false
+
+# Shorten the title if it gets long?  The number defines how many
+# directories are displayed at once, 0 turns off this feature.
+set shorten_title 3
+
+# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
+set tilde_in_titlebar true
+
+# How many directory-changes or console-commands should be kept in history?
+set max_history_size 20
+set max_console_history_size 50
+
+# Try to keep so much space between the top/bottom border when scrolling:
+set scroll_offset 8
+
+# Flush the input after each key hit?  (Noticeable when ranger lags)
+set flushinput true
+
+# Padding on the right when there's no preview?
+# This allows you to click into the space to run the file.
+set padding_right true
+
+# Save bookmarks (used with mX and `X) instantly?
+# This helps to synchronize bookmarks between multiple ranger
+# instances but leads to *slight* performance loss.
+# When false, bookmarks are saved when ranger is exited.
+set autosave_bookmarks false
+
+# You can display the "real" cumulative size of directories by using the
+# command :get_cumulative_size or typing "dc".  The size is expensive to
+# calculate and will not be updated automatically.  You can choose
+# to update it automatically though by turning on this option:
+set autoupdate_cumulative_size false
+
+# Turning this on makes sense for screen readers:
+set show_cursor false
+
+# One of: size, natural, basename, atime, ctime, mtime, type, random
+set sort natural
+
+# Additional sorting options
+set sort_reverse false
+set sort_case_insensitive true
+set sort_directories_first true
+set sort_unicode false
+
+# Enable this if key combinations with the Alt Key don't work for you.
+# (Especially on xterm)
+set xterm_alt_key false
+
+# Whether to include bookmarks in cd command
+set cd_bookmarks false
+
+# Avoid previewing files larger than this size, in bytes.  Use a value of 0 to
+# disable this feature.
+set preview_max_size 0
+
+# Add the highlighted file to the path in the titlebar
+set show_selection_in_titlebar true
+
+# The delay that ranger idly waits for user input, in milliseconds, with a
+# resolution of 100ms.  Lower delay reduces lag between directory updates but
+# increases CPU load.
+set idle_delay 2000
+
+# When the metadata manager module looks for metadata, should it only look for
+# a ".metadata.json" file in the current directory, or do a deep search and
+# check all directories above the current one as well?
+set metadata_deep_search false
+
+# Clear all existing filters when leaving a directory
+set clear_filters_on_dir_change false
+
+# Disable displaying line numbers in main column
+set line_numbers false
+
+
+
+
+ +
+

Command Aliases in the Console

+
+
+
alias e    edit
+alias q    quit
+alias q!   quitall
+alias qa   quitall
+alias qall quitall
+alias setl setlocal
+
+alias filter     scout -prt
+alias find       scout -aeit
+alias mark       scout -mr
+alias unmark     scout -Mr
+alias search     scout -rs
+alias search_inc scout -rts
+alias travel     scout -aefiklst
+
+
+
+
+ +
+

Some Custom Keybindings

+
+
+
+

Extract

+
+
+
map ,x shell atool -x %f
+
+
+
+
+ +
+

Compress

+
+
+
map ,z shell apack %f.zip %f
+
+
+
+
+ +
+

Delete first page of pdf

+
+
+
map ,d shell ~/scripts/pdf-delete-first-page.sh %f
+
+
+
+
+ +
+

Convert PDF to PNG

+
+
+
map ,cp shell pdftoppm -png %f > $(echo %f | cut -f 1 -d '.' | sed 's/$/.png/')
+
+
+
+
+ +
+

Magit Status

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

Upload with Tansfer.sh

+
+
+
map ,t shell curl --progress-bar --upload-file %f https://transfer.sh/$(basename $1) | xclip -in -selection clipboard;
+
+
+
+
+ +
+

Open current folder with PCManFM

+
+
+
map ,o shell nohup pcmanfm %d &
+
+
+
+
+ +
+

Open with Emacs

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

Define keys for the browser

+
+
+
+

Basic

+
+
+
map     Q quit!
+map     q quit
+copymap q ZZ ZQ
+
+map R     reload_cwd
+map <C-r> reset
+map <C-l> redraw_window
+map <C-c> abort
+map <esc> change_mode normal
+map ~ set viewmode!
+
+map i display_file
+map ? help
+map W display_log
+map w taskview_open
+
+map : console
+map ; console
+map ! console shell%space
+map @ console -p6 shell  %%s
+map # console shell -p%space
+
+
+
+
+ +
+

Open Shell in current directory

+
+
+
map s shell $SHELL
+# Open External Shell in current directory
+map S shell nohup termite &
+
+map r chain draw_possible_programs; console open_with%%space
+
+
+
+
+ +
+

Print on Rnice

+
+
+
map ,p shell print-rnice %f &
+
+
+
+
+ +
+

Filter

+
+
+
map f console filter%space
+# Reset filter
+map F filter
+
+
+
+
+ +
+

Change the line mode

+
+
+
map Mf linemode filename
+map Mi linemode fileinfo
+map Mm linemode mtime
+map Mp linemode permissions
+map Ms linemode sizemtime
+map Mt linemode metatitle
+
+
+
+
+ +
+

Tagging / Marking

+
+
+
map t       tag_toggle
+map ut      tag_remove
+map <Space> mark_files toggle=True
+map v       mark_files all=True toggle=True
+map uv      mark_files all=True val=False
+map V       toggle_visual_mode
+map uV      toggle_visual_mode reverse=True
+
+
+
+
+ +
+

VIM-like

+
+
+
copymap <UP>       k
+copymap <DOWN>     j
+copymap <LEFT>     h
+copymap <RIGHT>    l
+copymap <HOME>     gg
+copymap <END>      G
+copymap <PAGEDOWN> <C-F>
+copymap <PAGEUP>   <C-B>
+
+
+
+
+ +
+

Jumping around

+
+
+
map H     history_go -1
+map L     history_go 1
+map ]     move_parent 1
+map [     move_parent -1
+map }     traverse
+
+
+
+
+ +
+

TODO Go to special folders

+
+
+
map cd console cd%space
+
+map gh cd ~
+map ga cd ~/Cloud/administratif
+map gm cd ~/Cloud/thesis
+map gp cd ~/Pictures
+map gd cd ~/Downloads
+map gc cd ~/.config/literate-dotfiles
+
+
+
+
+ +
+

TODO Open With

+
+

+Should automatically close mimeopen after the program is chosen. +

+
+
map O shell mimeopen -a %f
+
+
+
+
+ +
+

External Programs

+
+
+
map E edit
+
+
+
+
+ +
+

Get size of folders

+
+
+
# Get size of all folders
+map du shell -p du --max-depth=1 -h --apparent-size
+# Get size of all folders and sort them
+map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
+
+
+
+
+ +
+

Yank path of directory/file

+
+
+
# Yank path of current directory/file
+map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
+# Yank path of directory
+map yd shell -f echo -n %d    | xsel -i; xsel -o | xsel -i -b
+# Yank filename
+map yn shell -f echo -n %f    | xsel -i; xsel -o | xsel -i -b
+
+
+
+
+ +
+

Filesystem Operations

+
+
+
map = chmod
+
+
+
+
+ +
+

Drag and Drop

+
+
+
map D shell dragon-drag-and-drop -a -x %p
+
+
+
+
+ +
+

TODO Rename

+
+
+
#map cw console rename%space
+map cw eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ")
+
+
+
+
+ +
+

Rename files - like vim bindings

+
+
+
map a  rename_append
+map A  eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
+map I  eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
+
+
+
+
+ +
+

Paste files

+
+
+
map pp paste
+map po paste overwrite=True
+map pP paste append=True
+map pO paste overwrite=True append=True
+map pl paste_symlink relative=False
+map pL paste_symlink relative=True
+map phl paste_hardlink
+map pht paste_hardlinked_subtree
+
+
+
+
+ +
+

Delete and move files

+
+
+
map dD console delete
+map dd cut
+map ud uncut
+map da cut mode=add
+map dr cut mode=remove
+map dt cut mode=toggle
+
+
+
+
+ +
+

Copy files

+
+
+
map yy copy
+map uy uncut
+map ya copy mode=add
+map yr copy mode=remove
+map yt copy mode=toggle
+
+
+
+
+ +
+

Temporary workarounds

+
+
+
map dgg eval fm.cut(dirarg=dict(to=0), narg=quantifier)
+map dG  eval fm.cut(dirarg=dict(to=-1), narg=quantifier)
+map dj  eval fm.cut(dirarg=dict(down=1), narg=quantifier)
+map dk  eval fm.cut(dirarg=dict(up=1), narg=quantifier)
+map ygg eval fm.copy(dirarg=dict(to=0), narg=quantifier)
+map yG  eval fm.copy(dirarg=dict(to=-1), narg=quantifier)
+map yj  eval fm.copy(dirarg=dict(down=1), narg=quantifier)
+map yk  eval fm.copy(dirarg=dict(up=1), narg=quantifier)
+
+
+
+
+ +
+

Searching

+
+
+
map /  console search%space
+map n  search_next
+map N  search_next forward=False
+map ct search_next order=tag
+map cs search_next order=size
+map ci search_next order=mimetype
+map cc search_next order=ctime
+map cm search_next order=mtime
+map ca search_next order=atime
+
+
+
+
+ +
+

Tabs

+
+
+
map <C-n>     tab_new ~
+map <C-w>     tab_close
+map <TAB>     tab_move 1
+map <S-TAB>   tab_move -1
+map <A-Right> tab_move 1
+map <A-Left>  tab_move -1
+map gt        tab_move 1
+map gT        tab_move -1
+map gn        tab_new ~
+map uq        tab_restore
+map <a-1>     tab_open 1
+map <a-2>     tab_open 2
+map <a-3>     tab_open 3
+map <a-4>     tab_open 4
+map <a-5>     tab_open 5
+map <a-6>     tab_open 6
+map <a-7>     tab_open 7
+map <a-8>     tab_open 8
+map <a-9>     tab_open 9
+
+
+
+
+ +
+

Sorting

+
+
+
map or set sort_reverse!
+map oz set sort=random
+map os chain set sort=size;      set sort_reverse=False
+map ob chain set sort=basename;  set sort_reverse=False
+map on chain set sort=natural;   set sort_reverse=False
+map om chain set sort=mtime;     set sort_reverse=False
+map oc chain set sort=ctime;     set sort_reverse=False
+map oa chain set sort=atime;     set sort_reverse=False
+map ot chain set sort=type;      set sort_reverse=False
+map oe chain set sort=extension; set sort_reverse=False
+
+map oS chain set sort=size;      set sort_reverse=True
+map oB chain set sort=basename;  set sort_reverse=True
+map oN chain set sort=natural;   set sort_reverse=True
+map oM chain set sort=mtime;     set sort_reverse=True
+map oC chain set sort=ctime;     set sort_reverse=True
+map oA chain set sort=atime;     set sort_reverse=True
+map oT chain set sort=type;      set sort_reverse=True
+map oE chain set sort=extension; set sort_reverse=True
+
+map dc get_cumulative_size
+
+
+
+
+ +
+

Settings

+
+
+
map zc    set collapse_preview!
+map zd    set sort_directories_first!
+map zh    set show_hidden!
+map <C-h> set show_hidden!
+map zI    set flushinput!
+map zi    set preview_images!
+map zm    set mouse_enabled!
+map zp    set preview_files!
+map zP    set preview_directories!
+map zs    set sort_case_insensitive!
+map zu    set autoupdate_cumulative_size!
+map zv    set use_preview_script!
+map zf    console filter%space
+
+
+
+
+ +
+

Bookmarks

+
+
+
map `<any>  enter_bookmark %any
+map '<any>  enter_bookmark %any
+map m<any>  set_bookmark %any
+map um<any> unset_bookmark %any
+
+map m<bg>   draw_bookmarks
+copymap m<bg>  um<bg> `<bg> '<bg>
+
+
+
+
+ +
+

Custom Mapping

+
+
+
map <C-f> fzf_select
+
+
+
+
+ +
+

Generate all the chmod bindings with some python help:

+
+
+
eval for arg in "rwxXst": cmd("map +u{0} shell -f chmod u+{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map +g{0} shell -f chmod g+{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map +o{0} shell -f chmod o+{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map +a{0} shell -f chmod a+{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map +{0}  shell -f chmod u+{0} %s".format(arg))
+
+eval for arg in "rwxXst": cmd("map -u{0} shell -f chmod u-{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map -g{0} shell -f chmod g-{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map -o{0} shell -f chmod o-{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map -a{0} shell -f chmod a-{0} %s".format(arg))
+eval for arg in "rwxXst": cmd("map -{0}  shell -f chmod u-{0} %s".format(arg))
+
+
+
+
+
+ +
+

Define keys for the console

+
+
+
+

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>
+copycmap <CR>  <C-j>
+
+
+
+
+ +
+

Move around

+
+
+
cmap <up>    eval fm.ui.console.history_move(-1)
+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)
+cmap <a-left>   eval fm.ui.console.move_word(left=1)
+cmap <a-right>  eval fm.ui.console.move_word(right=1)
+
+
+
+
+ +
+

Line Editing

+
+
+
cmap <backspace>  eval fm.ui.console.delete(-1)
+cmap <delete>     eval fm.ui.console.delete(0)
+cmap <C-w>        eval fm.ui.console.delete_word()
+cmap <A-d>        eval fm.ui.console.delete_word(backward=False)
+cmap <C-k>        eval fm.ui.console.delete_rest(1)
+cmap <C-u>        eval fm.ui.console.delete_rest(-1)
+cmap <C-y>        eval fm.ui.console.paste()
+
+
+
+
+ +
+

And of course the emacs way

+
+
+
copycmap <up>        <C-p>
+copycmap <down>      <C-n>
+copycmap <left>      <C-b>
+copycmap <right>     <C-f>
+copycmap <home>      <C-a>
+copycmap <end>       <C-e>
+copycmap <delete>    <C-d>
+copycmap <backspace> <C-h>
+
+
+
+
+ +
+

Others

+
+
+
# Note: There are multiple ways to express backspaces.  <backspace> (code 263)
+# and <backspace2> (code 127).  To be sure, use both.
+copycmap <backspace> <backspace2>
+
+# This special expression allows typing in numerals:
+cmap <allow_quantifiers> false
+
+
+
+
+
+ +
+

Pager Keybindings

+
+
+
+

Movement

+
+
+
pmap  <down>      pager_move  down=1
+pmap  <up>        pager_move  up=1
+pmap  <left>      pager_move  left=4
+pmap  <right>     pager_move  right=4
+pmap  <home>      pager_move  to=0
+pmap  <end>       pager_move  to=-1
+pmap  <pagedown>  pager_move  down=1.0  pages=True
+pmap  <pageup>    pager_move  up=1.0    pages=True
+pmap  <C-d>       pager_move  down=0.5  pages=True
+pmap  <C-u>       pager_move  up=0.5    pages=True
+
+copypmap <UP>       k  <C-p>
+copypmap <DOWN>     j  <C-n> <CR>
+copypmap <LEFT>     h
+copypmap <RIGHT>    l
+copypmap <HOME>     g
+copypmap <END>      G
+copypmap <C-d>      d
+copypmap <C-u>      u
+copypmap <PAGEDOWN> n  f  <C-F>  <Space>
+copypmap <PAGEUP>   p  b  <C-B>
+
+
+
+
+ +
+

Basic

+
+
+
pmap     <C-l> redraw_window
+pmap     <ESC> pager_close
+copypmap <ESC> q Q i <F3>
+pmap E      edit_file
+
+
+
+
+
+ +
+

Taskview Keybindings

+
+
+
+

Movement

+
+
+
tmap <up>        taskview_move up=1
+tmap <down>      taskview_move down=1
+tmap <home>      taskview_move to=0
+tmap <end>       taskview_move to=-1
+tmap <pagedown>  taskview_move down=1.0  pages=True
+tmap <pageup>    taskview_move up=1.0    pages=True
+tmap <C-d>       taskview_move down=0.5  pages=True
+tmap <C-u>       taskview_move up=0.5    pages=True
+
+copytmap <UP>       k  <C-p>
+copytmap <DOWN>     j  <C-n> <CR>
+copytmap <HOME>     g
+copytmap <END>      G
+copytmap <C-u>      u
+copytmap <PAGEDOWN> n  f  <C-F>  <Space>
+copytmap <PAGEUP>   p  b  <C-B>
+
+
+
+
+ +
+

Changing priority and deleting tasks

+
+
+
tmap J          eval -q fm.ui.taskview.task_move(-1)
+tmap K          eval -q fm.ui.taskview.task_move(0)
+tmap dd         eval -q fm.ui.taskview.task_remove()
+tmap <pagedown> eval -q fm.ui.taskview.task_move(-1)
+tmap <pageup>   eval -q fm.ui.taskview.task_move(0)
+tmap <delete>   eval -q fm.ui.taskview.task_remove()
+
+
+
+
+ +
+

Basic

+
+
+
tmap <C-l> redraw_window
+tmap <ESC> taskview_close
+copytmap <ESC> q Q w <C-c>
+default_linemode devicons
+
+
+
+
+
+
+ +
+

Rifle

+
+
+
# 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
+# are checked and if they are met, the respective command is run.
+#
+# Syntax:
+#   <condition1> , <condition2> , ... = command
+#
+# The command can contain these environment variables:
+#   $1-$9 | The n-th selected file
+#   $@    | All selected files
+#
+# If you use the special command "ask", rifle will ask you what program to run.
+#
+# Prefixing a condition with "!" will negate its result.
+# These conditions are currently supported:
+#   match <regexp> | The regexp matches $1
+#   ext <regexp>   | The regexp matches the extension of $1
+#   mime <regexp>  | The regexp matches the mime type of $1
+#   name <regexp>  | The regexp matches the basename of $1
+#   path <regexp>  | The regexp matches the absolute path of $1
+#   has <program>  | The program is installed (i.e. located in $PATH)
+#   env <variable> | The environment variable "variable" is non-empty
+#   file           | $1 is a file
+#   directory      | $1 is a directory
+#   number <n>     | change the number of this command to n
+#   terminal       | stdin, stderr and stdout are connected to a terminal
+#   X              | $DISPLAY is not empty (i.e. Xorg runs)
+#
+# There are also pseudo-conditions which have a "side effect":
+#   flag <flags>  | Change how the program is run. See below.
+#   label <label> | Assign a label or name to the command so it can
+#                 | be started with :open_with <label> in ranger
+#                 | or `rifle -p <label>` in the standalone executable.
+#   else          | Always true.
+#
+# Flags are single characters which slightly transform the command:
+#   f | Fork the program, make it run in the background.
+#     |   New command = setsid $command >& /dev/null &
+#   r | Execute the command with root permissions
+#     |   New command = sudo $command
+#   t | Run the program in a new terminal.  If $TERMCMD is not defined,
+#     | rifle will attempt to extract it from $TERM.
+#     |   New command = $TERMCMD -e $command
+# Note: The "New command" serves only as an illustration, the exact
+# 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
+#-------------------------------------------
+# 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 -- "$@"
+!mime ^text, label pager,  ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
+
+ext org                       = emacsclient -create-frame --alternate-editor="" -n "$1"
+
+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 -- "$@"
+
+#--------------------------------------------
+# Audio without X
+#-------------------------------------------
+mime ^audio|ogg$, terminal, has mpv      = mpv --no-audio-display -- "$@"
+mime ^audio|ogg$   = tag "$@"
+mime ^audio|ogg$, terminal, has mpv      = mpv -- "$@"
+
+#--------------------------------------------
+# Video without X:
+#-------------------------------------------
+mime ^video, terminal, !X, has mpv       = mpv -- "$@"
+mime ^video, terminal, !X, has mplayer2  = mplayer2 -- "$@"
+mime ^video, terminal, !X, has mplayer   = mplayer -- "$@"
+
+#-------------------------------------------
+# 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 "$@"
+
+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 catdoc,       terminal = catdoc -- "$@" | "$PAGER"
+
+  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"
+
+# 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

+
+
+
+

Import

+
+
+
from ranger.api.commands import *
+
+import os
+
+
+
+
+ +
+

fzfselect

+
+
+
class fzf_select(Command):
+    """
+    :fzf_select
+
+    Find a file using fzf.
+
+    With a prefix argument select only directories.
+
+    See: https://github.com/junegunn/fzf
+    """
+    def execute(self):
+        import subprocess
+        import os.path
+        if self.quantifier:
+            # match only directories
+            command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
+            -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
+        else:
+            # match files and directories
+            command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
+            -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
+        fzf = self.fm.execute_command(command, universal_newlines=True, stdout=subprocess.PIPE)
+        stdout, stderr = fzf.communicate()
+        if fzf.returncode == 0:
+            fzf_file = os.path.abspath(stdout.rstrip('\n'))
+            if os.path.isdir(fzf_file):
+                self.fm.cd(fzf_file)
+            else:
+                self.fm.select_file(fzf_file)
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/rofi.html b/docs/rofi.html new file mode 100644 index 0000000..858701a --- /dev/null +++ b/docs/rofi.html @@ -0,0 +1,516 @@ + + + + + + + + +Rofi Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Rofi Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

Rofi

+
+
+
configuration {
+modi: "window,run,ssh";
+width: 50;
+lines: 15;
+columns: 1;
+font: "Hack Nerd Font 12";
+fixed-num-lines: true;
+show-icons: false;
+terminal: "rofi-sensible-terminal";
+sort: false;
+case-sensitive: false;
+cycle: true;
+sidebar-mode: false;
+auto-select: false;
+combi-modi: "window,run";
+matching: "normal";
+line-margin: 2;
+line-padding: 1;
+separator-style: "dash";
+hide-scrollbar: true;
+fullscreen: false;
+dpi: -1;
+show-match: true;
+theme: "gruvbox-dark-soft";
+kb-move-front: "Control+a";
+kb-move-end: "Control+e";
+kb-move-word-back: "Alt+b,Control+Left";
+kb-move-word-forward: "Alt+f,Control+Right";
+kb-move-char-back: "Left,Control+b";
+kb-move-char-forward: "Right,Control+f";
+kb-remove-char-forward: "Delete,Control+d";
+kb-remove-char-back: "BackSpace,Shift+BackSpace";
+kb-remove-to-eol: "Control+k";
+kb-remove-to-sol: "Control+u";
+kb-accept-entry: "Control+j,Return,KP_Enter";
+kb-accept-custom: "Control+Return";
+kb-accept-alt: "Shift+Return";
+kb-delete-entry: "Shift+Delete";
+kb-row-up: "Up,Control+p";
+kb-row-down: "Down,Control+n";
+kb-row-tab: "Tab";
+kb-row-first: "Home,KP_Home";
+kb-row-last: "End,KP_End";
+kb-row-select: "Control+space";
+kb-cancel: "Escape,Control+g";
+}
+
+
+
+
+ +
+

Theme

+
+
+
configuration {
+  me-select-entry:  "MouseSecondary";
+  me-accept-entry:  "MousePrimary";
+  scroll-method:      1;
+    show-icons:         true;
+    sidebar-mode:       true;
+    kb-custom-1:        "";
+    kb-custom-2:        "";
+    kb-custom-3:        "";
+    kb-custom-4:        "";
+    kb-custom-5:        "";
+    kb-custom-6:        "";
+    kb-custom-7:        "";
+    kb-custom-8:        "";
+    kb-custom-9:        "";
+    kb-custom-10:       "";
+    kb-select-1:        "Alt+1";
+    kb-select-2:        "Alt+2";
+    kb-select-3:        "Alt+3";
+    kb-select-4:        "Alt+4";
+    kb-select-5:        "Alt+5";
+    kb-select-6:        "Alt+6";
+    kb-select-7:        "Alt+7";
+    kb-select-8:        "Alt+8";
+    kb-select-9:        "Alt+9";
+    kb-select-10:       "Alt+0";
+}
+
+* {
+////    COLORS  ////
+
+////    uncomment to match bspwm edition theme
+  background:                  #292f34FF;
+  background-color:            #292f3400;
+  foreground:                  #F6F9FFFF;
+  selected:                    #1ABB9BFF;
+  selected-foreground:         @foreground;
+
+////     uncomment to match Adapta Nokto theme
+//  background:                  #222D32E8;
+//  background-color:            #00000000;
+//  foreground:                  #CFD8DCFF;
+//  selected:                    #00BCD4FF;
+//  selected-foreground:         #FFFFFFFF;
+
+////    common - active and urgent
+    active-background:           #3A464BFF;
+    urgent-background:           #800000FF;
+    urgent-foreground:           @foreground;
+    selected-urgent-background:  @urgent-foreground;
+    selected-urgent-foreground:  @urgent-background;
+
+////    TEXT    ////
+
+  font:             "xos4 Terminus 18px";
+//    font:             "Knack Nerd Font 16px";
+    text-color:         @foreground;
+
+////    PADDING ETC ////
+
+  margin:               0px;
+  border:               0px;
+  padding:          0px;
+  spacing:          0px;
+  elementpadding:       2px 0px;
+  elementmargin:        0px 2px;
+  listmargin:           0px 2px 0px 0px;
+
+////    SIZE    ////
+
+  windowwidth:  40ch;
+  buttonwidth:  18ch;
+  lines:            12;
+  fixed-height: false;
+
+////    POSITION    ////
+
+  location:     northwest;
+  anchor:           northwest;
+  x-offset:     0px;
+  y-offset:     24px;
+
+////    LAYOUT  ////
+
+  scrollbar:        true;
+
+////    uncomment to get submenu-like style
+  menustyle:        [ sb-mainbox ];
+  buttonpadding:    2px 1ch;
+  button-bg:        @background;
+  dynamic:      true;
+
+////    uncomment to get tabs-like style
+//  menustyle:      [ tb-mainbox ];
+//  buttonpadding:  14px 1ch;
+//  dynamic:        false;
+}
+//////////////////////////////////////////
+window {
+  width:            @windowwidth;
+  children:     @menustyle;
+}
+//submenu-style
+sb-mainbox {
+  orientation:  horizontal;
+  children:     [ sidebar, vertibox ];
+}
+//tabs-style
+tb-mainbox {
+  orientation:  vertical;
+  children:     [ inputbar, horibox ];
+  background-color: @background;
+}
+//desktop-submenu
+dt-mainbox {
+  orientation:  vertical;
+  children:     [ boxdummy, sb-mainbox ];
+}
+horibox {
+  orientation:  horizontal;
+  children:     [ listview, sidebar ];
+}
+sidebar {
+  orientation:  vertical;
+}
+button {
+  horizontal-align: 0;
+  padding:      @buttonpadding;
+  width:            @buttonwidth;
+  background-color: @button-bg;
+  expand:           false;
+}
+vertibox {
+  orientation:  vertical;
+  children:     [ inputbar, listview ];
+  background-color: @background;
+}
+prompt {
+  enabled:      false;
+}
+listview {
+  margin:           @listmargin;
+}
+scrollbar {
+  handle-width: 0.5ch;
+  handle-color: @selected;
+}
+boxdummy {
+  enabled:      false;
+  orientation:  vertical;
+  expand:           false;
+  children:     [ textboxdummy ];
+}
+textboxdummy {
+  str:          " ";
+}
+element, inputbar, textboxdummy {
+  padding:      @elementpadding;
+  margin:           @elementmargin;
+  width:            @elementwidth;
+}
+element.normal.active,
+element.alternate.active {
+  background-color: @active-background;
+  text-color:           @selected-foreground;
+}
+element.selected,
+button.selected {
+  background-color: @selected;
+  text-color:           @selected-foreground;
+}
+element.normal.urgent,
+element.alternate.urgent {
+  background-color: @urgent-background;
+  text-color:           @urgent-foreground;
+}
+element.selected.urgent {
+  background-color: @selected-urgent-background;
+  text-color:           @selected-urgent-foreground;
+}
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/scripts.html b/docs/scripts.html new file mode 100644 index 0000000..7db9aa5 --- /dev/null +++ b/docs/scripts.html @@ -0,0 +1,829 @@ + + + + + + + + +Scripts + + + + + + + + + + + + +
+ UP + | + HOME +
+

Scripts

+ + +
+

Wallpapers

+
+
+
while true; do
+    nitrogen --set-zoom-fill --random ".wallpapers"
+    sleep 10m
+done
+
+
+
+
+ +
+

TODO LockScreen

+
+
    +
  • [ ] Does not work well with multiple screen
  • +
+ +

+First, turn off dunst +

+
+
killall -SIGUSR1 dunst && echo "off" > /tmp/dunststatus;
+
+
+ +

+Turn off the music if it is playing. +

+
+
MPC_STATE=$(mpc | sed -n '2p' | cut -d "[" -f2 | cut -d "]" -f1)
+if [[ $MPC_STATE == "playing" ]]; then
+  mpc pause
+fi
+
+
+ +

+Then take a screenshot and process it. +

+
+
temp_file="/tmp/screen.png"
+
+rm -f $temp_file
+
+maim $temp_file
+convert $temp_file -scale 10% -scale 1000% $temp_file
+
+
+ +

+Finally, lock the screen using i3lock. +

+
+
i3lock -e -n -i $temp_file && killall -SIGUSR2 dunst && echo "on" > /tmp/dunststatus
+
+
+ +
+
revert() {
+    xset dpms 0 0 0
+}
+trap revert HUP INT TERM
+# turn off screen after 5 seconds
+xset +dpms dpms 5 5 5
+
+# Parameters
+temp_file="/tmp/screen.png"
+icon="$HOME/Pictures/Evil_Rick_Sprite.png"
+width=1920
+height=1080
+blur_factor=6
+lock_blur_factor=0
+
+# Take the screen shot, blur the image and add the icon
+ffmpeg -f x11grab -video_size "${width}x${height}" -y -i $DISPLAY -i $icon -filter_complex "boxblur=$blur_factor:$blur_factor,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2,boxblur=$lock_blur_factor:$lock_blur_factor" -vframes 1 $temp_file
+
+# Alternative
+# maim -d 1 $temp_file
+# convert -blur 0x8 $temp_file $temp_file
+# convert -composite $temp_file $icon -gravity South -geometry -20x1200 $temp_file
+
+# Lock the screen with the image
+i3lock --no-unlock-indicator --ignore-empty-password --show-failed-attempts --nofork --image=$temp_file
+
+# Remove the screenshot
+rm $temp_file
+
+# Don't turn off screen when back from lock
+revert
+
+
+
+
+ +
+

Delete first page of PDF

+
+

+The requirement is to have pdftk or stapler installed. +

+ +
+
if [[ -f $1 && $1 == *.pdf ]]; then
+    # Argument if a file
+    if type stapler > /dev/null; then
+        stapler del "$1" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1"
+    elif type pdftk > /dev/null; then
+        pdftk "$1" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1"
+    else
+        echo "Neither pdftk nor stapler are installed"
+    fi
+fi
+
+
+
+
+ +
+

Lock / Exit / Suspend / …

+
+
+
option=$(echo -e "Lock\nExit\nLogout\nSuspend\nHibernate\nReboot\nShutdown" | rofi -i -dmenu)
+
+case "$option" in
+    "Lock")
+        i3exit lock ;;
+    "Exit")
+        i3exit switch_user ;;
+    "Logout")
+        i3exit logout ;;
+    "Suspend")
+        i3exit suspend ;;
+    "Hibernate")
+        i3exit hibernate ;;
+    "Reboot")
+        i3exit reboot ;;
+    "Shutdown")
+        i3exit shutdown ;;
+esac
+
+
+
+
+
+

TODO Copy Figures

+
+

+Things to do: +

+
    +
  • [ ] Display all the figures at once and ask for confirmation to copy them all
  • +
  • [ ] Display the not found figures
  • +
+ +
+
latexpath="$HOME/Cloud/thesis/latex/ressources/Figures";
+
+figures=`awk 'match($0, /(fig.*\.(png|svg|pdf))/, a) {print a[1];}' $1 \
+      | awk '{ print gensub(/\s*\]\]\s*\|\s*\[\[\s*\.?\/?/, "\n", "g") }'`;
+
+for figure in $figures
+do
+    figurename=`echo $figure | awk 'match($0, /(fig.*\/)(.*\.(png|svg|pdf))/, a) {print a[2];}'`;
+    if [ -f $latexpath/$figurename ]
+    then
+        figurepath=`echo $figure | awk 'match($0, /(fig.*)\/(.*\.(png|svg|pdf))/, a) {print a[1];}'`;
+
+        # echo $latexpath/$figurename
+        # echo $figurepath/$figurename
+        cp $latexpath/$figurename $figurepath/$figurename
+
+        # read -r -p "Are You Sure? [Y/n] " input
+
+        # case $input in
+        #     [yY][eE][sS]|[yY])
+        #         cp $latexpath/$figurename $figurepath/$figurename
+        #         ;;
+        #     [nN][oO]|[nN])
+        #         exit 1
+        #         ;;
+        #     *)
+        #         echo "Invalid input..."
+        #         exit 1
+        #         ;;
+        # esac
+    fi
+done
+
+
+
+
+ +
+

NAS

+
+
+
+

Mount

+
+
+
if [ $1 == "mount" ]; then
+    if sudo -A mount 192.168.1.2:/volume1/Downloads/ /mnt/NAS/; then
+        dunstify --replace=58249 'NAS' 'Successfully mounted'
+    else
+        dunstify --replace=58249 'NAS' 'Error while mounted'
+    fi
+elif [ $1 == "umount" ]; then
+    if sudo -A umount /mnt/NAS/; then
+        dunstify --replace=58249 'NAS' 'Successfully unmounted'
+    else
+        dunstify --replace=58249 'NAS' 'Error while unmounted'
+    fi
+fi
+
+
+
+
+
+
+

Buku Git Push

+
+
+
cd ~/.local/share/buku/
+
+if [[ ! -z $(git status -s bookmarks.db) ]]
+then
+    git add bookmarks.db
+    git commit -m "Changed bookmarks - $(date +%F)"
+    git push
+    dunstify --replace=79248 "Buku Git" "Updated"
+    exit
+fi
+
+
+
+
+
+

Icons Unicode

+
+
+
command -v xclip >/dev/null 2>&1 || { echo >&2 "I require xclip but it's not installed.  Aborting."; exit 1; }
+
+chosen=$(grep -v "#" ~/.config/emoji | dmenu -i -l 20)
+
+[ "$chosen" != "" ] || exit
+
+c=$(echo "$chosen" | sed "s/ .*//")
+echo "$c" | tr -d '\n' | xclip -selection clipboard
+dunstify --replace=05896 "'$c' copied to clipboard." &
+
+
+
+
+ +
+

Make GIF

+
+

+http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html +

+ +
+
palette="/tmp/palette.png"
+
+filters="fps=15,scale=320:-1:flags=lanczos"
+
+ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette
+ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2
+
+
+
+
+ +
+

Org-Capture

+
+
+
xclip -o -selection primary | xclip -o -selection clipboard -i
+emacsclient -ne '(org-capture "" "Q")' && dunstify "Emacs" "Text Successfully Captured"
+
+
+
+
+ +
+

Download-Audio

+
+
+
if [ $TMUX ]; then
+    tmux split -v -l 1 "cd ~/Downloads/ && youtube-dl --add-metadata -xic -f bestaudio/best $1" && tmux select-pane -U
+else
+    cd ~/Downloads/;
+    setsid nohup youtube-dl --add-metadata -xic -f bestaudio/best $1 &> /dev/null &
+fi
+
+
+
+
+ +
+

Download-Video

+
+
+
if [ $TMUX ]; then
+    tmux split -v -l 1 "cd ~/Downloads/ && youtube-dl --add-metadata -ic $1" && tmux select-pane -U
+else
+    cd ~/Downloads/;
+    setsid nohup youtube-dl --add-metadata -ic $1 &> /dev/null &
+fi
+
+
+
+
+
+

Org-Protocol-Capture-HTML

+
+

+Defaults +

+
+
heading="link"
+template="pu"
+url="https://google.com/"
+
+
+ +

+Functions +

+
+
function debug {
+    if [[ -n $debug ]]
+    then
+        function debug {
+            echo "DEBUG: $@" >&2
+        }
+        debug "$@"
+    else
+        function debug {
+            true
+        }
+    fi
+}
+function die {
+    echo "$@" >&2
+    exit 1
+}
+function urlencode {
+    python -c "
+from __future__ import print_function
+try:
+    from urllib import quote  # Python 2
+except ImportError:
+    from urllib.parse import quote  # Python 3
+import sys
+print(quote(sys.stdin.read()[:-1], safe=''))"
+}
+
+
+ +

+Documentation +

+
+
function usage {
+    cat <<EOF
+$0 [OPTIONS] [HTML]
+html | $0 [OPTIONS]
+Send HTML to Emacs through org-protocol, passing it through Pandoc to
+convert HTML to Org-mode.  HTML may be passed as an argument or
+through STDIN.  If only URL is given, it will be downloaded and its
+contents used.
+Options:
+    -h, --heading HEADING     Heading
+    -t, --template TEMPLATE   org-capture template key (default: pu)
+    -u, --url URL             URL
+    --debug  Print debug info
+    --help   I need somebody!
+EOF
+}
+
+
+ +

+Arguments +

+
+
args=$(getopt -n "$0" -o dh:rt:u: -l debug,help,heading:,template:,url: -- "$@") \
+    || die "Unable to parse args.  Is getopt installed?"
+eval set -- "$args"
+
+while true
+do
+    case "$1" in
+        -d|--debug)
+            debug=true
+            debug "Debugging on"
+            ;;
+        --help)
+            usage
+            exit
+            ;;
+        -h|--heading)
+            shift
+            heading="$1"
+            ;;
+        -t|--template)
+            shift
+            template="$1"
+            ;;
+        -u|--url)
+            shift
+            url="$1"
+            ;;
+        --)
+            # Remaining args
+            shift
+            rest=("$@")
+            break
+            ;;
+    esac
+
+    shift
+done
+
+debug "ARGS: $args"
+debug "Remaining args: ${rest[@]}"
+
+
+ +

+Get HTML +

+
+
if [[ -n $@ ]]
+then
+    debug "Text from args"
+
+    body="$@"
+fi
+
+
+ +

+URL-encode +

+
+
heading=$(urlencode <<<"$heading") || die "Unable to urlencode heading."
+url=$(urlencode <<<"$url") || die "Unable to urlencode URL."
+body=$(urlencode <<<"$body") || die "Unable to urlencode text."
+
+
+ +

+Send to Emacs +

+
+
emacsclient "org-protocol://capture?template=$template&url=$url&title=$heading&body=$body"
+
+
+
+
+
+

Pdf Shrink

+
+
+
shrink ()
+{
+gs \
+  -q -dNOPAUSE -dBATCH -dSAFER \
+  -sDEVICE=pdfwrite \
+  -dCompatibilityLevel=1.3 \
+  -dPDFSETTINGS=/screen \
+  -dEmbedAllFonts=true \
+  -dSubsetFonts=true \
+  -dAutoRotatePages=/None \
+  -dColorImageDownsampleType=/Bicubic \
+  -dColorImageResolution=$3 \
+  -dGrayImageDownsampleType=/Bicubic \
+  -dGrayImageResolution=$3 \
+  -dMonoImageDownsampleType=/Subsample \
+  -dMonoImageResolution=$3 \
+  -sOutputFile="$2" \
+  "$1"
+}
+
+check_smaller ()
+{
+# If $1 and $2 are regular files, we can compare file sizes to
+# see if we succeeded in shrinking. If not, we copy $1 over $2:
+if [ ! -f "$1" -o ! -f "$2" ]; then
+return 0;
+fi
+ISIZE="$(echo $(wc -c "$1") | cut -f1 -d\ )"
+OSIZE="$(echo $(wc -c "$2") | cut -f1 -d\ )"
+if [ "$ISIZE" -lt "$OSIZE" ]; then
+echo "Input smaller than output, doing straight copy" >&2
+cp "$1" "$2"
+fi
+}
+
+usage ()
+{
+echo "Reduces PDF filesize by lossy recompressing with Ghostscript."
+echo "Not guaranteed to succeed, but usually works."
+echo "  Usage: $1 infile [outfile] [resolution_in_dpi]"
+}
+
+IFILE="$1"
+
+# Need an input file:
+if [ -z "$IFILE" ]; then
+usage "$0"
+exit 1
+fi
+
+# Output filename defaults to "-" (stdout) unless given:
+if [ ! -z "$2" ]; then
+OFILE="$2"
+else
+OFILE="-"
+fi
+
+# Output resolution defaults to 72 unless given:
+if [ ! -z "$3" ]; then
+res="$3"
+else
+res="90"
+fi
+
+shrink "$IFILE" "$OFILE" "$res" || exit $?
+
+check_smaller "$IFILE" "$OFILE"
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/spacemacs.html b/docs/spacemacs.html new file mode 100644 index 0000000..325d645 --- /dev/null +++ b/docs/spacemacs.html @@ -0,0 +1,3992 @@ + + + + + + + + +Spacemacs configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Spacemacs configuration

+
+

Table of Contents

+
+ +
+
+ +

+Ressources: +

+ + +
+

User Init

+
+
+
+

Melpa

+
+
+
(add-to-list 'package-archives '("melpa" . "http://www.mirrorservice.org/sites/melpa.org/packages/"))
+
+
+
+
+ +
+

TODO Ispell

+
+

+https://emacs.stackexchange.com/questions/17237/in-emacs-where-is-ispells-personal-dictionary-stored +

+ +
+
(setq ispell-program-name "/usr/bin/aspell")
+;; (setq ispell-personal-dictionary "/home/thomas/.config/aspell/")
+
+
+
+
+ +
+

Org latex fragment

+
+
+
  (defvar tdh/org-latex-fragment-last nil
+    "Holds last fragment/environment you were on.")
+
+  (defun tdh/org-in-latex-fragment-p ()
+    "Return the point where the latex fragment begins, if inside
+  a latex fragment. Else return false"
+    (let* ((el (org-element-context))
+           (el-type (car el)))
+      (and (or (eq 'latex-fragment el-type) (eq 'latex-environment el-type))
+          (org-element-property :begin el))))
+
+  (defun tdh/org-latex-fragment-toggle ()
+    "Toggle a latex fragment image "
+    (and (eq 'org-mode major-mode)
+   (let ((begin (tdh/org-in-latex-fragment-p)))
+           (cond
+            ;; were on a fragment and now on a new fragment
+            ((and
+              ;; fragment we were on
+              tdh/org-latex-fragment-last
+              ;; and are on a fragment now
+              begin
+
+              ;; but not on the last one this is a little tricky. as you edit the
+              ;; fragment, it is not equal to the last one. We use the begin
+              ;; property which is less likely to change for the comparison.
+              (not (and tdh/org-latex-fragment-last
+      (= begin
+         tdh/org-latex-fragment-last))))
+             ;; go back to last one and put image back, provided there is still a fragment there
+             (save-excursion
+               (goto-char tdh/org-latex-fragment-last)
+               (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment))
+
+               ;; now remove current image
+               (goto-char begin)
+               (let ((ov (loop for ov in (org--list-latex-overlays)
+                               if
+                               (and
+r       (<= (overlay-start ov) (point))
+        (>= (overlay-end ov) (point)))
+                               return ov)))
+     (when ov
+                   (delete-overlay ov)))
+               ;; and save new fragment
+               (setq tdh/org-latex-fragment-last begin)))
+
+            ;; were on a fragment and now are not on a fragment
+            ((and
+              ;; not on a fragment now
+              (not begin)
+              ;; but we were on one
+              tdh/org-latex-fragment-last)
+             ;; put image back on, provided that there is still a fragment here.
+             (save-excursion
+               (goto-char tdh/org-latex-fragment-last)
+               (when (tdh/org-in-latex-fragment-p) (org-preview-latex-fragment)))
+
+             ;; unset last fragment
+             (setq tdh/org-latex-fragment-last nil))
+
+            ;; were not on a fragment, and now are
+            ((and
+              ;; we were not one one
+              (not tdh/org-latex-fragment-last)
+              ;; but now we are
+              begin)
+             ;; remove image
+             (save-excursion
+               (goto-char begin)
+               (let ((ov (loop for ov in (org--list-latex-overlays)
+                               if
+                               (and
+        (<= (overlay-start ov) (point))
+        (>= (overlay-end ov) (point)))
+                               return ov)))
+     (when ov
+                   (delete-overlay ov))))
+             (setq tdh/org-latex-fragment-last begin))))))
+
+
+
+
+ +
+

Default Browser

+
+
+
(setq browse-url-browser-function 'browse-url-generic
+      browse-url-generic-program "qutebrowser")
+
+
+
+
+
+ +
+

User-Config

+
+
+
+

Others

+
+
+
;; Line Wrapping
+(spacemacs/toggle-truncate-lines-on)
+
+;; Visual line navigation for textual modes
+(add-hook 'text-mode-hook 'spacemacs/toggle-visual-line-navigation-on)
+
+;; leader-q-q just kill the frame without killink the server
+(evil-leader/set-key
+  "q q" 'spacemacs/frame-killer)
+
+;; Remove current light highlight
+(spacemacs/toggle-highlight-current-line-globally-off)
+
+
+
+
+ +
+

Windows Management

+
+
+
(global-set-key (kbd "<C-up>") 'shrink-window)
+(global-set-key (kbd "<C-down>") 'enlarge-window)
+(global-set-key (kbd "<C-left>") 'shrink-window-horizontally)
+(global-set-key (kbd "<C-right>") 'enlarge-window-horizontally)
+
+
+
+
+ +
+

Lockfiles

+
+
+
(setq create-lockfiles nil)
+
+
+
+
+ +
+

Autosave

+
+
+
(setq backup-directory-alist `(("." . "~/.saves")))
+(setq backup-by-copying t)
+
+
+
+
+ +
+

Magit

+
+
+
(setenv "GIT_ASKPASS" "git-gui--askpass")
+
+(setq magit-diff-refine-hunk 'all)
+
+
+
+
+ +
+

User informations

+
+
+
;; Used to the \author for LaTeX export
+(setq user-full-name "Thomas Dehaeze")
+
+;; Used to set \email for LaTeX export
+(setq user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+

Change default alert backend

+
+
+
(setq alert-default-style 'libnotify)
+
+
+
+
+ +
+

LaTeX

+ + +
+

Basic LaTeX configuration

+
+
+
(defun latex/clean ()
+  "Clean LaTeX output using latexmk"
+  (interactive)
+  (async-shell-command
+   ;; command and parameters
+   "latexmk -c "
+   (shell-quote-argument buffer-file-name)
+   " &"
+  ))
+
+(evil-define-key 'normal LaTeX-mode-map (kbd ", C") 'latex/clean)
+
+(add-hook 'TeX-mode-hook #'TeX-fold-mode)
+
+
+
+
+ +
+

Master file

+
+
+
(setq-default TeX-master nil)
+
+
+
+
+ +
+

Pdf Viewer

+
+
+
(setq TeX-view-program-selection '((output-pdf "Zathura")))
+(setq TeX-source-correlate-mode t)
+(setq TeX-source-correlate-start-server t)
+(setq TeX-source-correlate-method 'synctex)
+(setq TeX-view-program-list
+      '(("PDF Tools" TeX-pdf-tools-sync-view)))
+
+
+
+
+
+ +
+

Helm-Bibtex

+
+
+
+

General Config

+
+
+
(with-eval-after-load 'helm-bibtex
+  ;; Use "tags" field when looking for bib entries
+  (setq helm-bibtex-additional-search-fields '(keywords))
+  ;; Special Tags:
+  ;; - favorite
+
+  ;; Reverse the order of display
+  ;; (advice-add 'bibtex-completion-candidates
+  ;;             :filter-return 'reverse)
+
+  ;; Display of bibtex entries with helm
+  (setq bibtex-completion-display-formats
+        '((t . "${author:36} ${title:*} ${year:4} ${=type=:7} ${=has-note=:1}")))
+
+  ;; Special symbols for notes and pdf
+  (setq bibtex-completion-pdf-symbol "⌘")
+  (setq bibtex-completion-notes-symbol "✎")
+
+  ;; Use file field to find the PDF
+  ;; (setq bibtex-completion-pdf-field "file")
+
+  ;; Bibliography file
+  (setq bibtex-completion-bibliography "~/Cloud/thesis/ressources/references.bib")
+
+  ;; Directory with all the pdfs
+  (setq bibtex-completion-library-path "~/Cloud/thesis/ressources/pdfs")
+
+  ;; Directory with notes files
+  (setq bibtex-completion-notes-path "~/Cloud/thesis/ressources/notes")
+
+  ;; Template used when creating new Note file
+  (setq bibtex-completion-notes-template-multiple-files (concat "#+TITLE: ${title}\n"
+                                                                ":DRAWER:\n"
+                                                                "#+LATEX_CLASS: biblioreport\n"
+                                                                "\n"
+                                                                "#+OPTIONS: toc:nil title:nil\n"
+                                                                "#+OPTIONS: ':t -:t\n"
+                                                                "\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refType}{${=type=}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refKey}{${=key=}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refTitle}{${title}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refAuthor}{${author-or-editor}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refJournal}{${journal}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refYear}{${year}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refDoi}{${DOI}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refUrl}{${url}}\n"
+                                                                "#+LATEX_HEADER: \\newcommand{\\refKeywords}{${keywords}}\n"
+                                                                "#+LATEX_HEADER: \\input{config.tex}\n"
+                                                                "#+LATEX_HEADER: \\graphicspath{{./figs/${=key=}/}}\n"
+                                                                "# #+TOC: headlines 2\n"
+                                                                ":END:\n"
+                                                                "\n"
+                                                                "#+BEGIN_abstract\n"
+                                                                "\n"
+                                                                "#+END_abstract\n"
+                                                                "\n"
+                                                                "* ${title} :ignore:\n"
+                                                                ":PROPERTIES:\n"
+                                                                ":CUSTOM_ID: ${=key=}\n"
+                                                                ":AUTHOR:    ${author}\n"
+                                                                ":TYPE:      ${=type=}\n"
+                                                                ":JOURNAL:   ${journal}\n"
+                                                                ":YEAR:      ${year}\n"
+                                                                ":VOLUME:    ${volume}\n"
+                                                                ":PAGES:     ${pages}\n"
+                                                                ":DOI:       ${DOI}\n"
+                                                                ":URL:       ${url}\n"
+                                                                ":NOTER_DOCUMENT: ../pdfs/${=key=}.pdf\n"
+                                                                ":END:\n"
+                                                                "\n"))
+
+  ;; Make "Edit notes" the default action
+  (helm-delete-action-from-source "Edit notes" helm-source-bibtex)
+  (helm-add-action-to-source "Edit notes" 'helm-bibtex-edit-notes helm-source-bibtex 0)
+  )
+
+
+
+
+ +
+

Open pdf externally

+
+
+
(with-eval-after-load 'helm-bibtex
+  (defun tdehaeze/open-pdf-externally (key)
+    (call-process "zathura" nil 0 nil (nth 0 (-cons-to-list (bibtex-completion-find-pdf key)))))
+
+  ;; Action to open the pdf with Zathura
+  (helm-delete-action-from-source "Open PDF Externally" helm-source-bibtex)
+  (helm-add-action-to-source "Open PDF Externally" 'tdehaeze/open-pdf-externally helm-source-bibtex 1)
+  )
+
+
+
+
+ +
+

Special Commands

+
+
+
(defun helm-bibtex-favorites (&optional arg)
+  "Search Favorite BibTeX entries"
+  (interactive "P")
+  (helm-bibtex arg nil "favorite "))
+
+
+
+
+ +
+

List all element of the bibliography without pdf associated

+
+
+
(defun list-bib-without-pdf-associated ()
+  (interactive)
+  (bibtex-completion-init)
+  (setq candidates (bibtex-completion-candidates))
+
+  (defun canditate-is-pdf-present (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)))
+                                     candidates-without-pdf))
+
+  (with-output-to-temp-buffer "*bib-without-pdf*" (princ (string-join candidate-without-pdf-names "\n")))
+  (switch-to-buffer-other-window "*bib-without-pdf*")
+  )
+
+
+
+
+
+ +
+

Auto Complete

+
+
+
(global-company-mode)
+
+
+
+
+ +
+

Yas Snippets

+
+
+
(setq yas-indent-line "fixed")
+
+
+
+
+ +
+

Org-Mode

+ + +
+

Org General Config

+
+
+
(with-eval-after-load 'org
+  (setq org-directory "~/Cloud/org/")
+  (setq org-default-notes-file "~/Cloud/org/refile.org")
+  ;; Highligh latex parts in org mode
+  (setq org-highlight-latex-and-related '(native))
+  ;; Disable automatic highlight of TODO keywords in orgmode buffers
+  (add-hook 'org-mode-hook (lambda () (hl-todo-mode -1)))
+  ;; The following setting hides blank lines between headings which keeps folded view nice and compact.
+  (setq org-cycle-separator-lines 0)
+  (setq org-startup-indented t)
+)
+
+
+
+
+ +
+

Org Tagging

+
+
+
(with-eval-after-load 'org
+  ;; Tags with fast selection keys
+  (setq org-tag-alist (quote (("@christophe" . ?c)
+                              ("@muriel" . ?m))))
+  )
+
+
+
+
+
+

Org Gcal

+
+ + +
+
(with-eval-after-load 'org
+  (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) ))
+  )
+
+
+
+
+ +
+

Org Refile

+
+
+
(with-eval-after-load 'org
+  (setq org-refile-targets '((org-agenda-files . (:maxlevel . 6))))
+)
+
+
+
+
+
+

Org Todos

+
+

+http://sachachua.com/blog/2014/04/thinking-todo-keywords/ +

+
+
(with-eval-after-load '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)" "|")
+                            ))
+
+  ;; 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
+  )
+
+
+
+
+ +
+

Archive subtrees under the same hierarchy as original in the archive files

+
+

+https://gist.github.com/Fuco1/e86fb5e0a5bb71ceafccedb5ca22fcfb +

+ +
+
(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)))
+                     1
+                   (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
+                       (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 ?*)
+                            " "
+                            heading
+                            "\n"))
+                  (cl-incf level)))
+              (widen)
+              (org-end-of-subtree t t)
+              (org-paste-subtree level tree-text))))))))
+
+
+
+
+ +
+

Org Agenda

+
+
+
+
General configuration
+
+
+
(with-eval-after-load 'org
+  ;; File to save todo items
+  (setq org-agenda-files (list "~/Cloud/org/" "~/.config/literate-dotfiles/dotfiles"))
+
+  ;; Include archived files
+  (setq org-agenda-archives-mode t)
+
+  ;; Set priority range from A to C with default A
+  (setq org-highest-priority ?A)
+  (setq org-lowest-priority ?C)
+  (setq org-default-priority ?C)
+
+  ;; Set colours for priorities
+  (setq org-priority-faces '((?A . (:foreground "#CC241D"))
+                             (?B . (:foreground "#D65D0E"))
+                             (?C . (:foreground "#D79921"))))
+
+  ;; Open agenda in current window
+  (setq org-agenda-window-setup 'current-window)
+
+  (setq org-agenda-prefix-format
+    '((agenda  . " %-12:c %?-12t% s")
+      (todo  . "") ;; Don't show the filename for reading agenda
+      (tags  . " %-12:c")
+      (search . " %-12:c"))
+  )
+)
+
+
+
+
+ +
+
Org Agenda Custom Views
+
+

+https://blog.aaronbieber.com/2016/09/24/an-agenda-for-life-with-org-mode.html +

+ +
+
(with-eval-after-load 'org
+  (defun tdh/org-agenda-skip-scheduled ()
+    (org-agenda-skip-entry-if 'scheduled 'deadline 'regexp "\n]+>"))
+
+  (setq org-agenda-custom-commands
+        '(("w" "Work" tags-todo "@work") ;; All todos related to work
+          ("h" "Home" tags-todo "@home") ;; All todos not related to work
+          ("q" . "Questions to ask")
+          ("qc" "Questions to Cristophe" tags "@christophe/QUES" ((org-agenda-overriding-header "Questions to Christophe")))
+          ("qm" "Questions to Muriel"    tags "@muriel/QUES"     ((org-agenda-overriding-header "Questions to Muriel")))
+          ("qo" "Questions to Olivier"   tags "@olivier/QUES"    ((org-agenda-overriding-header "Questions to Olivier")))
+          ("qq" "All questions"          tags "/QUES" ((org-agenda-overriding-header "Other questions")))
+          ("n" "Next things to do"
+           ((tags "+PRIORITY+\"A\""
+                  ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done))
+                   (org-agenda-overriding-header "High-priority unfinished tasks:")))
+            (agenda "")
+            (todo "NEXT" ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled)(org-agenda-overriding-header "Next thing to do that are not scheduled")))
+            (todo "MAIL" ((org-agenda-overriding-header "Email to write/reply")))
+            (todo "WAIT" ((org-agenda-overriding-header "Things Waiting")))))
+          ("u" "Unscheduled tasks" todo "TODO"
+           ((org-agenda-skip-function 'tdh/org-agenda-skip-scheduled)
+            (org-agenda-overriding-header "Unscheduled TODO entries: ")))
+          ("r" "Things to read"
+           ((todo "READ"   ((org-agenda-overriding-header "Things to read"))))
+           ((org-agenda-files '("~/Cloud/thesis/ressources/notes/")))))
+        )
+  )
+
+
+
+
+
+ +
+

Org Notification based on calendar event

+
+

+https://emacs.stackexchange.com/questions/3844/good-methods-for-setting-up-alarms-audio-visual-triggered-by-org-mode-events +

+ +
+
(with-eval-after-load 'org
+  (setq appt-message-warning-time 5)
+  (defun my-org-agenda-to-appt ()
+    (interactive)
+    (setq appt-time-msg-list nil)
+    (org-agenda-to-appt))
+
+  (my-org-agenda-to-appt)
+  ; Display appointments as a window manager notification
+  (setq appt-disp-window-function 'my-appt-display)
+  (setq appt-delete-window-function (lambda () t))
+
+  (setq my-appt-notification-app (concat (getenv "HOME") "/bin/appt-notification"))
+  (defun my-appt-display (min-to-app new-time msg)
+    (if (atom min-to-app)
+        (start-process "my-appt-notification-app" nil my-appt-notification-app min-to-app msg)
+        (dolist (i (number-sequence 0 (1- (length min-to-app))))
+        (start-process "my-appt-notification-app" nil my-appt-notification-app (nth i min-to-app) (nth i msg)))))
+  )
+
+
+
+ +
+
appt-notification script
+
+
+
TIME="$1"TODO
+MSG="$2"
+
+dunstify --replace=85401 "Event in $TIME minutes" "$MSG"
+
+
+
+
+
+ +
+

Org Structure Template

+
+
+
(with-eval-after-load 'org
+  (setq org-structure-template-alist
+        '(("c" . "center")
+          ("C" . "comment")
+          ("i" . "important")
+          ("e" . "example")
+          ("q" . "quote")
+          ("s" . "src"))
+  )
+)
+
+
+
+
+ +
+

Org Capture

+
+

+Documentation: +

+ + +
+
(with-eval-after-load 'org
+  (setq org-capture-templates
+        (quote (("t"    ; key
+                 "todo" ; name
+                 entry  ; type
+                 (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
+                 "** %?\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n" ; template
+                 )
+                ("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
+                 )
+                ("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"
+                 :immediate-finish t
+                )
+                ("pu"
+                 "Org-Protocol Url"
+                 entry
+                 (file+headline "~/Cloud/org/work-notebook.org" "Inbox")
+                 "* [[%:link][%:description]]\nCaptured On: %U\n\n"
+                 :immediate-finish t
+                )
+                ("pt"
+                 "Org-Protocol text"
+                 entry
+                 (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
+                 )
+                )))
+  )
+
+
+
+
+ +
+

Org Babel

+
+
+
+
Main configuration
+
+
+
(with-eval-after-load 'org
+  ;; Don't ask for confirmation when evalutating latex blocs
+  (defun my-org-confirm-babel-evaluate (lang body)
+    (not (member lang '("emacs-lisp" "latex" "matlab" "sh"))))
+  (setq org-confirm-babel-evaluate 'my-org-confirm-babel-evaluate)
+
+  ;; Enable Babel evalutation
+  (org-babel-do-load-languages 'org-babel-load-languages '((latex . t)
+                                                           (shell . t)
+                                                           (matlab . t)
+                                                           (python . t)
+                                                           (emacs-lisp . t)))
+  )
+
+
+
+
+ +
+
Library of Babel
+
+
+
(with-eval-after-load 'org
+  (org-babel-lob-ingest "~/Cloud/thesis/org-mode/org-babel-tutorial/org-babel-library.org")
+)
+
+
+
+
+ +
+
Org-Babel Matlab
+
+
+
(with-eval-after-load 'org
+  (setq org-babel-matlab-shell-command "/home/thomas/bin/matlab -nodesktop -nosplash")
+
+  (setq org-babel-matlab-emacs-link-wrapper-method
+    "%s
+    if ischar(ans);
+      echo('test');
+      fid = fopen('%s', 'w');
+      fprintf(fid, '%s', ans);
+      fclose(fid);
+    else;
+      save -ascii %s ans;
+    end
+    delete('%s');
+    ")
+  )
+
+
+
+
+ +
+
Default options
+
+
+
(setq org-babel-default-header-args:matlab
+      '((:results . "none")
+        (:session . "*MATLAB*")
+        (:comments . "org")
+        (:exports . "both")
+        (:cache .   "no")
+        (:noweb . "no")
+        (:hlines . "no")
+        (:tangle . "no")
+        (:mkdir . "yes")
+        (:eval . "no-export")))
+
+
+
+
+ +
+
TODO Asynchronous execution
+
+
+
(push "~/.emacs.d/private/ob-session-async/lisp/" load-path)
+(require 'ob-session-async)
+
+
+ +
+
;; (with-eval-after-load "ob"
+;;   (require 'org-babel-eval-in-repl))
+
+
+ +
+
;; (with-eval-after-load "eval-in-repl"
+;;   (setq eir-jump-after-eval nil))
+
+
+
+
+ +
+
TODO Theme
+
+
+
(with-eval-after-load 'org
+  (require 'color)
+  (set-face-attribute 'org-block nil :background (color-darken-name (face-attribute 'default :background) 3))
+  )
+
+
+
+
+ +
+
Indentation
+
+
+
(with-eval-after-load 'org
+  (setq org-edit-src-content-indentation 2
+        org-src-tab-acts-natively nil
+        org-src-preserve-indentation nil)
+  )
+
+
+
+
+ +
+
Org-Babel Tangle Subtree
+
+
+
(defun tdh/org-babel-tangle-subtree ()
+  "Tangle the current subtree"
+  (interactive)
+  (progn
+    (org-narrow-to-subtree)
+    (org-babel-tangle)
+    (widen))
+  )
+
+(evil-define-key 'normal org-mode-map (kbd ", b T") 'tdh/org-babel-tangle-subtree)
+
+
+
+
+ +
+
TODO Org-Babel Jump to Tangle File
+
+

+Actually this tangle the file and then go to the file. Maybe I would like to ignore the tangling phase. +

+ +
+
(defun tdh/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)))
+  (when file
+    (setq file (expand-file-name file))
+    (if (file-readable-p file)
+    (find-file file)
+  (error "Cannot open tangle file %S" file)))))
+
+(evil-define-key 'normal org-mode-map (kbd ", b F") 'tdh/org-babel-jump-to-tangle-file)
+
+
+
+
+
+ +
+

Org Export

+
+
+
+
Basic
+
+
+
(with-eval-after-load 'org
+  ;; How many levels of headline to export
+  (setq org-export-headline-levels 4)
+
+  ;; Authorize BIND to set local variables
+  (setq org-export-allow-bind-keywords t)
+
+  (setq org-odt-preferred-output-format "doc")
+
+  ;; Used to not export headings with :ignore: tag
+  (require 'ox-extra)
+  (ox-extras-activate '(ignore-headlines))
+)
+
+
+
+
+ +
+
Ox Latex Subfigure package
+
+
+
(use-package ox-latex-subfigure
+  :config (require 'ox-latex-subfigure)
+)
+
+
+
+
+ +
+
Clear page before heading
+
+

+https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-heading/30892 +

+ +
+
(with-eval-after-load 'org
+  (with-eval-after-load 'ox-latex
+    (defun org/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))))
+
+    (defun org/ensure-latex-clearpage (headline backend info)
+      (when (org-export-derived-backend-p backend 'latex)
+        (let ((elmnt (org/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
+                 'org/ensure-latex-clearpage)
+    )
+)
+
+
+
+
+ +
+
TODO HTML Export
+
+
+
    +
  • MathJax
    +
    +
    +
    (setq org-html-mathjax-template
    +  "<script type=\"text/x-mathjax-config\">
    +    MathJax.Hub.Config({
    +        displayAlign: \"%ALIGN\",
    +        displayIndent: \"%INDENT\",
    +
    +        \"HTML-CSS\": { scale: %SCALE,
    +                        linebreaks: { automatic: \"%LINEBREAKS\" },
    +                        webFont: \"%FONT\"
    +                       },
    +        SVG: {scale: %SCALE,
    +              linebreaks: { automatic: \"%LINEBREAKS\" },
    +              font: \"%FONT\"},
    +        NativeMML: {scale: %SCALE},
    +        TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
    +               MultLineWidth: \"%MULTLINEWIDTH\",
    +               TagSide: \"%TAGSIDE\",
    +               TagIndent: \"%TAGINDENT\",
    +               Macros: {
    +                 bm: [\"{\\\\boldsymbol #1}\",1],
    +               }
    +             }
    +});
    +</script>
    +<script type=\"text/javascript\"
    +        src=\"%PATH\"></script>")
    +
    +
    +
    +
  • + +
  • Export with css class instead of inline css
    +
    +
    +
    (with-eval-after-load 'org
    +  (setq org-html-htmlize-output-type 'css)
    +  )
    +
    +
    +
    +
  • + +
  • TODO MP4 movies
    +
    +
    +
    (with-eval-after-load 'org
    +  (setq org-html-html5-fancy t)
    +  (setq org-html-doctype "xhtml-strict")
    +  )
    +
    +
    +
    +
  • + +
  • TODO MathJax with SIunix
    +
    +
    +
    (with-eval-after-load 'org
    +  (setq org-html-mathjax-template
    +        "<script type=\"text/x-mathjax-config\">
    +      MathJax.Hub.Config({
    +          extensions: [\"tex2jax.js\", \"[siunitx]/siunitx.js\"],
    +          jax: [\"input/TeX\",\"output/HTML-CSS\"],
    +          tex2jax: {inlineMath: [[\"$\",\"$\"],[\"\\(\",\"\\)\"]]},
    +          displayAlign: \"%ALIGN\",
    +          displayIndent: \"%INDENT\",
    +
    +          \"HTML-CSS\": { scale: %SCALE,
    +                          linebreaks: { automatic: \"%LINEBREAKS\" },
    +                          webFont: \"%FONT\"
    +                         },
    +          SVG: {scale: %SCALE,
    +                linebreaks: { automatic: \"%LINEBREAKS\" },
    +                font: \"%FONT\"},
    +          NativeMML: {scale: %SCALE},
    +          TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
    +                 extensions: [\"AMSmath.js\",\"AMSsymbols.js\", \"sinuitx.js\"],
    +                 MultLineWidth: \"%MULTLINEWIDTH\",
    +                 TagSide: \"%TAGSIDE\",
    +                 TagIndent: \"%TAGINDENT\"
    +               }
    +  });
    +  MathJax.Ajax.config.path['siunitx']  = '../js';
    +  </script>
    +  <script type=\"text/javascript\"
    +          src=\"%PATH\"></script>"
    +        )
    +  )
    +
    +
    +
    +
  • +
+
+
+ +
+

Org LaTeX

+
+
+
+
Org CdLatex
+
+

+https://orgmode.org/manual/CDLaTeX-mode.html#CDLaTeX-mode +

+
+
(with-eval-after-load 'org
+  (push "~/.spacemacs.d/local/" load-path)
+  (require 'cdlatex)
+  (add-hook 'org-mode-hook 'turn-on-org-cdlatex))
+
+
+
+
+ +
+
LaTeX Classes
+
+
+
(with-eval-after-load 'org
+  (with-eval-after-load 'ox-latex
+    ;; Custom classes to use when exporting to latex
+    (add-to-list 'org-latex-classes
+              `("beamer"
+                ,(concat "\\documentclass[presentation]{beamer}\n"
+                         "[DEFAULT-PACKAGES]"
+                         "[PACKAGES]"
+                         "[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}"))
+                 )
+    (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}"))
+                 )
+    (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}"))
+                 )
+    (add-to-list 'org-latex-classes
+                 '("scrreprt"
+                   "\\documentclass{scrreprt}"
+                   ("\\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}"))
+                 )
+    )
+  )
+
+
+
+
+ +
+
Basic
+
+
+
(with-eval-after-load 'org
+  (with-eval-after-load 'ox-latex
+    ;; Add packages by default
+    (add-to-list 'org-latex-packages-alist '("" "siunitx" t))
+    (add-to-list 'org-latex-packages-alist '("" "array" t))
+    (add-to-list 'org-latex-packages-alist '("" "tabularx" t))
+    (add-to-list 'org-latex-packages-alist '("" "booktabs" t))
+    (add-to-list 'org-latex-packages-alist '("" "bm" t))
+    (add-to-list 'org-latex-packages-alist '("most" "tcolorbox" t))
+
+    ;; Setup default option for image size when exporting to LaTeX
+    (setq org-latex-image-default-option "scale=1")
+    (setq org-latex-image-default-width nil)
+
+    ;; Use define labels instead of automatic generated ones
+    (setq org-latex-prefer-user-labels t)
+
+    ;; Captions above the table
+    (setq org-latex-caption-above '(table))
+
+    ;; Settings to export code with `minted' instead of `verbatim'.
+    (setq org-latex-listings 'minted)
+
+    ;; Command used when exporting to pdf
+    (setq org-latex-pdf-process
+          '("latexmk -cd -pdflatex=\"pdflatex -synctex=1 -shell-escape -interaction nonstopmode -output-directory %o\" -pdf -bibtex -f %f"))
+    )
+  )
+
+
+
+
+ +
+
Beamer
+
+
+
    +
  • Bold Text
    +
    +
    +
    (defun my-beamer-bold (contents backend info)
    +  (when (eq backend 'beamer)
    +    (replace-regexp-in-string "\\`\\\\[A-Za-z0-9]+" "\\\\textbf" contents)))
    +
    +(add-to-list 'org-export-filter-bold-functions 'my-beamer-bold)
    +
    +
    +
    +
  • + +
  • TODO Make a custom environment for columns with title
    +
    +
    +
  • + +
  • TODO Custom Environments
    +
    +
      +
    • [ ] Make some comment those special environments
    • +
    + +
    +
    (with-eval-after-load 'org
    +  (with-eval-after-load 'ox-beamer
    +    (add-to-list 'org-beamer-environments-extra
    +                 '("cbox" ;; Name of environment
    +                   "m" ;; Selection key
    +                   "\\onslide%a{\\begin{cbox}[%h]%O"
    +                   "\\end{cbox}}\\vspace{0.5em}"))
    +    (add-to-list 'org-beamer-environments-extra
    +                 '("csubbox" ;; Name of environment
    +                   "M" ;; Selection key
    +                   "\\onslide%a{\\tcbsubtitle{%h}"
    +                   "}"))
    +    )
    +  )
    +
    +
    +
    +
  • +
+
+ +
+
TODO Latex Fragments
+
+
    +
  • [ ] The remove hook does not seems to work
  • +
+ +
+
(with-eval-after-load 'org
+  (with-eval-after-load 'ox-latex
+    ;; Automatic toggle of latex fragments http://slumpy.org/blog/2017-02-01-automatic-latex-preview-in-org-mode/
+    ;; Activate Automatic LaTeX fragment
+    (spacemacs/set-leader-keys "ol" '(lambda () (interactive) (add-hook 'post-command-hook 'tdh/org-latex-fragment-toggle t)))
+    ;; Disable Automatic LaTeX fragment
+    (spacemacs/set-leader-keys "oL" '(lambda () (interactive) (remove-hook 'post-command-hook 'tdh/org-latex-fragment-toggle)))
+
+    ;; Use F9 to globally generate all the latex fragments
+    (global-set-key (kbd "<f9>") (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 ("latex" "convert")
+                                             :description "pdf > png"
+                                             :message "you need to install the programs: latex and imagemagick."
+                                             :image-input-type "pdf"
+                                             :image-output-type "png"
+                                             :image-size-adjust (0.6 . 0.6)
+                                             :latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f")
+                                             :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O"))
+                                            (pdf2svg
+                                             :programs ("latex" "pdf2svg")
+                                             :description "pdf > svg"
+                                             :message "you need to install the programs: pdflatex and pdf2svg."
+                                             :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 && pdftocairo -svg %f %O"))
+                                             ;; :image-converter ("pdf2svg %f %O"))
+                                            (dvisvgm
+                                             :programs ("latex" "dvisvgm")
+                                             :description "dvi > svg"
+                                             :message "you need to install the programs: latex and dvisvgm."
+                                             :image-input-type "dvi"
+                                             :image-output-type "svg"
+                                             :image-size-adjust (1.0 . 1.0)
+                                             :latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
+                                             :image-converter ("dvisvgm %f -n -b min -c %S -o %O"))
+                                            ))
+
+    ;; Use imagemagick/dvisvgm to generate png from pdf
+    (setq org-preview-latex-default-process 'dvisvgm)
+    ))
+
+
+
+
+ +
+
TODO Custom Export - Add Page and Label for LaTeX export
+
+

+https://emacs.stackexchange.com/questions/156/emacs-function-to-convert-an-arbitrary-org-property-into-an-arbitrary-string-na?rq=1 +

+ +
+
(with-eval-after-load 'org
+  (defcustom tdehaeze/org-property-mapping
+    '((latex ("CUSTOM_PAGE" . tdehaeze/insert-org-page-latex)
+             ("CUSTOM_LABEL" . tdehaeze/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)))))
+  )
+
+
+ +
+
(with-eval-after-load 'org
+  (defun tdehaeze/replace-org-property (backend)
+    "Convert org properties using `tdehaeze/org-property-mapping'.
+  Lookup BACKEND in `tdehaeze/org-property-mapping' for a list of
+  (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 tdehaeze/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)))))))))
+
+  (add-hook 'org-export-before-processing-hook #'tdehaeze/replace-org-property)
+  )
+
+
+ +
+
(with-eval-after-load 'org
+  (defun tdehaeze/insert-org-label-latex (label)
+    "Insert \"\\\\label{LABEL}\\n\" after the :PROPERTY: drawer."
+    (search-forward-regexp org-property-end-re)
+    (forward-char 1)
+    (insert (format "\\label{%s}\n" label)))
+  (defun tdehaeze/insert-org-page-latex (page)
+    "Insert \"\\\\page{PAGE}\\n\" after the :PROPERTY: drawer."
+    (search-forward-regexp org-property-end-re)
+    (forward-char 1)
+    (insert (format "\\page{%s}\n" page)))
+  )
+
+
+ +
+
(with-eval-after-load 'org
+  (defun org-latex-format-headline-default-function (todo _todo-type priority text tags _info)
+    "Default format function for a headline.
+     See `org-latex-format-headline-function' for details."
+    (concat
+     (and todo (format "{\\bfseries\\sffamily %s} " todo))
+     (and priority (format "\\framebox{\\#%c} " priority))
+     text
+     (and tags
+          (format "\\hfill{}\\textsc{%s}"
+                  (mapconcat #'org-latex--protect-text tags ":")))
+     (and todo (format "{\n\\page{%s} " todo)))
+  )
+
+
+
+
+ +
+
Number Equations
+
+
+
(defun org-renumber-environment (orig-func &rest args)
+  "A function to inject numbers in LaTeX fragment previews."
+  (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))))
+      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))
+            ;; \\ is used for a new line. Each one leads to a number
+            (incf counter (count-matches "\\\\$"))
+            ;; unless there are nonumbers.
+            (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)))))
+
+  (apply orig-func args))
+
+(advice-add 'org-create-formula-image :around #'org-renumber-environment)
+
+
+
+
+
+ +
+

TODO View PDF in org mode

+
+
+
(defun tdh/org-include-img-from-pdf (&rest _)
+  "Convert pdf files to image files in org-mode bracket links.
+    # ()convertfrompdf:t # This is a special comment; tells that the upcoming
+                         # link points to the to-be-converted-to file.
+    # If you have a foo.pdf that you need to convert to foo.png, use the
+    # foo.png file name in the link.
+    [[./foo.png]]
+"
+  (interactive)
+  (if (executable-find "convert")
+      (save-excursion
+        (goto-char (point-min))
+        (while (re-search-forward "^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"
+                                  nil :noerror)
+          ;; Keep on going to the next line till it finds a line with bracketed
+          ;; file link.
+          (while (progn
+                   (forward-line 1)
+                   (not (looking-at org-bracket-link-regexp))))
+          ;; Get the sub-group 1 match, the link, from `org-bracket-link-regexp'
+          (let ((link (match-string-no-properties 1)))
+            (when (stringp link)
+              (let* ((imgfile (expand-file-name (file-name-sans-extension link)))
+                     (pdffile (expand-file-name
+                               (concat imgfile
+                                       "." "pdf")))
+                     (cmd (concat "pdftocairo -png -transp -singlefile "
+                                  pdffile " " imgfile)))
+
+                (message "%s" imgfile)
+                (when (and (file-readable-p pdffile)
+                           (file-newer-than-file-p pdffile imgfile))
+                  ;; This block is executed only if pdffile is newer than
+                  ;; imgfile or if imgfile does not exist.
+                  (shell-command cmd)
+                  (message "%s" cmd)))))))
+    (user-error "`convert' executable (part of Imagemagick) is not found")))
+  (add-hook 'org-export-before-processing-hook #'tdh/org-include-img-from-pdf)
+
+
+ +
+
(add-to-list 'image-type-file-name-regexps '("\\.pdf\\'" . imagemagick))
+(add-to-list 'image-file-name-extensions "pdf")
+(setq imagemagick-types-inhibit (remove 'PDF imagemagick-types-inhibit))
+(setq org-image-actual-width 600)
+
+
+ +
+
(defun my-latex-filter-nobreaks (text backend info)
+  "Ensure \" \" are properly handled in LaTeX export."
+  (when (org-export-derived-backend-p backend 'latex)
+    (replace-regexp-in-string " " "~" text)))
+
+(add-to-list 'org-export-filter-plain-text-functions
+            'my-latex-filter-nobreaks)
+
+
+ +
+
(setq image-file-name-extensions
+   (quote
+    ("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg" "pdf" "bmp")))
+
+(setq org-image-actual-width 600)
+
+(setq org-imagemagick-display-command "convert -density 600 \"%s\" -thumbnail \"%sx%s>\" \"%s\"")
+(defun org-display-inline-images (&optional include-linked refresh beg end)
+  "Display inline images.
+Normally only links without a description part are inlined, because this
+is how it will work for export.  When INCLUDE-LINKED is set, also links
+with a description part will be inlined.  This
+can be nice for a quick
+look at those images, but it does not reflect what exported files will look
+like.
+When REFRESH is set, refresh existing images between BEG and END.
+This will create new image displays only if necessary.
+BEG and END default to the buffer boundaries."
+  (interactive "P")
+  (unless refresh
+    (org-remove-inline-images)
+    (if (fboundp 'clear-image-cache) (clear-image-cache)))
+  (save-excursion
+    (save-restriction
+      (widen)
+      (setq beg (or beg (point-min)) end (or end (point-max)))
+      (goto-char beg)
+      (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
+                        (substring (org-image-file-name-regexp) 0 -2)
+                        "\\)\\]" (if include-linked "" "\\]")))
+            old file ov img)
+        (while (re-search-forward re end t)
+          (setq old (get-char-property-and-overlay (match-beginning 1)
+                                                   'org-image-overlay)
+        file (expand-file-name
+                      (concat (or (match-string 3) "") (match-string 4))))
+          (when (file-exists-p file)
+            (let ((file-thumb (format "%s%s_thumb.png" (file-name-directory file) (file-name-base file))))
+              (if (file-exists-p file-thumb)
+                  (let ((thumb-time (nth 5 (file-attributes file-thumb 'string)))
+                        (file-time (nth 5 (file-attributes file 'string))))
+                    (if (time-less-p thumb-time file-time)
+            (shell-command (format org-imagemagick-display-command
+                           file org-image-actual-width org-image-actual-width file-thumb) nil nil)))
+                (shell-command (format org-imagemagick-display-command
+                                         file org-image-actual-width org-image-actual-width file-thumb) nil nil))
+              (if (and (car-safe old) refresh)
+                  (image-refresh (overlay-get (cdr old) 'display))
+                (setq img (save-match-data (create-image file-thumb)))
+                (when img
+                  (setq ov (make-overlay (match-beginning 0) (match-end 0)))
+                  (overlay-put ov 'display img)
+                  (overlay-put ov 'face 'default)
+                  (overlay-put ov 'org-image-overlay t)
+                  (overlay-put ov 'modification-hooks
+                               (list 'org-display-inline-remove-overlay))
+                  (push ov org-inline-image-overlays))))))))))
+
+
+ +

+Two options: +

+
    +
  • work with .png file extension and only replace with .pdf when exporting to LaTeX if the corresponding file exists
  • +
  • work with .pdf file, add a special function to display .pdf files (using convert or pdftocairo). Change to .png when exporting to html
  • +
+ +

+Let’s try the first solution. +

+ +
+
(defun tdh/change-png-to-pdf (text backend info)
+  "Change png images to pdf images when existing"
+  (when (org-export-derived-backend-p backend 'latex)
+    (let ((text (replace-regexp-in-string "[^\\w]\\(:\\)[^\n\t\r]+\\(:\\)[^\\w]" "<mark>"  text nil nil 1 nil)))
+      (replace-regexp-in-string "[^\\w]\\(<mark>\\)[^\n\t\r]+\\(:\\)[^\\w]" "</mark>" text nil nil 2 nil))))
+
+(add-to-list 'org-export-filter-plain-text-fucntions 'my-html-mark-tag)
+
+
+ +
+
(save-excursion
+        (goto-char (point-min))
+        (while (re-search-forward "^[ \t]*#\\s-+()convertfrompdf\\s-*:\\s-*t"
+                                  nil :noerror)
+          ;; Keep on going to the next line till it finds a line with bracketed
+          ;; file link.
+          (while (progn
+                   (forward-line 1)
+                   (not (looking-at org-bracket-link-regexp))))
+          ;; Get the sub-group 1 match, the link, from `org-bracket-link-regexp'
+          (let ((link (match-string-no-properties 1)))
+            (when (stringp link)
+              (let* ((imgfile (expand-file-name link))
+                     (pdffile (expand-file-name
+                               (concat (file-name-sans-extension imgfile)
+                                       "." "pdf")))
+                     (cmd (concat "convert -density 96 -quality 85 "
+                                  pdffile " " imgfile)))
+                (when (and (file-readable-p pdffile)
+                           (file-newer-than-file-p pdffile imgfile))
+                  ;; This block is executed only if pdffile is newer than
+                  ;; imgfile or if imgfile does not exist.
+                  (shell-command cmd)
+                  (message "%s" cmd)))))))
+
+
+
+
+ + +
+

Org Ref

+
+

+Ressources: +

+ + +
+
(with-eval-after-load 'org
+  ;; Folder where the notes files are located (or file if just one Note file)
+  (setq org-ref-notes-directory "~/Cloud/thesis/ressources/notes")
+  (setq org-ref-bibliography-notes "~/Cloud/thesis/ressources/notes")
+
+  ;; Bibliography File
+  (setq reftex-default-bibliography  '("~/Cloud/thesis/ressources/references.bib"))
+  (setq org-ref-default-bibliography '("~/Cloud/thesis/ressources/references.bib"))
+
+  ;; Folder where all the pdf are located
+  (setq org-ref-pdf-directory "~/Cloud/thesis/ressources/pdfs")
+
+  ;; 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)))))))
+
+  ;; Problem with speed: don't display broken links
+  (setq org-ref-show-broken-links nil)
+  ;; Display information on the citation
+  (setq org-ref-show-citation-on-enter t)
+  )
+
+
+
+
+ +
+

Org Noter

+
+ + +
+
(with-eval-after-load 'org
+  (setq org-noter-always-create-frame nil)
+  (setq org-noter-kill-frame-at-session-end nil)
+  ;; Fraction of the frame that the document window will occupy when split
+  (setq org-noter-doc-split-fraction '(0.6 . 0.6))
+  ;; Save the last visited location automatically; when starting a new session, go to that location
+  (setq org-noter-auto-save-last-location t)
+  ;; Add an empty line between each note's heading and content
+  (setq org-noter-separate-notes-from-heading t)
+  ;; List of paths to check (non recursively) when searching for a notes file
+  (setq org-noter-notes-search-path "~/Cloud/thesis/ressources/notes")
+)
+
+
+
+
+ +
+

Custom key bindings

+
+

+Export to LaTeX +

+
+
(evil-define-key 'normal org-mode-map (kbd ", l") 'org-latex-export-to-latex)
+
+
+ +

+Open pdf externally. +

+
+
(defun tdh/open-org-pdf-externally ()
+  (interactive)
+  (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".pdf"))
+  )
+
+(evil-define-key 'normal org-mode-map (kbd ", v p") 'tdh/open-org-pdf-externally)
+
+
+ +

+Open HTML externally. +

+
+
(defun tdh/open-org-html-externally ()
+  (interactive)
+  (call-process "xdg-open" nil 0 nil (concat (file-name-sans-extension (buffer-file-name)) ".html"))
+  )
+
+(evil-define-key 'normal org-mode-map (kbd ", v h") 'tdh/open-org-html-externally)
+
+
+
+
+ +
+

TODO Org-Contacts

+
+
+
(with-eval-after-load 'org
+  (setq org-contacts-files (list "~/Cloud/org/contacts.org"))
+)
+
+
+
+
+ +
+

TODO Org-Wunderlist

+
+
+
(require 'org-wunderlist)
+(setq org-wunderlist-client-id "6799d9caeb2f5d8bd641"
+      org-wunderlist-token "fd5965cde436c2587850a7c517d366561d8a1cbf7b6d96ab62f3fc8c9930"
+      org-wunderlist-file "~/Cloud/thesis/todos/wunderlist.org"
+      org-wunderlist-dir "~/.emacs.d/org-wunderlist/")
+
+
+
+
+ +
+

TODO ox-hugo

+
+
+

Automatically run startblock when opening org-mode files

+
+
+
(with-eval-after-load '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))
+      nil
+      )
+    )
+
+  (add-hook 'org-mode-hook 'tdh/eval-startblock)
+)
+
+
+
+
+ +
+

TODO Insert ScreenShot or Picture from Phone

+
+

+http://pragmaticemacs.com/emacs/a-workflow-to-quickly-add-photos-to-org-mode-notes/ +

+ +
    +
  • [ ] One function to move file from ~/Picture/ folder (where the screenshots are taken) to current directory and then insert and org link to the picture. Maybe ask if it should be copied in a sub directory (figs folder for instance).
  • +
  • [ ] One function to copy file from ~/Cloud/Photos/ folder (where the pictures from phone are taken) to current directory (and ask for the new name of the picture) and insert org link.
  • +
+ +
+
;; required libraries
+(require 'dash)
+;; (require 'swiper)
+(require 's)
+
+;; start directory
+(defvar tdh/image-dir (expand-file-name "/home/thomas/Pictures"))
+
+(defun tdh/insert-conference-image ()
+  "Insert image from conference directory, rename and add link in current file.
+
+The file is taken from a start directory set by `tdh/image-dir' and moved to the current directory, renamed and embedded at the point as an org-mode link. The user is presented with a list of files in the start directory, from which to select the file to move, sorted by most recent first."
+  (interactive)
+  (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)))
+
+    ;; Get target directory
+    (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))))))
+
+    ;; Use ivy to select start-file
+    (setq start-file (ivy-read
+                      (concat "Move selected file to " target-dir ":")
+                      file-list-sorted
+                      :re-builder #'ivy--regex
+                      :sort 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))
+
+    ;; final file name including path
+    (setq end-file-full
+          (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)))
+
+    ;; display image
+    (org-display-inline-images t t)))
+
+
+
+
+ +
+

TODO Render Tables

+
+

+https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/ +

+ +
+
(defun my-render-org-table-at-point ()
+  (interactive)
+  (save-excursion
+    (beginning-of-line)
+    ;; removes the overlay is already there
+    (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")
+
+          (while (not (eq 'table (org-element-type (org-element-at-point))))
+            (forward-line -1))
+          (my-render-org-table (org-element-at-point))
+          )))))
+
+
+(defun my-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)
+                ;; 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))
+    )
+
+
+(defun my-render-org-tables-in-buffer ()
+  (save-excursion
+    (org-element-map (org-element-parse-buffer) 'table 'my-render-org-table)))
+
+  ;; Use F9 to globally generate tables
+  (global-set-key (kbd "<f8>") (lambda () (interactive) (my-render-org-table-at-point)))
+
+
+
+
+
+ + +
+

Projectile

+
+
+
(setq projectile-generic-command "fd -H --ignore-file .projectile -t f -0")
+
+
+
+
+ +
+

TODO Matlab

+ + +
+

TODO Test with Org Babel

+
+
+
(let* ((session
+  (funcall (intern "org-babel-matlab-initiate-session")
+     "*MATLAB*" params))
+  (result (org-babel-octave-evaluate session "ls" "output"))))
+
+
+
+
+ +
+

Setup Matlab Mode

+
+
+
(setq matlab-shell-command "/home/thomas/bin/matlab")
+(setq matlab-shell-command-switches (list "-nodesktop -nosplash"))
+(setq mlint-programs '("mlint" "/home/thomas/bin/mlint"))
+
+
+
+
+ +
+

Setup Flycheck

+
+
+
(defvar mlint-executable "/home/thomas/bin/mlint")
+
+(flycheck-define-command-checker 'matlab-mlint
+  "A Matlab checker based on mlint."
+  :command `(,mlint-executable source)
+  :error-patterns
+  '((warning line-start "L " line " (C " (1+ digit)  "): " (message) line-end))
+  :modes '(matlab-mode))
+
+(add-to-list 'flycheck-checkers 'matlab-mlint)
+
+;; Automatic startup of flycheck for matlab
+(add-hook 'matlab-mode-hook 'flycheck-mode)
+
+
+ +
+
(defadvice org-edit-src-code (around set-buffer-file-name activate compile)
+  (let ((file-name (buffer-file-name))) ;; (1)
+    ad-do-it                            ;; (2)
+    (setq buffer-file-name file-name))) ;; (3)
+
+
+
+
+ +
+

TODO Setup Company - not working

+
+
+
;; (add-to-list 'company-backends 'company-matlab)
+
+
+
+
+ +
+

TODO Beautify code

+
+
+
(defun matlab-beautify-buffer ()
+  "Beautify Current Buffer"
+  (interactive)
+  (save-buffer)
+  (matlab-shell-run-command (concat "MBeautify.formatFile(\"" (buffer-file-name) "\")"))
+)
+
+;; (global-set-key [C-f1] 'show-file-name)
+
+
+
+
+ +
+

Key Bindings

+
+
+
(defun matlab-add-breakpoint ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbstop in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
+(defun matlab-remove-breakpoint ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbclear in " (buffer-name) " at " (number-to-string (line-number-at-pos nil)))))
+(defun matlab-list-breakpoints ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbstatus " (buffer-name))))
+(defun matlab-clear-breakpoints ()
+  (interactive)
+  (matlab-shell-run-command (concat "dbclear in " (buffer-name))))
+(defun matlab-go-to-file-directory ()
+  (interactive)
+  (matlab-shell-run-command (concat "cd " (file-name-directory buffer-file-name))))
+
+
+ +
+
(evil-define-key 'normal matlab-mode-map (kbd ", g") 'matlab-go-to-file-directory)
+
+(evil-define-key 'normal matlab-mode-map (kbd ", d a") 'matlab-add-breakpoint)
+(evil-define-key 'normal matlab-mode-map (kbd ", d r") 'matlab-remove-breakpoint)
+(evil-define-key 'normal matlab-mode-map (kbd ", d L") 'matlab-list-breakpoints)
+(evil-define-key 'normal matlab-mode-map (kbd ", d c") 'matlab-clear-breakpoints)
+
+(evil-define-key 'normal matlab-mode-map (kbd ", d l") 'gud-cont)
+(evil-define-key 'normal matlab-mode-map (kbd ", d s") 'gud-step)
+(evil-define-key 'normal matlab-mode-map (kbd ", d n") 'gud-next)
+(evil-define-key 'normal matlab-mode-map (kbd ", d q") 'gud-finish)
+
+
+
+
+ +
+

Wrong highlight of comments

+
+
+
(add-hook 'matlab-mode-hook
+        ;; `highlight-numbers-mode' breaks MATLAB comment coloring --
+        ;; `highlight-numbers-mode' is mostly redundant with
+        ;; `rainbow-identifiers-mode' anyway
+        (lambda ()
+          (highlight-numbers-mode -1))
+        ;; We must append the above *after* `spacemacs/run-prog-mode-hooks'
+        ;; in `matlab-mode-hook', since the former hook enables
+        ;; `highlight-numbers-mode'. Note that
+        ;; `spacemacs/run-prog-mode-hooks' is manually added to
+        ;; `matlab-mode-hook' by Spacemacs since the upstream `matlab-mode'
+        ;; package does not derive `matlab-mode' from `prog-mode' (oddly --
+        ;; IIRC the author refused to do so for compatibility with XEmacs).
+        'append)
+
+
+
+
+
+ +
+

TODO Mails With Mu4e

+ + +
+

Set default mail user agent to mu4e

+
+
+
(setq mail-user-agent 'mu4e-user-agent)
+
+
+
+
+ +
+

Default config

+
+
+
+
Default behavior
+
+
+
(setq mu4e-maildir "~/.mail"
+      mu4e-update-interval nil
+      mu4e-compose-signature-auto-include t
+      mu4e-view-show-images t
+      mu4e-view-show-addresses t)
+
+
+
+
+ +
+
Default folders
+
+
+
(setq mu4e-sent-folder "/gmail/Sent"
+      mu4e-drafts-folder "/gmail/Drafts"
+      mu4e-trash-folder "/gmail/Trash"
+      mu4e-refile-folder "/gmail/Archive"
+      mu4e-compose-signature "Thomas Dehaeze\n"
+      user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+
Default signature and email address
+
+
+
(setq mu4e-compose-signature "Thomas Dehaeze\n"
+      user-mail-address "dehaeze.thomas@gmail.com")
+
+
+
+
+ +
+
Saving the attachment to Downloads directory
+
+
+
(setq mu4e-attachment-dir "~/Downloads")
+
+
+
+
+ +
+
A list of user’s e-mail addresses
+
+
+
(setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr" "thomas.dehaeze@doct.ulg.ac.be"))
+
+
+
+
+ +
+
Mail directory shortcuts
+
+
+
(setq mu4e-maildir-shortcuts
+      '(
+        ("/gmail/Inbox" . ?g)
+        ("/esrf/Inbox"  . ?e)
+        ("/ulg/Inbox"   . ?u)
+        ))
+
+
+
+
+
+ +
+

TODO Contexts - Email accounts

+
+
+
(setq mu4e-contexts
+      `( ,(make-mu4e-context
+           :name "gmail"
+           :enter-func (lambda () (mu4e-message "Entering Gmail context"))
+           :leave-func (lambda () (mu4e-message "Leaving Gmail context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/gmail" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (mu4e-sent-messages-behavior . (delete))
+                   (user-mail-address . "dehaeze.thomas@gmail.com")
+                   (mu4e-sent-folder . "/gmail/Sent")
+                   (mu4e-trash-folder . "/gmail/Trash")
+                   (mu4e-drafts-folder . "/gmail/Drafts")
+                   (mu4e-refile-folder . "/gmail/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ,(make-mu4e-context
+           :name "esrf"
+           :enter-func (lambda () (mu4e-message "Entering ESRF context"))
+           :leave-func (lambda () (mu4e-message "Leaving ESRF context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/esrf" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (user-mail-address . "thomas.dehaeze@esrf.fr")
+                   (mu4e-sent-folder . "/esrf/Sent")
+                   (mu4e-trash-folder . "/esrf/Trash")
+                   (mu4e-drafts-folder . "/esrf/Drafts")
+                   (mu4e-refile-folder . "/esrf/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ,(make-mu4e-context
+           :name "ulg"
+           :enter-func (lambda () (mu4e-message "Entering ULG context"))
+           :leave-func (lambda () (mu4e-message "Leaving ULG context"))
+           :match-func (lambda (msg)
+                         (when msg
+                           (string-match-p "^/ulg" (mu4e-message-field msg :maildir))))
+           :vars '(
+                   (user-mail-address . "thomas.dehaeze@doct.ulg.ac.be")
+                   (mu4e-sent-folder . "/ulg/Sent")
+                   (mu4e-trash-folder . "/ulg/Trash")
+                   (mu4e-drafts-folder . "/ulg/Drafts")
+                   (mu4e-refile-folder . "/ulg/Archive")
+                   (mu4e-compose-signature  .
+                                            (concat
+                                             "Thomas Dehaeze\n"
+                                             "\n"))
+                   ))
+         ))
+(setq mu4e-context-policy 'pick-first)
+
+
+
+
+ +
+

Receiving emails - Mbsync

+
+

+Let systemd get the mail, then pressing U will just run mu to reindex everything. +

+
+
(setq mu4e-get-mail-command "true")
+
+
+ +

+Fix for mbsync found here. +

+
+
(setq mu4e-change-filenames-when-moving t)
+
+
+
+
+ +
+

Sending emails - Msmtp

+
+
+
(setq smtpmail-default-smtp-server "smtp.gmail.com"
+      smtpmail-smtp-server "smtp.gmail.com"
+      smtpmail-smtp-service 587)
+
+(setq message-send-mail-function 'message-send-mail-with-sendmail
+      sendmail-program "msmtp"
+      user-full-name "Thomas Dehaeze")
+
+
+
+
+ +
+

Bookmarks

+
+
+
(setq mu4e-bookmarks
+      `(("flag:unread AND NOT flag:trashed" "Unread messages" ?u)
+        ("date:today..now" "Today's messages" ?t)
+        ("date:7d..now" "Last 7 days" ?w)
+        ("mime:image/*" "Messages with images" ?p)
+        (,(mapconcat 'identity
+                     (mapcar
+                      (lambda (maildir)
+                        (concat "maildir:" (car maildir)))
+                      mu4e-maildir-shortcuts) " OR ")
+         "All inboxes" ?i)))
+
+
+
+
+ +
+

TODO Notifications

+
+
+
(with-eval-after-load 'mu4e-alert
+  (mu4e-alert-set-default-style 'libnotify))
+(mu4e-alert-enable-notifications)
+
+
+ +

+Mode-line notifications +

+
+
(setq mu4e-enable-mode-line t)
+
+
+
+
+ +
+

Use Org-Mode Tables In Emails

+
+
+
(add-hook 'message-mode-hook 'turn-on-orgtbl)
+(add-hook 'message-mode-hook 'turn-on-orgstruct++)
+
+
+
+
+ +
+

TODO Integration with Org-Mode

+
+

+Store link to message if in header view, not to header query +

+
+
(setq org-mu4e-link-query-in-headers-mode nil)
+
+
+
+
+ +
+

TODO When putting something on the Trash, it will be in the archive folder on gmail

+
+

+Even when totally deleting it. It will stay on gmail. How to fix that? +

+
+
+ +
+

TODO Verify that sending mails with gmail account works and that there is no duplicate

+
+

+Should check this variable: mu4e-sent-messages-behavior +

+
+
(setq mu4e-sent-messages-behavior 'delete)
+
+
+ +

+And here. +If I put it to delete, it works for gmail but not for the other ones… +Check here. +

+
+
+ +
+

TODO Cheatsheet

+
+ + + +++ ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CommandUsage
C-jNext mail
C-kPrevious mail
R/C/FReply/Compose/Forward
tMove to Archive
dMove to Trash
+
+
+
+ +
+

PDF-Tools

+
+
+
(add-hook 'pdf-view-mode-hook (lambda() (linum-mode -1)))
+
+
+
+
+ +
+

Custom command and leader keys

+
+
+
+

Watch LaTeX file using latexmk

+
+
+
(defun latex/watch ()
+  "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))))
+(defun latex/watch/kill ()
+  "Kill the currently running TeX job."
+  (interactive)
+  (delete-process "latexmk-watch")
+  )
+
+(spacemacs/set-leader-keys "ow" 'latex/watch)
+(spacemacs/set-leader-keys "ok" 'latex/watch/kill)
+
+
+
+
+ +
+

Helm-Bibtex

+
+
+
(spacemacs/set-leader-keys "ob" 'helm-bibtex)
+(spacemacs/set-leader-keys "of" 'helm-bibtex-favorites)
+(spacemacs/set-leader-keys "or" 'helm-resume)
+
+
+
+
+ +
+

Eshell

+
+
+
(spacemacs/set-leader-keys "os" 'eshell)
+
+
+
+
+ +
+

Open terminal in current directory

+
+
+
(defun open-terminal-in-workdir ()
+  (interactive)
+  (call-process-shell-command
+  (concat "termite --directory=" default-directory) nil 0))
+
+(spacemacs/set-leader-keys "ot" 'open-terminal-in-workdir)
+
+
+
+
+ +
+

Open ranger in current directory

+
+
+
(defun open-ranger-in-workdir ()
+  (interactive)
+  (call-process-shell-command
+  (concat "termite --directory=" default-directory " --exec=ranger") nil 0))
+
+(spacemacs/set-leader-keys "oo" 'open-ranger-in-workdir)
+
+
+
+
+
+ +
+

Path for Shell

+
+
+
(when (memq window-system '(mac ns x))
+  (exec-path-from-shell-initialize))
+
+
+
+
+ +
+

Proxy

+
+
+
(setq url-proxy-services
+   '(("http" . "proxy.esrf.fr:3128")
+     ("https" . "proxy.esrf.fr:3128")
+     ("no_proxy" . "^.*esrf.fr")))
+
+
+
+
+ +
+

Remove the problem of recentf files

+
+
+
(cancel-timer recentf-auto-save-timer)
+
+
+
+
+ +
+

TODO Slack

+
+
+
(slack-register-team
+  :name "emacs-slack"
+  :default t
+  :client-id "299050134212.316863429523"
+  :client-secret "7168a660375090e517fe812ea2d136e5"
+  :token "xoxp-299050134212-299063259042-715794254097-7c319fdd63315620e86f1fad42c126a2"
+  :subscribed-channels '())
+
+
+ +
+
(advice-add 'slack-counts-update :override #'ignore)
+
+
+ +
+
(setq slack-prefer-current-team t)
+
+
+
+
+ +
+

TODO Neomutt connection

+
+

+https://mentat.za.net/blog/2018/10/31/using-org-mode-with-neomutt/ +

+ +
+
(require 'org-protocol)
+;; Call this function, which spawns neomutt, whenever org-mode
+;; tries to open a link of the form mutt:message-id+goes_here@mail.gmail.com
+
+(defun tdehaeze/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 -n 1 -f l i:%s" message-id))))
+      (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" ""
+                                          (file-name-directory mail-file)))
+      (message-id-escaped (regexp-quote message-id))
+      (mutt-keystrokes
+        (format "L~i %s\n\n" (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" "termite" "-e"
+                  (concat "neomutt -R -f " mail-dir " -e \"" (format "push '%s a l'\"" mutt-keystrokes)))))
+
+;; Hook up `message:...` style URLs
+(org-add-link-type "message" 'tdehaeze/mutt-open-message)
+
+
+
+
+ +
+

Abbreviations

+
+

+Type the abbreviation and use C-x a - to create a new abbreviation. +

+ +
+
(setq-default abbrev-mode t)
+;; save abbreviations upon exiting xemacs
+(setq save-abbrevs t)
+;; set the file storing the abbreviations
+(setq abbrev-file-name "~/.spacemacs.d/my-abbreviations.el")
+;; reads the abbreviations file on startup
+(quietly-read-abbrev-file)
+
+
+
+
+ +
+

Elfeed

+
+ +
+

Telegram

+
+
+
(telega-notifications-mode 1)
+
+
+
+
+
+ +
+

Snippets

+
+
+
+

LaTeX

+
+
+
+

Coordinate

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :coordinate
+# --
+\coordinate[${1:->}] (${2:name}) at (${3:pointcoordinate});
+$0
+
+
+
+
+ +
+

Draw

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :draw
+# --
+\draw[${1:->}] (${2:point1}) -- (${3:point2});
+$0
+
+
+
+
+ +
+

Node

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :node
+# --
+node[${1:below right}] (${2:name}) {${3:label}};
+$0
+
+
+
+
+ +
+

Path

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :path
+# --
+\path[${1}] (${2:point1}) -- (${3:point2});
+$0
+
+
+
+
+
+ +
+

Matlab

+
+
+
+

Clear

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :clear and close all
+# --
+clear; close all; clc;
+$0
+
+
+
+
+ +
+

Function

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :function
+# --
+function [${4:outputs}] = ${1:functionName}(${2:inputs}, ${3:opts_param})
+% $1 - Description
+%
+% Syntax: $1($2, $3)
+%
+% Inputs:
+%    - $2 -
+%    - $3 - Optionals parameters: structure with the following fields:
+%        -
+%
+% Outputs:
+%    - $4 -
+
+%% Default value for opts
+opts = struct(...
+    '${5:outputs}', ${6:default_value} ...
+);
+
+if exist('opts_param','var')
+    for opt = fieldnames($3)'
+        if sum(strcmp(fieldnames(opts), opt{1})) == 1
+            opts.(opt{1}) = $3.(opt{1});
+        else
+            warning(sprintf('%s is not a valid option.', opt{1}));
+        end
+    end
+end
+
+$0
+
+
+
+
+
+ +
+

Org Mode

+
+
+
+

Begin

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :LaTeX Environment
+# --
+\begin{${1:equation}}
+  $0
+\end{$1}
+
+
+
+
+ +
+

Block

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Org-Mode Block
+#key: block
+# --
+#+begin_${1:$$(let ((type (yas-choose-value '("src" "example" "quote" "verse" "center" "latex" "html" "ascii"))))
+               (if type (concat type (if (equal type "src")
+                                         (concat " " (yas-choose-value '("emacs-lisp" "latex" "python" "sh" "matlab")))))))}
+$0
+#+end_${1:$(car (split-string yas-text))}
+
+
+
+
+ +
+

Custom Box

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Custom Box
+# --
+#+attr_latex: :options [$1]{${2:blue}}{${3:ams nodisplayskip}}
+#+begin_cbox
+$0
+#+end_cbox
+
+
+
+
+ +
+

Latex Class

+
+
+
#name: latex-class
+#key: lc
+#expand-env: ((classes (mapcar 'car org-latex-classes)))
+# --
+#+latex_class: ${1:$$(yas-choose-value classes)}
+$0
+
+
+
+
+ +
+

Name Caption Figure

+
+
+
#name: name-caption-figure
+#key: ncf
+# --
+#+name: fig:${1:name}
+#+caption: ${2:Caption}
+[[${3:`(read-file-name "File: ")`}]]
+
+$0
+
+
+
+
+ +
+

Bibliography with completion

+
+
+
#name: bibliography with completion
+#key: bib
+# --
+bibliography:${1:$$(yas-choose-value (org-ref-find-bibliography))}
+
+
+
+
+ +
+

Cite

+
+
+
#name: org-ref cite link
+#key: cite
+# --
+cite:${1:$$(completing-read
+       "bibtex key: "
+       (let ((bibtex-files (org-ref-find-bibliography)))(bibtex-global-key-alist)))}
+
+
+
+
+ +
+

Ref

+
+
+
#name: org-ref ref link with completion
+#key: ref
+# --
+ref:${1:$$(completing-read "label: " (org-ref-get-labels))}
+
+
+
+
+ +
+

Beamer - CBOX

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Beamer Custom Box
+# --
+*** ${1:@@latex:@@}           :B_cbox:
+,:PROPERTIES:
+:BEAMER_env: cbox
+:BEAMER_opt: {${2:blue}}{${3:ams nodisplayskip}}
+:END:
+
+$0
+
+
+
+
+ +
+

Code

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Code
+# --
+#+caption: ${1:Listing Caption}
+#+label: lst:${2:listing_name}
+#+begin_src ${3:listing_language}
+$0
+#+end_src
+
+
+
+
+ +
+

Equation

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Equation
+# --
+#+name: eq:${1:equation_name}
+\begin{equation}
+$0
+\end{equation}
+
+
+
+
+ +
+

Figure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Figure
+# --
+#+name: fig:${1:figure_name}
+#+caption: ${2:Figure caption}
+#+attr_latex: :${3:scale 1}
+[[file:${4:figs/}$1.${5:pdf}]]
+$0
+
+
+
+
+ +
+

Frac

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :LaTeX Fraction
+# --
+\frac{$1}{$2} $0
+
+
+
+
+ +
+

Left

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Left Right mathematical delimitations
+# --
+\left$1 $0 \right$2
+
+
+
+
+ +
+

Mconfig

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Configuration-Header
+# --
+#+PROPERTY: header-args:matlab  :session *MATLAB*
+#+PROPERTY: header-args:matlab+ :tangle ${1:filename}.m
+#+PROPERTY: header-args:matlab+ :comments org
+#+PROPERTY: header-args:matlab+ :exports both
+#+PROPERTY: header-args:matlab+ :results none
+#+PROPERTY: header-args:matlab+ :eval no-export
+#+PROPERTY: header-args:matlab+ :noweb yes
+#+PROPERTY: header-args:matlab+ :mkdirp yes
+#+PROPERTY: header-args:matlab+ :output-dir ${2:figs}
+$0
+
+
+
+
+ +
+

Mdescription

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Measurement-Description
+# --
+* Measurement description
+** Setup                                                             :ignore:
+*Setup*:
+
+** Goal                                                              :ignore:
+*Goal*:
+
+** Measurements                                                      :ignore:
+*Measurements*:
+
+Three measurements are done:
+| Measurement File        | Description                  |
+|-------------------------+------------------------------|
+| =mat/data_${1:001}.mat= | $2                           |
+
+Each of the measurement =mat= file contains one =data= array with 3 columns:
+| Column number | Description       |
+|---------------+-------------------|
+|             1 | $3                |
+|             2 | $4                |
+|             3 | Time              |
+
+$0
+
+
+
+
+ +
+

Mfigure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Figure
+# --
+#+HEADER: :tangle no :exports results :results none :noweb yes
+#+begin_src matlab :var filepath="${2:figs}/$1.pdf" :var figsize="${3:full-tall}" :post pdf2svg(file=*this*, ext="png")
+  <<plt-matlab>>$0
+#+end_src
+
+#+NAME: fig:$1
+#+CAPTION: ${4:caption}${5: ([[./figs/$1.png][png]], [[./figs/$1.pdf][pdf]])}
+[[file:$2/$1.png]]
+
+
+
+
+ +
+

Mfunction

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Function
+# --
+* ${1:Function Name}
+:PROPERTIES:
+:header-args:matlab+: :tangle src/${2:matlab_file_name}.m
+:header-args:matlab+: :comments none :mkdirp yes :eval no
+:END:
+<<sec:$2>>
+
+This Matlab function is accessible [[file:src/$2.m][here]].
+
+#+begin_src matlab
+  function [${4:in_data}] = $2(${3:in_data})
+  % $2 - $0
+  %
+  % Syntax: [$4] = $2($3)
+  %
+  % Inputs:
+  %    - $3 -
+  %
+  % Outputs:
+  %    - $4 -
+
+  end
+#+end_src
+
+
+
+
+ +
+

Mheader

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Header
+# --
+* ${1:Heading Name}
+:PROPERTIES:
+:header-args:matlab+: :tangle matlab/${2:matlab_file_name}.m
+:header-args:matlab+: :comments org :mkdirp yes
+:END:
+<<sec:$2>>
+
+** ZIP file containing the data and matlab files                     :ignore:
+#+begin_src bash :exports none :results none
+  if [ matlab/$2.m -nt data/$2.zip ]; then
+    cp matlab/$2.m $2.m;
+    zip data/$2 \
+        mat/data.mat \
+        $2.m
+    rm $2.m;
+  fi
+#+end_src
+
+#+begin_note
+  All the files (data and Matlab scripts) are accessible [[file:data/$2.zip][here]].
+#+end_note
+
+$0
+
+
+
+
+ +
+

Minipage

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :minipage
+# --
+#+BEGIN_EXPORT latex
+\begin{figure}[htbp]
+\centering
+\begin{minipage}[t]{0.49\linewidth}
+#+END_EXPORT
+#+attr_latex: :float nil :width 0.95\linewidth
+$0
+#+BEGIN_EXPORT latex
+\end{minipage}%
+\hfill%
+\begin{minipage}[t]{0.49\linewidth}
+#+END_EXPORT
+#+attr_latex: :float nil :width 0.95\linewidth
+
+#+BEGIN_EXPORT latex
+\end{minipage}
+\end{figure}
+#+END_EXPORT
+
+
+
+
+ +
+

Minit

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Init
+# --
+** Matlab Init                                             :noexport:ignore:
+#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name)
+  <<matlab-dir>>
+#+end_src
+
+#+begin_src matlab :exports none :results silent :noweb yes
+  <<matlab-init>>
+#+end_src
+
+$0
+
+
+
+
+ +
+

Mtable

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Matlab-Table
+# --
+#+begin_src matlab :exports results :results value table replace :tangle no :post addhdr(*this*)
+  data2orgtable(${1:data}, {${2:'rowlabel'}}, {${3:'collabel'}}, ' %.1f ');
+#+end_src
+$0
+
+
+
+
+ +
+

Multicolumn

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Multcolumn
+# --
+#+attr_latex: :float multicolumn
+$0
+
+
+
+
+ +
+

Subfigure

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Subfigure
+# --
+#+name: fig:${1:figure_name}
+#+caption: ${2:figure caption}
+#+attr_latex: :environment subfigure :width 0.49\linewidth :align c
+| file:${3:sub_fig_name}.${4:pdf}       | file:${5:sub_fig_name}.${6:pdf} |
+| <<fig:$3>> ${7:sub figure caption}    | <<fig:$5>> ${8:sub figure caption}    |
+$0
+
+
+
+
+ +
+

Table

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Table
+# --
+#+name: tab:${1:table_name}
+#+caption: ${2:Table caption}
+#+attr_latex: :environment tabularx :width ${3:\linewidth} :align ${4:lXX}
+#+attr_latex: :center t :booktabs t :float t
+| $0  |   |   |
+|---+---+---|
+|   |   |   |
+
+
+
+
+ +
+

Tikz

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz figure
+# --
+#+begin_src latex :file ${1:figure_name}.pdf :post pdf2svg(file=*this*, ext="png") :exports both
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+
+
+
+ +
+

Tikzfig

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz Figure
+# --
+#+NAME: fig:${1:figure_name}
+#+HEADER: :headers '("\\\\usepackage{tikz}" "\\\\usepackage{import}" "\\\\import{$HOME/Cloud/thesis/LaTeX/}{config.tex}")
+#+HEADER: :imagemagick t :fit yes :iminoptions -scale 100% -density 150 :imoutoptions -quality 100
+#+HEADER: :results raw replace :buffer no :eval no-export :exports both :mkdirp yes
+#+HEADER: :output-dir ${2:figs}
+#+begin_src latex :file $1.pdf :post pdf2svg(file=*this*, ext="png") :exports both
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+#+NAME: fig:$1
+#+CAPTION: ${3:Caption}
+#+RESULTS: fig:$1
+
+
+
+
+ +
+

Tikzheader

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Tikz Header
+# --
+* ${1:Title/Description of the figure}
+#+begin_src latex :file ${2:figure_name}.pdf :tangle figs/$2.tex :exports ${3:both}
+  \begin{tikzpicture}
+    $0
+  \end{tikzpicture}
+#+end_src
+
+#+name: fig:$2
+#+caption: $1 ([[./figs/$2.png][png]], [[./figs/$2.pdf][pdf]], [[./figs/$2.tex][tex]]).
+#+RESULTS:
+[[file:./figs/$2.png]]
+
+
+
+
+ +
+

User-config

+
+
+
# -*- mode: snippet -*-
+# name: user-config
+# key: uc
+# --
+#+begin_src emacs-lisp :tangle user-config.el
+$1
+#+end_src
+
+
+
+
+ +
+

User-init

+
+
+
# -*- mode: snippet -*-
+# name: user-init
+# key: ui
+# --
+#+begin_src emacs-lisp :tangle user-init.el
+$1
+#+end_src
+
+
+
+
+ +
+

Wrap

+
+
+
#contributor : Thomas Dehaeze <dehaeze.thomas@gmail.com>
+#name :Wrap
+# --
+#+attr_latex: :float wrap
+$0
+
+
+
+
+
+

Latex

+
+
+
+
Integral
+
+
+
# -*- mode: snippet -*-
+# name: latex integral
+# key: int
+# contributor: John Kitchin <jkitchin@andrew.cmu.edu>
+# --
+\int_{$1}^{$2} $3d$4$0
+
+
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/sxhkd.html b/docs/sxhkd.html new file mode 100644 index 0000000..562d442 --- /dev/null +++ b/docs/sxhkd.html @@ -0,0 +1,848 @@ + + + + + + + + +Simple X Hotkey Daemon + + + + + + + + + + + + +
+ UP + | + HOME +
+

Simple X Hotkey Daemon

+ + +
+

Basic

+
+
+
super + ctrl + x
+  xkill
+
+
+ +
+
# make sxhkd reload its configuration files:
+super + Escape
+  pkill -USR1 -x sxhkd
+
+# Update Polybar
+super + r
+  $HOME/.config/polybar/scripts/launch.sh
+
+
+
+
+ +
+

Start Applications

+
+
+
# Start program launcher
+super + d
+  rofi -show run
+
+# Launch categorized menu
+super + shift + d
+  rofi -show drun
+
+# Start Sound Manager
+super + shift + s
+  pavucontrol
+
+# Start Bluetooth Manager
+super + shift + b
+  blueman-manager
+
+# Windows Switch
+super + shift + w
+  rofi -show window
+
+# Bookmarks
+super + shift + f
+  $HOME/bin/bukurun
+
+# Passwords
+super + shift + p
+  rofi-pass
+
+
+ +
+
# Start Terminal
+super + Return
+  termite
+
+# Tmux Terminal
+super + shift + Return
+  termite -e 'tmux'
+
+# Start Command line Calendar
+super + shift + c
+  termite -e "khal interactive"
+
+# File Manager
+super + o
+  urxvt -e "ranger"
+
+# Browser
+super + i
+  qutebrowser
+
+
+
+
+ +
+

Multimedia keys

+
+
+
+

Sound

+
+
+
XF86AudioMute
+  amixer -D pulse sset Master toggle
+XF86AudioRaiseVolume
+  amixer -D pulse sset Master 2%+
+XF86AudioLowerVolume
+  amixer -D pulse sset Master 2%-
+
+
+
+
+ +
+

Backlight

+
+
+
XF86MonBrightnessUp
+ xbacklight -inc 10
+XF86MonBrightnessDown
+ xbacklight -dec 10
+
+
+
+
+ +
+

Change Tracks

+
+
+
super + period
+    mpc toggle
+super + {greater,less}
+    mpc {next,prev}
+
+
+ +
+
XF86AudioPlay
+    mpc toggle
+XF86AudioNext
+    mpc next
+XF86AudioPrev
+    mpc prev
+
+
+
+
+ +
+

Print Screen

+
+
+
Print
+    ~/bin/screenshot
+XF86Display
+    rofi -show window
+
+
+
+
+ +
+

Other

+
+
+
XF86Search
+  rofi -show run
+
+
+
+
+
+ +
+

Set shut down, restart and locking features

+
+
+
XF86PowerOff
+  $HOME/scripts/quit.sh
+super + 0
+  $HOME/scripts/quit.sh
+
+
+
+
+ +
+

Command Mode

+
+
+
# Command line Calendar Client (khal)
+super + space ; c
+  termite -e "khal interactive"
+
+# GUI Calendar (Google Calendar)
+super + space ; shift + c
+  qutebrowser https://calendar.google.com/
+
+# Ranger
+super + space ; r
+  urxvt -e "ranger"
+
+# pcmanfm: GUI file manager
+super + space ; shift + r
+  pcmanfm;
+
+# Mails with neomutt
+super + space ; m
+  termite -e "tmux -L neomutt attach"
+
+super + space ; shift + m
+  termite -e "neomutt -R"
+
+# Weechat
+super + space ; w
+  termite -e "tmux -L weechat attach"
+
+# News with newsboat
+super + space ; n
+  termite -e "tmux -L newsboat attach"
+
+# Music with ncmpcpp
+super + space ; p
+  termite -e "tmux -L ncmpcpp attach"
+
+# Print Screen
+super + space ; shift + p
+  ~/bin/screenshot
+
+# Browser with qutebrowser
+super + space ; i
+  qutebrowser;
+
+# Browser with firefox
+super + space ; shift + i
+  firefox;
+
+# Emacs Client
+super + space ; e
+  emacsclient -create-frame --alternate-editor=""
+
+# Full Emacs - Usefull when installing packages
+super + space ; shift + e
+  emacs;
+
+
+
+
+ +
+

Change Keyboard Layout

+
+
+
super + ctrl + d
+    setxkbmap -layout us -variant intl -option caps:escape
+super + shift + d
+    setxkbmap -layout us -option caps:escape
+
+
+
+
+ +
+

BSPWM related

+
+
+ +
+

BSPWM hotkeys

+
+
+
# quit/restart bspwm
+super + alt + {q,r}
+  bspc {quit,wm -r}
+
+# close and kill
+super + {_,shift + }q
+  bspc node -{c,k}
+
+
+
+
+ +
+

Monocle Layout

+
+
+
# alternate between the tiled and monocle layout
+super + m
+  bspc desktop -l next
+
+# focus the next/previous node in the current desktop
+super + c
+  bspc node -f next.local
+
+
+
+
+ +
+

Set the window State

+
+
+
# Set the window state to tiled
+super + t
+  bspc node -t tiled
+
+
+# Toggle Fullscreen State
+super + f
+  if [ -z "$(bspc query -N -n focused.fullscreen)" ]; then \
+      bspc node focused -t fullscreen; \
+  else \
+      bspc node focused -t tiled; \
+  fi
+
+# Toggle Floating State
+super + s
+  if [ -z "$(bspc query -N -n focused.floating)" ]; then \
+      bspc node focused -t floating; \
+  else \
+      bspc node focused -t tiled; \
+  fi
+
+
+
+
+ +
+

Sticky Window

+
+
+
# set the node flags
+super + ctrl + y
+  bspc node -g sticky
+
+
+
+
+ +
+

Focus and Swap

+
+
+
# Focus/swap the node in the given direction
+super + {_,shift + }{h,j,k,l}
+  bspc node -{f,s} {west,south,north,east}
+
+# focus the last Node
+super + Tab
+  bspc node -f last
+
+
+ +
+
# Focus the next/previous desktop in the current monitor
+super + {p,n}
+  bspc desktop -f {prev,next}.local
+
+# focus the last Desktop
+super + b
+  bspc desktop -f last
+
+# focus or send to the given desktop
+super + {_,ctrl + }{1-9}
+  bspc {desktop -f,node -d} '^{1-9}'
+
+# Send and Focus to the given desktop
+super + shift + {1-9}
+  bspc node -d '^{1-9}' --follow
+
+
+
+
+ +
+

Preselect

+
+
+
# preselect the direction
+super + ctrl + {h,j,k,l}
+  bspc node -p {west,south,north,east}
+
+# preselect the ratio
+# super + ctrl + {1-9}
+#   bspc node -o 0.{1-9}
+
+# cancel the preselection for the focused node
+super + ctrl + space
+  bspc node -p cancel
+
+
+
+
+ +
+

Resize

+
+
+
# expand a window by moving one of its side outward
+super + alt + {h,j,k,l}
+  bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}
+
+# contract a window by moving one of its side inward
+super + alt + shift + {h,j,k,l}
+  bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}
+
+
+ +
+
# move a floating window
+super + {Left,Down,Up,Right}
+  bspc node -v {-20 0,0 20,0 -20,20 0}
+
+
+
+
+
+ +
+

I3 related

+
+
+ +
+

BSPWM hotkeys

+
+
+
# quit/restart bspwm
+super + alt + {q,r}
+  i3-msg {quit,restart}
+
+# close and kill
+super + {_,shift + }q
+  i3-msg {kill,kill}
+
+
+
+
+ +
+

Monocle Layout

+
+
+
# alternate between the tiled and monocle layout
+super + f
+  i3-msg layout toggle tabbed split
+
+# Change focus between tiling / floating windows
+super + c
+  i3-msg focus mode_toggle
+
+
+
+
+ +
+

Set the window State

+
+
+
# set the window state
+super + {t,s, shift + f}
+  i3-msg {fullscreen disable,floating toggle,fullscreen toggle}
+
+
+
+
+ +
+

Sticky Window

+
+
+
super + ctrl + y
+  i3-msg sticky toggle
+
+
+
+
+ +
+

focus/swap

+
+
+
# Focus/swap the node in the given direction
+super + {_,shift + }{h,Left}
+  i3-msg {focus,move} left
+super + {_,shift + }{j,Down}
+  i3-msg {focus,move} down
+super + {_,shift + }{k,Up}
+  i3-msg {focus,move} up
+super + {_,shift + }{l,Right}
+  i3-msg {focus,move} right
+
+
+ +
+
# Focus the next/previous desktop in the current monitor
+super + {p,n}
+  i3-msg workspace {prev,next}
+
+# focus the last Desktop
+super + b
+  i3-msg workspace back_and_forth
+
+# focus or send to the given desktop
+super + {1-9}
+  i3-msg workspace '{1-9}'
+super + ctrl + {1-9}
+  i3-msg move container to workspace '{1-9}'
+super + shift + {1-9}
+  WP={1-9} && i3-msg move container to workspace $WP && i3-msg workspace $WP
+
+
+
+
+ +
+

Preselect

+
+

+Preselect the direction +

+
+
super + ctrl + {h,l,Left,Right}
+  i3-msg split h
+
+super + ctrl + {j,k,Up,Down}
+  i3-msg split v
+
+
+
+
+ +
+

Resize

+
+

+Expand/Shrink a window +

+
+
super + alt + h
+  i3-msg resize shrink width 10 px or 10 ppt
+super + alt + j
+  i3-msg resize grow height 10 px or 10 ppt
+super + alt + k
+  i3-msg resize shrink height 10 px or 10 ppt
+super + alt + l
+  i3-msg resize grow width 10 px or 10 ppt
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/systemd.html b/docs/systemd.html new file mode 100644 index 0000000..fe1a131 --- /dev/null +++ b/docs/systemd.html @@ -0,0 +1,852 @@ + + + + + + + + +Systemd services and timers + + + + + + + + + + + + +
+ UP + | + HOME +
+

Systemd services and timers

+
+

Table of Contents

+ +
+ +

+https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units +

+ +
+

Pass Git

+
+
+
+

Service

+
+
+
[Unit]
+Description=Sync Passwords every day
+RefuseManualStart=no
+RefuseManualStop=yes
+
+[Service]
+Type=oneshot
+ExecStart=%h/scripts/pass_git_sync.sh
+
+
+
+
+ +
+

Timer

+
+
+
[Unit]
+Description=Sync Passwords every day
+RefuseManualStart=no
+RefuseManualStop=no
+Wants=network-online.target
+After=network.target network-online.target dbus.socket
+
+[Timer]
+OnCalendar=*-*-* 17:00:00
+Persistent=true
+Unit=passgit.service
+
+[Install]
+WantedBy=default.target
+
+
+
+
+ +
+

Script

+
+
+
pass git pull --rebase && pass git push
+
+
+
+
+
+ +
+

Buku Git

+
+
+
+

Service

+
+
+
[Unit]
+Description=Sync Bookmarks every day
+RefuseManualStart=no
+RefuseManualStop=yes
+
+[Service]
+Type=oneshot
+ExecStart=%h/scripts/buku_git_push.sh
+
+
+
+
+ +
+

Timer

+
+
+
[Unit]
+Description=Sync All Mails every x hours
+RefuseManualStart=no
+RefuseManualStop=no
+Wants=network-online.target
+After=network.target network-online.target dbus.socket
+
+[Timer]
+OnCalendar=*-*-* 16:00:00
+Persistent=true
+Unit=bukugit.service
+
+[Install]
+WantedBy=default.target
+
+
+
+
+ +
+

Script

+
+
+
cd ~/.local/share/buku/
+
+if [[ ! -z $(git status -s bookmarks.db) ]]
+then
+    git add bookmarks.db
+    git commit -m "Changed bookmarks - $(date +%F)"
+    git push
+    exit
+fi
+
+
+
+
+
+ +
+

Check mail

+
+
+
+

Service

+
+
+
[Unit]
+Description=Check new mails
+RefuseManualStart=no
+RefuseManualStop=yes
+
+[Service]
+Type=oneshot
+ExecStart=%h/scripts/checkmail.sh -q -v
+
+
+
+
+ +
+

Timer

+
+
+
[Unit]
+Description=Check Mail every x minutes
+RefuseManualStart=no
+RefuseManualStop=no
+Wants=network-online.target
+After=network.target network-online.target dbus.socket
+Requires=checkmail.service
+
+[Timer]
+Persistent=false
+OnBootSec=2min
+OnUnitActiveSec=5min
+AccuracySec=10s
+Unit=checkmail.service
+
+[Install]
+WantedBy=default.target
+
+
+
+
+ +
+

Script

+
+
+
while [ -n "$1" ]; do # while loop starts
+    case "$1" in
+    -a) opt_all='--all' ;; # Check All inboxes
+    -v) opt_verbose='--verbose' ;; # Verbose
+    -q) opt_quiet='--quiet' ;; # Quiet
+    *) echo "Option $1 not recognized" ;; # In case you typed a different option
+    esac
+    shift
+done
+
+
+# =============================================================
+# Count number of mails
+gmail_old="$(ls ~/.mail/gmail/Inbox/new | wc -l)"
+esrf_old="$(ls ~/.mail/esrf/Inbox/new | wc -l)"
+ulg_old="$(ls ~/.mail/ulg/Inbox/new | wc -l)"
+# =============================================================
+
+# =============================================================
+# Retreive mails
+mbsync $opt_all $opt_verbose gmail-Home esrf-Home ulg-Home
+# =============================================================
+
+# =============================================================
+# Count number of mails
+gmail_new="$(ls ~/.mail/gmail/Inbox/new | wc -l)"
+esrf_new="$(ls ~/.mail/esrf/Inbox/new | wc -l)"
+ulg_new="$(ls ~/.mail/ulg/Inbox/new | wc -l)"
+# =============================================================
+
+# =============================================================
+# Total Number of new mails since last checking
+new="$(($gmail_new+$esrf_new+$ulg_new))"
+old="$(($gmail_old+$esrf_old+$ulg_old))"
+# =============================================================
+
+# =============================================================
+# Notification
+if [ "$new" -gt 0 ]; then
+    dunstify --replace=98465 'New mail' " $esrf_new$gmail_new$ulg_new"
+fi
+# =============================================================
+
+# =============================================================
+# Indexation and Tags
+# notmuch new
+mu index --maildir=~/.mail $opt_verbose $opt_quiet
+# Update on Emacs
+# if [ "$(($new-$old))" -gt 0 ]; then
+#     emacsclient --eval '(mu4e-update-index)';
+# fi
+# =============================================================
+
+
+
+
+
+ +
+

Sync mail

+
+
+
+

Service

+
+
+
[Unit]
+Description=Sync all mails
+RefuseManualStart=no
+RefuseManualStop=yes
+
+[Service]
+Type=oneshot
+ExecStart=%h/scripts/checkmail.sh -a -q -v
+
+
+
+
+ +
+

Timer

+
+
+
[Unit]
+Description=Sync All Mails every x hours
+RefuseManualStart=no
+RefuseManualStop=no
+Wants=network-online.target
+After=network.target network-online.target dbus.socket
+Requires=syncmail.service
+
+[Timer]
+Persistent=false
+OnBootSec=30min
+OnUnitActiveSec=300min
+AccuracySec=10s
+Unit=syncmail.service
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+ +
+

Emacs

+
+
+
+

Service

+
+
+
[Unit]
+Description=Emacs text editor
+Documentation=info:emacs man:emacs(1) https://gnu.org/software/emacs/
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/emacs --daemon
+ExecStop=/usr/bin/emacsclient --eval "(kill-emacs)"
+Environment=SSH_AUTH_SOCK=%t/keyring/ssh
+Restart=on-failure
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+ +
+

Vdirsyncer

+
+
+
+

Service

+
+
+
[Unit]
+Description=Synchronize calendars and contacts
+Documentation=https://vdirsyncer.readthedocs.org/
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+ExecStart=/usr/bin/vdirsyncer sync
+Type=oneshot
+
+
+
+
+ +
+

Timer

+
+
+
[Unit]
+Description=Synchronize vdirs
+
+[Timer]
+OnBootSec=5m
+OnUnitActiveSec=15m
+AccuracySec=5m
+
+[Install]
+WantedBy=timers.target
+
+
+
+
+
+ +
+

Weechat

+
+
+
+

Service

+
+
+
[Unit]
+Description=A WeeChat client and relay service using Tmux
+Wants=network-online.target
+After=network.target network-online.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/tmux -L weechat new -d -s weechat weechat
+ExecStop=/usr/bin/tmux -L weechat kill-session -t weechat
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+ +
+

Neomutt

+
+
+
+

Service

+
+
+
[Unit]
+Description=Neomutt - mail client
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/tmux -L neomutt new -d -s neomutt neomutt
+ExecStop=/usr/bin/tmux -L neomutt kill-session -t neomutt
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+ +
+

Powertop

+
+
+
+

Service

+
+
+
[Unit]
+Description=Powertop tunings
+
+[Service]
+ExecStart=/usr/bin/powertop --auto-tune
+RemainAfterExit=true
+
+[Install]
+WantedBy=multi-user.target
+
+
+
+
+
+
+

NCMPCPP

+
+
+
+

Service

+
+
+
[Unit]
+Description=Ncmpcpp - Music Player
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/tmux -L ncmpcpp new -d -s ncmpcpp ncmpcpp
+ExecStop=/usr/bin/tmux -L ncmpcpp kill-session -t ncmpcpp
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+ +
+

Newsboat

+
+
+
+

Service - tmux

+
+
+
[Unit]
+Description=Newsboat - RSS reader
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/tmux -L newsboat new -d -s newsboat newsboat
+ExecStop=/usr/bin/tmux -L newsboat kill-session -t newsboat
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+
+

SSH Agent

+
+
+
[Unit]
+Description=SSH key agent
+
+[Service]
+Type=simple
+Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
+ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
+
+[Install]
+WantedBy=default.target
+
+
+
+
+
+

Mopidy

+
+
+
[Unit]
+Description=Mopidy music server
+After=avahi-daemon.service
+After=dbus.service
+After=network.target
+After=nss-lookup.target
+After=pulseaudio.service
+After=remote-fs.target
+After=sound.target
+
+[Service]
+ExecStart=/usr/bin/mopidy
+
+[Install]
+WantedBy=multi-user.target
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/termite.html b/docs/termite.html new file mode 100644 index 0000000..7bb3793 --- /dev/null +++ b/docs/termite.html @@ -0,0 +1,401 @@ + + + + + + + + +Termite Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Termite Configuration

+
+

Table of Contents

+
+ +
+
+ +
+

Options

+
+
+
[options]
+  #allow_bold = true
+  #audible_bell = false
+  #bold_is_bright = true
+  clickable_url = true
+  #dynamic_title = true
+  font = Hack Nerd Font Mono 13px
+  #fullscreen = true
+  #icon_name = terminal
+  mouse_autohide = true
+  #scroll_on_output = false
+  #scroll_on_keystroke = true
+  # Length of the scrollback buffer, 0 disabled the scrollback buffer
+  # and setting it to a negative value means "infinite scrollback"
+  scrollback_lines = 10000
+  #search_wrap = true
+  #urgent_on_bell = true
+  #hyperlinks = false
+
+  # $BROWSER is used by default if set, with xdg-open as a fallback
+  #browser = xdg-open
+
+  # Hide links that are no longer valid in url select overlay mode
+  #filter_unmatched_urls = true
+
+  # Emit escape sequences for extra modified keys
+  #modify_other_keys = false
+
+  # set size hints for the window
+  #size_hints = false
+
+  # "off", "left" or "right"
+  #scrollbar = off
+
+  highlight = #2f2f2f
+
+
+
+
+ +
+

Hints

+
+
+
[hints]
+  #padding = 2
+  #border = #3f3f3f
+  #border_width = 0.5
+  #roundness = 2.0
+
+
+
+
+ +
+

Colors

+
+
+
[colors]
+# Base16 Gruvbox dark, soft
+# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
+
+# fg2
+foreground          = #d5c4a1
+# fg1
+foreground_bold     = #ebdbb2
+cursor              = #ebdbb2
+# bg0_s
+cursor_foreground   = #32302f
+background          = #32302f
+
+# 16 color space
+
+# bg0_s
+color0  = #32302f
+# bg3
+color8  = #665c54
+# fb2
+color7  = #d5c4a1
+# fg0
+color15 = #fbf1c7
+
+# Red
+color1  = #fb4934
+color9  = #fb4934
+
+# Green
+color2  = #b8bb26
+color10 = #b8bb26
+
+# Yellow
+color3  = #fabd2f
+color11 = #fabd2f
+
+# Blue
+color4  = #83a598
+color12 = #83a598
+
+# Purple
+color5  = #d3869b
+color13 = #d3869b
+
+# Teal
+color6  = #8ec07c
+color14 = #8ec07c
+
+# Extra colors
+# orange
+color16 = #fe8019
+# orange
+color17 = #d65d0e
+# bg1
+color18 = #3c3836
+# bg2
+color19 = #504945
+# fg3
+color20 = #bdae93
+# fg
+color21 = #ebdbb2
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/tmux.html b/docs/tmux.html new file mode 100644 index 0000000..28b17b0 --- /dev/null +++ b/docs/tmux.html @@ -0,0 +1,579 @@ + + + + + + + + +Tmux Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

Tmux Configuration

+ + +
+

Line

+
+
+
# Activate the status bar
+set -g status "on"
+
+# default statusbar color
+set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
+
+# default window title colors
+set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
+
+# default window with an activity alert
+set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
+
+# active window title colors
+set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
+
+# pane border
+set-option -g pane-active-border-style fg=colour250 #fg2
+set-option -g pane-border-style fg=colour237 #bg1
+
+# message infos
+set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
+
+# writing commands inactive
+set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
+
+# pane number display
+set-option -g display-panes-active-colour colour250 #fg2
+set-option -g display-panes-colour colour237 #bg1
+
+# clock
+set-window-option -g clock-mode-colour colour109 #blue
+
+# bell
+set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red, fg=bg
+
+## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
+set-option -g status-justify "left"
+set-option -g status-left-style none
+set-option -g status-left-length "80"
+set-option -g status-right-style none
+set-option -g status-right-length "80"
+set-window-option -g window-status-separator ""
+
+set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]"
+set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#{?client_prefix,#[fg=colour124],}#[fg=colour237, bg=colour248]#{?client_prefix,#[bg=colour124],} #h "
+
+set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]"
+set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]"
+
+
+
+
+ +
+

Bindings

+
+
+
# Set prefix to 'C-Space'
+unbind C-b
+set -g prefix C-Space
+
+# Reload the config using 'C-Space + r'
+bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."
+
+# Simulate 'C-l' to clear the terminal
+bind C-l send-keys C-l \; clear-history
+
+# Open new panes with the path of the current pane.
+unbind c
+bind c new-window -c '#{pane_current_path}'
+
+# Vim-like key bindings for pane navigation (default uses cursor keys).
+unbind h
+bind h select-pane -L
+unbind j
+bind j select-pane -D
+unbind k
+bind k select-pane -U
+unbind l # normally used for last-window
+bind l select-pane -R
+
+# Move Panes
+unbind L
+bind L swap-pane -D
+unbind H
+bind H swap-pane -U
+
+# Resizing (mouse also works).
+unbind Left
+bind -r Left resize-pane -L 5
+unbind Right
+bind -r Right resize-pane -R 5
+unbind Down
+bind -r Down resize-pane -D 5
+unbind Up
+bind -r Up resize-pane -U 5
+
+# Fast toggle (normally prefix-l).
+bind ^space last-window
+
+# Intuitive window-splitting keys.
+bind / split-window -h -c '#{pane_current_path}' # normally prefix-%
+bind - split-window -v -c '#{pane_current_path}' # normally prefix-"
+
+# Swap windows
+bind-key -r "<" swap-window -t -1
+bind-key -r ">" swap-window -t +1
+
+# Smart pane switching with awareness of Vim splits
+# See: https://github.com/christoomey/vim-tmux-navigator
+is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
+    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
+bind-key -n C-h if-shell "$is_vim" "send-keys C-h"  "select-pane -L"
+bind-key -n C-j if-shell "$is_vim" "send-keys C-j"  "select-pane -D"
+bind-key -n C-k if-shell "$is_vim" "send-keys C-k"  "select-pane -U"
+bind-key -n C-l if-shell "$is_vim" "send-keys C-l"  "select-pane -R"
+
+# Set 'C-Space + v' to enter copy-mode
+unbind [
+bind-key v copy-mode
+
+# Set 'C-Space + C-v' to paste
+unbind ]
+bind-key C-v paste-buffer
+
+# Setup 'v' to begin selection as in Vim and 'y' to yank
+bind-key -T copy-mode-vi 'v' send -X begin-selection
+bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
+bind-key -T copy-mode-vi 'Escape' send -X cancel
+bind-key -T copy-mode-vi 'C-v' send-keys -X rectangle-toggle
+
+
+
+
+ +
+

Settings

+
+
+
# Activity monitoring
+set -g visual-activity off
+
+# Automatically renumber window numbers on closing a pane (tmux >= 1.7).
+set -g renumber-windows on
+
+# Mouse can be used to select panes, select windows (by clicking on the status bar), resize panes
+set -g mouse on
+
+set -g default-terminal "screen-256color"
+set -ga terminal-overrides ',xterm-256color:Tc'
+
+set -g history-limit 262144
+
+# Start window and pane numbering at 1, (0 is too hard to reach)
+set -g base-index 1
+set -g pane-base-index 1
+
+# Don't wait for an escape sequence after seeing C-a
+set -s escape-time 0
+
+# Dynamically update iTerm tab and window titles
+set -g set-titles on
+
+# Needed as on tmux 1.9 and up (defaults to off)
+set -g focus-events on
+
+# But don't change tmux's own window titles
+set-option -g allow-rename off
+
+# Don't wrap searches; it's super confusing given tmux's reverse-ordering of position info in copy mode
+set -w -g wrap-search off
+
+# Restore pre-2.1 behavior of scrolling with the scrollwheel in Vim, less, copy mode etc, otherwise entering copy mode if not already in it.
+bind-key -T root WheelUpPane \
+  if-shell -Ft= '#{?pane_in_mode,1,#{mouse_any_flag}}' \
+    'send -Mt=' \
+    'if-shell -Ft= "#{alternate_on}" "send -t= Up" "copy-mode -et="'
+bind-key -T root WheelDownPane \
+  if-shell -Ft = '#{?pane_in_mode,1,#{mouse_any_flag}}' \
+    'send -Mt=' \
+    'if-shell -Ft= "#{alternate_on}"  "send -t= Down" "send -Mt="'
+
+# Stay in copy mode on drag end, but otherwise exit for mouse up.
+# Requires patch from https://github.com/tmux/tmux/issues/326
+# unbind-key -t vi-copy MouseDragEnd1Pane
+# bind-key -t vi-copy MouseUp1Pane cancel
+
+bind-key -n MouseDrag1Status swap-window -t=
+# bind-key -n MouseDown3Status new-window -a -t=
+
+bind-key -n MouseDrag1Status swap-window -t=
+# bind-key -n MouseDown3Status new-window -a -t=
+
+
+# #T      = standard window title (last command, see ~/.bash_profile)
+# #h      = short hostname
+# #S      = session name
+# #W      = tmux window name
+set -g set-titles-string "#T : #h > #S > #W"
+
+# Show bells in window titles
+set -g window-status-bell-style fg=yellow,bold,underscore
+
+# Causes tmux to resize a window based on the smallest client actually viewing it, not on the smallest one attached to the entire session
+set-window-option -g aggressive-resize
+
+
+
+
+ +
+

Plugins

+
+
+
+

Install plugins

+
+
+
set -g @plugin 'tmux-plugins/tpm'
+# set -g @plugin 'tmux-plugins/tmux-sessionist'
+# set -g @plugin 'tmux-plugins/tmux-resurrect'
+# set -g @plugin 'tmux-plugins/tmux-continuum'
+# set -g @plugin 'tmux-plugins/tmux-battery'
+set -g @plugin 'nhdaly/tmux-better-mouse-mode'
+set -g @plugin 'seebi/tmux-colors-solarized'
+
+
+
+
+ +
+

Configuration

+
+
+
# =============================================================
+# tmux-resurrect
+# =============================================================
+# for vim
+set -g @resurrect-strategy-vim 'session'
+# for neovim
+set -g @resurrect-strategy-nvim 'session'
+
+# Restoring pane contents
+set -g @resurrect-capture-pane-contents 'on'
+
+run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
+# =============================================================
+
+
+# =============================================================
+# tmux-continuum
+# =============================================================
+set -g @continuum-boot 'on'
+set -g @continuum-boot-options 'iterm,fullscreen'
+set -g @continuum-save-interval '15'
+
+run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux
+# =============================================================
+
+
+# =============================================================
+# tmux-battery
+# =============================================================
+set -g @batt_charged_icon "="
+set -g @batt_charging_icon "+"
+set -g @batt_discharging_icon "-"
+set -g @batt_attached_icon "o"
+# =============================================================
+
+
+
+
+
+ +
+

Colors

+
+
+
set -g @colors-solarized 'light'
+
+
+
+
+ +
+

Initialize TMUX plugin manager

+
+
+
run '~/.tmux/plugins/tpm/tpm'
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/video.html b/docs/video.html new file mode 100644 index 0000000..b6d8248 --- /dev/null +++ b/docs/video.html @@ -0,0 +1,606 @@ + + + + + + + + +MPV Configuration + + + + + + + + + + + + +
+ UP + | + HOME +
+

MPV Configuration

+ + +
+

MPV Configuration

+
+
+ +
+

Video settings

+
+
+
# Start in fullscreen mode by default.
+#fs=yes
+
+# force starting with centered window
+#geometry=50%:50%
+
+# don't allow a new window to have a size larger than 90% of the screen size
+#autofit-larger=90%x90%
+
+# Do not close the window on exit.
+#keep-open=yes
+
+# Do not wait with showing the video window until it has loaded. (This will
+
+# resize the window once video is loaded. Also always shows a window with
+# audio.)
+#force-window=immediate
+
+# Disable the On Screen Controller (OSC).
+#osc=no
+
+# Keep the player window on top of all other windows.
+#ontop=yes
+
+# Specify high quality video rendering preset (for --vo=gpu only)
+# Can cause performance problems with some drivers and GPUs.
+#profile=gpu-hq
+
+# Force video to lock on the display's refresh rate, and change video and audio
+# speed to some degree to ensure synchronous playback - can cause problems
+# with some drivers and desktop environments.
+#video-sync=display-resample
+
+# Enable hardware decoding if available. Often, this does not work with all
+# video outputs, but should work well with default settings on most systems.
+# If performance or energy usage is an issue, forcing the vdpau or vaapi VOs
+# may or may not help.
+#hwdec=auto
+
+
+
+
+ +
+

Audio settings

+
+
+
# Specify default audio device. You can list devices with: --audio-device=help
+# The option takes the device string (the stuff between the '...').
+#audio-device=alsa/default
+
+# Do not filter audio to keep pitch when changing playback speed.
+#audio-pitch-correction=no
+
+# Output 5.1 audio natively, and upmix/downmix audio with a different format.
+#audio-channels=5.1
+# Disable any automatic remix, _if_ the audio output accepts the audio format.
+# of the currently played file. See caveats mentioned in the manpage.
+# (The default is "auto-safe", see manpage.)
+#audio-channels=auto
+
+
+
+
+ +
+

Other settings

+
+
+
# Pretend to be a web browser. Might fix playback with some streaming sites,
+# but also will break with shoutcast streams.
+#user-agent="Mozilla/5.0"
+
+stop-screensaver = "yes"
+
+sub-auto=fuzzy
+
+# cache settings
+#
+# Use 150MB input cache by default. The cache is enabled for network streams only.
+#cache-default=153600
+#
+# Use 150MB input cache for everything, even local files.
+#cache=153600
+#
+# Disable the behavior that the player will pause if the cache goes below a
+# certain fill size.
+#cache-pause=no
+#
+# Read ahead about 5 seconds of audio and video packets.
+#demuxer-readahead-secs=5.0
+#
+# Raise readahead from demuxer-readahead-secs to this value if a cache is active.
+#cache-secs=50.0
+
+# Display English subtitles if available.
+#slang=en
+
+# Play Finnish audio if available, fall back to English otherwise.
+#alang=fi,en
+
+# Change subtitle encoding. For Arabic subtitles use 'cp1256'.
+# If the file seems to be valid UTF-8, prefer UTF-8.
+# (You can add '+' in front of the codepage to force it.)
+#sub-codepage=cp1256
+
+
+
+
+
+ +
+

MPV Key Bindings

+
+
+
# =============================================================
+# Audio
+# =============================================================
+#WHEEL_LEFT    add volume -2
+#WHEEL_RIGHT   add volume 2
+#ctrl++ add audio-delay 0.100           # this changes audio/video sync
+#ctrl+- add audio-delay -0.100
+
+#9 add volume -2
+#/ add volume -2
+#0 add volume 2
+#* add volume 2
+#m cycle mute
+
+#SHARP cycle audio                      # switch audio streams
+# =============================================================
+
+
+# =============================================================
+# Basic
+# =============================================================
+ESC set fullscreen no
+
+q quit
+Q quit-watch-later
+
+SPACE cycle pause   # toggle pause/playback mode
+# p cycle pause       # toggle pause/playback mode
+# =============================================================
+
+
+# =============================================================
+# Navigation
+# =============================================================
+l seek  5
+h seek -5
+# k seek  60
+# j seek -60
+
+L playlist-next  # skip to next file
+H playlist-prev  # skip to previous file
+K add chapter  1 # skip to next chapter
+J add chapter -1 # skip to previous chapter
+
+WHEEL_UP      seek 10
+WHEEL_DOWN    seek -10
+# =============================================================
+
+
+# =============================================================
+# Subtitles
+# =============================================================
+z add sub-delay -0.1                   # subtract 100 ms delay from subs
+Z add sub-delay +0.1                   # add
+#x add sub-delay +0.1                   # same as previous binding (discouraged)
+#r add sub-pos -1                       # move subtitles up
+#R add sub-pos +1                       #                down
+#t add sub-pos +1                       # same as previous binding (discouraged)
+#v cycle sub-visibility
+# stretch SSA/ASS subtitles with anamorphic videos to match historical
+#V cycle sub-ass-vsfilter-aspect-compat
+# switch between applying no style overrides to SSA/ASS subtitles, and
+# overriding them almost completely with the normal subtitle style
+#u cycle-values sub-ass-override "force" "no"
+#j cycle sub                            # cycle through subtitles
+#J cycle sub down                       # ...backwards
+# Skip to previous/next subtitle (subject to some restrictions; see manpage)
+#Ctrl+LEFT   no-osd sub-seek -1
+#Ctrl+RIGHT  no-osd sub-seek  1
+# Adjust timing to previous/next subtitle
+#Ctrl+Shift+LEFT sub-step -1
+#Ctrl+Shift+RIGHT sub-step 1
+# F9 show_text ${track-list}             # show list of audio/sub streams
+# ? add sub-scale +0.1                  # increase subtitle font size
+# ? add sub-scale -0.1                  # decrease subtitle font size
+# =============================================================
+
+
+# =============================================================
+# Video
+# =============================================================
+# Move video rectangle
+#Alt+left  add video-pan-x  0.1
+#Alt+right add video-pan-x -0.1
+#Alt+up    add video-pan-y  0.1
+#Alt+down  add video-pan-y -0.1
+# Zoom/unzoom video
+#Alt++     add video-zoom   0.1
+#Alt+-     add video-zoom  -0.1
+# Reset video zoom/pan settings
+#Alt+BS set video-zoom 0 ; set video-pan-x 0 ; set video-pan-y 0
+
+#1 add contrast -1
+#2 add contrast 1
+#3 add brightness -1
+#4 add brightness 1
+#5 add gamma -1
+#6 add gamma 1
+#7 add saturation -1
+#8 add saturation 1
+# =============================================================
+
+
+# =============================================================
+# Speed
+# =============================================================
+#[ multiply speed 1/1.1                 # scale playback speed
+#] multiply speed 1.1
+#{ multiply speed 0.5
+#} multiply speed 2.0
+#BS set speed 1.0                       # reset speed to normal
+# =============================================================
+
+
+# =============================================================
+# # Informations
+# =============================================================
+#o show-progress
+#P show-progress
+
+#i script-binding stats/display-stats
+#I script-binding stats/display-stats-toggle
+# =============================================================
+
+
+# =============================================================
+# Screenshot
+# =============================================================
+#s async screenshot                     # take a screenshot
+#S async screenshot video               # ...without subtitles
+#Ctrl+s async screenshot window         # ...with subtitles and OSD, and scaled
+#Alt+s screenshot each-frame            # automatically screenshot every frame
+# =============================================================
+
+
+# =============================================================
+# Media keys
+# =============================================================
+#POWER quit
+#PLAY cycle pause
+#PAUSE cycle pause
+#PLAYPAUSE cycle pause
+#STOP quit
+#FORWARD seek 60
+#REWIND seek -60
+#NEXT playlist-next
+#PREV playlist-prev
+#VOLUME_UP add volume 2
+#VOLUME_DOWN add volume -2
+#MUTE cycle mute
+#CLOSE_WIN quit
+#CLOSE_WIN {encode} quit 4
+# =============================================================
+
+
+# =============================================================
+# Others
+# =============================================================
+#Shift+BS revert-seek                   # undo previous (or marked) seek
+#Shift+Ctrl+BS revert-seek mark         # mark position for revert-seek
+
+#. frame-step                           # advance one frame and pause
+#, frame-back-step                      # go back by one frame and pause
+
+#O no-osd cycle-values osd-level 3 1    # cycle through OSD mode
+
+
+#Alt+0 set window-scale 0.5
+#Alt+1 set window-scale 1.0
+#Alt+2 set window-scale 2.0
+
+# toggle deinterlacer (automatically inserts or removes required filter)
+#d cycle deinterlace
+
+#_ cycle video
+
+#T cycle ontop                          # toggle video window ontop of other windows
+#f cycle fullscreen                     # toggle fullscreen
+
+
+#w add panscan -0.1                     # zoom out with -panscan 0 -fs
+#W add panscan +0.1                     #      in
+#e add panscan +0.1                     # same as previous binding (discouraged)
+
+# cycle video aspect ratios; "-1" is the container aspect
+#A cycle-values video-aspect "16:9" "4:3" "2.35:1" "-1"
+
+#E cycle edition                        # next edition
+#l ab-loop                              # Set/clear A-B loop points
+#L cycle-values loop-file "inf" "no"    # toggle infinite looping
+#ctrl+c quit 4
+#DEL script-binding osc/visibility      # cycle OSC display
+#ctrl+h cycle-values hwdec "auto" "no"  # cycle hardware decoding
+#F8 show_text ${playlist}               # show playlist
+
+
+#q {encode} quit 4
+#ESC {encode} quit 4
+# =============================================================
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/vim.html b/docs/vim.html new file mode 100644 index 0000000..3b75e4c --- /dev/null +++ b/docs/vim.html @@ -0,0 +1,2301 @@ + + + + + + + + +Vim Config + + + + + + + + + + + + +
+ UP + | + HOME +
+

Vim Config

+ + +
+

Plugins Install

+
+
+
+

Plug start

+
+
+
call plug#begin('~/.vim/plugged')
+
+
+
+
+ +
+

Manage Files

+
+
+
Plug 'tpope/vim-vinegar'                                          " Combine with netrw to create a delicious salad dressing
+Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } " A command-line fuzzy finder written in Go
+Plug 'junegunn/fzf.vim'                                           " Fzf for vim
+
+
+
+
+ +
+

Text Objects

+
+
+
Plug 'kana/vim-textobj-user'           " Create your own text objects
+Plug 'kana/vim-textobj-line'           " Text objects for the current line
+Plug 'kana/vim-textobj-entire'         " Text objects for entire buffer
+Plug 'michaeljsmith/vim-indent-object' " Defines a new text object representing lines of code at the same indent level
+Plug 'jiangmiao/auto-pairs'            " Vim plugin, insert or delete brackets, parens, quotes in pair
+
+
+
+
+ +
+

Git

+
+
+
Plug 'jreybert/vimagit'
+Plug 'tpope/vim-fugitive'     " A Git wrapper so awesome, it should be illegal
+Plug 'junegunn/gv.vim'        " A git commit browser
+Plug 'mhinz/vim-signify'      " Show a diff using Vim its sign column
+
+
+
+
+ +
+

Motions, Search

+
+
+
Plug 'terryma/vim-expand-region' " Vim plugin that allows you to visually select increasingly larger regions of text using the same key combination
+Plug 'justinmk/vim-sneak'        " The missing motion for Vim
+Plug 'haya14busa/is.vim'         " Improved incremental searching for Vim
+
+
+
+
+ +
+

Manipulate Things

+
+
+
Plug 'tpope/vim-surround'      " Quoting/parenthesizing made simple
+Plug 'tpope/vim-commentary'    " Comment stuff out
+Plug 'junegunn/vim-easy-align' " A Vim alignment plugin
+Plug 'Olical/vim-enmasse'      " Edit every line in a quickfix list at the same time
+Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '<plug>(GrepperOperator)'] } "
+
+
+
+
+ +
+

Utils

+
+
+
Plug 'tpope/vim-repeat'         " Enable repeating supported plugin maps with '.'
+Plug 'tpope/vim-obsession'      " Continuously updated session files
+Plug 'tpope/vim-eunuch'         " eunuch.vim: helpers for UNIX
+Plug 'kana/vim-operator-user'   " Define your own operator easily
+Plug 'majutsushi/tagbar'        " Vim plugin that displays tags in a window, ordered by scope
+Plug 'tpope/vim-speeddating'    " use CTRL-A/CTRL-X to increment dates, times, and more
+Plug 'liuchengxu/vim-which-key' " Vim plugin that shows keybindings in popup
+
+
+
+
+ +
+

Visual

+
+
+
Plug 'itchyny/lightline.vim'  " A light and configurable statusline/tabline for Vim
+Plug 'Yggdroot/indentLine'    " A vim plugin to display the indention levels with thin vertical lines
+Plug 'ryanoasis/vim-devicons' " Adds file type glyphs/icons to many popular Vim plugins such as: NERDTree, vim-airline, unite, vim-startify and many more
+Plug 'mhinz/vim-startify'     " The fancy start screen for Vim
+Plug 'junegunn/goyo.vim'      " Distraction-free writing in Vim
+
+
+
+
+ +
+

Themes

+
+
+
Plug 'morhetz/gruvbox'         " Retro groove color scheme for Vim
+
+
+
+
+ +
+

Language Server Protocol

+
+
+
Plug 'autozimu/LanguageClient-neovim', {
+    \ 'branch': 'next',
+    \ 'do': 'bash install.sh',
+    \ }
+
+
+
+
+ +
+

Snippnets and autocompletion

+
+
+
Plug 'SirVer/ultisnips'   " The ultimate snippet solution for Vim
+" TODO Alternative https://github.com/Shougo/neosnippet.vim
+Plug 'honza/vim-snippets' " Vim-snipmate default snippets
+
+
+
+
+ +
+

Syntax Checking and Build Utils

+
+
+
Plug 'neomake/neomake' " Asynchronous linting and make framework for Neovim/Vim
+
+
+
+
+ +
+

Auto Completion

+
+
+
if has('nvim')
+  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
+  Plug 'Nelyah/deoplete-mu'
+else
+  Plug 'Shougo/deoplete.nvim'
+  Plug 'roxma/nvim-yarp'
+  Plug 'roxma/vim-hug-neovim-rpc'
+  Plug 'Nelyah/deoplete-mu'
+endif
+
+
+
+
+ +
+

Tmux

+
+
+
Plug 'christoomey/vim-tmux-navigator' " Seamless navigation between tmux panes and vim splits
+Plug 'jpalardy/vim-slime'             " Used to type text into a REPL
+
+
+
+
+ +
+

Syntax

+
+
+
Plug 'sheerun/vim-polyglot' " A solid language pack for Vim
+
+
+
+
+ +
+

Markdown

+
+
+
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }            " Markdown Vim Mode
+Plug 'mzlogin/vim-markdown-toc', { 'for': 'markdown' }           " A vim plugin to generate table of contents for Markdown files
+Plug 'JamshedVesuna/vim-markdown-preview', { 'for': 'markdown' } " A light Vim plugin for previewing markdown files in a browser
+Plug 'nelstrom/vim-markdown-folding'                             " Fold markdown documents by section
+
+
+
+
+ +
+

LaTeX

+
+
+
Plug 'lervag/vimtex', { 'for': 'tex' } " A modern vim plugin for editing LaTeX files.
+
+
+
+
+ +
+

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
+
+
+
+
+ +
+

Org Mode

+
+
+
Plug 'jceb/vim-orgmode'             " Text outlining and task management for Vim
+Plug 'vim-scripts/SyntaxRange' " Define a different filetype syntax on regions of a buffer
+Plug 'chrisbra/NrrwRgn' " A Narrow Region Plugin for vim
+Plug 'mattn/calendar-vim' " calendar vimscript
+Plug 'vim-scripts/utl.vim' " Univeral Text Linking - Execute URLs, footnotes, open emails, organize ideas
+
+
+
+
+ +
+

Others / To test

+
+
+
" Plug 'francoiscabrol/ranger.vim' " Ranger integration in vim and neovim
+" Plug 'brooth/far.vim'            " Find And Replace Vim plugin
+" Plug 'justinmk/vim-gtfo'         " Go to Terminal or File manager
+" Plug 'sjl/gundo.vim', { 'on':  'GundoToggle' } " Vim plugin to visualize your Vim undo tree
+" Plug 'drzel/vim-line-no-indicator'             " Simple and expressive line number indicator
+
+
+
+
+ +
+

Plug End

+
+
+
call plug#end()
+
+
+
+
+
+ +
+

Basic

+
+
+
+

General

+
+
+
set runtimepath+=~/.vim
+
+" Sets how many lines of history VIM has to remember
+set history=500
+
+" Enable filetype plugins
+filetype plugin on
+filetype indent on
+
+" Set to auto read when a file is changed from the outside
+set autoread
+
+" writes the content of the file automatically if you call :make
+set autowrite
+
+" Share clipboard with system
+set clipboard+=unnamedplus
+
+" Define Leader Key as Space key
+let mapleader = "\<Space>"
+let g:mapleader = "\<Space>"
+let maplocalleader = ","
+
+
+
+
+ +
+

VIM user interface

+
+
+
" Set 7 lines to the cursor - when moving vertically using j/k
+set so=7
+
+" Avoid garbled characters in Chinese language windows OS
+let $LANG='en'
+set langmenu=en
+
+" Set Timeout config
+set timeout
+set ttimeout
+set timeoutlen=500
+set ttimeoutlen=50
+
+" Turn on the wild menu
+set wildmenu
+
+" Ignore compiled files
+set wildignore=*.o,*~,*.pyc
+if has("win16") || has("win32")
+    set wildignore+=.git\*,.hg\*,.svn\*
+else
+    set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
+endif
+
+set wildmode=full
+
+"Always show current position
+set ruler
+
+" Height of the command bar
+set cmdheight=1
+
+" A buffer becomes hidden when it is abandoned
+set hid
+
+" Configure backspace so it acts as it should act
+set backspace=eol,start,indent
+set whichwrap+=<,>,h,l
+
+" Ignore case when searching
+set ignorecase
+
+" When searching try to be smart about cases
+set smartcase
+
+" Option for smarter completions that will be case aware
+set infercase
+
+" Highlight search results
+set hlsearch
+
+" Makes search act like search in modern browsers
+set incsearch
+
+" Don't redraw while executing macros (good performance config)
+set lazyredraw
+
+" For regular expressions turn magic on
+set magic
+
+" Show matching brackets when text indicator is over them
+set showmatch
+
+" Don't show tab line if there is only one tab
+set showtabline=1
+
+" How tany tenths of a second to blink when matching brackets
+set mat=2
+
+" No annoying sound on errors
+set noerrorbells
+set novisualbell
+set t_vb=
+set tm=500
+
+" Add a bit extra margin to the left
+set foldcolumn=0
+
+" Improve VIM scrolling
+set ttyfast
+
+" Relative Numbers
+set relativenumber
+
+" Smarter J and K navigation
+nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
+nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
+
+" Splits open at the bottom and right, which is non-retarded, unlike vim defaults.
+set splitbelow splitright
+
+
+
+
+ +
+

Foldings

+
+
+
if has('folding')
+    if has('windows')
+        let &fillchars='vert: '           " less cluttered vertical window separators
+    endif
+    set foldmethod=indent               " not as cool as syntax, but faster
+    set foldlevelstart=99               " start unfolded
+endif
+
+
+
+
+ +
+

Colors and Fonts

+
+
+
syntax enable
+
+set background=dark
+
+let base16colorspace=256
+
+let g:gruvbox_contrast_dark = 'soft'
+
+try
+    colorscheme gruvbox
+catch
+endtry
+
+" set cursor shapes for insert and replace modes
+set guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
+
+" Set utf8 as standard encoding
+set encoding=utf-8
+set fileencoding=utf-8
+
+" Use Unix as the standard file type
+set ffs=unix,dos,mac
+
+" Do not highlight the cursor line : http://vim.wikia.com/wiki/Highlight_current_line
+set nocursorline
+set nocursorcolumn
+
+" Always show the status line
+set laststatus=2
+
+" Underline for bad spelled words
+hi clear SpellBad
+hi SpellBad cterm=underline
+" Set style for gVim
+hi SpellBad gui=undercurl
+
+
+
+
+ +
+

Files, backups and undo

+
+
+
" Turn backup off, since most stuff is in SVN, git et.c anyway...
+set nobackup
+set nowb
+set noswapfile
+
+
+
+
+ +
+

Text, tab and indent related

+
+
+
" Use spaces instead of tabs
+set expandtab
+
+" Be smart when using tabs
+set smarttab
+
+" 1 tab == 4 spaces
+set shiftwidth=4
+set tabstop=4
+
+" Word wrap without line breaks
+set wrap
+set linebreak
+set nolist  " list disables linebreak
+
+set autoindent " Auto Indentation
+set nosmartindent " No Smart Indentation
+
+
+
+
+ +
+

Moving around, tabs, windows and buffers

+
+
+
" Specify the behavior when switching between buffers
+try
+    set switchbuf=useopen,usetab
+catch
+endtry
+
+" Return to last edit position when opening files (You want this!)
+au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
+
+set splitbelow
+set splitright
+
+" This enables mouse in all modes
+set mouse=a
+
+" Automatically equalize splits when Vim is resized
+autocmd VimResized * wincmd =
+
+
+
+
+ +
+

Misc

+
+
+
" Enable Line Number
+set number
+
+" Speed up cursor movments : http://superuser.com/a/625994/587300
+set regexpengine=1 " https://github.com/xolox/vim-easytags/issues/88
+
+" Set the maximum column for syntax highlighting
+set synmaxcol=250
+
+
+
+
+ +
+

Helper functions

+
+
+
function! CmdLine(str)
+    exe "menu Foo.Bar :" . a:str
+    emenu Foo.Bar
+    unmenu Foo
+endfunction
+
+function! VisualSelection(direction, extra_filter) range
+    let l:saved_reg = @"
+    execute "normal! vgvy"
+
+    let l:pattern = escape(@", '\\/.*$^~[]')
+    let l:pattern = substitute(l:pattern, "\n$", "", "")
+
+    if a:direction == 'gv'
+        call CmdLine("Ag \"" . l:pattern . "\" " )
+    elseif a:direction == 'replace'
+        call CmdLine("%s" . '/'. l:pattern . '/')
+    endif
+
+    let @/ = l:pattern
+    let @" = l:saved_reg
+endfunction
+
+" Don't close window, when deleting a buffer
+command! Bclose call <SID>BufcloseCloseIt()
+function! <SID>BufcloseCloseIt()
+    let l:currentBufNum = bufnr("%")
+    let l:alternateBufNum = bufnr("#")
+
+    if buflisted(l:alternateBufNum)
+        buffer #
+    else
+        bnext
+    endif
+
+    if bufnr("%") == l:currentBufNum
+        new
+    endif
+
+    if buflisted(l:currentBufNum)
+        execute("bdelete! ".l:currentBufNum)
+    endif
+endfunction
+
+
+
+
+ +
+

GUI related

+
+
+
set guifont=Hack\ Nerd\ Font\ Mono:h13
+set gfn=Hack\ Nerd\ Font\ Mono:h13
+
+" Disable scrollbars
+set guioptions-=r
+set guioptions-=R
+set guioptions-=l
+set guioptions-=L
+
+
+
+
+ +
+

Turn persistent undo on

+
+
+
try
+    set undodir=~/.vim_runtime/temp_dirs/undodir
+    set undofile
+catch
+endtry
+
+
+
+
+
+ +
+

Mappings

+
+
+
+

Normal mode related

+
+
+
" Smart way to move between windows
+noremap <C-j> <C-W>j
+noremap <C-k> <C-W>k
+noremap <C-h> <C-W>h
+noremap <C-l> <C-W>l
+
+
+
+
+ +
+

Insert mode related

+
+
+
" Paste while in insert mode
+inoremap <C-v> <C-r>*
+
+" Go to the end of line
+inoremap <C-e> <Esc>A
+
+" Go to the beginning of line
+inoremap <C-a> <Esc>I
+
+
+
+
+ +
+

Visual mode related

+
+
+
" Visual mode pressing / or ? searches for the current selection
+vnoremap <silent> / :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
+vnoremap <silent> ? :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
+
+" Re-select visual block after indenting
+vnoremap < <gv
+vnoremap > >gv
+
+" Move visual block
+vnoremap J :m '>+1<CR>gv=gv
+vnoremap K :m '<-2<CR>gv=gv
+
+
+
+
+ +
+

Add some delimiters

+
+
+
" use $ as a delimiter
+xnoremap i$ :<C-u>normal! T$vt$<CR>
+xnoremap a$ :<C-u>normal! T$hvt$l<CR>
+onoremap i$ :normal vi$<CR>
+onoremap a$ :normal va$<CR>
+
+
+
+
+ +
+

Command mode related

+
+
+
" Bash like keys for the command line
+cnoremap <C-A> <Home>
+cnoremap <C-E> <End>
+cnoremap <C-K> <C-U>
+
+cnoremap <C-P> <Up>
+cnoremap <C-N> <Down>
+
+
+
+
+ +
+

Terminal mode related

+
+
+
" tnoremap <Esc> <C-\><C-n>
+
+tnoremap <C-w>h <C-\><C-n><C-w>h
+tnoremap <C-w>j <C-\><C-n><C-w>j
+tnoremap <C-w>k <C-\><C-n><C-w>k
+tnoremap <C-w>l <C-\><C-n><C-w>l
+
+
+
+
+ +
+

Correct misspelled works

+
+

+Taken from: https://vi.stackexchange.com/questions/68/autocorrect-spelling-mistakes +

+
+
" Go back to last misspelled word and pick first suggestion.
+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>
+inoremap <C-K> <Esc>[sve<C-G>
+snoremap <C-K> <Esc>b[sviw<C-G>
+
+
+
+
+
+ +
+

Filetypes

+
+
+
+

Vim Which Key

+
+
+
nnoremap <silent> <localleader> :<c-u>WhichKey  ','<CR>
+
+let g:which_key_map_local =  {}
+
+
+
+
+ +
+

Mails

+
+
+
autocmd FileType mail set spell spelllang=en_us,fr
+
+
+
+
+
+

MarkDown

+
+
+
" Automatically turn on spell-checking for Markdown files
+au BufRead,BufNewFile *.md setlocal spell spelllang=fr,en
+
+
+
+
+ +
+

LaTeX

+
+
+
" TODO : améliorer ça
+au BufRead,BufNewFile *.tikz set filetype=tex
+let tex_no_error=1 " TODO: used to not highlight underscores
+au BufRead,BufNewFile *.tex set filetype=tex
+au BufRead,BufNewFile *.tex let b:AutoPairs={'(':')', '[':']', '{':'}',"'":"'",'"':'"', '`':'`', '$':'$'}
+
+au BufRead,BufNewFile *.tex set iskeyword+=-
+
+" " clear the current list of matches that cause error-highlighting
+" syn clear texOnlyMath
+" " still mark '^' as an error outside of math mode
+" syn match texOnlyMath /[\^]/
+
+" autocmd FileType tex,tikz nnoremap <leader>lt <plug>(vimtex-toc-toggle)
+" autocmd FileType tex,tikz nnoremap <leader>ll <plug>(vimtex-labels-open)
+" autocmd FileType tex,tikz nnoremap <leader>lv <plug>(vimtex-view)
+" autocmd FileType tex,tikz nnoremap <leader>lf <plug>(vimtex-reverse-search)
+
+" " Make Tikz
+" nnoremap <leader>mt :Make pdf t=tikz f=%:t:r<cr>
+" nnoremap <leader>mto :make open t=tikz f=%:t:r<cr>
+
+" " Make LaTeX
+" nnoremap <leader>ml :Make pdf f=%:t:r<cr>
+" nnoremap <leader>mlo :make open f=%:t:r<cr>
+
+
+
+
+ +
+

Arduino

+
+
+
au BufRead,BufNewFile *.pde set filetype=arduino
+au BufRead,BufNewFile *.ino set filetype=arduino
+" au FileType arduino map <leader>ac :!platformio run<CR>
+" au FileType arduino map <leader>au :!platformio run -s --target=upload<CR>
+" au FileType arduino map <leader>am :!platformio serialports monitor --port=/dev/cu
+
+
+
+
+ +
+

Python

+
+
+
let g:slime_python_ipython = 1
+
+au FileType python setlocal expandtab
+au FileType python setlocal tabstop=4
+au FileType python setlocal shiftwidth=4
+
+" Run Section
+au FileType python nmap <buffer> <localleader><localleader> <Plug>SlimeParagraphSend
+
+" Run Selected text
+au FileType python vmap <buffer> <localleader><localleader> <Plug>SlimeRegionSend
+
+" CD to directory of current file
+" TODO - Should enter the command. This just output the command without runing
+" it...
+au FileType python nmap <buffer> <localleader>c :SlimeSend0('cd '.expand('%:p:h'))<CR>
+
+" let python_highlight_all = 1
+" au FileType python syn keyword pythonDecorator True None False self
+
+" au BufNewFile,BufRead *.jinja set syntax=htmljinja
+" au BufNewFile,BufRead *.mako set ft=mako
+
+" au FileType python map <buffer> F :set foldmethod=indent<cr>
+
+" au FileType python inoremap <buffer> $r return
+" au FileType python inoremap <buffer> $i import
+" au FileType python inoremap <buffer> $p print
+" au FileType python inoremap <buffer> $f #--- <esc>a
+" au FileType python map <buffer> <leader>1 /class
+" au FileType python map <buffer> <leader>2 /def
+" au FileType python map <buffer> <leader>C ?class
+" au FileType python map <buffer> <leader>D ?def
+
+
+
+
+ +
+

Matlab

+
+
+
" TODO Run Section (delimited by %%)
+au FileType matlab nmap <buffer> <localleader>mm <Plug>SlimeParagraphSend
+let g:which_key_map_local.m = { 'name' : '+matlab' }
+
+" Run either Selected text
+au FileType matlab vmap <buffer> <localleader>mm <Plug>SlimeRegionSend
+let g:which_key_map_local.mm = 'run-code'
+
+func! GetSelectedText()
+  normal gv"xy
+  let result = getreg("x")
+  normal gv
+  return result
+endfunc
+
+" Help on the current selection
+au FileType matlab vmap <buffer> <localleader>mh :<C-U>SlimeSend0('help '.expand(GetSelectedText()))<CR>
+let g:which_key_map_local.mh = 'help'
+
+" Documentation on the current selection
+au FileType matlab vmap <buffer> <localleader>mH :<C-U>SlimeSend0('doc '.expand(GetSelectedText()))<CR>
+let g:which_key_map_local.mh = 'help'
+
+" Open the current file in the Matlab Editor (usefull for debuging)
+au FileType matlab nmap <buffer> <localleader>me :SlimeSend0('edit '.expand('%:p'))<CR>
+let g:which_key_map_local.me = 'edit-gui'
+
+" Run all the file
+au FileType matlab nmap <buffer> <localleader>mr :SlimeSend0('run '.expand('%:t'))<CR>
+let g:which_key_map_local.mr = 'run-file'
+
+" Send "cd filepath" to matlab
+au FileType matlab nmap <buffer> <localleader>mc :SlimeSend0('cd '.expand('%:p:h'))<CR>
+let g:which_key_map_local.mr = 'cd-file'
+
+" Open workspace
+au FileType matlab nmap <buffer> <localleader>mw :SlimeSend0('workspace')<CR>
+let g:which_key_map_local.mr = 'workspace'
+
+
+
+
+ +
+

Sage

+
+
+
" TODO Run Section
+au FileType sage.python nmap <buffer> <localleader><localleader> <Plug>SlimeParagraphSend
+
+" Run Selected text
+au FileType sage.python vmap <buffer> <localleader><localleader> <Plug>SlimeRegionSend
+
+
+
+
+ +
+

Save Which Key Configuration

+
+
+
call which_key#register(',', "g:which_key_map_local")
+
+
+
+
+
+ +
+

Plugins Config

+
+
+
+

junegunn/fzf

+
+
+
" This is the default extra key bindings
+let g:fzf_action = {
+  \ 'ctrl-t': 'tab split',
+  \ 'ctrl-h': 'split',
+  \ 'ctrl-v': 'vsplit' }
+" [[B]Commits] Customize the options used by 'git log':
+let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
+
+let g:fzf_colors =
+\ { 'fg':      ['fg', 'Normal'],
+  \ 'bg':      ['bg', 'Normal'],
+  \ 'hl':      ['fg', 'Comment'],
+  \ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
+  \ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],
+  \ 'hl+':     ['fg', 'Statement'],
+  \ 'info':    ['fg', 'PreProc'],
+  \ 'prompt':  ['fg', 'Conditional'],
+  \ 'pointer': ['fg', 'Exception'],
+  \ 'marker':  ['fg', 'Keyword'],
+  \ 'spinner': ['fg', 'Label'],
+  \ 'header':  ['fg', 'Comment'] }
+
+function! s:fzf_statusline()
+  " Override statusline as you like
+  highlight fzf1 ctermfg=161 ctermbg=251
+  highlight fzf2 ctermfg=23 ctermbg=251
+  highlight fzf3 ctermfg=237 ctermbg=251
+  setlocal statusline=%#fzf1#\ >\ %#fzf2#fz%#fzf3#f
+endfunction
+
+autocmd! User FzfStatusLine call <SID>fzf_statusline()
+
+
+
+
+ +
+

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'],
+    \ }
+
+nnoremap <F5> :call LanguageClient_contextMenu()<CR>
+" Or map each action separately
+nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
+nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
+nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
+
+
+
+
+ +
+

JamshedVesuna/vim-markdown-preview

+
+
+
let vim_markdown_preview_github=1
+let vim_markdown_preview_browser='Google Chrome'
+let vim_markdown_preview_temp_file=1
+" let vim_markdown_preview_pandoc=1
+
+
+
+
+ +
+

mhinz/vim-signify

+
+
+
let g:signify_vcs_list = ['git']
+
+let g:signify_disable_by_default = 1
+
+
+
+
+ +
+

Deoplete

+
+
+
let g:deoplete#enable_at_startup = 1
+
+" let g:deoplete#omni#functions = {}
+" set completeopt=longest,menuone,preview
+" let g:deoplete#sources = {}
+" let g:deoplete#enable_smart_case = 1
+" call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy'])
+
+
+
+
+ +
+

SirVer/ultisnips

+
+
+
let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip'
+
+" inoremap <silent><expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
+let g:UltiSnipsExpandTrigger="<C-j>"
+" let g:UltiSnipsJumpForwardTrigger="<tab>"
+" let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
+
+
+
+
+ +
+

honza/vim-snippets

+
+
+
let g:snipMate = {}
+let g:snipMate.scope_aliases = {}
+
+
+
+
+ +
+

itchyny/lightline.vim

+
+
+
function! LightlineObsession()
+    return '%{ObsessionStatus("")}'
+endfunction
+
+" \ 'colorscheme': 'gruvbox',
+let g:lightline = {
+    \ 'colorscheme': 'solarized',
+    \ 'active': {
+    \   'left': [ [ 'mode', 'paste' ],
+    \             [ 'filename', 'modified', 'fugitive', 'obsession' ] ]
+    \ },
+    \ 'component': {
+        \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
+    \ },
+    \ 'component_expand': {
+    \   'obsession': 'LightlineObsession'
+    \ },
+    \ 'component_visible_condition': {
+    \   'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
+    \ },
+    \ 'separator': { 'left': '', 'right': '' },
+    \ 'subseparator': { 'left': "|", 'right': "|" }
+\ }
+
+
+
+
+ +
+

Autopairs

+
+
+
" Incompatibilité entre auto-pairs et clang-complete
+let g:AutoPairsMapCR = 0
+imap <silent><CR> <CR><Plug>AutoPairsReturn
+
+
+
+
+ +
+

Yggdroot/indentLine

+
+
+
" :IndentLinesToggle toggles lines on and off.
+let g:indentLine_color_term = 239
+
+
+
+
+ +
+

ryanoasis/vim-devicons

+
+
+
let g:webdevicons_enable_ctrlp = 1
+
+
+
+
+ +
+

junegunn/goyo.vim

+
+
+
let g:goyo_width=100
+let g:goyo_margin_top = 2
+let g:goyo_margin_bottom = 2
+
+
+ +

+This is for soft line breaks +

+
+
function! s:goyo_enter()
+    set wrap linebreak nolist textwidth=0 wrapmargin=0
+
+    let b:quitting = 0
+    let b:quitting_bang = 0
+    autocmd QuitPre <buffer> let b:quitting = 1
+    cabbrev <buffer> q! let b:quitting_bang = 1 <bar> q!
+endfunction
+
+
+ +

+Quit Vim if this is the only remaining buffer +

+
+
function! s:goyo_leave()
+    if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1
+        if b:quitting_bang
+            qa!
+        else
+            qa
+        endif
+    endif
+endfunction
+
+
+ +
+
autocmd! User GoyoEnter call <SID>goyo_enter()
+autocmd! User GoyoLeave call <SID>goyo_leave()
+
+
+
+
+ +
+

tpope/vim-surround

+
+
+
vmap Si S(i_<esc>f)
+au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
+" surroung un visual mode : use S, then b to make the text bold in markdown
+let g:surround_{char2nr('b')} = "__\r__"
+
+
+
+
+ +
+

Vim-Markdown

+
+
+
let g:vim_markdown_folding_disabled = 1
+let g:vim_markdown_conceal = 0
+let g:vim_markdown_toc_autofit = 1
+let g:vim_markdown_toml_frontmatter = 1
+
+let g:tex_conceal = ""
+
+
+
+
+ +
+

Neomake

+
+
+
" Latex
+autocmd! BufWritePost *.tex Neomake
+let g:neomake_tex_chktex_maker = {
+\ 'exe': 'chktex',
+\ 'args': ['--inputfiles'],
+\ 'errorformat':
+\ '%EError %n in %f line %l: %m,' .
+\ '%WWarning %n in %f line %l: %m,' .
+\ '%WMessage %n in %f line %l: %m,' .
+\ '%Z%p^,' .
+\ '%-G%.%#'
+\ }
+
+let g:neomake_tex_enabled_makers = ['chktex']
+
+" Matlab
+autocmd! BufWritePost *.m Neomake
+let g:neomake_matlab_mlint_maker = {
+  \ 'exe': 'mlint',
+  \ 'mapexpr': "neomake_bufname.':'.v:val",
+  \ 'errorformat':
+  \     '%f:L %l (C %c): %m,' .
+  \     '%f:L %l (C %c-%*[0-9]): %m,',
+  \ }
+let g:neomake_matlab_enabled_makers = ['mlint']
+
+
+
+
+ +
+

lervag/vimtex

+
+
+
" let g:tex_conceal=""
+" autocmd FileType tex let b:vimtex_main = 'main.tex'
+" let g:vimtex_mappings_enabled=0
+
+
+
+
+ +
+

jpalardy/vim-slime

+
+
+
if exists('$TMUX')
+let g:slime_target = "tmux"
+let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.2"}
+let g:slime_dont_ask_default = 1
+endif
+
+
+
+
+ +
+

mhinz/vim-grepper

+
+
+
" nnoremap <leader>G :Grepper -tool ag<cr>
+" nmap gs  <plug>(GrepperOperator)
+" xmap gs  <plug>(GrepperOperator)
+
+
+
+
+ +
+

Editor config

+
+
+
" To ensure that this plugin works well with Tim Pope's fugitive, use the following patterns array:
+let g:EditorConfig_exclude_patterns = ['fugitive://.*']
+
+
+
+
+ +
+

Polyglot

+
+
+
let g:polyglot_disabled = ['latex']
+
+
+
+
+
+ +
+

Bindings

+
+
+
+

Vim Which Key

+
+
+
nnoremap <silent> <leader> :WhichKey '<Space>'<cr>
+
+let g:which_key_map =  {}
+
+
+
+
+ +
+

Direct ones

+
+
+
" Switch with last buffer
+nnoremap <leader><Tab> :e #<cr>
+" let g:which_key_map.<Tab> = 'last-buffer'
+
+
+
+
+ +
+

Quit

+
+
+
let g:which_key_map.q = { 'name' : '+quit' }
+
+" Quit
+nnoremap <leader>qq :qa<cr>
+let g:which_key_map.q.q = 'quit'
+
+" Quit - Force
+nnoremap <leader>qQ :qa!<cr>
+let g:which_key_map.q.Q = 'quit-force'
+
+" Quit - Save
+nnoremap <leader>qw :wq<cr>
+let g:which_key_map.q.w = 'quit-save'
+
+" Quit - Save all
+nnoremap <leader>qW :wqa<cr>
+let g:which_key_map.q.W = 'quit-save-all'
+
+
+
+
+ +
+

Files

+
+
+
let g:which_key_map.f = { 'name' : '+files' }
+
+" Fast saving
+nnoremap <leader>fs :w!<cr>
+let g:which_key_map.f.s = 'save-file'
+
+" Fast saving all
+nnoremap <leader>fS :wa!<cr>
+let g:which_key_map.f.S = 'save-all'
+
+" Find Files
+noremap <leader>ff :Files<CR>
+let g:which_key_map.f.f = 'find-file'
+
+" Find File corresping to Word
+nnoremap <leader>fw
+  \ :call fzf#vim#files('.', fzf#vim#with_preview({'options': ['--query', expand('<cword>')]}))<cr>
+" TODO - Add visual keymap
+" vnoremap <leader>fw
+  " \ :call fzf#vim#files('.', fzf#vim#with_preview({'options': ['--query', <C-r>0]}))<cr>
+let g:which_key_map.f.w = 'find-file-word'
+
+
+
+
+ +
+

Buffers

+
+
+
let g:which_key_map.b = { 'name' : '+buffers' }
+
+" Buffer Create
+noremap <leader>bc :enew<cr>
+let g:which_key_map.b.c = 'buffer-create'
+
+" Buffer Delete
+noremap <leader>bd :Bclose<cr>
+let g:which_key_map.b.d = 'buffer-delete'
+
+" Buffer Delete all others
+noremap <leader>bD :bufdo bd<cr>
+let g:which_key_map.b.D = 'buffer-delete-others'
+
+" Buffer Next
+noremap <leader>bn :bnext<cr>
+let g:which_key_map.b.n = 'buffer-next'
+
+" Buffer Previous
+noremap <leader>bp :bprevious<cr>
+let g:which_key_map.b.p = 'buffer-previous'
+
+" Find Buffers
+noremap <leader>bf :Buffers<CR>
+let g:which_key_map.b.f = 'buffer-find'
+
+" Buffer Home (startify)
+noremap <leader>bh :Startify<CR>
+let g:which_key_map.b.h = 'buffer-home'
+
+" CD to buffer path
+noremap <leader>bw :cd %:p:h<CR>:pwd<CR>
+let g:which_key_map.b.w = 'buffer-pwd'
+
+
+
+
+ +
+

Tabs

+
+
+
let g:which_key_map.t = { 'name' : '+tabs' }
+
+" Let 'tt' toggle between this and the last accessed tab
+let g:lasttab = 1
+au TabLeave * let g:lasttab = tabpagenr()
+
+" Tab New
+nnoremap <leader>tc :tabnew<cr>
+let g:which_key_map.t.c = 'tab-create'
+
+" Tab Delete
+nnoremap <leader>td :tabclose<cr>
+let g:which_key_map.t.d = 'tab-delete'
+
+" Tab Maximize
+nnoremap <leader>tD :tabonly<cr>
+let g:which_key_map.t.D = 'tab-delete-others'
+
+" Tab Left
+nnoremap <leader>th gt<cr>
+let g:which_key_map.t.h = 'tab-left'
+
+" Tab Right
+nnoremap <leader>tl gT<cr>
+let g:which_key_map.t.l = 'tab-right'
+
+" Tab Move Left
+nnoremap <leader>tH :tabmove -1<cr>
+let g:which_key_map.t.H = 'tab-move-left'
+
+" Tab Move Right
+nnoremap <leader>tL :tabmove +1<cr>
+let g:which_key_map.t.L = 'tab-move-right'
+
+" Tab Toggle
+nnoremap <Leader>tt :exe "tabn ".g:lasttab<CR>
+let g:which_key_map.t.t = 'tab-toggle'
+
+
+
+
+ +
+

Terminals

+
+
+
let g:which_key_map.T = { 'name' : '+terminals' }
+
+" Quickly create a new terminal in a new tab
+nnoremap <Leader>Tc :tab new<CR>:term<CR>
+let g:which_key_map.T.c = 'term-create'
+
+" Quickly create a new terminal in a vertical split
+nnoremap <Leader>T/ :vsplit<CR>:term<CR>
+" let g:which_key_map.T./ = 'term-vert'
+
+" Quickly create a new terminal in a horizontal split
+nnoremap <Leader>T- :split<CR>:term<CR>
+" let g:which_key_map.T.- = 'term-hor'
+
+
+
+
+ +
+

Splits / Windows

+
+
+
let g:which_key_map.w = { 'name' : '+windows' }
+
+" Split Horizontal
+nnoremap <leader>w- :split<cr>
+" let g:which_key_map.w.- = 'win-hor'
+
+" Split Vertical
+nnoremap <leader>w/ :vsplit<cr>
+" let g:which_key_map.w./ = 'win-vert'
+
+" Split Maximize
+nnoremap <leader>wD <C-w>o
+let g:which_key_map.w.D = 'win-delete-others'
+
+" Split Delete
+nnoremap <leader>wd <C-w>q
+let g:which_key_map.w.d = 'win-delete'
+
+" Split Go Left
+nnoremap <leader>wh :wincmd h<CR>
+let g:which_key_map.w.h = 'win-left'
+
+" Split Go Down
+nnoremap <leader>wj :wincmd j<CR>
+let g:which_key_map.w.j = 'win-down'
+
+" Split Go Up
+nnoremap <leader>wk :wincmd k<CR>
+let g:which_key_map.w.k = 'win-up'
+
+" Split Go Right
+nnoremap <leader>wl :wincmd l<CR>
+let g:which_key_map.w.l = 'win-right'
+
+" Split to Tab
+nnoremap <leader>wt <C-w>T
+let g:which_key_map.w.t = 'win-make-tab'
+
+" Find window
+nnoremap <leader>wf :Windows<CR>
+let g:which_key_map.w.f = 'win-find'
+
+" Maximize window
+nnoremap <leader>wm :call MaximizeToggle()<CR>
+let g:which_key_map.w.m = 'win-maximize'
+
+function! MaximizeToggle()
+  if exists("s:maximize_session")
+    exec "source " . s:maximize_session
+    call delete(s:maximize_session)
+    unlet s:maximize_session
+    let &hidden=s:maximize_hidden_save
+    unlet s:maximize_hidden_save
+  else
+    let s:maximize_hidden_save = &hidden
+    let s:maximize_session = tempname()
+    set hidden
+    exec "mksession! " . s:maximize_session
+    only
+  endif
+endfunction
+
+
+
+
+ +
+

Check Spell

+
+
+
let g:which_key_map.S = { 'name' : '+spell-check' }
+
+" CheckSpell Toggle
+noremap <leader>St :setlocal spell!<cr>
+let g:which_key_map.S.t = 'spell-toggle'
+
+" CheckSpell Correct
+noremap <leader>Sc z=
+let g:which_key_map.S.c = 'spell-correct'
+
+" CheckSpell Do first
+noremap <leader>SC 1z=
+let g:which_key_map.S.C = 'spell-correct-first'
+
+" CheckSpell Language
+noremap <leader>Sl :set spelllang=
+let g:which_key_map.S.l = 'spell-language'
+
+" CheckSpell Next
+noremap <leader>Sn ]s
+let g:which_key_map.S.n = 'spell-next'
+
+" CheckSpell Next and correct
+noremap <leader>SN ]s1z=
+let g:which_key_map.S.N = 'spell-next-correct'
+
+" CheckSpell Previous
+noremap <leader>Sp [s
+let g:which_key_map.S.p = 'spell-prev'
+
+" CheckSpell Previous and correct
+noremap <leader>SP [s1z=
+let g:which_key_map.S.P = 'spell-prev-correct'
+
+" CheckSpell Add to dictionnary
+noremap <leader>Sa zg
+let g:which_key_map.S.a = 'spell-add-dict'
+
+
+
+
+ +
+

Make

+
+
+
let g:which_key_map.m = { 'name' : '+make' }
+
+" Make Make
+nnoremap <leader>mm :Make -B<CR>
+let g:which_key_map.m.m = 'make'
+
+" Make Clean
+nnoremap <leader>mc :Make clean<CR>
+let g:which_key_map.m.c = 'make-clean'
+
+" Make Force
+nnoremap <leader>mf :Make! -B<CR>
+let g:which_key_map.m.f = 'make-force'
+
+" Make Run
+nnoremap <leader>mr :Make! run<cr>
+let g:which_key_map.m.r = 'make-run'
+
+" Make Open
+nnoremap <leader>mo :make! open<cr>
+let g:which_key_map.m.o = 'make-open'
+
+
+
+
+ +
+

Search

+
+
+
let g:which_key_map.s = { 'name' : '+search' }
+
+" Search History
+noremap <leader>sh :History<CR>
+let g:which_key_map.s.h = 'search-history'
+
+" Search Tags
+noremap <leader>sT :Tags<CR>
+let g:which_key_map.s.T = 'search-tags'
+
+" Search All
+noremap <leader>sa :Rg<CR>
+let g:which_key_map.s.g = 'search-all'
+
+" Search Word
+noremap <leader>sw :exe ':Rg ' . expand('<cword>')<CR>
+let g:which_key_map.s.w = 'search-word'
+
+" Search todo keyboard
+" TODO - should not have to press enter
+nnoremap <leader>st :Grepper -tool rg -query TODO<CR>
+let g:which_key_map.s.t = 'search-todos'
+
+
+
+
+ +
+

TODO - GIT

+
+
+
let g:which_key_map.g = { 'name' : '+git' }
+
+" Git Gutter
+nnoremap <silent><leader>gg :SignifyToggle<cr>
+let g:which_key_map.g.g = 'git-'
+
+" Git Gutter Highlight
+nnoremap <silent><leader>gG :SignifyToggleHighlight<cr>
+let g:which_key_map.g.G = 'git-'
+
+" Git Commit
+nnoremap <leader>gc :Gcommit<CR>
+let g:which_key_map.g.c = 'git-commit'
+
+" Git Status
+nnoremap <leader>gs :Gstatus<CR>
+let g:which_key_map.g.s = 'git-status'
+
+" Git Diff
+nnoremap <leader>gd :Gdiff<CR>
+let g:which_key_map.g.d = 'git-diff'
+
+" Git Blame
+nnoremap <leader>gb :Gblame<CR>
+let g:which_key_map.g.b = 'git-blame'
+
+" Git Visualise
+nnoremap <leader>gv :GV<CR>
+let g:which_key_map.g.v = 'git-visualize'
+
+" Git File (visualise)
+nnoremap <leader>gF :GV!<CR>
+let g:which_key_map.g.F = 'git-file'
+
+" Git Find Commits
+noremap <leader>gf :Commits<CR>
+let g:which_key_map.g.f = 'git-find-commit'
+
+
+
+
+ +
+

Errors

+
+
+
let g:which_key_map.e = { 'name' : '+errors' }
+
+function! s:GetBufferList()
+    redir =>buflist
+    silent! ls
+    redir END
+    return buflist
+endfunction
+
+function! ToggleLocationList()
+    let curbufnr = winbufnr(0)
+    for bufnum in map(filter(split(s:GetBufferList(), '\n'), 'v:val =~ "Location List"'), 'str2nr(matchstr(v:val, "\\d\\+"))')
+        if curbufnr == bufnum
+            lclose
+            return
+        endif
+    endfor
+
+    let winnr = winnr()
+    let prevwinnr = winnr("#")
+
+    let nextbufnr = winbufnr(winnr + 1)
+    try
+        lopen
+    catch /E776/
+        echohl ErrorMsg
+        echo "Location List is Empty."
+        echohl None
+        return
+    endtry
+    if winbufnr(0) == nextbufnr
+        lclose
+        if prevwinnr > winnr
+            let prevwinnr-=1
+        endif
+    else
+        if prevwinnr > winnr
+            let prevwinnr+=1
+        endif
+    endif
+    " restore previous window
+    exec prevwinnr."wincmd w"
+    exec winnr."wincmd w"
+endfunction
+
+" Error Toggle
+nnoremap <silent><leader>ee :call ToggleLocationList()<CR>
+let g:which_key_map.e.e = 'error-toggle'
+
+" Error Open
+nnoremap <silent><leader>eo :lopen<CR>
+let g:which_key_map.e.o = 'error-open'
+
+" Error Close
+nnoremap <silent><leader>ec :lclose<CR>
+let g:which_key_map.e.c = 'error-close'
+
+" Error Next
+nnoremap <silent><leader>en :lnext<CR>
+let g:which_key_map.e.n = 'error-next'
+
+" Error Previous
+nnoremap <silent><leader>ep :lprevious<CR>
+let g:which_key_map.e.p = 'error-previous'
+
+
+
+
+ +
+

Text

+
+
+
let g:which_key_map.x = { 'name' : '+text' }
+
+" Start interactive EasyAlign in visual mode (e.g. vipga) and for a motion
+xmap <leader>xa <Plug>(EasyAlign)
+nmap <leader>xa <Plug>(EasyAlign)
+let g:which_key_map.x.a = 'text-align'
+
+" Indent all file
+nnoremap <leader>x= mzgg=G`z
+" let g:which_key_map.x.= = 'text-indent-file'
+
+" Custom Multiple Cursor
+" http://www.kevinli.co/posts/2017-01-19-multiple-cursors-in-500-bytes-of-vimscript/
+let g:mc = "y/\\V\<C-r>=escape(@\", '/')\<CR>\<CR>"
+
+" Multiple Cursor
+nnoremap <leader>xm *``cgn
+vnoremap <expr> <leader>xm g:mc . "``cgn"
+let g:which_key_map.x.m = 'multiple-cursor'
+
+" Multiple Cursor - reserve direction
+nnoremap <leader>xM *``cgN
+vnoremap <expr> <leader>xM g:mc . "``cgN"
+let g:which_key_map.x.M = 'multiple-cursor-reverse'
+
+" Delete trainling Whitespaces
+fun! TrimWhitespace()
+    let l:save = winsaveview()
+    keeppatterns %s/\s\+$//e
+    call winrestview(l:save)
+endfun
+nnoremap <leader>xt :call TrimWhitespace()<CR>
+let g:which_key_map.x.t = 'delete-trailing-whitespaces'
+
+
+
+
+ +
+

Config

+
+
+
let g:which_key_map.c = { 'name' : '+config' }
+
+let s:activatedsh = 0
+function! ToggleSyntaxH()
+    if s:activatedsh == 0
+        let s:activatedsh = 1
+        set synmaxcol=800
+    else
+        let s:activatedsh = 0
+        set synmaxcol=100
+    endif
+endfunction
+
+" Toggle Syntax column
+nnoremap <leader>cs :call ToggleSyntaxH()<CR>
+let g:which_key_map.c.s = 'toggle-syntax-col'
+
+let s:activatedh = 0
+function! ToggleH()
+    if s:activatedh == 0
+        let s:activatedh = 1
+        match Search '\%>80v.\+'
+    else
+        let s:activatedh = 0
+        match none
+    endif
+endfunction
+
+" Toggle Highlight
+nnoremap <leader>ch :call ToggleH()<CR>
+let g:which_key_map.c.h = 'toggle-highlight'
+
+" Reload vim config
+noremap <Leader>cr :source $MYVIMRC<CR>
+let g:which_key_map.c.e = 'reload-config'
+
+" Edit vim config
+noremap <Leader>ce :e $MYVIMRC<CR>
+let g:which_key_map.c.e = 'edit-config'
+
+" Disable highlight
+noremap <silent> <leader>c<CR> :noh<CR>
+let g:which_key_map.c.enter = 'disable-highlight'
+
+" Theme
+noremap <silent> <leader>ct :noh<CR>
+let g:which_key_map.c.t = 'choose-theme'
+
+
+
+
+ +
+

Insert

+
+
+
let g:which_key_map.i = { 'name' : '+insert' }
+
+" Insert Snippet
+noremap <Leader>is :Snippets<CR>
+let g:which_key_map.i.s = 'insert-snippet'
+
+
+
+
+ +
+

Save Which Key Configuration

+
+
+
call which_key#register('<Space>', "g:which_key_map")
+
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 22:00

+
+ + diff --git a/docs/xconfig.html b/docs/xconfig.html new file mode 100644 index 0000000..38cff35 --- /dev/null +++ b/docs/xconfig.html @@ -0,0 +1,836 @@ + + + + + + + + +Configuration Files related to Xorg + + + + + + + + + + + + +
+ UP + | + HOME +
+

Configuration Files related to Xorg

+
+

Table of Contents

+ +
+ +
+

Xresources

+
+
+ +
+

Colors

+
+
+
#define base00 #32302f
+#define base01 #3c3836
+#define base02 #504945
+#define base03 #665c54
+#define base04 #bdae93
+#define base05 #d5c4a1
+#define base06 #ebdbb2
+#define base07 #fbf1c7
+#define base08 #fb4934
+#define base09 #fe8019
+#define base0A #fabd2f
+#define base0B #b8bb26
+#define base0C #8ec07c
+#define base0D #83a598
+#define base0E #d3869b
+#define base0F #d65d0e
+
+*foreground:   base05
+#ifdef background_opacity
+*background:   [background_opacity]base00
+#else
+*background:   base00
+#endif
+*cursorColor:  base05
+
+*color0:       base00
+*color1:       base08
+*color2:       base0B
+*color3:       base0A
+*color4:       base0D
+*color5:       base0E
+*color6:       base0C
+*color7:       base05
+
+*color8:       base03
+*color9:       base08
+*color10:      base0B
+*color11:      base0A
+*color12:      base0D
+*color13:      base0E
+*color14:      base0C
+*color15:      base07
+
+! Note: colors beyond 15 might not be loaded (e.g., xterm, urxvt),
+! use 'shell' template to set these if necessary
+*color16:      base09
+*color17:      base0F
+*color18:      base01
+*color19:      base02
+*color20:      base04
+*color21:      base06
+
+
+
+
+ +
+

XFT

+
+
+
Xft.dpi:       96
+Xft.autohint:  0
+Xft.lcdfilter: lcddefault
+Xft.hintstyle: hintfull
+Xft.hinting:   1
+Xft.antialias: 1
+Xft.rgba:      rgb
+
+
+
+
+ +
+

Xcursor

+
+
+
Xcursor.theme: Breeze
+Xcursor.size:  0
+
+
+
+
+ +
+

URxvt

+
+
+
! -----------------------------------------------------------------------------
+! File: gruvbox-dark.xresources
+! Description: Retro groove colorscheme generalized
+! Author: morhetz <morhetz@gmail.com>
+! Source: https://github.com/morhetz/gruvbox-generalized
+! Last Modified: 6 Sep 2014
+! -----------------------------------------------------------------------------
+
+! hard contrast: *background: #1d2021
+*background: #282828
+! soft contrast: *background: #32302f
+*foreground: #ebdbb2
+! Black + DarkGrey
+*color0:  #282828
+*color8:  #928374
+! DarkRed + Red
+*color1:  #cc241d
+*color9:  #fb4934
+! DarkGreen + Green
+*color2:  #98971a
+*color10: #b8bb26
+! DarkYellow + Yellow
+*color3:  #d79921
+*color11: #fabd2f
+! DarkBlue + Blue
+*color4:  #458588
+*color12: #83a598
+! DarkMagenta + Magenta
+*color5:  #b16286
+*color13: #d3869b
+! DarkCyan + Cyan
+*color6:  #689d6a
+*color14: #8ec07c
+! LightGrey + White
+*color7:  #a89984
+*color15: #ebdbb2
+
+
+ +
+
URxvt*termName: screen-256color
+URxvt*geometry: 240x84
+URxvt*loginShell: true
+URxvt*scrollstyle: plain
+URxvt*scrollTtyKeypress: true
+URxvt*scrollTtyOutput: false
+URxvt*scrollWithBuffer: false
+URxvt*secondaryScreen: true
+URxvt*secondaryScroll: true
+URxvt*skipScroll: true
+URxvt*scrollBar: false
+URxvt*scrollBar_right: false
+URxvt*scrollBar_floating: false
+URxvt*utmpInhibit: false
+URxvt*urgentOnBell: false
+URxvt*visualBell: true
+URxvt*mapAlert: true
+URxvt*mouseWheelScrollPage: true
+URxvt*font: xft:Hack Nerd Font Mono:size=10
+URxvt*boldFont: xft:Hack Nerd Font Mono:bold:size=10
+URxvt.perl-ext-common: selection-to-clipboard
+URxvt.keysym.C-S-c: perl:clipboard:copy
+URxvt.keysym.C-S-v: perl:clipboard:paste
+
+
+
+
+
+ +
+

Xmodmap

+
+
+
keycode   8 =
+keycode   9 = Escape NoSymbol Escape
+keycode  10 = 1 exclam 1 exclam
+keycode  11 = 2 at 2 at
+keycode  12 = 3 numbersign 3 numbersign
+keycode  13 = 4 dollar 4 dollar
+keycode  14 = 5 percent 5 percent
+keycode  15 = 6 asciicircum 6 asciicircum
+keycode  16 = 7 ampersand 7 ampersand
+keycode  17 = 8 asterisk 8 asterisk
+keycode  18 = 9 parenleft 9 parenleft
+keycode  19 = 0 parenright 0 parenright
+keycode  20 = minus underscore minus underscore
+keycode  21 = equal plus equal plus
+keycode  22 = BackSpace BackSpace BackSpace BackSpace
+keycode  23 = Tab ISO_Left_Tab Tab ISO_Left_Tab
+keycode  24 = q Q q Q
+keycode  25 = w W w W
+keycode  26 = e E e E
+keycode  27 = r R r R
+keycode  28 = t T t T
+keycode  29 = y Y y Y
+keycode  30 = u U u U
+keycode  31 = i I i I
+keycode  32 = o O o O
+keycode  33 = p P p P
+keycode  34 = bracketleft braceleft bracketleft braceleft
+keycode  35 = bracketright braceright bracketright braceright
+keycode  36 = Return NoSymbol Return
+keycode  37 = Control_L NoSymbol Control_L
+keycode  38 = a A a A
+keycode  39 = s S s S
+keycode  40 = d D d D
+keycode  41 = f F f F
+keycode  42 = g G g G
+keycode  43 = h H h H
+keycode  44 = j J j J
+keycode  45 = k K k K
+keycode  46 = l L l L
+keycode  47 = semicolon colon semicolon colon
+keycode  48 = apostrophe quotedbl apostrophe quotedbl
+keycode  49 = grave asciitilde grave asciitilde
+keycode  50 = Shift_L NoSymbol Shift_L
+keycode  51 = backslash bar backslash bar
+keycode  52 = z Z z Z
+keycode  53 = x X x X
+keycode  54 = c C c C
+keycode  55 = v V v V
+keycode  56 = b B b B
+keycode  57 = n N n N
+keycode  58 = m M m M
+keycode  59 = comma less comma less
+keycode  60 = period greater period greater
+keycode  61 = slash question slash question
+keycode  62 = Shift_R NoSymbol Shift_R
+keycode  63 = KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply KP_Multiply XF86ClearGrab
+keycode  64 = Alt_L Meta_L Alt_L Meta_L
+keycode  65 = space NoSymbol space
+keycode  66 = Caps_Lock NoSymbol Caps_Lock
+keycode  67 = F1 F1 F1 F1 F1 F1 XF86Switch_VT_1
+keycode  68 = F2 F2 F2 F2 F2 F2 XF86Switch_VT_2
+keycode  69 = F3 F3 F3 F3 F3 F3 XF86Switch_VT_3
+keycode  70 = F4 F4 F4 F4 F4 F4 XF86Switch_VT_4
+keycode  71 = F5 F5 F5 F5 F5 F5 XF86Switch_VT_5
+keycode  72 = F6 F6 F6 F6 F6 F6 XF86Switch_VT_6
+keycode  73 = F7 F7 F7 F7 F7 F7 XF86Switch_VT_7
+keycode  74 = F8 F8 F8 F8 F8 F8 XF86Switch_VT_8
+keycode  75 = F9 F9 F9 F9 F9 F9 XF86Switch_VT_9
+keycode  76 = F10 F10 F10 F10 F10 F10 XF86Switch_VT_10
+keycode  77 = Num_Lock NoSymbol Num_Lock
+keycode  78 = Scroll_Lock NoSymbol Scroll_Lock
+keycode  79 = KP_Home KP_7 KP_Home KP_7
+keycode  80 = KP_Up KP_8 KP_Up KP_8
+keycode  81 = KP_Prior KP_9 KP_Prior KP_9
+keycode  82 = KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract KP_Subtract XF86Prev_VMode
+keycode  83 = KP_Left KP_4 KP_Left KP_4
+keycode  84 = KP_Begin KP_5 KP_Begin KP_5
+keycode  85 = KP_Right KP_6 KP_Right KP_6
+keycode  86 = KP_Add KP_Add KP_Add KP_Add KP_Add KP_Add XF86Next_VMode
+keycode  87 = KP_End KP_1 KP_End KP_1
+keycode  88 = KP_Down KP_2 KP_Down KP_2
+keycode  89 = KP_Next KP_3 KP_Next KP_3
+keycode  90 = KP_Insert KP_0 KP_Insert KP_0
+keycode  91 = KP_Delete KP_Decimal KP_Delete KP_Decimal
+keycode  92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift
+keycode  93 =
+keycode  94 = less greater less greater bar brokenbar bar
+keycode  95 = F11 F11 F11 F11 F11 F11 XF86Switch_VT_11
+keycode  96 = F12 F12 F12 F12 F12 F12 XF86Switch_VT_12
+keycode  97 =
+keycode  98 = Katakana NoSymbol Katakana
+keycode  99 = Hiragana NoSymbol Hiragana
+keycode 100 = Henkan_Mode NoSymbol Henkan_Mode
+keycode 101 = Hiragana_Katakana NoSymbol Hiragana_Katakana
+keycode 102 = Muhenkan NoSymbol Muhenkan
+keycode 103 =
+keycode 104 = KP_Enter NoSymbol KP_Enter
+keycode 105 = Control_R NoSymbol Control_R
+keycode 106 = KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide KP_Divide XF86Ungrab
+keycode 107 = Print Sys_Req Print Sys_Req
+keycode 108 = Alt_R Meta_R Alt_R Meta_R
+keycode 109 = Linefeed NoSymbol Linefeed
+keycode 110 = Home NoSymbol Home
+keycode 111 = Up NoSymbol Up
+keycode 112 = Prior NoSymbol Prior
+keycode 113 = Left NoSymbol Left
+keycode 114 = Right NoSymbol Right
+keycode 115 = End NoSymbol End
+keycode 116 = Down NoSymbol Down
+keycode 117 = Next NoSymbol Next
+keycode 118 = Insert NoSymbol Insert
+keycode 119 = Delete NoSymbol Delete
+keycode 120 =
+keycode 121 = XF86AudioMute NoSymbol XF86AudioMute
+keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
+keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
+keycode 124 = XF86PowerOff NoSymbol XF86PowerOff
+keycode 125 = KP_Equal NoSymbol KP_Equal
+keycode 126 = plusminus NoSymbol plusminus
+keycode 127 = Pause Break Pause Break
+keycode 128 = XF86LaunchA NoSymbol XF86LaunchA
+keycode 129 = KP_Decimal KP_Decimal KP_Decimal KP_Decimal
+keycode 130 = Hangul NoSymbol Hangul
+keycode 131 = Hangul_Hanja NoSymbol Hangul_Hanja
+keycode 132 =
+keycode 133 =
+keycode 134 = Super_R NoSymbol Super_R
+keycode 135 = Menu NoSymbol Menu
+keycode 136 = Cancel NoSymbol Cancel
+keycode 137 = Redo NoSymbol Redo
+keycode 138 = SunProps NoSymbol SunProps
+keycode 139 = Undo NoSymbol Undo
+keycode 140 = SunFront NoSymbol SunFront
+keycode 141 = XF86Copy NoSymbol XF86Copy
+keycode 142 = XF86Open NoSymbol XF86Open
+keycode 143 = XF86Paste NoSymbol XF86Paste
+keycode 144 = Find NoSymbol Find
+keycode 145 = XF86Cut NoSymbol XF86Cut
+keycode 146 = Help NoSymbol Help
+keycode 147 = xf86menukb nosymbol xf86menukb
+keycode 148 = XF86Calculator NoSymbol XF86Calculator
+keycode 149 =
+keycode 150 = XF86Sleep NoSymbol XF86Sleep
+keycode 151 = XF86WakeUp NoSymbol XF86WakeUp
+keycode 152 = XF86Explorer NoSymbol XF86Explorer
+keycode 153 = XF86Send NoSymbol XF86Send
+keycode 154 =
+keycode 155 = XF86Xfer NoSymbol XF86Xfer
+keycode 156 = XF86Launch1 NoSymbol XF86Launch1
+keycode 157 = XF86Launch2 NoSymbol XF86Launch2
+keycode 158 = XF86WWW NoSymbol XF86WWW
+keycode 159 = XF86DOS NoSymbol XF86DOS
+keycode 160 = XF86ScreenSaver NoSymbol XF86ScreenSaver
+keycode 161 = XF86RotateWindows NoSymbol XF86RotateWindows
+keycode 162 = XF86TaskPane NoSymbol XF86TaskPane
+keycode 163 = XF86Mail NoSymbol XF86Mail
+keycode 164 = XF86Favorites NoSymbol XF86Favorites
+keycode 165 = XF86MyComputer NoSymbol XF86MyComputer
+keycode 166 = XF86Back NoSymbol XF86Back
+keycode 167 = XF86Forward NoSymbol XF86Forward
+keycode 168 =
+keycode 169 = XF86Eject NoSymbol XF86Eject
+keycode 170 = XF86Eject XF86Eject XF86Eject XF86Eject
+keycode 171 = XF86AudioNext NoSymbol XF86AudioNext
+keycode 172 = XF86AudioPlay XF86AudioPause XF86AudioPlay XF86AudioPause
+keycode 173 = XF86AudioPrev NoSymbol XF86AudioPrev
+keycode 174 = XF86AudioStop XF86Eject XF86AudioStop XF86Eject
+keycode 175 = XF86AudioRecord NoSymbol XF86AudioRecord
+keycode 176 = XF86AudioRewind NoSymbol XF86AudioRewind
+keycode 177 = XF86Phone NoSymbol XF86Phone
+keycode 178 =
+keycode 179 = XF86Tools NoSymbol XF86Tools
+keycode 180 = XF86HomePage NoSymbol XF86HomePage
+keycode 181 = XF86Reload NoSymbol XF86Reload
+keycode 182 = XF86Close NoSymbol XF86Close
+keycode 183 =
+keycode 184 =
+keycode 185 = XF86ScrollUp NoSymbol XF86ScrollUp
+keycode 186 = XF86ScrollDown NoSymbol XF86ScrollDown
+keycode 187 = parenleft NoSymbol parenleft
+keycode 188 = parenright NoSymbol parenright
+keycode 189 = XF86New NoSymbol XF86New
+keycode 190 = Redo NoSymbol Redo
+keycode 191 = XF86Tools NoSymbol XF86Tools
+keycode 192 = XF86Launch5 NoSymbol XF86Launch5
+keycode 193 = XF86Launch6 NoSymbol XF86Launch6
+keycode 194 = XF86Launch7 NoSymbol XF86Launch7
+keycode 195 = XF86Launch8 NoSymbol XF86Launch8
+keycode 196 = XF86Launch9 NoSymbol XF86Launch9
+keycode 197 =
+keycode 198 = XF86AudioMicMute NoSymbol XF86AudioMicMute
+keycode 199 = XF86TouchpadToggle NoSymbol XF86TouchpadToggle
+keycode 200 = XF86TouchpadOn NoSymbol XF86TouchpadOn
+keycode 201 = XF86TouchpadOff NoSymbol XF86TouchpadOff
+keycode 202 =
+keycode 203 = Mode_switch NoSymbol Mode_switch
+keycode 204 = NoSymbol Alt_L NoSymbol Alt_L
+keycode 205 = NoSymbol Meta_L NoSymbol Meta_L
+keycode 206 = NoSymbol Super_L NoSymbol Super_L
+keycode 207 = NoSymbol Hyper_L NoSymbol Hyper_L
+keycode 208 = XF86AudioPlay NoSymbol XF86AudioPlay
+keycode 209 = XF86AudioPause NoSymbol XF86AudioPause
+keycode 210 = XF86Launch3 NoSymbol XF86Launch3
+keycode 211 = XF86Launch4 NoSymbol XF86Launch4
+keycode 212 = XF86LaunchB NoSymbol XF86LaunchB
+keycode 213 = XF86Suspend NoSymbol XF86Suspend
+keycode 214 = XF86Close NoSymbol XF86Close
+keycode 215 = XF86AudioPlay NoSymbol XF86AudioPlay
+keycode 216 = XF86AudioForward NoSymbol XF86AudioForward
+keycode 217 =
+keycode 218 = Print NoSymbol Print
+keycode 219 =
+keycode 220 = XF86WebCam NoSymbol XF86WebCam
+keycode 221 =
+keycode 222 =
+keycode 223 = XF86Mail NoSymbol XF86Mail
+keycode 224 = XF86Messenger NoSymbol XF86Messenger
+keycode 225 = XF86Search NoSymbol XF86Search
+keycode 226 = XF86Go NoSymbol XF86Go
+keycode 227 = XF86Finance NoSymbol XF86Finance
+keycode 228 = XF86Game NoSymbol XF86Game
+keycode 229 = XF86Shop NoSymbol XF86Shop
+keycode 230 =
+keycode 231 = Cancel NoSymbol Cancel
+keycode 232 = XF86MonBrightnessDown NoSymbol XF86MonBrightnessDown
+keycode 233 = XF86MonBrightnessUp NoSymbol XF86MonBrightnessUp
+keycode 234 = XF86AudioMedia NoSymbol XF86AudioMedia
+keycode 235 = XF86Display NoSymbol XF86Display
+keycode 236 = XF86KbdLightOnOff NoSymbol XF86KbdLightOnOff
+keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown
+keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp
+keycode 239 = XF86Send NoSymbol XF86Send
+keycode 240 = XF86Reply NoSymbol XF86Reply
+keycode 241 = XF86MailForward NoSymbol XF86MailForward
+keycode 242 = XF86Save NoSymbol XF86Save
+keycode 243 = XF86Documents NoSymbol XF86Documents
+keycode 244 = XF86Battery NoSymbol XF86Battery
+keycode 245 = XF86Bluetooth NoSymbol XF86Bluetooth
+keycode 246 = XF86WLAN NoSymbol XF86WLAN
+keycode 247 =
+keycode 248 = XF86Display NoSymbol XF86Display
+keycode 249 =
+keycode 250 =
+keycode 251 =
+keycode 252 =
+keycode 253 =
+keycode 254 = XF86WWAN NoSymbol XF86WWAN
+keycode 255 = XF86RFKill NoSymbol XF86RFKill
+
+
+
+
+ +
+

xinit

+
+
+
dbus-update-activation-environment --systemd DISPLAY
+
+
+ +

+Start gnome-keyring-daemon in order not to be asked for password to unlock GPG key. +

+
+
# eval $(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)
+# export SSH_AUTH_SOCK
+
+
+ +

+Fix for Matlab. +

+
+
export _JAVA_AWT_WM_NONREPARENTING=1
+
+
+ +

+Merge in defaults and keymaps +

+
+
userresources=$HOME/.Xresources
+usermodmap=$HOME/.Xmodmap
+sysresources=/etc/X11/xinit/.Xresources
+sysmodmap=/etc/X11/xinit/.Xmodmap
+
+if [ -f $sysresources ]; then
+    xrdb -merge $sysresources
+fi
+
+if [ -f $sysmodmap ]; then
+    xmodmap $sysmodmap
+fi
+
+if [ -f "$userresources" ]; then
+    xrdb -merge "$userresources"
+fi
+
+if [ -f "$usermodmap" ]; then
+    xmodmap "$usermodmap"
+fi
+
+
+ +
+
[ -f ~/.xprofile ] && . ~/.xprofile
+
+
+
+
+ +
+

Xprofile

+
+

+Keyboard Options +

+
+
# Set repetition keyboard rate
+xset r rate 200 40 &
+# Set International US keyboard layout
+setxkbmap -layout us -variant intl -option caps:escape &
+
+
+ +

+Start programs related to display. +

+
+
# Screen options
+xrandr --output eDP1 --mode 1920x1080 --dpi 192 &
+
+# Set custom wallpaper script
+$HOME/scripts/wallpapers.sh &
+
+# Hide mouse cursor after x seconds
+pgrep -xu "$USER" unclutter >/dev/null || \
+  unclutter --timeout 5 &
+
+# Autolock screen after x minutes
+xautolock -locker "~/scripts/lockscreen.sh" -detectsleep -time 30 -notify 60 -notifier "dunstify --replace=31846 -u critical -t 10000 -- 'Locking Screen' '60 seconds'" &
+
+# Redshift
+pgrep -xu "$USER" redshift >/dev/null || \
+    redshift &
+
+# Run Compton (compositor)
+picom --daemon &
+
+
+ +

+Start the applications related to the top bar (polybar + applet). +

+
+
# Start Network Management Framework
+nm-applet &
+
+# Start Power Manager
+xfce4-power-manager &
+
+# Bluetooth Manager
+blueman-applet &
+
+# Synology Cloud Station Drive
+synology-drive &
+
+# Udiskie to automount usb keys
+pgrep -xu "$USER" udiskie >/dev/null || \
+  udiskie --automount --notify --tray --use-udisks2 &
+
+
+ +

+Finally, run SXHKD for the key bindings. +

+
+
# Start sxhkd
+pgrep -xu "$USER" sxhkd >/dev/null || \
+  sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc &
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/zathura.html b/docs/zathura.html new file mode 100644 index 0000000..6c7c43a --- /dev/null +++ b/docs/zathura.html @@ -0,0 +1,364 @@ + + + + + + + + +Zathura + + + + + + + + + + + + +
+ UP + | + HOME +
+

Zathura

+
+

Table of Contents

+ +
+ +
+

Configuration

+
+
+
# Use clipboard
+set selection-clipboard clipboard
+
+# Remove padding
+set statusbar-h-padding 0
+set statusbar-v-padding 0
+
+# Padding between pages
+set page-padding 1
+
+
+
+
+ +
+

Bindings

+
+
+
map u scroll half-up
+map d scroll half-down
+
+map D toggle_page_mode
+
+map r reload
+map R rotate
+map > rotate
+map < rotate
+
+map L zoom in
+map H zoom out
+
+map i recolor
+map p print
+
+map m toggle_statusbar
+
+map <Space> scroll full-down
+map <BackSpace> scroll full-up
+
+
+
+
+ +
+

Colors

+
+
+
# Base16 Gruvbox dark, soft
+# Author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
+
+set default-bg                  "#32302f"
+set default-fg                  "#3c3836"
+
+set statusbar-fg                "#bdae93"
+set statusbar-bg                "#504945"
+
+set inputbar-bg                 "#32302f"
+set inputbar-fg                 "#fbf1c7"
+
+set notification-bg             "#32302f"
+set notification-fg             "#fbf1c7"
+
+set notification-error-bg       "#32302f"
+set notification-error-fg       "#fb4934"
+
+set notification-warning-bg     "#32302f"
+set notification-warning-fg     "#fb4934"
+
+set highlight-color             "#fabd2f"
+set highlight-active-color      "#83a598"
+
+set completion-bg               "#3c3836"
+set completion-fg               "#83a598"
+
+set completion-highlight-fg     "#fbf1c7"
+set completion-highlight-bg     "#83a598"
+
+set recolor-lightcolor          "#32302f"
+set recolor-darkcolor           "#ebdbb2"
+
+set recolor                     "false"
+set recolor-keephue             "false"
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/docs/zsh.html b/docs/zsh.html new file mode 100644 index 0000000..0a64cc9 --- /dev/null +++ b/docs/zsh.html @@ -0,0 +1,302 @@ + + + + + + + + +ZSH Config + + + + + + + + + + + + +
+ UP + | + HOME +
+

ZSH Config

+
+

Table of Contents

+
+ +
+
+ +

+https://github.com/unixorn/awesome-zsh-plugins +

+ +
+

Zplug

+
+

+https://github.com/zplug/zplug +

+
+
source ~/.zplug/init.zsh
+
+zplug mafredri/zsh-async, from:github
+zplug sindresorhus/pure, use:pure.zsh, from:github, as:theme
+
+# Install plugins if there are plugins that have not been installed
+if ! zplug check --verbose; then
+    printf "Install? [y/N]: "
+    if read -q; then
+        echo; zplug install
+    fi
+fi
+
+# Then, source plugins and add commands to $PATH
+zplug load --verbose
+
+
+
+
+
+
+

Author: Dehaeze Thomas

+

Created: 2020-01-11 sam. 21:59

+
+ + diff --git a/elisp/tangle.el b/elisp/tangle.el deleted file mode 100644 index 57a8912..0000000 --- a/elisp/tangle.el +++ /dev/null @@ -1,19 +0,0 @@ -;;; tangle --- Tangle one or more org files - -;;; Commentary: - -;; This file can be used to tangle one or more files to their output -;; files. - -;;; Code: - -(require 'org) -(require 'ob-tangle) - -(defun literate-dotfiles-tangle (&rest files) - "Tangle FILES or all files in the project." - (when (null files) - (setq files command-line-args-left)) - (dolist (file files) - (with-current-buffer (find-file-noselect file) - (org-babel-tangle)))) diff --git a/publish.org b/publish.org new file mode 100644 index 0000000..bfb3c2a --- /dev/null +++ b/publish.org @@ -0,0 +1,13 @@ + +#+begin_src emacs-lisp + (setq org-publish-project-alist + '(("config" + :base-directory "~/.config/literate-dotfiles/dotfiles/" + :publishing-directory "~/.config/literate-dotfiles/docs/" + :recursive t + :publishing-function org-html-publish-to-html + :auto-sitemap nil + :section-numbers nil + :table-of-contents nil))) +#+end_src + diff --git a/readme.html b/readme.html deleted file mode 100644 index 857eccc..0000000 --- a/readme.html +++ /dev/null @@ -1,6388 +0,0 @@ - - - - - - - -Dotfiles - Manjaro Linux on Macbook Pro - - - - - - - - - - - - -
-

Dotfiles - Manjaro Linux on Macbook Pro

-
-

Table of Contents

-
- -
-
- - - -
-

2 Package Manager: yay

- - -
-

2.1 Installation

-
-
-
sudo pacman -S yay
-
-
-
-
- -
-

2.2 CheatSheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
yayPerform system upgrade
yay -Ss <package>Search
yay -S <package>Install
yay -Si <package>Get informations
yay -Rs <package>Uninstall
yay -Yc <package>Clean unneeded dependencies
-
-
-
- -
-

3 Git Setup

- - -
-

3.1 Installation

-
-
-
yay -S git
-
-
-
-
- -
-

3.2 Configuration

-
-
    -
  • ~/.gitconfig
  • -
  • ~/.gitignore_global
  • -
-
-
- -
-

3.3 Diff-So-Fancy

- -
-

3.3.1 Installation

-
-
-
yay -S diff-so-fancy
-
-
-
-
- -
-

3.3.2 Configuration

-
-
-
git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"
-
-
-
-
-
- -
-

3.4 TODO Github interface - Hub

-
-
-
-

3.4.1 Installation

-
-
-
yay -S hub
-
-
-
-
-
- -
-

3.5 Credential Helper setup with Pass

-
-

-This is explained in a further part: Integration of Pass with Git. -

-
-
-
- -
-

4 Terminal

- -
-

4.1 Termite

-
-
-
-

4.1.1 Installation

-
-
-
yay -S termite
-
-
-
-
- -
-

4.1.2 Configuration

-
-
    -
  • ~/.config/termite/config
  • -
-
-
- -
-

4.1.3 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
ctrl-shift-xactivate url hints mode
ctrl-shift-ccopy to CLIPBOARD
ctrl-shift-vpaste from CLIPBOARD
ctrl-shift-spacestart selection mode
ctrl-shift-upscroll up a line
ctrl-shift-downscroll down a line
ctrl-+increase font size
ctrl--decrease font size
ctrl-=reset font size to default
-
-
-
- -
-

4.2 TODO Unicode Rxvt

-
-
-
-

4.2.1 Installation

-
-
-
yay -S rxvt-unicode
-
-
-
-
- -
-

4.2.2 Configuration

-
-

-Most of Urxvt configuration is done in ~/.Xresources -

-
-
-
-
- -
-

5 TODO Shell: Bash

- - -
-

5.1 Bash Completion

-
-
-
yay -S bash-completion
-
-
-
-
- -
-

5.2 TODO Configuration

-
-
    -
  • ~/.bashrc
  • -
  • ~/.bash_profile
  • -
  • ~/.config/bash/
  • -
  • ~/.profile
  • -
-
-
-
- -
-

6 TODO Terminal Multiplexer: Tmux

- - -
-

6.1 Installation

-
-
-
yay -S tmux
-
-
-
-
- -
-

6.2 Session Manager - Tmuxinator

- - -
-

6.2.1 Installation

-
-
-
yay -S tmuxinator
-
-
-
-
- -
-

6.2.2 Special sessions

-
-

-Sessions are created using tmuxinator new session_name and edited using tmuxinator edit session_name. -

-
-
- -
-

6.2.3 Mux: run terminal and tmux session

-
-

-~/bin/mux -

- -

-To open a terminal and run tmux session automatically, run mux <session-name>. -This is used with rofi. -

-
-
-
- -
-

6.3 TODO Multiple Tmux configuration

-
-
    -
  • one with no line for neomutt
  • -
  • one complete for coding
  • -
-
-
-
-

6.4 TODO Configuration: theme

- -
- - -
-

6.6 TODO Cheatsheet

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
  
-
-
-
- -
-

7 TODO Fonts

-
-
-
-

7.1 Installation

-
-
-
yay -S ttf-inconsolata nerd-font-complete ttf-linux-libertine
-
-
-
-
- -
-

7.2 TODO Default fonts

-
-

-SauceCodePro Nerd Font Mono -

- -

-Maybe use: -

-
    -
  • Monospace Font: Inconsolata
  • -
  • Serif Font: Libertine
  • -
  • Sans Font: Linux Biolinum
  • -
-
-
- -
-

7.3 Nice fonts

- -
-
-

7.4 Emojis

-
-
-
yay -S ttf-emojione
-
-
-
-
- -
-

7.5 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
fc-listList all fonts available
-
-
-
- -
-

8 Text Editors

-
-
-
-

8.1 Neovim

- - -
-

8.1.1 Installation

-
-
-
yay -S neovim
-
-
-
-
- -
-

8.1.2 Configuration

- -
- -
-

8.1.3 Vim Anywhere with i3

-
-

-https://github.com/cknadler/vim-anywhere -

- -
-
yay -S vim-anywhere-git
-
-
- -

-Then, add the following to the i3 config: bindsym $mod+t exec vim-anywhere nvim termite -

-
-
- -
-

8.1.4 Matlab Setup

- -
- - -
- -
-

8.2 Emacs

- - -
-

8.2.1 Installation

-
-
-
yay -S emacs
-
-
-
-
- -
-

8.2.2 TODO Emacs Client/Server - I removed the systemd service to just run it with i3 startup

-
-

-Add a systemd service to automatically run Emacs deamon in the background on startup: -~/.config/systemd/user/emacs.service -

- -

-Then run: -

-
-
systemctl enable --user emacs
-systemctl start --user emacs
-
-
- -

-In order to open the emacs client: emacsclient -create-frame --alternate-editor""= -

- -

-Then, add a shortcut to i3 config to open an emacsclient. -

-
-
- -
-

8.2.3 Configuration

- -
- -
-

8.2.4 SpellCheck with Aspell

-
-
-
yay -S aspell aspell-en aspell-fr
-
-
-
-
-
-
- -
-

9 SSH setup

-
-
-
-

9.1 Generating a new SSH key

-
-
-
ssh-keygen -t rsa -b 4096 -C "dehaeze.thomas@gmail.com"
-
-
-
-
- -
-

9.2 Start the ssh-agent in the background

-
-
-
eval "$(ssh-agent -s)"
-
-
-
-
- -
-

9.3 Add the SSH key to the ssh-agent

-
-
-
ssh-add ~/.ssh/id_rsa
-
-
-
-
-
- -
-

10 GnuPG

- - -
-

10.1 Install the gnupg package:

-
-
-
yay -S gnupg
-
-
-
-
- -
-

10.2 Create a key pair

-
-
-
gpg --full-gen-key
-
-
-
-
- -
-

10.3 Configure the gpg-agent to cache the passphrase

-
-

-Edit the following file ~/.gnupg/gpg-agent.conf -

- -
-max-cache-ttl 60480000
-default-cache-ttl 60480000
-
-
-
-
- -
-

11 Password Manager: Pass

- - -
-

11.1 Install the pass package

-
-
-
yay -S pass
-
-
-
-
- -
-

11.2 TODO Connect the GPG key

-
- -
-

11.3 Initialize the password store as a git repository

-
-
-
pass git init
-pass git remote add origin https://github.com/tdehaeze/pass.git
-
-
-
-
- -
-

11.4 Gui Manager

-
-

-https://github.com/IJHack/qtpass -

- -
-
yay -S qtpass
-
-
-
-
- -
-

11.5 Integration with Rofi

- - -
-

11.5.1 Installation

-
-
-
yay -S rofi-pass
-
-
- -

-Then we can add a shortcut to rofi-pass on i3 config. -

-
-
- -
-

11.5.2 Alternative

-
-

-https://github.com/ibizaman/pass-clip -

- -
-
yay -S pass-clip
-
-
-
-
-
- -
-

11.6 Integration with Browsers

-
-

-This is explained here. -

-
-
- -
-

11.7 Integration with Git

- -
-

11.7.1 Installation

-
-
-
yay -S pass-git-helper
-
-
-
-
- -
-

11.7.2 Configuration

-
-

-First, add the relation between repository addresses and entries in pass. This is done in the following config file .config/pass-git-helper/git-pass-mapping.ini: -

-
-[github.com*]
-target=github.com/tdehaeze
-
- -

-Then, add the credential helper on the git configuration file ~/.gitconfig and add the default username for the repositories adresses. -

-
-[credential]
-    helper = !pass-git-helper $@
-
-[credential "https://github.com"]
-    username = tdehaeze
-
-
-
-
- -
-

11.8 Integration with other programs

-
-

-Integrate pass in other programs is usually very easy, here are few examples: -

-
    -
  • ~/.msmtprc: -
      -
    • passwordeval "pass email/dehaeze.thomas@gmail.com"
    • -
  • -
  • ~/.mbsyncrc -
      -
    • PassCmd "pass email/dehaeze.thomas@gmail.com"
    • -
  • -
-
-
-
- -
-

12 Bookmark Manager: Buku

- - -
-

12.1 Installation

-
-
-
yaourt -S buku
-
-
-
-
- -
-

12.2 Integration with Rofi

- - -
-

12.2.1 Installation

-
-
-
wget https://raw.githubusercontent.com/carnager/buku_run/master/buku_run -o ~/bin/buku_run
-chmod +x ~/bin/buku_run
-
-
-
-
- -
-

12.2.2 Configuration

-
-

-The configuration file is here: ~/.config/buku_run/config -

-
-
- -
-

12.2.3 Key binding with i3

-
-

-Custom key binding in i3 config file ~/.i3/config: -

- -
-bindsym $mod+Shift+f exec --no-startup-id buku_run
-
-
-
-
- -
-

12.3 Integration with qutebrowser

- -
- -
-

12.4 Synchronization with a git repository

-
-

-The database is stored in ~/.local/share/buku/bookmarks.db. -

- -

-We initialize a git repository in this folder: -

-
-
cd ~/.local/share/buku/bookmarks.db
-git init
-
-
- -

-Then we create a script that will automatically add bookmarks.db and push to some repository: ~/scripts/buku_git_push.sh. -

- -

-To automatically run the script every day, a systemd unit is used: ~/.config/systemd/user/bukugit.timer and ~/.config/systemd/user/bukugit.service -

- -
-
systemctl start --user bukugit.timer
-systemctl enable --user bukugit.timer
-
-
-
-
- -
-

12.5 Import Bookmarks from Firefox and Chrome

-
-

-From Firefox, export the bookmarks as html file. -Then import the bookmark file using buku -i bookmarks.html. -This will add a tag with current date to all bookmarks imported. -To remove them, use: buku --replace '2018dec20' '' -

-
-
- -
-

12.6 Web Interface

-
-

-Run: -

-
-
bukuserver run --host 127.0.0.1 --port 5001
-
-
- -

-And then browse to 127.0.0.1:5001. -

-
-
- -
-

12.7 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
bukuRun buku interactively
buku -pList all bookmarks
buku -w idEdit bookmark
buku -d idDelete bookmark
buku -s <>Search bookmarks
-
-
- - -
- -
-

13 TODO Browser: qutebrowser

- - -
-

13.1 Installation

-
-
-
yay -S qutebrowser
-
-
-
-
- -
-

13.2 View Pdf inside qutebrowser with pdfjs

-
-
-
-

13.2.1 Installation

-
-
-
yay -S pdfjs
-
-
-
-
- -
-

13.2.2 Usage

-
-

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

- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
<return>Download the file
Ctrl-xDownload and open
Ctrl-pOpen with pdf.js
Alt-yYank the url
-
-
-
- -
-

13.3 TODO Make it default browser

-
-
-

13.4 Integration with Pass: the password manager

-
-

-Add the key-binding on ~/.config/qutebrowser/config.py -

- -
-config.bind('<Ctrl-p>', 'spawn --userscript password_fill')
-
- -

-The password_fill script can be found on github.com. -It is configured using the ~/.config/qutebrowser/password_fill_rc file. -

-
-
- -
-

13.5 TODO Integration with Buku

-
-

-Custom key binding in ~/.config/qutebrowser/config.py -

- -
-# Add current page to Buku (Bookmark Manager)
-config.bind('B', 'spawn buku -a {url}')
-
-
- -
-

13.5.1 TODO Add an option to specify title, modify url? add tags?

-
-
- - -
-

13.7 TODO Cast youtube to chromecast

-
-
-

13.8 Spell Checking

-
-
-
/usr/share/qutebrowser/scripts/dictcli.py install fr-FR
-/usr/share/qutebrowser/scripts/dictcli.py install en-US
-
-
-
-
- - -
-

13.10 TODO Ressources

-
- -
-
-
- - - -
-

15 Music Setup

-
-
-
-

15.1 Sound Server - Pulse Audio

-
-

-https://wiki.archlinux.org/index.php/PulseAudio -

- -

-If sound is not working, should run pulseaudio --kill to kill the deamon and then pulseaudio --daemonize to run it again. -

- -

-https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/ -

-
-
- -
-

15.2 Audio Server - MPD

- - -
-

15.2.1 Installation

-
-
-
yay -S mpd
-
-
-
-
- -
-

15.2.2 Automatic Startup

-
-
-
systemctl start --user mpd.service
-systemctl enable --user mpd.service
-
-
-
-
- -
-

15.2.3 Command line interface to MPD - MPC

-
-

-https://github.com/MusicPlayerDaemon/mpc -

- -

-To install mpc: yay -S mpc. -

- - - - --- -- - - - - - - - - - - - - - - - - - -
CommandUsage
mpc updateUpdate the library
mpc rescanRescan the library
-
-
-
- - - -
-

15.4 MPD Client - ncmpcpp

- - -
-

15.4.1 Installation

-
-
-
yay -S ncmpcpp
-
-
-
-
- -
-

15.4.2 Config

-
-

-The main config is located here: ~/.ncmpcpp/config. -The key bindings can be configured here: ~/.ncmpcpp/bindings. -

-
-
- -
-

15.4.3 Cheatsheet

-
-

-https://pkgbuild.com/~jelle/ncmpcpp/ -

- - - --- -- - - - - - - -
CommandUsage
-
-
-
- -
-

15.5 Library Manager - beets

- - -
-

15.5.1 Installation

-
-
-
yay -S beets
-
-
-
-
- -
-

15.5.2 Configuration

-
-

-Configuration folder: ~/.config/beets/ -

-
-
- -
-

15.5.3 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
beet import <folder>Import folder to Music folder
-
-
-
-
- -
-

16 TODO Movies

-
-
-
-

16.1 Media Player - MPV

-
-
-
-

16.1.1 Installation

-
-
-
yay -S mpv
-
-
-
-
- -
-

16.1.2 Key Bindings

-
-

-The configuration is set in /.config/mpv/input.conf. -

-
-
- -
-

16.1.3 TODO CheatSheet

-
- - - --- -- - - - - - - -
CommandUsage
-
-
-
- -
-

16.2 TODO Chromecast with CATT

- - -
-

16.2.1 Installation

-
-
-
yay -S catt
-
-
-
-
- -
-

16.2.2 Usage to cast videos to chromecast

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
catt cast "https://www.youtube.com/watch?v=dQw4w9WgXcQ"Cast youtube video
catt cast ./myvideo.mp4Cast local video
catt add ./myvideo.mp4Add a video to the queue
catt cast -s ./mysubtitle.srt /myvideo.mp4Add sub title
catt castsite https://en.wikipedia.org/wiki/RickrollingCast website
-
-
- -
-

16.2.3 Usage for controlling the device

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
ffwdFastforward a video by TIME duration
rewindRewind a video by TIME duration
seekSeek the video to TIME position
scanScan the local network and show all Chromecasts and their IPs
statusShow some information about the currently-playing video
pausePause a video
playResume a video after it has been paused
stopStop playing
skipSkip to end of content
saveSave the current state of the Chromecast for later use
restoreReturn Chromecast to saved state
volumeSet the volume to LVL [0-100]
volumedownTurn down volume by a DELTA increment
volumeupTurn up volume by a DELTA increment
-
-
-
- -
-

16.3 TODO Popcorn Time or similar

-
-
-

16.4 TODO Movie Collection Manager - Filebot

-
-

-https://github.com/filebot/filebot -This is paid software, I should uninstall it and find alternative -

-
-
-

16.4.1 Installation

-
-
-
yay -S bilebot
-
-
- -

-When runing filebot, if you obtain the following error: -/usr/bin/filebot: line 22: /usr/lib/jvm/java-8-openjdk/bin/java: No such file or directory. -You can simlink the java binary: -

-
-
sudo ln -s /usr/lib/jvm/java-8-openjdk/jre/bin/java /usr/lib/jvm/java-8-openjdk/bin/java
-
-
-
-
- -
-

16.4.2 Usage

-
-
-

16.4.3 Configuration

-
-

-Configuration folder: ~/.config/filebot/ -

-
-
- -
-

16.4.4 Documentation

- -
- - -
- -
-

16.5 Subtitle Manager

-
-
-
-

16.5.1 subdl

-
-
-
-

16.6 TODO Youtube

- -
-
-
-

17 TODO Contact Manager

- - -
-

17.1 GooBook - Contacts from Google

-
-
-
-

17.1.1 Installation

-
-
-
yay -S goobook-git
-
-
-

-And Then -

-
-
goobook authenticate
-
-
-
-
- -
-

17.1.2 Usage

-
-
-
goobook query name
-
-
-
-
-
- -
-

17.2 TODO lbdb

-
-
-
-

17.2.1 Installation

-
-
-
yay -S lbdb
-
-
-
-
-
- -
-

17.3 TODO Use Vdirsyncer for contact synchronization

-
-
-

17.4 TODO Mu

-
-

-This looks for contacts in your emails. -mu cfind <name> -

-
-
- -
-

17.5 TODO Integration with Mutt

-
-
- -
-

18 TODO Chat Application

-
-
-
-

18.1 Gui Chat Application - Franz

- -
-

18.1.1 Installation

-
-

-Download the AppImage and run it. -

-
-
-
- -
-

18.2 Weechat

-
-

-https://weechat.org/files/doc/stable/weechat_user.en.html -

- -

-Installation -

-
-
yay -S weechat
-
-
- -

-Then we install some dependencies -

-
-
yay -S tcl lua ruby
-
-
- -

-Enable mouse support: -

-
-
/mouse enable
-
-
-
- -
-

18.2.1 TODO Theme

-
-

-https://www.bfoliver.com/technology/2017/07/15/weechat/ -

- -

-https://alexjj.com/blog/2016/9/setting-up-weechat/ -

-
-
/set weechat.look.prefix_same_nick "⤷"
-/set weechat.look.prefix_error "⚠"
-/set weechat.look.prefix_action "⚡"
-/set weechat.look.bar_more_down "▼▼"
-/set weechat.look.bar_more_left "◀◀"
-/set weechat.look.bar_more_right "▶▶"
-/set weechat.look.bar_more_up "▲▲"
-/set weechat.look.prefix_suffix "╡"
-/set weechat.color.chat_nick_colors red,green,brown,blue,magenta,cyan,white,lightred,lightgreen,yellow,lightblue,lightmagenta,lightcyan
-/set weechat.color.separator 31
-/set buffers.color.current_fg 31
-/set buffers.color.current_bg white
-/set buffers.color.hotlist_message_fg 229
-/set buffers.color.hotlist_private_fg 121
-/set buffers.color.hotlist_highlight_fg 163
-/set buffers.color.number 239
-/set buffers.color.number_char 245
-/set weechat.bar.title.conditions "${inactive}"
-/set weechat.bar.title.color_fg black
-/set weechat.bar.title.color_bg 31         #Or white if 31 does nothing
-
-
-
-
- - - -
-

18.2.3 Multi-line messages

-
-

-Solution is provided here: https://github.com/wee-slack/wee-slack/issues/118 -It uses multiline.pl script. -Then alt-enter is bound to insert a new line: -

-
-
/set plugins.var.perl.multiline.magic_paste_only on
-/key bind meta-ctrl-M /input insert \x0a
-
-
-

-And enter is bound to magic_enter that directly sends the message if its one line, and if its multiple line, waits a little bit and then sends the message: -

-
-
/key bind ctrl-M /input magic_enter
-
-
-
-
- -
-

18.2.4 Send message using $EDITOR

-
-

-https://github.com/keith/edit-weechat -

-
-
mkdir -p ~/.weechat/python/autoload
-cd ~/.weechat/python/autoload
-wget https://raw.githubusercontent.com/keith/edit-weechat/master/edit.py
-
-
- -

-Then, on weechat, type /edit. -

-
-
- -
-

18.2.5 CheatSheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
Ctlr-NNext channel
Ctlr-PPrevious channel
Esc-nToggle nicklist
alt-entNew line
-
-
- -
-

18.2.6 Slack Integration

-
-

-https://github.com/wee-slack/wee-slack -

- -

-Dependency: -

-
-
yay -S python2-websocket-client
-
-
-
-
-
- -
-

18.3 TODO Terminal Based - Slack-Term

- - -
-

18.3.1 Installation

-
-
- -
-

18.4 TODO Using Emacs

-
-
-
-

19 Redshift

- - -
-

19.1 Installation

-
-
-
yay -S redshift
-
-
-
-
-
- -
-

20 TODO Mail Setup

-
-
-
-

20.1 Synchronize Mailboxes - Mbsync

- - -
-

20.1.1 Installation

-
-
-
yay -S isync
-
-
-
-
- -
-

20.1.2 TODO Configuration

-
-

-~/.mbsyncrc -

-
-
- -
-

20.1.3 Automation using systemd

-
-
-
-
20.1.3.1 Retreive New mails
-
-
    -
  • ~/scripts/checkmail.sh
  • -
  • ~/.config/systemd/user/checkmail.service
  • -
  • ~/.config/systemd/user/checkmail.timer
  • -
- -
-
systemctl --user enable checkmail.timer
-systemctl --user start checkmail.timer
-
-
-
-
- -
-
20.1.3.2 Synchronize all the mailboxes
-
-
    -
  • ~/.config/systemd/user/syncmail.service
  • -
  • ~/.config/systemd/user/syncmail.timer
  • -
- -
-
systemctl --user enable syncmail.timer
-systemctl --user start syncmail.timer
-
-
-
-
- -
-
20.1.3.3 Alternative
- -
-
- - -
-
-

20.2 Send Mails - Msmtp

- - -
-

20.2.1 Installation

-
-
-
yay -S msmtp
-
-
-
-
-
- -
-

20.3 Mail Indexer - Notmuch

- - -
-

20.3.1 Installation

-
-
-
yay -S notmuch
-
-
-
-
- -
-

20.3.2 Configuration

-
-

-Configuration file: ~/.notmuch-config -

-
-
- -
-

20.3.3 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - -
CommandUsage
notmuch setupInitial Setup
notmuch newIncorporate new email into notmuch database
-
-
-
- -
-

20.4 TODO Mail Index, Search and Tagging - Mu

- -
- -
-

20.5 TODO Mail Client - NeoMutt

- - -
-

20.5.1 Installation

-
-
-
yay -S neomutt
-
-
-
-
- -
-

20.5.2 TODO Vim Bindings

-
-

-Unding toutes les touches (https://github.com/iagox86/mutt/blob/master/keybindings.conf) et rebind tout pour faire un truc coherent et documenté -Rajouter les keybindings de vim https://github.com/neomutt/neomutt/issues/56#issuecomment-250780838 -

-
-
- -
-

20.5.3 TODO Mailcap configuration

-
-
-

20.5.4 Display html mails

-
-
-
yay -S w3m
-
-
-
-
- -
-

20.5.5 Open PDF from mail

-
-

-~/scripts/openfile.sh -

-
-
- -
-

20.5.6 TODO Integrate with contact manager

-
- - - -
-

20.5.9 Attachments

-
-
-
-
20.5.9.1 Attach multiple files at once
-
-

-First, tag the files you want to send using t, then ; to apply the action on all tagged files and finally <enter> to add them all -

-
-
-
-
20.5.9.2 TODO Add attachment using GUI file manager
-
-
-
20.5.9.3 Cheatsheet
-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
<spc>Open the file
-
-
-
- -
-

20.5.10 Open Url from mail

-
-
-
yay -S urlview
-
-
-
-
- -
-

20.5.11 TODO View emails while composing

- -
- -
-

20.5.12 TODO Searching mails with notmuch

- -
- -
-

20.5.13 TODO Cheatsheet

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
  
-
-
- -
-

20.5.14 TODO Integration with calendar application

- -
- - -
- -
-

20.6 TODO Mu4e

-
-
-

20.7 TODO Notification system

-
-

-A script (~/scripts/checkmail.sh) is used to retreive new mails and use notify=send is there are new received mails. -

-
-
-
- -
-

21 TODO File Manager

-
-
-
-

21.1 TODO Ranger

- -
-

21.1.1 Installation

-
-
-
yay -S ranger
-
-
-
-
- -
-

21.1.2 Configuration

-
-

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

-
-
- -
-

21.1.3 Display pdf

-
-

-All the display of the files are defined in ~/.config/ranger/scope.sh. -

- -

-It seems that Ranger is not working well with Termite. The screen is not refreshing after viewing one image (Github Issue). -

- -

-It works better with Urxvt. -

-
-
- -
-

21.1.4 TODO Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - -
CommandUsage
XExtract archive
ZCompress file or folder
-
-
-
- -
-

21.2 TODO nnn

- - -
-

21.2.1 Installation

-
-
-
yay -S nnn
-
-
-
-
-
- -
-

21.3 TODO GUI File Manager: pcmanfm

- -
-
- -
-

22 TODO Image viewer

-
-
-
-

22.1 TODO Write a script to open any type of image using the corresponding program

-
- - - --- -- -- -- - - - - - - - - - - - - - - - - -
Filetypepngpdfsvg
Programfehzathurainkview
-
-
- -
-

22.2 Feh - Minimal Image Viewer

- -
-

22.2.1 Installation

-
-
-
yay -S feh
-
-
-
-
- -
-

22.2.2 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
fFullscreen
mShow menu
spcnext image
bspcprevious image
wFit image
-
-
-
- -
-

22.3 TODO Vimiv

- -
-

22.3.1 Installation

-
-
-
yay -S vimiv
-
-
-
-
- -
-

22.3.2 TODO Cheatsheet

- -
-
- -
-

22.4 TODO sxiv

- -
-

22.4.1 Installation

-
-
-
yay -S sxiv
-
-
-
-
-
-
- -
-

23 TODO Windows Manager - i3

-
-
-
-

23.1 TODO Installation

-
-
-
yay -S i3-gaps
-
-
-
-
- -
-

23.2 TODO Packages to install/understand

-
-

-artwork-i3 -i3-wallpapers -

-
-
- -
-

23.3 TODO Configuration

-
-

-~/.i3/config -

-
-
- -
-

23.4 TODO Specific config per workspace

-
-

-https://github.com/i3/i3/blob/next/contrib/per-workspace-layout.pl -For instance, default to tabbed windows for workspace dealing with matlab figures. -

-
-
-

23.4.1 Figures / Matlab

-
-
- -
-

23.5 TODO Scratchpad

-
-

-This mode is activated using cmd-s. -

- - - - --- -- - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
pMusic Player - ncmpcpp
mMail Reader - neomutt
cCalculator - insect
- -

-To close the current Scratchpad, use cmd-bsp -

-
-
- -
-

23.6 TODO CheatSheet

-
- - - --- -- - - - - - - -
CommandUsage
-
-
-
- -
-

24 TODO Custom bar - Polybar

- - -
-

24.1 Installation

-
-
-
yay -S polybar
-
-
-
-
- -
-

24.2 TODO Configuration

-
-

-~/.config/polybar/config -

- -

-Polybar is launched automatically from i3 config. -

-
-
- -
-

24.3 TODO Add custom modules

-
-
    -
  • [ ] show passwords
  • -
  • [ ] show bibliography
  • -
  • [ ] show bookmarks
  • -
  • [ ] switch theme (dark/light)
  • -
  • [ ] suspend, restart, hibernate, lock
  • -
-
-
- -
-

24.4 Display unread emails

-
-

-Let's say we want to display unread emails, and when clicking on that we open our mail client. -

- -
-[module/unread_mail]
-type = custom/script
-
-label-font = 2
-format-underline = ${colors.background}
-click-left = termite -e "tmuxinator start neomutt" &
-format = <label>
-exec = ~/.config/polybar/scripts/unread_mails.sh
-interval = 1
-
- -

-A custom script ~/.config/polybar/scripts/unread_mails.sh is just returning the unread emails. -

-
-
- - - -
-

24.6 TODO Add Conky to polybar

-
-
-
-

25 TODO Compositor - Compton

- - -
-

25.1 Installation

-
-
-
yay -S compton
-
-
-
-
- -
-

25.2 TODO Configuration

-
-

-~/.config/compton.conf -

-
-
- -
-

25.3 GUI Configuration

-
-

-To install: -

-
-
yay -S compton-conf
-
-
- -

-Then run compton-conf -

-
-
- -
-

25.4 Automatic run as daemon

-
-

-Compton is run from i3 config in the background (-b option) -

-
-
exec --no-startup-id compton -b
-
-
-
-
-
- -
-

26 TODO Notification Manager - Dunst

- - -
-

26.1 Installation

-
-
-
yay -S dunst
-
-
-
-
- -
-

26.2 Configuration

-
-

-~/.config/dunst/dunstrc -

-
-
- -
-

26.3 TODO Special notifications

-
-
    -
  • [ ] Mails
  • -
  • [ ] New messages on slack
  • -
-
-
- -
-

26.4 TODO How to merge similar notifications like new mails?

-
-
-
-

27 Office Suite - LibreOffice

-
-
-
yay -S libreoffice-fresh
-
-
-
-
- -
-

28 SpreadSheet - SC-IM

-
-

-https://github.com/andmarti1424/sc-im -https://www.youtube.com/watch?v=K_8_gazN7h0 -

- -

-It permits to open Excel files on the terminal very quickly. -

- -
-
yay -S sc-im
-
-
-
-
- -
-

29 Managing Theme

-
-
-
-

29.1 GTK Themes

-
-

-Gtk2 themes are managed using the file ~/.gtkrc-2.0 while Gtk3 themes are managed using ~/.config/gtk-3.0/settings.ini. -

-
- -
-

29.1.1 Gui Manager

-
-

-To customize the look of the system using GUI application, run lxappearance. -

- -

-Installation: -

-
-
yay -S lxappearance
-
-
-
-
- -
-

29.1.2 Icons and themes

-
-
-
yay -S zukitwo-themes faenza-icon-theme
-
-
-
-
-
- -
-

29.2 QT Themes

-
-

-Run qt5ct to manage QT Themes. -

-
-
- -
-

29.3 XFT Themes

-
-

-Some configuration are located in ~/.Xresources. -

-
-
-
- -
-

30 Launcher - Rofi

- - -
-

30.1 Installation

-
-
-
yay -S rofi
-
-
-
-
- -
-

30.2 Setup rofi as a dmenu replacement

-
-

-Setup rofi as a dmenu replacement in ~/.i3/config: -

-
-bindsym $mod+d exec --no-startup-id rofi -show run
-
-
-
- -
-

30.3 Run sudo commands with rofi

-
-

-https://github.com/DaveDavenport/rofi/issues/584#issuecomment-384555551 -

- -

-Use sudo -A, that will open a rofi prompt to ask for the password. -

- -

-For that to work, we need to add the following code to ~/.profile: -

-
-
export SUDO_ASKPASS=~/bin/askpass-rofi
-
-
- -

-The askpass script is: -

-
-
#!/bin/sh
-
-# Take password prompt from STDIN, print password to STDOUT
-# the sed piece just removes the colon from the provided
-# prompt: rofi -p already gives us a colon
-rofi -dmenu \
-  -password \
-  -no-fixed-num-lines \
-  -p "$(printf "$1" | sed s/://)"
-
-
-
-
-
- -
-

31 TODO Advanced config

-
-
-
-

31.1 TODO Deactivate startup mac sound

-
-
-
sudo nvram SystemAudioVolume=%80
-
-
-
-
- -
-

31.2 TODO Webcam

-
-

-https://github.com/patjak/bcwc_pcie/wiki/Get-Started -

- -

-Explain how this is working now -

-
-
- -
-

31.3 TODO Trackpad

-
-

-The configuration is here: /etc/X11/xorg.conf.d/30-touchpad.conf -

-
-
- -
-

31.4 TODO Startup programs

- -
-
-

31.5 TODO Printer

-
-

-https://wiki.archlinux.org/index.php/CUPS -Web based administration: http://localhost:631/ -

- -

-system-config-printer -

-
-
-

31.5.1 Check and Clear the Queue

-
-

-Check the queue -

-
-
lpq
-lpq -a # on all queues
-
-
- -

-Clear the queue -

-
-
lprm   # remove last entry only
-lprm - # remove all entries
-
-
-
-
- -
-

31.5.2 TODO CheatSheet

-
- - - --- -- - - - - - - -
CommandUsage
-
-
-
- -
-

31.6 TODO Kernel Management

- - -
-

31.6.1 TODO Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - -
CommandUsage
mhwd-kernel -liDetermine which kernel is used
 Change current kernel
-
-
-
- -
-

31.7 TODO Power Consumption

- -
- -
-

31.8 TODO Power Management Tool: TLP and Powertop

- -
- -
-

31.9 TODO Suspend / Hibernate

- - -
-

31.9.1 Current behavior

-
-

-Actually, it seems that the first suspend is working. After that the macbook go out of the suspend after few seconds -

-
-
-
- -
-

31.10 TODO Lid open/close

-
-

-Should automatic show lock screen -

- -

-/etc/systemd/logind.conf -

-
-
- - - -
-

31.12 TODO NAS Synology

-
-
-
-

31.12.1 Script to mount and umount

- -
- -
-

31.12.2 TODO Automatic Backup of folders?

-
-

-AUR package: synology backup -

-
-
- -
-

31.12.4 TODO Install beets on the nas?

-
-
-
-

31.13 TODO Format disks

-
-

-https://gparted.org/ -

- -

-sudo gparted to format disks () -

-
-
- -
-

31.14 TODO Bluetooth

- - - - -
-

31.14.2 TODO Bluetooth headset

-
-
- -
-

31.16 TODO Temperature and Fan control

-
-

-https://github.com/dgraziotin/mbpfan -https://0xadada.pub/2016/03/05/install-encrypted-arch-linux-on-apple-macbook-pro/#fine-tuning -Fan are controlled by mbpfan. The config file is /etc/mbpfan.conf -

- -
-
# Enable Automated Power Regulation
-sudo pacman -S tlp
-sudo systemctl enable tlp
-sudo systemctl enable tlp-sleep
-sudo tlp start
-
-# Enable thermald (overheat shutoff)
-yaourt -S thermald
-sudo systemctl enable thermald
-sudo systemctl start thermald
-
-
-
-
- - -
-

31.18 TODO Lock Screen

- - -
-

31.18.1 Installation

-
-
-
yay -S betterlockscreen
-
-
-
-
-
-
- -
-

32 TODO LaTeX

-
-
-
-

32.1 Installation

-
-
-
yay -S texlive-most
-
-
- -

-Biber support for the bibliography: -

-
-
yay -S biber
-
-
- -

-Support for source code using minted: -

-
-
yay -S minted
-
-
-
-
- -
-

32.2 Personnal classes/packages

-
-

-Every custom class or packages can be put under ~/texmf/tex/latex/local/ folder. -

- -

-In order for LaTeX to be aware of new packages/classes, run sudo texhash each time a new custom package is added. -

-
-
- -
-

32.3 TODO From screenshot to latex math formula

- - -
-

32.3.1 Installation

-
-
-
yay -S mathpix-snipping-tool
-
-
-
-
- -
-

32.3.2 Usage

-
-

-First, you have to run mathpix-snipping-tool. That will add something in the tray. -

- -

-Then, use <ctrl><alt>m and then select a part of the screen to convert that area to latex formula. -

-
-
- -
-

32.3.3 TODO Think of a better way to run that program. Maybe disable the tray icon and add some polybar script that automatically run the program, and ask for selection of the screen.

-
-
- -
-

32.4 TODO Custom script to select latex symbol

-
-

-https://github.com/superluserdo/Latex-picker -Maybe use that script for other things? -

-
-
- -
-

32.5 Awesome LaTeX

- -
-
- -
-

33 Mathematical Software

-
-
-
-

33.1 Insect

- - -
-

33.1.1 Installation

-
-
-
yay -S insect
-
-
-
-
- -
-

33.1.2 Usage

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
3 m/s to km/hConvert Unit
-
-
-
- -
-

33.2 Matlab

- - -
-

33.2.1 Installation

-
-
-
yay -S matlab
-
-
-
-
-
- - -
- -
-

34 TODO Cloud Backup / Sync - Rclone

-
-

-https://github.com/ncw/rclone -https://rclone.org/docs/ -gui: https://martins.ninja/RcloneBrowser/ -

- -

-Rclone is used to manage the online drives like Google Drive and Dropbox. -

-
- -
-

34.1 Installation

-
-
-
yay -S rclone
-
-
-
-
- -
-

34.2 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
rclone configConfiguration
rclone listremotesList configured remotes
rclone aboutInformations about the remote
rclone copyCopy files from source to dest
rclone syncMake source and dest identical, modifying destination only
rclone checkCheck if the files in the source and destination match
rclone lsList all the objects in the path
rclone sizeReturn the total size and number of objects in remote:path
rclone cleanupClean up the remote if possible
-
-
- -
-

34.3 Usefull commands

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
rclone sync ~/gdrive/ gdrive:/ -PMake Google Drive files to same as local ones
rclone copy gdrive:/directory/ ~/gdrive/directory/ -PCopy directory from Google Drive to local
rclone lsf gdrive:/ --max-depth 1List files and directory
-
- -
-

34.3.1 Progress bar for long synchronizations

-
-

-Use --progress --stats-one-line. -

-
-
-
-
- -
-

35 Download Manager

-
-
-
-

35.1 TODO CLI Download Manager - Aria2

-
-
-
-

35.1.1 Installation

-
-
-
yay -S aria2
-
-
-
-
-
-

35.1.2 Usage

-
-
- -
-

35.2 TODO Torrent Client - deluge

- - -
-

35.2.1 Installation

-
-
-
yay -S deluge
-
-
-
-
- -
-

35.2.2 Configuration

-
-

-~/.config/deluge/ -

-
-
- -
-

35.2.3 Command Line Interface

-
-

-https://whatbox.ca/wiki/deluge_console_documentation -

- -

-Start the daemon using deluge -d. -Then run the CLI client using deluge-console. -

-
-
- -
-

35.2.4 GUI Client

-
-

-deluge -

-
-
- - -
- -
-

35.3 TODO CLI Torrent Client - btpd

- -
- -
-

35.4 TODO Youtube-dl

-
-
-
yay -S youtube-dl
-
-
-
-
-

35.4.1 Download best audio

-
-
-
youtube-dl -f bestaudio url
-
-
-
-
- -
-

35.4.2 Download best video with audio

-
-
-
youtube-dl -f best url
-
-
-
-
- -
-

35.4.3 Download playlist

-
-
-
- -
-

36 TODO Default Applications

- -
-

36.1 Mailcap file

-
-
-

36.2 TODO XDG-OPEN

-
-

-~/.config/mimeapps.list -

-
-
- -
-

36.3 TODO Make QuteBrowser the default browser

-
-
-
-

37 TODO Desktop files

-
-

-~/.local/share/applications/ -

-
-
- -
-

38 TODO Bibliography Management

- - - -
-

38.2 Papis

- - -
-

38.2.1 Installation

-
-
-
sudo pip3 install papis
-
-
-
-
-
-
- -
-

39 TODO Calendar

-
-
-
-

39.1 TODO Vdirsyncer - Sync calendars

-
-
-
-

39.1.1 Installation

-
-
-
yay -S vdirsyncer
-
-
- -
-
sudo pip install requests-oauthlib
-
-
-
-
- -
-

39.1.2 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - -
CommandUsage
vdirsyncer syncSynchronize
-
-
- -
-

39.1.3 Automation - Systemd

-
-

-http://vdirsyncer.pimutils.org/en/stable/tutorials/systemd-timer.html?highlight=systemd -

- -
-
systemctl --user enable vdirsyncer.timer
-systemctl --user start vdirsyncer.timer
-
-
- -

-To check the status of the service: -

-
-
systemctl --user status vdirsyncer.service
-
-
-
-
-
- -
-

39.2 TODO Calendar Client - Khal

- - -
-

39.2.1 Installation

-
-
-
yay -S khal
-
-
-
-
- -
-

39.2.2 TODO Cheatsheet

-
- - - --- -- - - - - - - -
CommandUsage
-
-
-
- -
-

39.3 TODO Calendar Client - Calcurse

- - -
-

39.3.1 Installation

-
-
-
yay -S calcurse
-
-
-
-
-
- -
-

39.4 TODO gcalcli

- -
-
- -
-

40 TODO Presentation software

-
-
-
-

40.1 Beamer

-
- - -
-

40.3 Presentation setup on computer

-
-
-

40.4 PowerPoint Viewer

-
-
-

40.5 Multi-monitor pdf presentation - pdfpc

-
-

-https://github.com/pdfpc/pdfpc -

- -

-pdfpc is a great tool for showing pdf presentations. It support: -

-
    -
  • screen splitting
  • -
  • support for videos in pdf presentations
  • -
  • support for notes
  • -
-
- -
-

40.5.1 Installation

-
-
-
yay -S pdfpc
-
-
-
-
- -
-

40.5.2 Video support

-
-
-
yay -S gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav
-
-
-
-
- -
-

40.5.3 Usage

-
-
-
pdfpc filename.pdf
-
-
-
-
-
-
- -
-

41 TODO RSS Reader

- - -
-

41.1 Newboat

- - -
-

41.1.1 Installation

-
-
-
yay -S newboat
-
-
-
-
- -
-

41.1.2 Configuration

- -
- -
-

41.1.3 TODO Automatic Retrival of Feeds

-
-

-Make a systemd service. -

-
-
- -
-

41.1.4 TODO Add reddit personnal RSS

- -
- -
-

41.1.5 CheatSheet

- -
-
-
- -
-

42 TODO Task Manager

-
-
-
-

42.1 OrgMode and Emacs

-
-
-

42.2 Wunderlist

- -
-

42.2.1 Wunderline

- - -
-
42.2.1.1 Installation
-
-
-
yay -S wunderline
-
-
-
-
- -
-
42.2.1.2 Cheatsheet
-
-

-wunderline list -

-
-
-
-
-
- -
-

43 Background manager: nitrogen

- - -
-

43.1 Configuration

-
-

-~/.config/nitrogen/nitrogen.cfg -

-
-
- -
-

43.2 Wallpapers

-
-

-~/scripts/wallpaper.sh: script to automatically change wallpaper each x minutes. -

-
-
-
- -
-

44 PDF Reader: Zathura

- -
-

44.1 Installation

-
-
-
yay -S zathura
-
-
- -

-Then add dependecies to view specific files: -

-
-
yay -S zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb
-
-
- -

-It seems that mupdf is better that poppler to view pdf. -

-
-
- -
-

44.2 Configuration

-
-

-~/.config/zathura/zathurarc -

-
-
- -
-

44.3 Cheatsheet

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
pPrint the current pdf
tabShow the outline
rReload
J/KNext/previous page
H/LZoom in/out
aFit height
sFit width
DDouble page
fFollow link
iNight Mode
<n>ggGo to page n
mmMark current location to m
'mGoto location m
-
-
-
- -
-

45 TODO Theme manager

-
-

-The idea would be to have a command that changes the theme of all the system. -

- -

-There would be at least one light and one dark theme. -Applications that could change: -

- -

-It seems the color is due to this part of the script. Should then source this file somehow. -

- -
-
BASE16_SHELL="$HOME/.base16-manager/chriskempson/base16-shell/"
-[ -n "$PS1" ] && \
-    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
-        eval "$("$BASE16_SHELL/profile_helper.sh")"
-
-
- - - -

-Possible theme managers: -

- -
-
-

45.1 TODO Theme script

-
-

-~/bin/theme -

-
-
- -
-

45.2 TODO Base16

- - -
-

45.2.1 Base16 Philosophy

-
-

-Define colors according to rules: http://chriskempson.com/projects/base16/ -Then we can use these colors multiple applications. -

-
-
- -
-

45.2.2 Base16-shell

-
-

-https://github.com/chriskempson/base16-shell -

- -

-This changes the shell colors. This should be added to ~/.bashrc: -

-
-
# Base16 Shell
-BASE16_SHELL="$HOME/.config/base16-shell/"
-[ -n "$PS1" ] && \
-    [ -s "$BASE16_SHELL/profile_helper.sh" ] && \
-        eval "$("$BASE16_SHELL/profile_helper.sh")"
-
-
-
-
- -
-

45.2.3 Base16-manager

-
-

-https://github.com/AuditeMarlow/base16-manager -

- -

-This help changes many applications colors at once. -

-
-
-
-
- - - -
-

48 TODO Bugs

-
-
-
-

48.1 TODO Why the cursor is turning when on the background image?

-
-
- -
-

50 TODO VPN Setup

-
-
-
-

50.1 NordVPN

- - -
-

50.1.1 Installation

-
-
-
yay -S nordvpn-bin
-
-
-
-
- -
-

50.1.2 Configuration

-
-
-
sudo systemctl enable nordvpnd.service
-sudo systemctl start nordvpnd.service
-
-
-
-
- -
-

50.1.3 Usage

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandUsage
nordvpn login 
nordvpn connect country 
nordvpn disconnect 
nordvpn status 
nordvpn countries 
-
-
- -
-

50.1.4 TODO Integration with Polybar

-
-
- - -
- -
-

51 Others

-
-
-
-

51.1 Reddit on terminal: rtv

-
-
-
yay -S rtv
-
-
-
-
-
- -
-

52 TODO Usefull commands

-
-
- - -
-

52.2 Show informations about the machine

-
- -
-
- -
-

52.3 Work with PDF

-
-

-pdftk -

-
-
- -
-

52.4 Separate PDF

-
-

-pdfseparate -f 1 -l 6 file.pdf split%d.pdf -Will create split1.pdf to split6.pdf files corresponding to correct pages of file.pdf. -

-
-
- -
-

52.5 Readline

-
-

-https://wiki.archlinux.org/index.php/Keyboard_shortcuts -

- - - - --- -- - - - - - - - - - - - - -
KeyboardShortcut Description
Ctrl+lClear the screen
-
- -
-

52.5.1 Cursor Movement

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyboardShortcut Description
Ctrl+bMove cursor one character to the left
Ctrl+fMove cursor one character to the right
Alt+bMove cursor one word to the left
Alt+fMove cursor one word to the right
Ctrl+aMove cursor to start of the line
Ctrl+eMove cursor to end of the line
-
-
- -
-

52.5.2 Copy & Paste

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyboardShortcut Description
Ctrl+uCut everything from line start to cursor
Ctrl+kCut everything from the cursor to end of the line
Alt+dCut the current word after the cursor
Ctrl+wCut the current word before the cursor
Ctrl+yPaste the previous cut text
Alt+yPaste the second latest cut text
Alt+Ctrl+yPaste the first argument of the previous command
Alt+./Paste the last argument of the previous command
-
-
- -
-

52.5.3 History

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeyboardShortcut Description
Ctrl+pMove to the previous line
Ctrl+nMove to the next line
Ctrl+sSearch
Ctrl+rReverse search
Ctrl+jEnd search
Ctrl+gAbort search (restores original line)
Alt+rRestores all changes made to line
-
-
- -
-

52.5.4 Completion

-
- - - --- -- - - - - - - - - - - - - - - - - - - - - - - -
KeyboardShortcut Description
TabAuto-complete a name
Alt+?List all possible completions
Alt+*Insert all possible completions
-
-
-
- -
-

52.6 Google translate from the command line

-
-
-
yay -S translate-shell
-
-
- -
-
trans englishwork en:fr
-
-
-
-
- -
-

52.7 Others

-
- - - - - - --- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CommandDescription
glancesMoniteur d'activité
meteoGet the meteo
sudo cputhrottle PID %PROCLimiter l'accès au proc pour un processus
asciinemaReccord you terminal
nmap -sP “192.168.1.*"Check all ip addresses on local netword
ncduSee what takes place on the disk
rsync -a --progress source destCopy folders with stats
du -sh folderReturn the size of the folder
df -hReport disk usage
-
-
-
-

52.8 Archive and Extract

-
-

-Use apack and aunpack: -

- - - --- -- - - - - - - - - - - - - - - - - - -
  
aunpack foobar.tar.gzextract all files from archive
apack myarchive.zip foo barcreate a zip archive of two files
-
-
-
- -
-

53 TODO Custom scripts

-
-
-
-

53.1 TODO Password completion with fzf

-
-

-Make a script to use FZF for autocompletion of password (with pass program) and then send to current line or copy. -Maybe use tmux pane for that. -

-
-
-
-
-

54 TODO Bash Snippets

-
-
-
-

54.1 For loop

-
-
-
for file in ./*; do
-  command ${file};
-done
-
-
-
-
-
-
-
-

Author: Thomas Dehaeze

-

Created: 2019-04-01 lun. 18:13

-

Validate

-
- -