diff --git a/alacritty.org b/alacritty.org index 55d5191..0152023 100644 --- a/alacritty.org +++ b/alacritty.org @@ -8,19 +8,19 @@ #+begin_src yaml font: normal: - family: Hack Nerd Font Mono + family: SauceCodePro Nerd Font Mono style: Regular bold: - family: Hack Nerd Font Mono + family: SauceCodePro Nerd Font Mono style: Bold italic: - family: Hack Nerd Font Mono + family: SauceCodePro Nerd Font Mono style: Italic bold_italic: - family: Hack Nerd Font Mono + family: SauceCodePro Nerd Font Mono style: Bold Italic size: 10.0 diff --git a/applications.org b/applications.org index af3b597..024b757 100644 --- a/applications.org +++ b/applications.org @@ -3,19 +3,17 @@ #+PROPERTY: header-args:conf :comments none :mkdirp yes * Mime Applications -:PROPERTIES: -:header-args: :tangle ~/.config/mimeapps.list -:END: -#+BEGIN_SRC conf +#+BEGIN_SRC conf :tangle ~/.config/mimeapps.list [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 @@ -23,17 +21,23 @@ x-scheme-handler/magnet=stig.desktop; application/x-bittorrent=stig.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 + +text/xml=org.qutebrowser.qutebrowser.desktop +text/html=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/http=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/https=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/ftp=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/chrome=org.qutebrowser.qutebrowser.desktop +application/x-extension-htm=org.qutebrowser.qutebrowser.desktop +application/x-extension-html=org.qutebrowser.qutebrowser.desktop +application/x-extension-shtml=org.qutebrowser.qutebrowser.desktop +application/xhtml+xml=org.qutebrowser.qutebrowser.desktop +application/x-extension-xhtml=org.qutebrowser.qutebrowser.desktop +application/x-extension-xht=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/about=org.qutebrowser.qutebrowser.desktop +x-scheme-handler/unknown=org.qutebrowser.qutebrowser.desktop + +text/calendar=ics_add.desktop [Added Associations] text/plain=mousepad.desktop; @@ -41,14 +45,12 @@ application/x-bittorrent=stig.desktop; #+END_SRC * Neomutt -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/neomutt.desktop -:END: -#+begin_src conf + +#+begin_src conf :tangle ~/.local/share/applications/neomutt.desktop [Desktop Entry] Name=Neomutt GenericName=Email client -Exec=$TERMINAL -e neomutt %u +Exec=alacritty -e neomutt %u Type=Application Icon=/usr/share/icons/Papirus/64x64/apps/mutt.svg Categories=Network;Email; @@ -57,12 +59,10 @@ StartupNotify=true #+end_src * Matlab -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/matlab.desktop -:END: -#+begin_src conf + +#+begin_src conf :tangle ~/.local/share/applications/matlab.desktop [Desktop Entry] -Version=R2020b +Version=R2019b Type=Application Terminal=false MimeType=text/x-matlab @@ -74,25 +74,6 @@ Comment=Scientific computing environment StartupNotify=true #+end_src -* Neovim -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/nvim.desktop -:END: -#+begin_src conf -[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; -#+end_src - * Images :PROPERTIES: :header-args: :tangle ~/.local/share/applications/img.desktop @@ -105,10 +86,8 @@ Exec=/usr/bin/sxiv -a %u #+end_src * Org-Protocol -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/org-protocol.desktop -:END: -#+begin_src conf + +#+begin_src conf :tangle ~/.local/share/applications/org-protocol.desktop [Desktop Entry] Name=org-protocol Exec=emacsclient %u @@ -118,64 +97,9 @@ Terminal=false MimeType=x-scheme-handler/org-protocol; #+end_src -* Ranger -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/ranger.desktop -:END: -#+begin_src conf -[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; -#+end_src -* Emacs Client -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/emacsclient.desktop -:END: -#+begin_src conf -[Desktop Entry] -Name=Emacs Client -GenericName=Text Editor -Comment=Edit text -MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; -Exec=emacsclient -c %f -Icon=emacs -Type=Application -Terminal=false -Categories=Utility;TextEditor; -#+end_src - -* Qutebrowser -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/qutebrowser.desktop -:END: -#+begin_src conf -[Desktop Entry] -Name=qutebrowser -StartupWMClass=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=true -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; -#+end_src - * Zathura -:PROPERTIES: -:header-args: :tangle ~/.local/share/applications/zathura.desktop -:END: -#+begin_src conf + +#+begin_src conf :tangle ~/.local/share/applications/zathura.desktop [Desktop Entry] Version=1.0 Type=Application @@ -201,3 +125,15 @@ MimeType=application/x-bittorrent Categories=Network;FileTransfer;P2P; Keywords=p2p;bittorrent;transmission;rpc; #+end_src + +* ICS-Add + +#+begin_src conf :tangle ~/.local/share/applications/ics_add.desktop +[Desktop Entry] +Name=ICS Add +Comment=Add ICS file to the calendar +Terminal=true +Exec=ics-add %U +Type=Application +MimeType=text/calendar +#+end_src diff --git a/bash.org b/bash.org index f5398ba..b03657c 100644 --- a/bash.org +++ b/bash.org @@ -21,8 +21,8 @@ ** FZF #+begin_src bash -. /usr/share/doc/fzf/examples/completion.bash -. /usr/share/doc/fzf/examples/key-bindings.bash +. /usr/share/fzf/completion.bash +. /usr/share/fzf/key-bindings.bash #+end_src ** Ignore case for auto-completion @@ -86,9 +86,13 @@ alias grep='grep --colour=auto' alias cp="cp -i" # confirm before overwriting something alias df='df -h' # human-readable sizes alias free='free -m' # show sizes in MB -alias bat='batcat' alias mutt="neomutt" +#+END_SRC + +Change default configuration file location: +#+BEGIN_SRC bash alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf' +alias mbsync='mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc' #+END_SRC *** One letter aliases @@ -118,11 +122,6 @@ alias :e=nvim alias path='echo -e ${PATH//:/\\n}' #+END_SRC -*** Other -#+begin_src bash -alias fd="fdfind" -#+end_src - ** Functions *** =colors= - Display colors #+BEGIN_SRC bash @@ -250,7 +249,7 @@ PROMPT_COMMAND="history -a; $PROMPT_COMMAND" ** QT And GTK Themes #+begin_src bash export QT_QPA_PLATFORMTHEME="qt5ct" -export GTK2_RC_FILES="$HOME/.gtkrc-2.0" +export GTK2_RC_FILES="$HOME/.config/gtk-2.0/gtkrc.mine" #+END_SRC ** Gui program to ask for sudo password @@ -258,15 +257,6 @@ export GTK2_RC_FILES="$HOME/.gtkrc-2.0" export SUDO_ASKPASS=~/.local/bin/askpass-rofi #+END_SRC -** Gnome Keyring Daemon -Enable the keyring for applications run through the terminal -#+begin_src bash -if [ -n "$DESKTOP_SESSION" ];then - eval $(gnome-keyring-daemon --start) - export SSH_AUTH_SOCK -fi -#+end_src - ** Export some default applications #+begin_src bash export EDITOR="nvim" @@ -280,6 +270,21 @@ export FILE="ranger" *** XDG Default #+begin_src bash export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_STATE_HOME="$HOME/.local/state" +export XDG_CACHE_HOME="$HOME/.cache" +#+end_src + +#+begin_src bash +export LESSHISTFILE=- +export GNUPGHOME="$XDG_DATA_HOME/gnupg" +export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java" +export PASSWORD_STORE_DIR="$XDG_DATA_HOME/pass" +export INPUTRC="$XDG_CONFIG_HOME/readline/inputrc" +export XINITRC="$XDG_CONFIG_HOME/X11/xinitrc" +export CARGO_HOME="$XDG_DATA_HOME/cargo" +export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtkrc-2.0" +export MATLAB_LOG_DIR="$XDG_CACHE_HOME/matlab" #+end_src *** Use Ripgrep for FZF @@ -288,37 +293,39 @@ export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.g export FZF_DEFAULT_OPTS='--layout=reverse --height=20' #+end_src -*** Goland -#+begin_src bash -export GOPATH=$HOME/go -#+end_src - *** Latex Path #+begin_src bash export TEXMFHOME=$HOME/.local/share/texmf #+end_src -*** Python Path -#+begin_src bash -export PYTHONPATH="${PYTHONPATH}:/usr/lib/python3.9/site-packages/configobj" -#+end_src - *** Linkding #+begin_src bash export LINKDING_URL=`pass nas/linkding_url` export LINKDING_TOKEN=`pass nas/linkding_token` #+end_src +*** Restic +#+begin_src bash +export RESTIC_REPOSITORY=sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop +export RESTIC_PASSWORD_COMMAND="pass show restic" +#+end_src + +*** Go +#+begin_src bash +export GOPATH=$HOME/.config/go +#+end_src + +*** Japanese input +#+begin_src bash +# Japanese input +export QT_IM_MODULE=fcitx +export XMODIFIERS=@im=fcitx +export GTK_IM_MODULE=fcitx +#+end_src + ** Path #+begin_src bash -PATH=$HOME/appimages:$PATH -PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH -PATH=$GOPATH:$GOPATH/bin:$PATH -PATH=~/.config/emacs/bin:$PATH PATH=~/.local/bin:$PATH -PATH=~/.local/bin/nvim/bin:$PATH -PATH=~/.npm-global/bin:$PATH -PATH=~/miniconda3/bin:$PATH export PATH #+END_SRC @@ -329,9 +336,9 @@ if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then fi #+end_src -* =~/.inputrc= +* =inputrc= :PROPERTIES: -:header-args: :tangle ~/.inputrc +:header-args: :tangle ~/.config/readline/inputrc :header-args+: :comments both :mkdirp yes :CUSTOM_ID: inputrc :END: diff --git a/binaries-private.org b/binaries-private.org index 55d11a0..354b1e5 100644 --- a/binaries-private.org +++ b/binaries-private.org @@ -10,7 +10,7 @@ :CUSTOM_ID: phonebook :END: -The phone-list is taken from =scp opid21@lid21nano:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt= +The phone-list is taken from =scp rnice@esrf.fr:/mnt/multipath-shares/sware/pub/phonelist/share/annuaire.txt /home/thomas/.local/data/annuaire.txt= #+begin_src bash :tangle ~/.local/bin/phonebook cat ~/.local/data/annuaire.txt | fzf --header="NAME Phone Box department roomNumber description mail" @@ -33,77 +33,62 @@ khard | fzf --header="Index Name Phone $TERMINAL --title esrf-phonebook -e contacts #+end_src -* =qutebrowser= -:PROPERTIES: -:CUSTOM_ID: qutebrowser -:END: - -#+begin_src bash :tangle ~/.local/bin/qutebrowser -~/.local/soft/qutebrowser/.venv/bin/python3 -m qutebrowser "$@" -#+end_src - -* =remote-home= - Remote Desktop to Home PC -:PROPERTIES: -:CUSTOM_ID: remote-home -:END: - -#+begin_src bash :tangle ~/.local/bin/remote-home -notify-send 'Rdesktop' "Connection to Home PC..." - -common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_PC /grab-keyboard /cert:ignore" - -xfreerdp $common_arg /u:thomas /p:$(pass home_pc/thomas | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_home_pc.log 2>&1 & -#+end_src - * =remote-desktop= - Remote Desktop Connect :PROPERTIES: :CUSTOM_ID: remote-desktop :END: #+begin_src bash :tangle ~/.local/bin/remote-desktop -computer=$(echo -e 'WID21SPEEDGOAT1\nWBM23SPEEDGOAT1\nWID24SPEEDGOAT1\nPCMEL1\nRNICE\nPCDEHAEZE\nLAPPAMU1\nPCNASS1\nDesktop-W10' | rofi -i -dmenu -no-custom -p 'Computer:' -l 20); +computer=$(echo -e 'WID21SPEEDGOAT1\nWID24SPEEDGOAT1\nWBM23SPEEDGOAT1\nWMELSPEEDGOAT1\nWID31PC1\nPCOPTRO\nPCMEL1\nPCMEL2\nRNICE\nPCDEHAEZE\nLAPMEL01\nDesktop-W10' | rofi -i -dmenu -no-custom -p 'Computer:' -l 20); if [[ -z "$computer" ]]; then exit 1 fi -notify-send 'Rdesktop' "Connection to ${computer}..." +dunstify --replace=99425 'Rdesktop' "Connection to ${computer}..." proxy_arg="" if [ "$computer" = "Desktop-W10" ]; then # If connect to local PC - if [ ping -c 1 -t 1 desktop-w10.lan &> /dev/null ]; then + ping -c 1 desktop-w10.lan &> /dev/null + if [ $? -ne 0 ]; then # And outside of local network, use proxy proxy_arg="/proxy:socks5://localhost:8080" fi -elif [ -z "$(timeout 1s dig +short proxy.esrf.fr.)" ]; then - # Outside the ESRF network - proxy_arg="/proxy:socks5://localhost:8081" +else + ping -c 1 proxy.esrf.fr &> /dev/null + if [ $? -ne 0 ]; then + # Outside the ESRF network + proxy_arg="/proxy:socks5://localhost:8081" + fi fi common_arg="/clipboard /bpp:8 /bpp:16 /compression -themes -wallpaper /async-update /async-input -glyph-cache /audio-mode:1 /dynamic-resolution /auto-reconnect /wm-class:RDP_$computer /grab-keyboard /cert:ignore" case "$computer" in - "RNICE" | "PCDEHAEZE" | "PCNASS1") + "RNICE" | "PCDEHAEZE") xfreerdp $proxy_arg $common_arg /d:ESRF /u:dehaeze /p:$(pass esrf.fr/dehaeze | sed -n 1p) /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; - "PCMEL1") + "PCMEL1" | "PCMEL2" | "PCOPTRO" | "LAPMEL01") xfreerdp $proxy_arg $common_arg /d:ESRF /u:OPPEL /p:TonicPEL /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; + "WMELSPEEDGOAT1") + xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; + + "WID31PC1") + xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid31 /p:tonic31 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; + "WID21SPEEDGOAT1") xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid21 /p:tonic21 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; - "WBM23SPEEDGOAT1") - xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; - "WID24SPEEDGOAT1") xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid24 /p:tonic24 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; - "LAPPAMU1") - xfreerdp $proxy_arg $common_arg /d:ESRF /u:opid00 /p:tonic00 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; + "WBM23SPEEDGOAT1") + xfreerdp $proxy_arg $common_arg /d:ESRF /u:opd23 /p:tonic23 /v:$computer.esrf.fr > /tmp/freerdp_${computer}.log 2>&1 & ;; "Desktop-W10") - xfreerdp $proxy_arg $common_arg /d:ESRF /u:thomas /p:$(pass windows/Desktop-W10 | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_${computer}.log 2>&1 & ;; + xfreerdp $proxy_arg $common_arg /u:thomas /p:$(pass windows/Desktop-W10 | sed -n 1p) /v:192.168.1.72 > /tmp/freerdp_${computer}.log 2>&1 & ;; esac #+end_src @@ -129,9 +114,22 @@ dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs no //wfiles/groupshare /home/thomas/mnt/groupshare vsifs noauto,user,credentials=/home/thomas/.smbcredentials,uid=1001,gid=1001,forceuid,forcegid 0 0 #+end_src -#+begin_src bash :tangle ~/.local/bin/mount-dir +#+begin_src text :tangle no +//wfiles/groupshare /home/thomas/mnt/groupshare cifs noauto,user,uid=1000,gid=1000,credentials=/home/thomas/.smbcredentials 0 0 +homelab:/srv/storage/ /home/thomas/mnt/homelab fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +dehaeze@rnice:/tmp_14_days/ /home/thomas/mnt/tmp_14_days fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +dehaeze@rnice:/home/esrf/dehaeze/ /home/thomas/mnt/unix_home fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +dehaeze@rnice:/data/monochromators/ /home/thomas/mnt/monochromators fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +dehaeze@rnice:/gpfs/jazzy/data/id21/inhouse /home/thomas/mnt/data_id21 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +blissadm@lmellab:/data/id00/inhouse/DCM /home/thomas/mnt/data_id24 fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +blissadm@lmellab:/data/id00/inhouse/MEL /home/thomas/mnt/data_mel fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +blissadm@lmellab:/users/blissadm/local /home/thomas/mnt/bliss fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +blissadm@lmellab:/data/visitor /home/thomas/mnt/data_bl fuse.sshfs noauto,allow_other,user,uid=1000,gid=1000,default_permissions 0 0 +#+end_src + +#+begin_src bash :tangle no if [ $# -eq 0 ]; then - drive=$(echo -e 'monochromators\ntmp_14_days\nhomelab\ngroupshare\nunix_home\ndata_id21' | rofi -dmenu -no-custom -p 'Drive:' -l 20); + drive=$(echo -e 'bliss_mel\nbliss_id21\ndata_bl\ndata_id21\ndata_id24\ndata_mel\ndata_visitor\ndrive\nhomelab\nmonochromators\ntmp_14_days\nunix_home' | rofi -dmenu -no-custom -p 'Drive:' -l 20); if [[ -z "$drive" ]]; then exit 1 fi @@ -142,23 +140,110 @@ fi if grep -qs "/home/thomas/mnt/$drive" /proc/mounts; then umount "/home/thomas/mnt/$drive" && \ - notify-send "$drive " 'Successfully unmounted' || \ - notify-send --urgency=critical "$drive " 'Error while unmounted' + dunstify --replace=58249 "$drive " 'Successfully unmounted' || \ + dunstify --replace=58249 --urgency=critical "$drive " 'Error while unmounted' else echo "It's not mounted." mount "/home/thomas/mnt/$drive" && \ - notify-send "$drive " 'Successfully mounted' || \ - notify-send --urgency=critical "$drive " 'Error while mounted' + dunstify --replace=58249 "$drive " 'Successfully mounted' || \ + dunstify --replace=58249 --urgency=critical "$drive " 'Error while mounted' fi #+end_src +#+begin_src bash :tangle ~/.local/bin/mount-dir +if [ $# -eq 0 ]; then + drive=$(find ~/mnt/* -maxdepth 0 -type d -empty -printf '%f\n' | rofi -i -dmenu -no-custom -p 'Drive:' -l 20); + if [[ -z "$drive" ]]; then + exit 1 + fi +else + exit 1 +fi + +proxy_arg="" +ping -c 1 proxy.esrf.fr &> /dev/null +if [ $? -ne 0 ]; then + # Outside the ESRF network + proxy_arg=".esrf.fr" +fi + +remote_loc="" +passname="" +case "$drive" in + "homelab") + remote_loc="thomas@homelab:/srv/storage/" ;; + "tmp_14_days") + remote_loc="dehaeze@rnice$proxy_arg:/tmp_14_days/" + passname="esrf/dehaeze" ;; + "unix_home") + remote_loc="dehaeze@rnice$proxy_arg:/home/esrf/dehaeze/" + passname="esrf/dehaeze" ;; + "monochromators") + remote_loc="dehaeze@rnice$proxy_arg:/data/monochromators/" + passname="esrf/dehaeze" ;; + "data_mel") + remote_loc="opid00@lmellab$proxy_arg:/data/id00/inhouse/MEL/" + passname="esrf/opid00" ;; + "data_jazzy") + remote_loc="dehaeze@rnice$proxy_arg:/gpfs/jazzy/data/" + passname="esrf/dehaeze" ;; + "data_easy") + remote_loc="dehaeze@rnice$proxy_arg:/gpfs/easy/data/" + passname="esrf/dehaeze" ;; + "data_id31") + remote_loc="opid31@id31$proxy_arg:/data/id31/inhouse/" + passname="esrf/opid31" ;; + "bliss_mel") + remote_loc="blissadm@lmellab$proxy_arg:/users/blissadm/local/" + passname="esrf/blissadm" ;; + "bliss_id21") + remote_loc="blissadm@lid21nano$proxy_arg:/users/blissadm/local/" + passname="esrf/blissadm" ;; + "bliss_id24") + remote_loc="blissadm@foucault$proxy_arg:/users/blissadm/local/" + passname="esrf/blissadm" ;; + "groupshare") + mount ~/mnt/groupshare && \ + exit ;; +esac + +if [-z $remote_loc ] +then + exit +else + if [-z $passname ] + then + sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions $remote_loc /home/thomas/mnt/$drive + else + pass "$passname" | sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions,password_stdin $remote_loc /home/thomas/mnt/$drive + fi + +fi + +# sshfs -o allow_other,user,uid=1000,gid=1000,default_permissions $remote_loc /home/thomas/mnt/$drive +#+end_src + +#+begin_src bash :tangle ~/.local/bin/umount-dir +if [ $# -eq 0 ]; then + # drive=$(find ~/mnt/* -maxdepth 0 -type d -not -empty -printf '%f\n' | rofi -dmenu -no-custom -p 'Drive:' -l 20); + drive=$(ls ~/mnt/ | rofi -dmenu -no-custom -p 'Drive:' -l 20); + if [[ -z "$drive" ]]; then + exit 1 + fi +else + exit 1 +fi + +umount /home/thomas/mnt/$drive +#+end_src + * =screen-select= - Xrandr pre-defined scripts :PROPERTIES: :CUSTOM_ID: screen-select :END: #+begin_src bash :tangle ~/.local/bin/screen-select -option=$(echo -e "Work\nLaptop\nHome" | rofi -dmenu -no-custom -p 'Screen:' -l 20) +option=$(echo -e "Work\nLaptop\nHome" | rofi -i -dmenu -no-custom -p 'Screen:' -l 20) if [[ -z "$option" ]]; then exit 1 @@ -188,7 +273,7 @@ case "$option" in after_screen_change ;; "Home") - xrandr --output eDP-1 --off --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ + xrandr --output eDP-1 --off --output DP-1-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ after_screen_change ;; ,*) @@ -210,11 +295,12 @@ sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | rofi -d media=$(echo -e 'A4\nA3' | rofi -dmenu -no-custom -p 'Size:' -l 20); printer=$(echo -e 'ctb127c1u\nctb110c1u' | rofi -dmenu -no-custom -p 'Size:' -l 20); -if [[ -z "$nbpage" || -z "$side" || -z "$media" || -z "$printer" ]]; then +if [[ -z "$nbpage" || -z "$sides" || -z "$media" || -z "$printer" ]]; then exit 1 fi -lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer "$1"; +rsync -zaP "$1" dehaeze@rnice:/home/esrf/dehaeze/Downloads/to-be-printed.pdf && \ + ssh rnice "lpr -o media=$media -o sides=$sides -o number-up=$nbpage -P $printer /home/esrf/dehaeze/Downloads/to-be-printed.pdf"; #+end_src * =readbib= - Open Bibliography File diff --git a/binaries.org b/binaries.org index 9dfc516..900c1b9 100644 --- a/binaries.org +++ b/binaries.org @@ -5,123 +5,6 @@ #+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash" #+PROPERTY: header-args:bash+ :tangle-mode (identity #o555) -* =dmenumount= - Mount USB and Android -:PROPERTIES: -:CUSTOM_ID: dmenumount -:END: - -Script taken from Luke Smith. - -#+begin_src bash :tangle ~/.local/bin/dmenumount -getmount() { \ - [ -z "$chosen" ] && exit 1 - # shellcheck disable=SC2086 - mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 - [ "$mp" = "" ] && exit 1 - if [ ! -d "$mp" ]; then - mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1 - [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") - fi -} - -mountusb() { \ - chosen="$(echo "$usbdrives" | dmenu -i -p "Mount which drive?")" || exit 1 - chosen="$(echo "$chosen" | awk '{print $1}')" - sudo -A mount "$chosen" 2>/dev/null && notify-send "💻 USB mounting" "$chosen mounted." && exit 0 - alreadymounted=$(lsblk -nrpo "name,type,mountpoint" | awk '$3!~/\/boot|\/home$|SWAP/&&length($3)>1{printf "-not ( -path *%s -prune ) ",$3}') - getmount "/mnt /media /mount /home -maxdepth 5 -type d $alreadymounted" - partitiontype="$(lsblk -no "fstype" "$chosen")" - case "$partitiontype" in - "vfat") sudo -A mount -t vfat "$chosen" "$mp" -o rw,umask=0000;; - ,*) sudo -A mount "$chosen" "$mp"; user="$(whoami)"; ug="$(groups | awk '{print $1}')"; sudo -A chown "$user":"$ug" "$mp";; - esac - notify-send "💻 USB mounting" "$chosen mounted to $mp." -} - -mountandroid() { \ - chosen="$(echo "$anddrives" | dmenu -i -p "Which Android device?")" || exit 1 - chosen="$(echo "$chosen" | cut -d : -f 1)" - getmount "$HOME -maxdepth 3 -type d" - simple-mtpfs --device "$chosen" "$mp" - echo "OK" | dmenu -i -p "Tap Allow on your phone if it asks for permission and then press enter" || exit 1 - simple-mtpfs --device "$chosen" "$mp" - notify-send "🤖 Android Mounting" "Android device mounted to $mp." -} - -asktype() { \ - choice="$(printf "USB\\nAndroid" | dmenu -i -p "Mount a USB drive or Android device?")" || exit 1 - case $choice in - USB) mountusb ;; - Android) mountandroid ;; - esac -} - -anddrives=$(simple-mtpfs -l 2>/dev/null) -usbdrives="$(lsblk -rpo "name,type,size,mountpoint" | awk '$4==""{printf "%s (%s)\n",$1,$3}')" - -if [ -z "$usbdrives" ]; then - [ -z "$anddrives" ] && echo "No USB drive or Android device detected" && exit - echo "Android device(s) detected." - mountandroid -else - if [ -z "$anddrives" ]; then - echo "USB drive(s) detected." - mountusb - else - echo "Mountable USB drive(s) and Android device(s) detected." - asktype - fi -fi -#+end_src - -* =dmenuumount= - Unmount USB and Android devices -:PROPERTIES: -:CUSTOM_ID: dmenuumount -:END: - -Script taken from Luke Smith. - -#+begin_src bash :tangle ~/.local/bin/dmenuumount -unmountusb() { - [ -z "$drives" ] && exit - chosen="$(echo "$drives" | dmenu -i -p "Unmount which drive?")" || exit 1 - chosen="$(echo "$chosen" | awk '{print $1}')" - [ -z "$chosen" ] && exit - sudo -A umount "$chosen" && notify-send "💻 USB unmounting" "$chosen unmounted." -} - -unmountandroid() { \ - chosen="$(awk '/simple-mtpfs/ {print $2}' /etc/mtab | dmenu -i -p "Unmount which device?")" || exit 1 - [ -z "$chosen" ] && exit - sudo -A umount -l "$chosen" && notify-send "🤖 Android unmounting" "$chosen unmounted." -} - -asktype() { \ - choice="$(printf "USB\\nAndroid" | dmenu -i -p "Unmount a USB drive or Android device?")" || exit 1 - case "$choice" in - USB) unmountusb ;; - Android) unmountandroid ;; - esac -} - -drives=$(lsblk -nrpo "name,type,size,mountpoint" | awk '$4!~/\/boot|\/home$|SWAP/&&length($4)>1{printf "%s (%s)\n",$4,$3}') - -if ! grep simple-mtpfs /etc/mtab; then - [ -z "$drives" ] && echo "No drives to unmount." && exit - echo "Unmountable USB drive detected." - unmountusb -else - if [ -z "$drives" ] - then - echo "Unmountable Android device detected." - unmountandroid - else - echo "Unmountable USB drive(s) and Android device(s) detected." - asktype - fi -fi -#+end_src - * =dmenukill= - Kill program using Dmenu :PROPERTIES: :CUSTOM_ID: dmenukill @@ -135,7 +18,7 @@ if [ ! -z "$ps_line" ]; then name=$(echo $ps_line | awk '{print $4}') kill -15 $pid && \ - notify-send "Kill" "$name (PID $pid)" & + dunstify "Kill" "$name (PID $pid)" & fi #+end_src @@ -147,19 +30,21 @@ fi To use this this, =nordvpn= must be installed: =yay -S nordvpn-bin=. +In order to populate the country list, =nordvpn countries | tr '\t' '\n' | sed -r '/^\s*$/d' > ~/.local/data/nordvpn_countries.txt=. + #+begin_src bash :tangle ~/.local/bin/nordvpn-toggle tmpfile="/tmp/vpnstatus"; if [[ $(nordvpn status) == *"Connected"* ]]; then nordvpn disconnect && \ - notify-send "VPN" "Disconnected" && \ + dunstify --replace=23198 "VPN" "Disconnected" && \ echo "off" > $tmpfile; else # Select Country to connect to country=`cat ~/.local/data/nordvpn_countries.txt | rofi -i -dmenu | sed 's/\s/_/g'`; - notify-send "VPN" "Connecting to $country..."; + dunstify --replace=23198 "VPN" "Connecting to $country..."; nordvpn connect $country && \ - notify-send "VPN" "Connected to $country" && \ + dunstify --replace=23198 "VPN" "Connected to $country" && \ echo "on" > $tmpfile; fi #+end_src @@ -254,7 +139,7 @@ if [[ $status != "Copy" ]]; then if [ -z "$name" ]; then exit; fi - filename=~/Pictures/$name.png + filename=~/Cloud/pictures/screenshots/$name.png fi case "$status" in @@ -322,10 +207,10 @@ ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" - #+begin_src bash :tangle ~/.local/bin/yt-audio if [ $TMUX ]; then - tmux split -v -l 5 "cd ~/Downloads/ && youtube-dl --add-metadata -xic -f bestaudio/best $1" && tmux select-pane -U + tmux split -v -l 5 "cd ~/Downloads/ && yt-dlp --add-metadata -xic --audio-format best $1" && tmux select-pane -U else cd ~/Downloads/; - setsid nohup youtube-dl --add-metadata -xic -f bestaudio/best $1 &> /dev/null & + setsid nohup yt-dlp --add-metadata -xic --audio-format flac $1 &> /dev/null & fi #+end_src @@ -336,12 +221,13 @@ fi #+begin_src bash :tangle ~/.local/bin/yt-video if [ $TMUX ]; then - tmux split -v -l 5 "cd ~/Downloads/ && youtube-dl --add-metadata -ic $1" && tmux select-pane -U + tmux split -v -l 5 "cd ~/Downloads/ && yt-dlp --add-metadata -ic $1" && tmux select-pane -U else cd ~/Downloads/; - setsid nohup youtube-dl --add-metadata -ic $1 &> /dev/null & + setsid nohup yt-dlp --add-metadata -ic $1 &> /dev/null & fi #+end_src + * =setbg= - Set Background :PROPERTIES: :CUSTOM_ID: setbg @@ -384,7 +270,7 @@ if [ -n "$1" ]; then xdotool key Shift+Insert else echo "$chosen" | tr -d '\n' | xsel -ib - notify-send "'$chosen' copied to clipboard." & + dunstify "'$chosen' copied to clipboard." & fi #+end_src @@ -408,7 +294,7 @@ if [ -n "$1" ]; then xdotool key Shift+Insert else echo "$chosen" | tr -d '\n' | xsel -ib - notify-send "'$chosen' copied to clipboard." & + dunstify "'$chosen' copied to clipboard." & fi #+end_src @@ -432,6 +318,8 @@ case "$1" in curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; ,*svg) curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && inkview "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + ,*torrent) + stig add "$1" >/dev/null 2>&1 & ;; ,*mp3|*flac|*opus|*mp3?source*) setsid curl -LO "$1" >/dev/null 2>&1 & ;; ,*) @@ -519,8 +407,8 @@ if [ $TMUX ]; then tmux split -v -l 1 "curl --progress-bar -F\"file=@$1\" https://0x0.st | xsel -ib;" && tmux select-pane -U else curl --progress-bar -F"file=@$1" https://0x0.st | xsel -ib && \ - notify-send 'Upload' 'Successful' || \ - notify-send --urgency=critical 'Upload' 'Failed' + dunstify 'Upload' 'Successful' || \ + dunstify --urgency=critical 'Upload' 'Failed' fi #+end_src @@ -553,54 +441,7 @@ else fi #+end_src -* =pdf2bib= - Extract bibtex entry from PDF file -:PROPERTIES: -:CUSTOM_ID: pdf2bib -:END: - -#+begin_src bash :tangle ~/.local/bin/pdf2bib -pdf2doi () { - pdfinfo "$1" | grep -io "doi:.*" | grep -Poi "10.\d+/[^\s]+" || \ - pdftotext "$1" 2>/dev/null - | grep -io "doi:.*" -m 1 | grep -Poi "10.\d+/[^\s]+" || \ - pdftotext "$1" 2>/dev/null - | grep -Poi "10.\d+/[^\s]+" -} - -doi2bib () { - # curl -LHs "Accept: application/x-bibtex" http://dx.doi.org/$1 -w "\\n" - curl -s "http://api.crossref.org/works/$1/transform/application/x-bibtex" -w "\\n" -} - -# If a file is specified, try to extract DOI from the file -if [ -f "$1" ]; then - doi=$(pdf2doi "$1") -fi - -if hash rofi 2>/dev/null; then - doi=$(echo "$doi" | rofi -i -dmenu -p "DOI") -else - doi=$(echo "$doi" | dmenu -i -p "DOI") -fi - -if [ -n "$1" ]; then - doi2bib $doi | xsel -ib && \ - notify-send 'BibTeX' 'Copied to Clipboard' || \ - notify-send --urgency=critical 'BibTeX' 'Failed' -fi -#+end_src - -* =pdf2png= - Convert a PDF to PNG -:PROPERTIES: -:CUSTOM_ID: pdf2png -:END: - -#+begin_src bash :tangle ~/.local/bin/pdf2png -# Check if the input argumetn is a PDF file -if [[ -f "$1" && "$1" == *.pdf ]]; then - pdftoppm -png "$1" > "$(echo "$1" | cut -f 1 -d '.' | sed 's/$/.png/')" -fi -#+end_src - -* TODO =convert-file= - Convert any file to another filetype +* =convert-file= - Convert any file to another filetype :PROPERTIES: :CUSTOM_ID: convert-file :header-args: :tangle ~/.local/bin/convert-file @@ -612,6 +453,8 @@ fi filename_with_extension=$(basename -- "$1") # Extract extension of the file in_ext="${filename_with_extension##*.}" +# To lowercase +in_ext="${in_ext,,}" # filename without extension filename_without_extension=${filename_with_extension%.*} #+end_src @@ -624,7 +467,7 @@ List of useful programs: #+begin_src bash svg2png_function() { \ if command -v inkscape &> /dev/null; then - inkscape --export-type="$out_ext" --export-dpi=200 --export-area-drawing "$filename_with_extension" + inkscape --export-type="png" --export-filename="$filename_without_extension.png" --export-dpi=500 --export-area-drawing "$filename_with_extension" fi } #+end_src @@ -633,7 +476,7 @@ svg2png_function() { \ #+begin_src bash svg2pdf_function() { \ if command -v inkscape &> /dev/null; then - inkscape --export-type="$out_ext" "$filename_with_extension" + inkscape --export-type="pdf" --export-filename="$filename_without_extension.pdf" "$filename_with_extension" fi } #+end_src @@ -890,11 +733,22 @@ gif2png_function() { \ } #+end_src +*** GIF to mp4 +#+begin_src bash +gif2mp4_function() { \ + if command -v ffmpeg &> /dev/null; then + loop_num=$(rofi -dmenu -p "Number of loops") + + ffmpeg -stream_loop $loop_num -i $filename_with_extension -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "$filename_without_extension.mp4" + fi +} +#+end_src + *** Main function #+begin_src bash # Convert GIF Files gif2() { \ - out_ext=$(echo -e "png" | rofi -i -dmenu -p "Convert GIF to") + out_ext=$(echo -e "png\nmp4" | rofi -i -dmenu -p "Convert GIF to") if [ -z "$out_ext" ]; then exit; @@ -904,6 +758,9 @@ gif2() { \ "png") gif2png_function ;; + "mp4") + gif2mp4_function + ;; esac } #+end_src @@ -952,11 +809,20 @@ pngresize_function() { \ } #+end_src +*** PNG Crop +#+begin_src bash +pngcrop_function() { \ + if command -v cropgui &> /dev/null; then + cropgui "$filename_with_extension" + fi +} +#+end_src + *** Main function #+begin_src bash # Convert PNG Files png2() { \ - out_ext=$(echo -e "pdf\njpg\ntrim\nresize" | rofi -i -dmenu -p "Convert PNG to") + out_ext=$(echo -e "pdf\njpg\ntrim\nresize\ncrop" | rofi -i -dmenu -p "Convert PNG to") if [ -z "$out_ext" ]; then exit; @@ -969,6 +835,9 @@ png2() { \ "jpg") png2jpg_function ;; + "crop") + pngcrop_function + ;; "trim") pngtrim_function ;; @@ -989,6 +858,15 @@ jpg2pdf_function() { \ } #+end_src +*** JPG to PNG +#+begin_src bash +jpg2png_function() { \ + if command -v convert &> /dev/null; then + convert "$filename_with_extension" "$filename_without_extension.png" + fi +} +#+end_src + *** JPG Resize #+begin_src bash jpgresize_function() { \ @@ -1005,11 +883,39 @@ jpgresize_function() { \ } #+end_src +*** JPG Rotate +#+begin_src bash +jpgrotate_function() { \ + if command -v convert &> /dev/null; then + # convert "$filename_with_extension" -rotate 90 /tmp/output.jpg && mv /tmp/output.jpg "$filename_with_extension" + convert "$filename_with_extension" -rotate 90 "$filename_with_extension" + fi +} +#+end_src + +*** JPG Trim +#+begin_src bash +jpgtrim_function() { \ + if command -v convert &> /dev/null; then + convert -trim "$filename_with_extension" "$filename_with_extension" + fi +} +#+end_src + +*** JPG Crop +#+begin_src bash +jpgcrop_function() { \ + if command -v cropgui &> /dev/null; then + cropgui "$filename_with_extension" + fi +} +#+end_src + *** Main function #+begin_src bash # Convert JPG Files jpg2() { \ - out_ext=$(echo -e "pdf\nresize" | rofi -i -dmenu -p "Convert JPG to") + out_ext=$(echo -e "pdf\npng\nresize\ncrop\ntrim\nrotate" | rofi -i -dmenu -p "Convert JPG to") if [ -z "$out_ext" ]; then exit; @@ -1019,9 +925,49 @@ jpg2() { \ "pdf") jpg2pdf_function ;; + "png") + jpg2png_function + ;; "resize") jpgresize_function ;; + "crop") + jpgcrop_function + ;; + "trim") + jpgtrim_function + ;; + "rotate") + jpgrotate_function + ;; + esac +} +#+end_src + +** XOPP files +*** XOPP to PDF +#+begin_src bash +xopp2pdf_function() { \ + if command -v xournalpp &> /dev/null; then + xournalpp -p "$filename_without_extension.pdf" "$filename_with_extension" + fi +} +#+end_src + +*** Main function +#+begin_src bash +# Convert XOPP Files +xopp2() { \ + out_ext=$(echo -e "pdf" | rofi -i -dmenu -p "Convert XOPP to") + + if [ -z "$out_ext" ]; then + exit; + fi + + case "$out_ext" in + "pdf") + xopp2pdf_function + ;; esac } #+end_src @@ -1048,11 +994,20 @@ mp42gif_function() { \ } #+end_src +*** MP4 remove sound +#+begin_src bash +mp4nosound_function() { \ + if command -v ffmpeg &> /dev/null; then + ffmpeg -i "$filename_with_extension" -c copy -an "$filename_without_extension-nosound.mp4" + fi +} +#+end_src + *** Main function #+begin_src bash # Convert MP4 Files mp42() { \ - out_ext=$(echo -e "gif" | rofi -i -dmenu -p "Convert MP4 to") + out_ext=$(echo -e "gif\nremove sound" | rofi -i -dmenu -p "Convert MP4 to") if [ -z "$out_ext" ]; then exit; @@ -1062,6 +1017,9 @@ mp42() { \ "gif") mp42gif_function ;; + "remove sound") + mp4nosound_function + ;; esac } #+end_src @@ -1096,9 +1054,12 @@ case "$in_ext" in "docx") docx2 ;; - "pttx") + "pptx") docx2 ;; + "xopp") + xopp2 + ;; esac #+end_src @@ -1107,6 +1068,7 @@ esac :CUSTOM_ID: preview-file :header-args: :tangle ~/.local/bin/preview-file :END: + ** Get basic information about the file #+begin_src bash # Get filename @@ -1175,129 +1137,6 @@ case "$in_ext" in esac #+end_src -* =pdf-shrink= - Pdf Shrink -:PROPERTIES: -:CUSTOM_ID: pdf-shrink -:END: - -Simply reduces the size of a given pdf file. - -#+begin_src bash :tangle ~/.local/bin/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 90 unless given: -if [ ! -z "$3" ]; then - res="$3" -else - res="90" -fi - -shrink "$IFILE" "$OFILE" "$res" || exit $? - -check_smaller "$IFILE" "$OFILE" -#+end_src -* =pdf-delete-annotations= - Delete Annotations from PDFs -:PROPERTIES: -:CUSTOM_ID: pdf-delete-annotations -:END: - -Taken from this [[https://gist.github.com/stefanschmidt/5248592][gist]]. - -#+begin_src bash :tangle ~/.local/bin/pdf-delete-annotations -# Check if the input argumetn is a PDF file -if [[ -f "$1" && "$1" == *.pdf ]]; then - pdftk $1 output /tmp/uncompressed.pdf uncompress - LANG=C sed -n '/^\/Annots/!p' /tmp/uncompressed.pdf > /tmp/stripped.pdf - pdftk /tmp/stripped.pdf output $1 compress -fi -#+end_src - -* =pdf-delete-first-page= - Delete first page of PDF -:PROPERTIES: -:CUSTOM_ID: pdf-delete-first-page -:END: - -The requirement is to have =pdftk= or =stapler= installed. - -#+begin_src bash :tangle ~/.local/bin/pdf-delete-first-page -# Check if the input argumetn is a PDF file -if [[ -f $1 && $1 == *.pdf ]]; then - if type stapler > /dev/null 2>&1; then - stapler del "$1" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$1" - elif type pdftk > /dev/null 2>&1; 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 -#+end_src - -* =rofi-calc= - Simple Calculation using Rofi -:PROPERTIES: -:CUSTOM_ID: rofi-calc -:END: - -Run some simple calculations with =rofi=. - -#+begin_src bash :tangle ~/.local/bin/rofi-calc -rofi -show calc -mode calc -no-show-match -no-sort -#+end_src - * =pass-gen= - Generate Random Alphanumeric Password :PROPERTIES: :CUSTOM_ID: pass-gen @@ -1317,7 +1156,7 @@ fi # Send the password to the clipboard printf "$pass" | xclip -sel clip && \ - notify-send 'Password' 'Generated' + dunstify 'Password' 'Generated' #+end_src * =sxhkd-help= - List of keybindings using Rofi @@ -1332,11 +1171,10 @@ awk '/^[a-z]/ && last {print "",$0,"\t",last,""} {last=""} /^#/{l #+end_src * =qrdecode= - Decode QRcode by taking screenshot - -- =zbar-tools= -- =main= -- =xclip= -- =notify-send= +To install: +#+begin_src bash :tangle no +paru -S zbar maim xclip dunstify +#+end_src #+begin_src bash :tangle ~/.local/bin/qrdecode image_file="/tmp/ocr.png" @@ -1366,7 +1204,7 @@ fi printf %b "$decoded_text" | xclip -selection clip # Let us know that something was decoded -notify-send "qrshot" "$decoded_text" +dunstify "qrshot" "$decoded_text" # Cleaning up the trash that was left behind rm $image_file diff --git a/bspwm.org b/bspwm.org deleted file mode 100644 index e437984..0000000 --- a/bspwm.org +++ /dev/null @@ -1,53 +0,0 @@ -#+TITLE: BSPWM -#+SETUPFILE: ./setup/org-setup-file.org - -#+PROPERTY: header-args:bash :comments both -#+PROPERTY: header-args:bash+ :mkdirp yes -#+PROPERTY: header-args:bash+ :shebang "#!/bin/sh" -#+PROPERTY: header-args:bash+ :tangle ~/.config/bspwm/bspwmrc - -* List Desktops -#+begin_src bash -bspc monitor -d code web mail misc figs -#+end_src - -* Basic Config -#+begin_src bash -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 -#+end_src - -* Colors -#+begin_src bash -bspc config normal_border_color \#32302f -bspc config focused_border_color \#bdae93 -#+end_src - -* Rules -Use =xprop= to obtain information about the window. - -#+begin_src bash -# 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 -#+end_src - -* Run Polybar and SXHKD -#+begin_src bash -polybar top >>/tmp/polybar.log 2>&1 & -sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.bspwm & -#+end_src diff --git a/calendar-contact.org b/calendar-contact.org index ff9501c..19d7d9c 100644 --- a/calendar-contact.org +++ b/calendar-contact.org @@ -14,18 +14,18 @@ status_path = "~/.config/vdirsyncer/status/" [pair radicale_calendar] a = "radicale_calendar_remote" b = "radicale_calendar_local" -collections = ["76bfc802-3186-e3af-f688-7e165115b4f8", "f78f1649-b54e-7bfe-488d-6a7005a5aa2f"] +collections = ["76bfc802-3186-e3af-f688-7e165115b4f8", "f78f1649-b54e-7bfe-488d-6a7005a5aa2f", "627e2bee-7d6a-49dc-128e-fc7a8aed1e8b"] conflict_resolution = "a wins" [storage radicale_calendar_remote] type = "caldav" url = "https://radicale.tdehaeze.xyz/tdehaeze/" username = "tdehaeze" -password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"] +password.fetch = ["command", "~/.local/bin/get-pass", "radicale.tdehaeze.xyz/tdehaeze"] [storage radicale_calendar_local] type = "filesystem" -path = "~/.calendars/radicale/" +path = "~/.local/share/calendars/radicale/" fileext = ".ics" [pair esrf_calendar] @@ -38,11 +38,11 @@ conflict_resolution = "a wins" type = "caldav" url = "https://calendar.esrf.fr/egroupware/groupdav.php/calendar" username = "dehaeze" -password.fetch = ["command", "get-pass", "esrf.fr/dehaeze"] +password.fetch = ["command", "~/.local/bin/get-pass", "esrf.fr/dehaeze"] [storage esrf_calendar_local] type = "filesystem" -path = "~/.calendars/esrf/" +path = "~/.local/share/calendars/esrf/" fileext = ".ics" [pair radicale_contacts] @@ -53,14 +53,14 @@ conflict_resolution = "a wins" [storage radicale_contacts_local] type = "filesystem" -path = "~/.contacts/" +path = "~/.local/share/contacts/" fileext = ".vcf" [storage radicale_contacts_remote] type = "carddav" url = "https://radicale.tdehaeze.xyz/tdehaeze/" username = "tdehaeze" -password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"] +password.fetch = ["command", "~/.local/bin/get-pass", "radicale.tdehaeze.xyz/tdehaeze"] #+END_SRC * =khal= - CLI calendar application @@ -73,19 +73,23 @@ password.fetch = ["command", "get-pass", "radicale.tdehaeze.xyz/tdehaeze"] [calendars] [[Home]] -path = ~/.calendars/radicale/76bfc802-3186-e3af-f688-7e165115b4f8/ +path = ~/.local/share/calendars/radicale/76bfc802-3186-e3af-f688-7e165115b4f8/ color = "#B8BB26" # Green +[[Orgmode]] +path = ~/.local/share/calendars/radicale/627e2bee-7d6a-49dc-128e-fc7a8aed1e8b/ +color = "#D3869B" # aqua + [[Thesis]] -path = ~/.calendars/radicale/f78f1649-b54e-7bfe-488d-6a7005a5aa2f/ +path = ~/.local/share/calendars/radicale/f78f1649-b54e-7bfe-488d-6a7005a5aa2f/ color = "#FB4934" # Red [[ESRF]] -path = ~/.calendars/esrf/calendar/ +path = ~/.local/share/calendars/esrf/calendar/ color = "#83A598" # Blue [[Birthdays]] -path = ~/.contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/ +path = ~/.local/share/contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/ color = "#D3869B" # aqua type = birthdays @@ -98,6 +102,7 @@ highlight_event_days = True [locale] local_timezone= Europe/Berlin default_timezone= Europe/Berlin +weeknumbers= left timeformat= %H:%M dateformat= %d.%m. longdateformat= %d.%m.%Y @@ -119,7 +124,7 @@ new = c #+BEGIN_SRC conf [addressbooks] [[contacts]] -path = ~/.contacts/98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/ +path = ~/.local/share/contacts//98ee5e2c-afcf-70e0-c4a2-9fb9de2e97b7/ [general] debug = no @@ -188,7 +193,7 @@ if [[ -f $1 ]]; then exit; fi khal import -a "$calendar" --batch "$1" && \ - notify-send --hint=string:x-dunst-stack-tag:fJeNG8gc "Calendar" "Even added"; + dunstify "Calendar" "Even added"; fi fi #+end_src diff --git a/compositor.org b/compositor.org index 00106ad..e1ad266 100644 --- a/compositor.org +++ b/compositor.org @@ -16,7 +16,7 @@ shadow-exclude = [ "window_type = 'dnd'", "class_g = 'VirtualBox'", "class_g ?= 'Notify-osd'", -"name = 'cpt_frame_window'", # For zoom problem when sharing screen +"name = 'cpt_frame_xcb_window'", # For zoom problem when sharing screen "class_g = 'stalonetray'" ]; #+END_SRC diff --git a/config.org b/config.org index 8708a94..2777636 100644 --- a/config.org +++ b/config.org @@ -9,12 +9,26 @@ Host * ControlMaster auto ControlPath ~/.ssh/master-%r@%h:%p.socket +# Host backup +# hostname <> +# Port 2022 +# user thomas +# IdentityFile ~/.ssh/id_rsa + Host homelab hostname <> Port 22 user thomas IdentityFile ~/.ssh/id_rsa +Host router + hostname 192.168.1.1 + Port 22 + user root + IdentityFile ~/.ssh/id_rsa + PubkeyAcceptedAlgorithms +ssh-rsa + HostkeyAlgorithms +ssh-rsa + Host *.esrf.fr User dehaeze IdentityFile ~/.ssh/id_rsa @@ -26,7 +40,6 @@ Host firewall.esrf.fr Match host *.esrf.fr !host firewall.esrf.fr !exec "~/.ssh/esrf-test" ProxyJump firewall.esrf.fr - Host rnice Port 22 user dehaeze @@ -34,7 +47,7 @@ Host rnice #+end_src #+begin_src bash :tangle ~/.ssh/esrf-test :comments none :mkdirp yes :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o555) -test -n "$(timeout 1s dig +short proxy.esrf.fr.)" +test -n "$(ping -c1 -W1 -q proxy.esrf.fr. &> /dev/null )" #+end_src * Font @@ -70,7 +83,7 @@ test -n "$(timeout 1s dig +short proxy.esrf.fr.)" * GnuPG :PROPERTIES: -:header-args: :tangle ~/.gnupg/gpg-agent.conf +:header-args: :tangle ~/.config/gnupg/gpg-agent.conf :header-args+: :comments both :mkdirp yes :END: @@ -104,35 +117,6 @@ lat=45.1 lon=5.7 #+end_src -* dmenu -:PROPERTIES: -:header-args: :tangle ~/.dmenurc -:header-args+: :comments both :mkdirp yes -:END: - -#+BEGIN_SRC conf -# 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" -#+END_SRC - * Locale :PROPERTIES: :header-args: :tangle ~/.config/locale.conf @@ -727,4 +711,44 @@ It is very important that =~/.netrc= as =600= permissions. machine torrent.tdehaeze.xyz login tdehaeze password <> + +machine prowlarr.tdehaeze.xyz +login tdehaeze +password <> #+end_src + +* Gotify Dunst +#+begin_src conf :comments none :mkdirp yes :noweb yes :tangle ~/.config/gotify-dunst/gotify-dunst.conf +[server] +ssl=true +domain=gotify.tdehaeze.xyz +token=<> +#+end_src + +* SMBCredentials +#+begin_src conf :comments none :mkdirp yes :noweb yes :tangle ~/.smbcredentials :tangle-mode (identity #o600) +user=dehaeze +password=<> +domain=esrf +#+end_src + +* Keyboard repetition rate +Install [[https://github.com/SFTtech/xautocfg][xautocfg]] with =paru -S xautocfg=. +Then create =~/.config/xautocfg.cfg= with: + +#+begin_src conf :tangle ~/.config/xautocfg.cfg +# xautocfg config + +[keyboard] +# set keyboard repeat rate for every keyboard automatically +# equivalent one-time invocation: +# xset r rate 220 45 + +# when to start repeating +delay = 200 + +# rate in hz for repetitions +rate = 40 +#+end_src + +And then enable the service with: =systemctl --user enable xautocfg.service= diff --git a/doom.org b/doom.org index 75be596..5add66a 100644 --- a/doom.org +++ b/doom.org @@ -1,4 +1,5 @@ #+title: Doom Emacs Configuration +:DRAWER: #+startup: overview #+language: en @@ -11,6 +12,7 @@ #+html_head: #+html_head: #+property: header-args:emacs-lisp :tangle ~/.config/doom/config.el :results none :padline no +:END: * Introduction and Resources https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b @@ -26,6 +28,8 @@ Documentation: When changing =init.el= or =package.el=, tangle the files and then run =doom sync=. After that, restart Emacs with =spc q r=. +* Dependencies / Installation + * Useful Bindings - =align-regexp=: equivalent of [[https://github.com/junegunn/vim-easy-align][vim-easy-align]]. Very useful to align tables and stuff @@ -101,13 +105,12 @@ Tables: * Basic Configuration ** Personal Information #+begin_src emacs-lisp -;; 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") #+end_src ** Doom Config +Fonts #+begin_src emacs-lisp (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") @@ -115,14 +118,17 @@ Tables: doom-big-font (font-spec :family "Hack Nerd Font Mono" :size 19)) #+end_src +Theme #+begin_src emacs-lisp (setq doom-theme 'leuven) #+end_src +Line numbers #+begin_src emacs-lisp (setq display-line-numbers-type t) #+end_src +Mode Line #+begin_src emacs-lisp (use-package doom-modeline :hook (after-init . doom-modeline-mode) @@ -154,40 +160,11 @@ Tables: (setq evil-respect-visual-line-mode nil)) #+end_src -Make movement keys work like they should -#+begin_src emacs-lisp -(define-key evil-normal-state-map (kbd " ") 'evil-next-visual-line) -(define-key evil-normal-state-map (kbd " ") 'evil-previous-visual-line) -(define-key evil-motion-state-map (kbd " ") 'evil-next-visual-line) -(define-key evil-motion-state-map (kbd " ") 'evil-previous-visual-line) -#+end_src - Make horizontal movement cross lines #+begin_src emacs-lisp (setq-default evil-cross-lines t) #+end_src -;; In org-mode, $ does not go to the real end of line, it jumps to the end of /visual/ line -;; Create a real end of line by APPENDING and then going back to normal state - -Evil Surround (not working): -#+begin_src emacs-lisp :tangle no -;; this macro was copied from here: https://stackoverflow.com/a/22418983/4921402 -(defmacro define-and-bind-quoted-text-object (name key start-regex end-regex) - (let ((inner-name (make-symbol (concat "evil-inner-" name))) - (outer-name (make-symbol (concat "evil-a-" name)))) - `(progn - (evil-define-text-object ,inner-name (count &optional beg end type) - (evil-select-paren ,start-regex ,end-regex beg end type count nil)) - (evil-define-text-object ,outer-name (count &optional beg end type) - (evil-select-paren ,start-regex ,end-regex beg end type count t)) - (define-key evil-inner-text-objects-map ,key #',inner-name) - (define-key evil-outer-text-objects-map ,key #',outer-name)))) - -;; Add dollar as a surround object -(define-and-bind-quoted-text-object "dollar" "$" "\\$" "\\$") -#+end_src - ** Which Key #+begin_src emacs-lisp (after! which-key @@ -213,33 +190,18 @@ Turn off auto-fill mode that add line breaks. (add-hook 'latex-mode-hook 'turn-off-auto-fill)) #+end_src -** Useful General Functions -#+begin_src emacs-lisp -(defun tdh-matlab-work () - "Setup Matlab Work Windows" - (interactive) - (delete-other-windows) - (evil-window-vsplit) - (evil-window-right 1) - (switch-to-buffer "*MATLAB*") - (evil-normal-state) - (evil-goto-line) - (evil-window-left 1) - ) -#+end_src - ** Change default alert backend #+begin_src emacs-lisp (setq alert-default-style 'libnotify) #+end_src ** Spell Check -Switch from one language to an other ([[https://stackoverflow.com/questions/42159012/emacs-spell-check-on-fly-for-2-languages][link]]). #+begin_src emacs-lisp (setq ispell-dictionary "en") (setq ispell-program-name "aspell") #+end_src +Correct last work using =C-l=. #+begin_src emacs-lisp (defun tdh-correct-last-word () (interactive) @@ -248,9 +210,7 @@ Switch from one language to an other ([[https://stackoverflow.com/questions/4215 (+spell/correct) ) ) -#+end_src -#+begin_src emacs-lisp (define-key evil-insert-state-map (kbd "C-l") 'tdh-correct-last-word) #+end_src @@ -260,6 +220,7 @@ Switch from one language to an other ([[https://stackoverflow.com/questions/4215 #+end_src ** Disable highlight of current line +This helps to speed-up emacs. #+begin_src emacs-lisp (global-hl-line-mode -1) (after! org @@ -336,6 +297,7 @@ This works also with =C-x C-q= ) #+end_src +Function that opens current pdf page as an SVG file with Inkscape. #+begin_src emacs-lisp (defun tdh-screenshot-page () "Open current page as an SVG file with Inkscape" @@ -347,9 +309,7 @@ This works also with =C-x C-q= (shell-command (concat "pdftk " buffer-file-name " cat " (number-to-string (pdf-view-current-page)) " output /tmp/pdf_page.pdf")) (shell-command (concat "pdf2svg /tmp/pdf_page.pdf " filepath)) (start-process "" nil "inkscape" filepath)) -#+end_src -#+begin_src emacs-lisp (after! pdf-tools (map! :map pdf-view-mode-map (:desc "Screenshot" @@ -358,21 +318,6 @@ This works also with =C-x C-q= #+end_src ** Flycheck -#+begin_src emacs-lisp :tangle no -(flycheck-define-checker proselint - "A linter for prose." - :command ("proselint" source-inplace) - :error-patterns - ((warning line-start (file-name) ":" line ":" column ": " - (id (one-or-more (not (any " ")))) - (message (one-or-more not-newline) - (zero-or-more "\n" (any " ") (one-or-more not-newline))) - line-end)) - :modes (text-mode markdown-mode gfm-mode org-mode)) - -(add-to-list 'flycheck-checkers 'proselint) -#+end_src - Disable flycheck for now with orgmode buffers: #+begin_src emacs-lisp (defun disable-flycheck-mode () @@ -381,27 +326,6 @@ Disable flycheck for now with orgmode buffers: (add-hook 'org-mode-hook 'disable-flycheck-mode) #+end_src -** Yassnippets -#+begin_src emacs-lisp -(push "~/.config/doom/snippets" yas-snippet-dirs) -(yas-global-mode 1) -#+end_src - -** Ox-Hugo -#+begin_src emacs-lisp -;; (defun tdh-export-everything-to-hugo () -;; "Export all the .org files in the specified directory to markdown using Hugo" -;; (interactive) -;; (setq org-files (directory-files (read-directory-name "Directory:" "/home/thomas/Cloud/brain/") t "org$" t)) - -;; (while org-files -;; (setq current-org-file (car org-files)) -;; (message "Exporting %s" current-org-file) -;; (find-file current-org-file) -;; (org-hugo-export-to-md) -;; (setq org-files (cdr org-files)))) -#+end_src - ** Tramp #+begin_src emacs-lisp (after! tramp @@ -434,7 +358,7 @@ Disable flycheck for now with orgmode buffers: (setq org-default-notes-file "~/Cloud/org/refile.org") ;; Avoid accidentally editing folded regions, say by adding text after an Org “⋯”. - (setq org-catch-invisible-edits 'show) + (setq org-catch-invisible-edits 'show-and-error) ;; The following setting hides blank lines between headings which keeps folded view nice and compact. (setq org-cycle-separator-lines 0) @@ -448,6 +372,9 @@ Disable flycheck for now with orgmode buffers: ;; begining of line on heading behavior (setq org-special-ctrl-a/e nil) + + ;; Automatic save all org buffers after 30s of innactivity + (add-hook 'after-save-hook 'org-save-all-org-buffers) ) #+end_src @@ -457,6 +384,14 @@ TAB was changed to toggle only the visibility state of the current subtree, rath (remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h)) #+end_src +https://github.com/doomemacs/doomemacs/issues/6478#issuecomment-1406167570 +#+begin_src emacs-lisp +(after! evil + (setq org-fold-core-style 'text-properties) + (evil-select-search-module 'evil-search-module 'isearch) + ) +#+end_src + ** Org Inline Images Display the real size of images and not the one set with =attr_latex: :width \linewidth= for instance. #+begin_src emacs-lisp @@ -504,7 +439,7 @@ Display the real size of images and not the one set with =attr_latex: :width \li ) #+end_src -** TODO Org TODO +** Org TODO #+begin_src emacs-lisp (after! org ;; Tags with fast selection keys @@ -580,7 +515,7 @@ Archive subtrees under the same hierarchy as original in the archive files ) #+end_src -** TODO [#A] Org Agenda +** Org Agenda General configuration #+begin_src emacs-lisp (after! org @@ -592,7 +527,7 @@ General configuration ;; Set priority range from A to C with default A (setq org-highest-priority ?A) - (setq org-lowest-priority ?C) + (setq org-lowest-priority ?C) (setq org-default-priority ?C) ;; Set colours for priorities @@ -709,47 +644,6 @@ Org Agenda Custom Views ) #+end_src -** Synchronize Agenda with ICS -https://200ok.ch/posts/2022-02-13_integrating_org_mode_agenda_into_other_calendar_apps.html - -#+begin_src emacs-lisp :tangle no -;; Setting variables for the ics file path -(setq org-agenda-private-local-path "~/.calendars/radicale/d2ff3f82-9cdb-7e0c-ec9e-5887da0993f4/dummy.ics") - -;; Define a custom command to save the org agenda to a file -(setq org-agenda-custom-commands - `(("X" agenda "" nil ,(list org-agenda-private-local-path)))) - -(defun org-agenda-export-to-ics () - (setq org-agenda-files (list "~/Cloud/org/")) - ;; Run all custom agenda commands that have a file argument. - (org-batch-store-agenda-views) - - ;; Org mode correctly exports TODO keywords as VTODO events in ICS. - ;; However, some proprietary calendars do not really work with - ;; standards (looking at you Google), so VTODO is ignored and only - ;; VEVENT is read. - (with-current-buffer (find-file-noselect org-agenda-private-local-path) - (goto-char (point-min)) - (save-buffer))) -#+end_src - -Then, use: -#+begin_src emacs-lisp :tangle no -(org-agenda-export-to-ics) -#+end_src - -** TODO Org Agenda HTML -This function can be used to export the week calendar to html. -This html page can be used as a starting page for the browser. -This idea comes from [[https://blog.lambda.cx/posts/org-agenda-new-tab/][here]]. -#+begin_src emacs-lisp :tangle no -(defun tdh-org-agenda-to-html () - (interactive) - (org-agenda-list) - (org-agenda-write "/ssh:thomas@homelab:~/docker/config/calendar/www/index.html")) -#+end_src - ** Org Fancy Priority #+begin_src emacs-lisp (use-package! org-fancy-priorities ; priority icons @@ -757,41 +651,6 @@ This idea comes from [[https://blog.lambda.cx/posts/org-agenda-new-tab/][here]]. :config (setq org-fancy-priorities-list '("■" "■" "■"))) #+end_src -** TODO [#B] 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 - -- [ ] Issue with this part on ubuntu - -#+begin_src emacs-lisp :tangle no -(after! org-agenda - (setq appt-message-warning-time 5) - (defun tdh-org-agenda-to-appt () - (interactive) - (setq appt-time-msg-list nil) - (org-agenda-to-appt)) - - (tdh-org-agenda-to-appt) - ; Display appointments as a window manager notification - (setq appt-disp-window-function 'tdh-appt-display) - (setq appt-delete-window-function (lambda () t)) - - (setq tdh-appt-notification-app (concat (getenv "HOME") "/.local/bin/appt-notification")) - (defun tdh-appt-display (min-to-app new-time msg) - (if (atom min-to-app) - (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app min-to-app msg) - (dolist (i (number-sequence 0 (1- (length min-to-app)))) - (start-process "tdh-appt-notification-app" nil tdh-appt-notification-app (nth i min-to-app) (nth i msg))))) - ) -#+end_src - -*** appt-notification script -#+begin_src bash :tangle ~/.local/bin/appt-notification :shebang "#!/usr/bin/env bash" :comments none :mkdirp yes -TIME="$1"TODO -MSG="$2" - -notify-send "Event in $TIME minutes" "$MSG" -#+end_src - ** Org Structure Template #+begin_src emacs-lisp (after! org @@ -833,19 +692,19 @@ Documentation: (quote (("t" ; key "Todo" ; name entry ; type - (file+headline "~/Cloud/org/work-notebook.org" "Inbox") ; target + (file+headline "~/Cloud/org/work-tasks.org" "Inbox") ; target "** TODO %?\n%U\n" ; template ) ("M" ; key "Meeting" ; name entry ; type - (file+headline "~/Cloud/org/work-notebook.org" "Meetings") ; target + (file+headline "~/Cloud/org/work-tasks.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 + (file+headline "~/Cloud/org/work-tasks.org" "Mails") ; target "** TODO [#A] %?\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%a\n" ; template ) ("r" ; key @@ -857,28 +716,28 @@ Documentation: ("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%i\n" + (file+headline "~/Cloud/org/work-tasks.org" "Mails") + "* TODO [#C] %:description [[message:%:link][link]]\nSCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n%i\n" :immediate-finish t ) ("ps" "Org-Protocol Sent Mail" entry - (file+headline "~/Cloud/org/work-notebook.org" "Mails") + (file+headline "~/Cloud/org/work-tasks.org" "Mails") "* WAIT %:description [[message:%:link][link]]\n%(org-insert-time-stamp (org-read-date nil t \"+0d\"))\n- to: %i\n\n\n\n" :immediate-finish t ) ("pu" "Org-Protocol Url" entry - (file+headline "~/Cloud/org/work-notebook.org" "Inbox") + (file+headline "~/Cloud/org/work-tasks.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") + (file+headline "~/Cloud/org/work-tasks.org" "Inbox") "* %:description\nSource: %:link\nCaptured On: %U\n\n#+begin_quote\n%i\n#+end_quote\n\n" :immediate-finish t ) @@ -886,38 +745,6 @@ Documentation: ) #+end_src -** =message:= link to mutt -#+begin_src emacs-lisp -(require 'org-protocol) - -(defun stefanv/mutt-open-message (message-id) - "In neomutt, open the email with the the given Message-ID" - (let* - ((message-id (replace-regexp-in-string "^/*" "" message-id)) - (mail-file - (replace-regexp-in-string - "\n$" "" (shell-command-to-string - (format "mu find -f l i:%s | head -n 1" message-id)))) - (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" "" - (file-name-directory mail-file))) - (process-id (concat "neomutt-" message-id)) - (message-id-escaped (regexp-quote message-id)) - (mutt-keystrokes - (format "L~i %s\n\nLall\n\nl" (shell-quote-argument message-id-escaped))) - (mutt-command (list "neomutt" "-R" "-f" mail-dir - "-e" (format "push '%s'" mutt-keystrokes)))) - - (message "Launching neomutt for message %s" message-id) - (call-process "setsid" nil nil - "-f" "alacritty" "-e" - "neomutt" "-R" "-f" mail-dir - "-e" (format "push '%s'" mutt-keystrokes)))) - -; Whenever org-mode sees a link starting with `message://`, it -; calls our `mutt-open-message` function -(org-add-link-type "message" 'stefanv/mutt-open-message) -#+end_src - ** Org Export Basic configuration: #+begin_src emacs-lisp @@ -930,6 +757,9 @@ Basic configuration: ;; Use doc instead of odt (setq org-odt-preferred-output-format "doc") + + ;; Search collapse items + (setq search-invisible t) ) #+end_src @@ -1007,6 +837,7 @@ Do not export headline with the =:ignore:= tag: (setq org-html-footnotes-section "
\n

%s

\n
\n%s\n
\n
")) #+end_src + *** MathJax #+begin_src emacs-lisp (after! org @@ -1056,168 +887,6 @@ Do not export headline with the =:ignore:= tag: ) #+end_src -*** TODO Ensuring useful HTML Anchors -- [ ] https://github.com/alhassy/emacs.d -- [ ] https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors - -This is not working - -#+begin_src emacs-lisp :tangle no -(define-minor-mode unpackaged/org-export-html-with-useful-ids-mode - "Attempt to export Org as HTML with useful link IDs. -Instead of random IDs like \"#orga1b2c3\", use heading titles, -made unique when necessary." - :global t - (if unpackaged/org-export-html-with-useful-ids-mode - (advice-add #'org-export-get-reference :override #'unpackaged/org-export-get-reference) - (advice-remove #'org-export-get-reference #'unpackaged/org-export-get-reference))) - -(defun unpackaged/org-export-get-reference (datum info) - "Like `org-export-get-reference', except uses heading titles instead of random numbers." - (let ((cache (plist-get info :internal-references))) - (or (car (rassq datum cache)) - (let* ((crossrefs (plist-get info :crossrefs)) - (cells (org-export-search-cells datum)) - ;; Preserve any pre-existing association between - ;; a search cell and a reference, i.e., when some - ;; previously published document referenced a location - ;; within current file (see - ;; `org-publish-resolve-external-link'). - ;; - ;; However, there is no guarantee that search cells are - ;; unique, e.g., there might be duplicate custom ID or - ;; two headings with the same title in the file. - ;; - ;; As a consequence, before re-using any reference to - ;; an element or object, we check that it doesn't refer - ;; to a previous element or object. - (new (or (cl-some - (lambda (cell) - (let ((stored (cdr (assoc cell crossrefs)))) - (when stored - (let ((old (org-export-format-reference stored))) - (and (not (assoc old cache)) stored))))) - cells) - (when (org-element-property :raw-value datum) - ;; Heading with a title - (unpackaged/org-export-new-named-reference datum cache)) - (when (member (car datum) '(src-block table example fixed-width property-drawer)) - ;; Nameable elements - (unpackaged/org-export-new-named-reference datum cache)) - ;; NOTE: This probably breaks some Org Export - ;; feature, but if it does what I need, fine. - (org-export-format-reference - (org-export-new-reference cache)))) - (reference-string new)) - ;; Cache contains both data already associated to - ;; a reference and in-use internal references, so as to make - ;; unique references. - (dolist (cell cells) (push (cons cell new) cache)) - ;; Retain a direct association between reference string and - ;; DATUM since (1) not every object or element can be given - ;; a search cell (2) it permits quick lookup. - (push (cons reference-string datum) cache) - (plist-put info :internal-references cache) - reference-string)))) - -(defun unpackaged/org-export-new-named-reference (datum cache) - "Return new reference for DATUM that is unique in CACHE." - (cl-macrolet ((inc-suffixf (place) - `(progn - (string-match (rx bos - (minimal-match (group (1+ anything))) - (optional "--" (group (1+ digit))) - eos) - ,place) - ;; HACK: `s1' instead of a gensym. - (-let* (((s1 suffix) (list (match-string 1 ,place) - (match-string 2 ,place))) - (suffix (if suffix - (string-to-number suffix) - 0))) - (setf ,place (format "%s--%s" s1 (cl-incf suffix))))))) - (let* ((headline-p (eq (car datum) 'headline)) - (title (if headline-p - (org-element-property :raw-value datum) - (or (org-element-property :name datum) - (concat (org-element-property :raw-value - (org-element-property :parent - (org-element-property :parent datum))))))) - ;; get ascii-only form of title without needing percent-encoding - (ref (concat (org-reference-contraction (substring-no-properties title)) - (unless (or headline-p (org-element-property :name datum)) - (concat "," - (pcase (car datum) - ('src-block "code") - ('example "example") - ('fixed-width "mono") - ('property-drawer "properties") - (_ (symbol-name (car datum)))) - "--1")))) - (parent (when headline-p (org-element-property :parent datum)))) - (while (--any (equal ref (car it)) - cache) - ;; Title not unique: make it so. - (if parent - ;; Append ancestor title. - (setf title (concat (org-element-property :raw-value parent) - "--" title) - ;; get ascii-only form of title without needing percent-encoding - ref (org-reference-contraction (substring-no-properties title)) - parent (when headline-p (org-element-property :parent parent))) - ;; No more ancestors: add and increment a number. - (inc-suffixf ref))) - ref))) - -(add-hook 'org-load-hook #'unpackaged/org-export-html-with-useful-ids-mode) -#+end_src - -*** TODO Folded Drawers -Adapt this from https://github.com/alhassy/emacs.d to do something similar for source blocks. -#+begin_src emacs-lisp :tangle no -(defun my/org-drawer-format (name contents) - "Export to HTML the drawers named with prefix ‘fold_’, ignoring case. - -The resulting drawer is a ‘code-details’ and so appears folded; -the user clicks it to see the information therein. -Henceforth, these are called ‘fold drawers’. - -Drawers without such a prefix may be nonetheless exported if their -body contains ‘:export: t’ ---this switch does not appear in the output. -Thus, we are biased to generally not exporting non-fold drawers. - -One may suspend export of fold drawers by having ‘:export: nil’ -in their body definition. - -Fold drawers naturally come with a title. -Either it is specfied in the drawer body by ‘:title: ⋯’, -or otherwise the drawer's name is used with all underscores replaced -by spaces. -" - (let* ((contents′ (replace-regexp-in-string ":export:.*\n?" "" contents)) - (fold? (s-prefix? "fold_" name 'ignore-case)) - (export? (string-match ":export:\s+t" contents)) - (not-export? (string-match ":export:\s+nil" contents)) - (title′ (and (string-match ":title:\\(.*\\)\n" contents) - (match-string 1 contents)))) - - ;; Ensure we have a title. - (unless title′ (setq title′ (s-join " " (cdr (s-split "_" name))))) - - ;; Output - (cond - ((and export? (not fold?)) contents′) - (not-export? nil) - (fold? - (thread-last contents′ - (replace-regexp-in-string ":title:.*\n" "") - (format "
- %s - %s
" title′)))))) - -(setq org-html-format-drawer-function 'my/org-drawer-format) -#+end_src - ** Org Xournalpp #+begin_src emacs-lisp (use-package! org-xournalpp @@ -1225,20 +894,9 @@ by spaces. (add-hook 'org-mode-hook 'org-xournalpp-mode)) #+end_src -#+begin_src emacs-lisp :tangle no -(setq org-xournalpp-template-getter (lambda () "/home/thomas/Downloads/template_test.xopp")) -#+end_src - -** Org Transclusion - -#+begin_src emacs-lisp -(use-package! org-transclusion - :config - ) -#+end_src - ** Org LaTeX *** LaTeX Fragments + #+begin_src emacs-lisp (after! org ;; Highligh latex parts in org mode @@ -1250,7 +908,7 @@ by spaces. (lambda () (interactive) (org-preview-latex-fragment 16))) ;; Put all the preview images in some directory - (setq org-preview-latex-image-directory "~/.ltximg/") + (setq org-preview-latex-image-directory "~/.local/share/ltximg/") ;; Define backends to preview LaTeX fragments (setq org-preview-latex-process-alist '((imagemagick @@ -1313,6 +971,36 @@ by spaces. ) #+end_src +From https://karthinks.com/software/scaling-latex-previews-in-emacs/, scale the LaTeX fragments with the text: +#+begin_src emacs-lisp +(after! org + (defun my/text-scale-adjust-latex-previews () + "Adjust the size of latex preview fragments when changing the +buffer's text scale." + (pcase major-mode + ('latex-mode + (dolist (ov (overlays-in (point-min) (point-max))) + (if (eq (overlay-get ov 'category) + 'preview-overlay) + (my/text-scale--resize-fragment ov)))) + ('org-mode + (dolist (ov (overlays-in (point-min) (point-max))) + (if (eq (overlay-get ov 'org-overlay-type) + 'org-latex-overlay) + (my/text-scale--resize-fragment ov)))))) + + (defun my/text-scale--resize-fragment (ov) + (overlay-put + ov 'display + (cons 'image + (plist-put + (cdr (overlay-get ov 'display)) + :scale (+ 1.0 (* 0.25 text-scale-mode-amount)))))) + + (add-hook 'text-scale-mode-hook #'my/text-scale-adjust-latex-previews) + ) +#+end_src + *** LaTeX Classes #+begin_src emacs-lisp (after! org @@ -1395,12 +1083,6 @@ by spaces. #+end_src *** Ox Latex Subfigure package -#+begin_src emacs-lisp -;; (use-package! ox-latex-subfigure -;; :after org -;; :config (require 'ox-latex-subfigure)) -#+end_src - #+begin_src emacs-lisp (use-package! ox-latex-subfigure :load-path "~/.config/doom/packages/ox-latex-subfigure/" @@ -1484,6 +1166,11 @@ https://emacs.stackexchange.com/questions/30575/adding-latex-newpage-before-a-he ;; 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 -f %f")) + + ;; Better display of timestamps + (setq org-latex-diary-timestamp-format "\\footnotesize{\\textit{%s}}" + org-latex-inactive-timestamp-format "\\footnotesize{\\textit{%s}}" + org-latex-active-timestamp-format "\\footnotesize{\\textit{%s}}") ) #+end_src @@ -1520,55 +1207,6 @@ Special Environments ) #+end_src -*** 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 - -#+begin_src emacs-lisp :tangle no -(defcustom tdh-org-property-mapping - '((latex ("CUSTOM_PAGE" . tdh-insert-org-page-latex) - ("CUSTOM_LABEL" . tdh-insert-org-label-latex))) - "List of mappings from org property to arbitrary strings. -Each element is a list: - (BACKEND (PROPERTY1 . FUNCTION1) (PROPERTY2 . FUNCTION2) ...) -FUNCTION are functions which get called with a single -argument (the value of PROPERTY) and are responsible for doing -whatever should be done." - :type '(repeat (cons symbol (repeat (cons string string))))) -#+end_src - -#+begin_src emacs-lisp :tangle no -(defun tdh-replace-org-property (backend) - "Convert org properties using `tdh-org-property-mapping'. -Lookup BACKEND in `tdh-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 tdh-org-property-mapping))) - value replacement) - (when map - (org-map-entries - (lambda () - (dolist (it map) - (save-excursion - (when (setq value (org-entry-get (point) (car it))) - (funcall (cdr it) value))))))))) - -(add-hook 'org-export-before-processing-hook #'tdh-replace-org-property) -#+end_src - -#+begin_src emacs-lisp :tangle no -(defun tdh-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 tdh-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))) -#+end_src - *** Number Equations https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in-LaTeX-fragments-in-org-mode/ @@ -1619,18 +1257,6 @@ https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in- ) #+end_src -** Org Media Note -#+begin_src emacs-lisp :tangle no -(use-package! org-media-note - :hook (org-mode . org-media-note-setup-org-ref) - :bind ( - ("H-v" . org-media-note-hydra/body)) ;; Main entrance - :config - (setq org-media-note-screenshot-image-dir "~/Pictures/") ;; Folder to save screencast - (setq org-media-note-use-refcite-first t) ;; use videocite link instead of video link if possible - ) -#+end_src - ** LaTeX macro both for LaTeX and HTML export https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_for_use_in_both/ @@ -1656,71 +1282,6 @@ https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_f ) #+end_src -** Igo-go -#+begin_src emacs-lisp :tangle no -(with-eval-after-load "org" - (require 'igo-org) - (igo-org-setup)) -#+end_src - -** Org Projects -#+begin_src emacs-lisp -(setq org-publish-project-alist - '(("config" - :base-directory "~/.config/literate-dotfiles/" - :publishing-directory "~/.config/literate-dotfiles/docs/" - :recursive nil - :publishing-function org-html-publish-to-html - :auto-sitemap nil - :section-numbers nil - :table-of-contents nil) - ("stewart-simscape" - :base-directory "~/Cloud/thesis/matlab/stewart-simscape/org/" - :base-extension "org" - :publishing-directory "~/Cloud/thesis/matlab/stewart-simscape/docs/" - :author "Dehaeze Thomas" - :email "dehaeze.thomas@gmail.com/" - :recursive nil - :publishing-function org-html-publish-to-html - :auto-preamble t - :auto-sitemap nil - :html-link-up "index.html" - :html-link-home "index.html" - :with-todo-keywords nil - :html-wrap-src-lines nil - :table-of-contents nil) - ("nass-simscape" - :base-directory "~/Cloud/thesis/matlab/nass-simscape/org/" - :base-extension "org" - :publishing-directory "~/Cloud/thesis/matlab/nass-simscape/docs/" - :author "Dehaeze Thomas" - :email "dehaeze.thomas@gmail.com/" - :recursive nil - :publishing-function (list org-html-publish-to-html org-latex-publish-to-pdf) - :auto-preamble t - :auto-sitemap nil - :html-link-up "index.html" - :html-link-home "index.html" - :with-todo-keywords nil - :html-wrap-src-lines nil - :table-of-contents nil) - ("tikz-maker" - :base-directory "~/Cloud/tikz/org/" - :base-extension "org" - :publishing-directory "~/Cloud/tikz/docs/" - :author "Dehaeze Thomas" - :email "dehaeze.thomas@gmail.com/" - :recursive nil - :publishing-function org-html-publish-to-html - :auto-preamble t - :auto-sitemap nil - :html-link-up "index.html" - :html-link-home "index.html" - :with-todo-keywords nil - :html-wrap-src-lines nil - :table-of-contents nil))) -#+end_src - ** Automatically run =startblock= when opening org-mode files #+begin_src emacs-lisp (after! org @@ -1740,7 +1301,7 @@ https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_f ** Some function #+begin_src emacs-lisp (defun org-syntax-convert-case-to-lower () - "Convert all #+keywords to #+keywords." + "Convert all #+KEYWORDS to #+keywords." (interactive) (save-excursion (goto-char (point-min)) @@ -1752,72 +1313,10 @@ https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_f (message "Replaced %d occurances" count)))) #+end_src -** 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. - -#+begin_src emacs-lisp :tangle no -;; 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))) -#+end_src - ** Render Tables https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_chapter_2_it/ -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (after! org (defun tdh-render-org-table-at-point () (interactive) @@ -1872,11 +1371,20 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c ) #+end_src -** Org Special Block Extras +** Org CalDAV #+begin_src emacs-lisp -(after! org - (require 'org-special-block-extras) - ) +(use-package! org-caldav + :config + (setq + org-caldav-url "https://radicale.tdehaeze.xyz/tdehaeze" + org-caldav-calendar-id "627e2bee-7d6a-49dc-128e-fc7a8aed1e8b" + org-caldav-inbox "~/Cloud/org/inbox-calendar.org" + org-caldav-files '("~/Cloud/org/inbox.org" "~/Cloud/org/home-tasks.org") + org-icalendar-use-scheduled '(event-if-todo-not-done) + org-icalendar-use-deadline '(event-if-todo-not-done) + org-caldav-days-in-past 7 + org-icalendar-timezone "Europe/Paris" + )) #+end_src ** Org Inline Task @@ -1887,7 +1395,7 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c #+end_src ** Org Links -*** Youtube Links +*** =yt:= Youtube Links #+begin_src emacs-lisp (after! org (setq yt-iframe-format @@ -1916,6 +1424,38 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c ) #+end_src +*** =message:= link to mutt +#+begin_src emacs-lisp +;; (require 'org-protocol) + +(defun stefanv/mutt-open-message (message-id) + "In neomutt, open the email with the the given Message-ID" + (let* + ((message-id (replace-regexp-in-string "^/*" "" message-id)) + (mail-file + (replace-regexp-in-string + "\n$" "" (shell-command-to-string + (format "mu find -f l i:%s | head -n 1" message-id)))) + (mail-dir (replace-regexp-in-string "/\\(cur\\|new\\|tmp\\)/$" "" + (file-name-directory mail-file))) + (process-id (concat "neomutt-" message-id)) + (message-id-escaped (regexp-quote message-id)) + (mutt-keystrokes + (format "L~i %s\n\nLall\n\nl" (shell-quote-argument message-id-escaped))) + (mutt-command (list "neomutt" "-R" "-f" mail-dir + "-e" (format "push '%s'" mutt-keystrokes)))) + + (message "Launching neomutt for message %s" message-id) + (call-process "setsid" nil nil + "-f" "alacritty" "-e" + "neomutt" "-R" "-f" mail-dir + "-e" (format "push '%s'" mutt-keystrokes)))) + +; Whenever org-mode sees a link starting with `message://`, it +; calls our `mutt-open-message` function +(org-add-link-type "message" 'stefanv/mutt-open-message) +#+end_src + ** Org Wild Notifier #+begin_src emacs-lisp (use-package! org-wild-notifier @@ -1929,20 +1469,7 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c ) #+end_src -** TODO Orch -#+begin_src emacs-lisp :tangle no -(use-package! web-server - :init - :config -) -#+end_src - -#+begin_src emacs-lisp :tangle no -(add-to-list 'load-path "~/.config/doom/packages/orch/") -(autoload 'orch-toggle "orch" nil t) -#+end_src - -** TODO [#A] Custom Keybindings - =,= leader key and =C-c= +** Custom Keybindings - =,= leader key and =C-c= | | | |---------+-------------------| @@ -1977,10 +1504,16 @@ https://www.reddit.com/r/emacs/comments/d3a8or/pretty_org_tables_in_the_buffer_c :ni "C-c f" 'tdh-insert-link-to-next-figure) (:desc "Link to previous Figure" :ni "C-c F" 'tdh-insert-link-to-previous-figure) + (:desc "Link to next Table" + :ni "C-c t" 'tdh-insert-link-to-next-table) + (:desc "Link to previous Table" + :ni "C-c T" 'tdh-insert-link-to-previous-table) (:desc "Insert Screenshot" :ni "C-c s" 'tdh-insert-screenshot-org-link) (:desc "Insert Screenshot" :ni "C-c R" 'org-roam-node-find) + (:desc "Helm Bibtex" + :ni "C-c ]" 'org-ref-cite-insert-helm) )) #+end_src @@ -2079,7 +1612,7 @@ Insert link to next figure: (interactive) (save-excursion (re-search-forward "^#\\+name:\s*\\(fig:.*\\)" nil t 1)) - (insert (concat "[[" (match-string 1) "]]")) + (insert (concat "ref:" (match-string 1))) ) #+end_src @@ -2089,7 +1622,27 @@ Insert link to previous figure: (interactive) (save-excursion (re-search-backward "^#\\+name:\s*\\(fig:.*\\)" nil t 1)) - (insert (concat "[[" (match-string 1) "]]")) + (insert (concat "ref:" (match-string 1))) + ) +#+end_src + +Insert link to next table: +#+begin_src emacs-lisp +(defun tdh-insert-link-to-next-table () + (interactive) + (save-excursion + (re-search-forward "^#\\+name:\s*\\(tab:.*\\)" nil t 1)) + (insert (concat "ref:" (match-string 1))) + ) +#+end_src + +Insert link to previous table: +#+begin_src emacs-lisp +(defun tdh-insert-link-to-previous-table () + (interactive) + (save-excursion + (re-search-backward "^#\\+name:\s*\\(tab:.*\\)" nil t 1)) + (insert (concat "ref:" (match-string 1))) ) #+end_src @@ -2278,7 +1831,7 @@ Add all named source blocks to =org-babel-library-of-babel= ([[file:emacs-librar ** Org-Babel Matlab #+begin_src emacs-lisp (after! org - (setq org-babel-matlab-shell-command "/home/thomas/.local/bin/matlab -softwareopengl -nodesktop -nosplash") + (setq org-babel-matlab-shell-command "~/.local/bin/matlab -softwareopengl -nodesktop -nosplash") ) #+end_src @@ -2388,14 +1941,14 @@ Better format the output results for Matlab ([[https://www.reddit.com/r/emacs/co ** Mermaid #+begin_src bash :tangle no -yay -S mermaid-cli +paru -S mermaid-cli #+end_src #+begin_src emacs-lisp (use-package! ob-mermaid :after org :config - (setq ob-mermaid-cli-path "/home/thomas/.npm-global/bin/mmdc") + (setq ob-mermaid-cli-path "mmdc") ) #+end_src @@ -2744,6 +2297,9 @@ Nice Functions: ;; Display information on the citation (setq org-ref-show-citation-on-enter t) + ;; Remove hook that tries do get PDF each time... + (remove-hook 'org-ref-clean-bibtex-entry-hook 'orcb-download-pdf) + ;; (add-to-list 'org-ref-helm-user-candidates ;; '("Open pdf in Zathura" . (lambda () (call-process "zathura" nil 0 nil (concat ;; (file-name-as-directory org-ref-pdf-directory) @@ -2765,6 +2321,40 @@ Nice Functions: ((eq format 'latex) (format "\\eqref{%s}" keyword)) ((eq format 'html) (format "\\eqref{%s}" keyword)) ((eq format 'md) (format "\\eqref{%s}" keyword)))) + + ;; Derived from org-ref-extract-bibtex-to-file to force the bibfile to have the same name than to org file, and take references from bibtex-completion-bibliography + ;; this function can be added in the org-export-before-parsing-hook for instance + (defun tdh-org-ref-extract-bibtex-to-file (&optional arg) + "Extract all bibtex entries for citations buffer to BIBFILE. +If BIBFILE exists, append, unless you use a prefix arg (C-u), +which will CLOBBER the file." + (interactive) + (let* ((bibtex-files bibtex-completion-bibliography) + (bibfile (file-name-nondirectory + (concat (file-name-sans-extension + (buffer-file-name)) + ".bib"))) + (keys (reverse (org-ref-get-bibtex-keys))) + (bibtex-entry-kill-ring-max (length keys)) + (bibtex-entry-kill-ring '()) + (kill-cb (not (find-buffer-visiting bibfile))) + (cb (find-file-noselect bibfile)) + (current-bib-entries (with-current-buffer cb + (prog1 + (buffer-string) + (when kill-cb (kill-buffer cb)))))) + + (save-window-excursion + (cl-loop for key in keys + do + (bibtex-search-entry key t) + (bibtex-kill-entry t))) + + (with-temp-file bibfile + (insert (mapconcat + 'identity + bibtex-entry-kill-ring + "\n\n"))))) ) #+end_src @@ -2789,6 +2379,33 @@ Nice Functions: (setq org-ref-open-pdf-function 'tdh-org-ref-open-pdf-at-point) #+end_src +#+begin_src emacs-lisp +(after! org + (defun tdh-org-ref-import-pdf (doi file) + (doi-utils-add-bibtex-entry-from-doi doi "~/Cloud/brain/biblio/references.bib") + (save-excursion + (find-file "~/Cloud/brain/biblio/references.bib") + (goto-char (point-max)) + (bibtex-beginning-of-entry) + (let* ((bibtex-expand-strings t) + (entry (bibtex-parse-entry t)) + (key (cdr (assoc "=key=" entry))) + pdf) + (if (bibtex-completion-find-pdf-in-library key) + (message (format "A file named %s already exists" (bibtex-completion-find-pdf-in-library key))) + (setq pdf (expand-file-name (concat key ".pdf") (cond + ((stringp bibtex-completion-library-path) + bibtex-completion-library-path) + ((and (listp bibtex-completion-library-path) + (= 1 (length bibtex-completion-library-path))) + (car bibtex-completion-library-path)) + (t + (completing-read "Dir: " bibtex-completion-library-path))))) + (rename-file file pdf) + (message (format "Created file %s" pdf)))))) + ) +#+end_src + ** Org Noter ([[https://github.com/weirdNox/org-noter][link]]) #+begin_src emacs-lisp (use-package! org-noter @@ -2826,7 +2443,7 @@ Nice Functions: ** Capture Templates *** Bibliography -#+begin_src org :tangle ~/.config/doom/capture-templates/ref.org +#+begin_src org :tangle ~/.config/doom/capture-templates/ref.org :mkdirp yes - Tags :: %? - Reference :: ${ref} - Author(s) :: %^{author} @@ -2906,6 +2523,7 @@ Re-Export all roam files. #+end_src ** Helm-Bibtex ([[https://github.com/tmalsburg/helm-bibtex][link]]) + #+begin_src emacs-lisp (use-package! helm-bibtex :after-call helm-bibtex @@ -2937,6 +2555,17 @@ Re-Export all roam files. (setq bibtex-completion-pdf-symbol "⌘") (setq bibtex-completion-notes-symbol "✎") + ;; custom function for helm-bibtex + (defun tdh-bibtex-completion-format-citation-cite (keys) + "Format cite references for keys in KEYS." + (s-join ", " + (--map (format "cite:%s" it) keys))) + + (setq bibtex-completion-format-citation-functions + '((org-mode . tdh-bibtex-completion-format-citation-cite) + (latex . bibtex-completion-format-citation-cite) + (default . bibtex-completion-format-citation-default))) + ;; Template used when creating new Note file (setq bibtex-completion-notes-template-multiple-files (concat "#+title: ${title}\n" "#+setupfile: ./setup/org-setup-file.org\n" @@ -3058,7 +2687,8 @@ Provides nice functions such as: #+begin_src emacs-lisp (after! bibtex (map! :map bibtex-mode-map - :n "C-c c" 'org-ref-clean-bibtex-entry)) + :n "C-c c" 'org-ref-clean-bibtex-entry) + (setq bibtex-files bibtex-completion-bibliography)) #+end_src ** Citar @@ -3095,15 +2725,15 @@ Provides nice functions such as: ** Setup Matlab Mode #+begin_src emacs-lisp -(setq matlab-shell-command "/home/thomas/.local/bin/matlab") +(setq matlab-shell-command "~/.local/bin/matlab") (setq matlab-shell-command-switches (list "-softwareopengl -nodesktop -nosplash")) (setq matlab-indent-function t) -(setq mlint-programs '("mlint" "/home/thomas/.local/bin/mlint")) +(setq mlint-programs '("mlint" "~/.local/bin/mlint")) #+end_src ** Setup Flycheck to work with =mlint= #+begin_src emacs-lisp -(defvar mlint-executable "/home/thomas/.local/bin/mlint") +(defvar mlint-executable "~/.local/bin/mlint") (flycheck-define-command-checker 'matlab-mlint "A Matlab checker based on mlint." @@ -3188,204 +2818,18 @@ Provides nice functions such as: :n "dq" 'gud-finish))) #+end_src -* Pandoc -#+begin_src emacs-lisp :tangle no -(use-package! pandoc-mode - ) -#+end_src - -* Mu4e -:PROPERTIES: -:header-args:emacs-lisp: :tangle no -:END: -** Resources -Documentation: -- [ ] Mu4e documentation: http://www.djcbsoftware.nl/code/mu/mu4e/index.html#Top -- [ ] https://github.com/djcb/mu - -Use contexts for multiple accounts: -- [ ] https://vxlabs.com/2017/02/07/mu4e-0-9-18-e-mailing-with-emacs-now-even-better/ -- [ ] http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/ -- [ ] https://notanumber.io/2016-10-03/better-email-with-mu4e/ - -Send math and source code: -- [ ] https://vxlabs.com/2015/01/28/sending-emails-with-math-and-source-code/ - -** Cheatsheet -| Command | Usage | -|---------+-----------------------| -| =C-j= | Next mail | -| =C-k= | Previous mail | -| =R/C/F= | Reply/Compose/Forward | -| =t= | Move to Archive | -| =d= | Move to Trash | - -** Helping function -This is a helper to help determine which account context I am in based on the folder in my maildir the email (eg. ~/.mail/nine27) is located in. +** Useful General Functions #+begin_src emacs-lisp -(defun mu4e-message-maildir-matches (msg rx) - (when rx - (if (listp rx) - ;; If rx is a list, try each one for a match - (or (mu4e-message-maildir-matches msg (car rx)) - (mu4e-message-maildir-matches msg (cdr rx))) - ;; Not a list, check rx - (string-match rx (mu4e-message-field msg :maildir))))) -#+end_src - -Choose account label to feed msmtp -a option based on From header in Message buffer; This function must be added to message-send-mail-hook for on-the-fly change of From address before sending message since message-send-mail-hook is processed right before sending message. -#+begin_src emacs-lisp -(defun choose-msmtp-account () - (if (message-mail-p) - (save-excursion - (let* - ((from (save-restriction - (message-narrow-to-headers) - (message-fetch-field "from"))) - (account - (cond - ((string-match "dehaeze.thomas@gmail.com" from) "gmail") - ((string-match "thomas.dehaeze@esrf.fr" from) "esrf")))) - (setq message-sendmail-extra-arguments (list '"-a" account)))))) -#+end_src - -** Basic Config -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq mail-user-agent 'mu4e-user-agent - mu4e-mu-binary "/usr/bin/mu" - mu4e-maildir "~/.mail" - mu4e-compose-format-flowed t - mu4e-compose-in-new-frame nil - mu4e-view-show-images t - mu4e-html2text-command "w3m -dump -T text/html" - mu4e-use-fancy-chars t - mu4e-headers-include-related t - mu4e-attachment-dir "~/Downloads" - message-kill-buffer-on-exit t - mu4e-compose-signature-auto-include t - mu4e-view-show-images t - mu4e-view-show-addresses t) - ) -#+end_src - -** Additional config -#+begin_src emacs-lisp -(use-package! mu4e - :config - ;; Use imagemagick, if available. - (when (fboundp 'imagemagick-register-types) - (imagemagick-register-types)) - - ;; Sometimes html email is just not readable in a text based client, this lets me open the - ;; email in my browser. - (add-to-list 'mu4e-view-actions '("View in browser" . mu4e-action-view-in-browser) t) - - ;; Spell checking ftw. - (add-hook 'mu4e-compose-mode-hook 'flyspell-mode) - - ;; Use Helm to select mailboxes - (setq mu4e-completing-read-function 'completing-read) - ;; Don't ask for a 'context' upon opening mu4e - (setq mu4e-context-policy 'pick-first) - ;; Don't ask to quit... why is this the default? - (setq mu4e-confirm-quit nil) - ) -#+end_src - -** Provide Information -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq mu4e-user-mail-address-list '("dehaeze.thomas@gmail.com" "thomas.dehaeze@esrf.fr") - mu4e-compose-signature "Thomas Dehaeze\n" - user-mail-address "dehaeze.thomas@gmail.com") - ;; Default Folders - (setq mu4e-sent-folder "/gmail/Sent" - mu4e-drafts-folder "/gmail/Drafts" - mu4e-trash-folder "/gmail/Trash" - mu4e-refile-folder "/gmail/Archive") - ) -#+end_src - -** Receiving emails using mbsync -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq mu4e-get-mail-command "checkmail" - mu4e-update-interval nil - mu4e-change-filenames-when-moving t) ;; Fix for mbsync - ) -#+end_src - -** Contexts -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq mu4e-contexts - `( ,(make-mu4e-context - :name "gmail" - :enter-func (lambda () (mu4e-message "Switch to the gmail context")) - :match-func (lambda (msg) (when msg - (string-prefix-p "/gmail" (mu4e-message-field msg :maildir)))) - :leave-func (lambda () (mu4e-clear-caches)) - :vars '( - (user-mail-address . "dehaeze.thomas@gmail.com") - (user-full-name . "Thomas Dehaeze") - (mu4e-sent-folder . "/gmail/Sent") - (mu4e-trash-folder . "/gmail/Trash") - (mu4e-drafts-folder . "/gmail/Drafts") - (mu4e-refile-folder . "/gmail/Archive") - (mu4e-compose-signature . "Thomas Dehaeze\n") - )) - ,(make-mu4e-context - :name "esrf" - :enter-func (lambda () (mu4e-message "Switch to the esrf context")) - :match-func (lambda (msg) (when msg - (string-prefix-p "/esrf" (mu4e-message-field msg :maildir)))) - :leave-func (lambda () (mu4e-clear-caches)) - :vars '( - (user-mail-address . "thomas.dehaeze@esrf.fr") - (user-full-name . "Thomas Dehaeze") - (mu4e-sent-folder . "/esrf/Sent") - (mu4e-trash-folder . "/esrf/Trash") - (mu4e-drafts-folder . "/esrf/Drafts") - (mu4e-refile-folder . "/esrf/Archive") - (mu4e-compose-signature . "Thomas Dehaeze\n") - )) - )) - ) -#+end_src - -** Sending mails -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq message-send-mail-function 'message-send-mail-with-sendmail - sendmail-program "/usr/bin/msmtp" - user-full-name "Thomas Dehaeze") - - ;; This prevents saving the email to the Sent folder since gmail will do this for us on their end. - (setq mu4e-sent-messages-behavior 'delete) - - ;; Use the correct account context when sending mail based on the from header. - (setq message-sendmail-envelope-from 'header) - (add-hook 'message-send-mail-hook 'choose-msmtp-account) - ) -#+end_src - -** Bookmarks -#+begin_src emacs-lisp -(use-package! mu4e - :config - (setq mu4e-bookmarks `(,(make-mu4e-bookmark - :name "All Inboxes" - :query "maildir:/gmail/Inbox OR maildir:/esrf/Inbox" - :key ?i) - ("flag:unread" "Unread messages" ?u) - ("date:today..now" "Today's messages" ?t) - ("date:7d..now" "Last 7 days" ?w))) +(defun tdh-matlab-work () + "Setup Matlab Work Windows" + (interactive) + (delete-other-windows) + (evil-window-vsplit) + (evil-window-right 1) + (switch-to-buffer "*MATLAB*") + (evil-normal-state) + (evil-goto-line) + (evil-window-left 1) ) #+end_src @@ -3470,6 +2914,7 @@ Choose account label to feed msmtp -a option based on From header in Message buf +roam2 ; +gnuplot +jupyter + +pretty +present) ; using org-mode for presentations python ; beautiful is better than ugly (sh ; she sells {ba,z,fi}sh shells on the C xor @@ -3497,6 +2942,88 @@ Choose account label to feed msmtp -a option based on From header in Message buf :header-args:emacs-lisp: :tangle ~/.config/doom/packages.el :END: +** Org Mode Related +https://github.com/doomemacs/doomemacs/issues/6478 +#+begin_src emacs-lisp +(package! org-mode :pin "971eb6885ec996c923e955730df3bafbdc244e54") +#+end_src + +#+begin_src emacs-lisp +;; Automatic toggling of LaTeX fragments +(package! org-fragtog) +#+end_src + +#+begin_src emacs-lisp +;; Toggle visibility of hidden Org mode element parts upon entering and leaving an element +(package! org-appear) +#+end_src + +#+begin_src emacs-lisp +;; Connector between Org-roam, BibTeX-completion, and Org-ref +(package! org-roam-bibtex + :recipe (:host github :repo "org-roam/org-roam-bibtex")) +(unpin! org-roam company-org-roam) +#+end_src + +#+begin_src emacs-lisp +;; Org-mode modules for citations, cross-references, bibliographies +(package! org-ref) +#+end_src + +#+begin_src emacs-lisp +;; Org-mode calendar sync +(package! org-caldav) +#+end_src + +#+begin_src emacs-lisp +;; Alert notifications for org-agenda +(package! org-wild-notifier) +#+end_src + +#+begin_src emacs-lisp +;; Turn table into subfigure +(package! ox-latex-subfigure + :recipe (:host github :repo "tdehaeze/ox-latex-subfigure")) +#+end_src + +#+begin_src emacs-lisp +;; Org-mode query language +(package! org-ql :recipe (:host github :repo "alphapapa/org-ql" + :files ("*.el") + )) +;; (package! helm-org-ql) +#+end_src + +** Other +#+begin_src emacs-lisp +;; Nice theme +(package! poet-theme) +#+end_src + +#+begin_src emacs-lisp +;; Major Mode for Matlab +(package! matlab-mode + :recipe (:host github :repo "matlab-mode/mirror")) +#+end_src + +#+begin_src emacs-lisp +;; Don't use this default package in Doom +(package! evil-escape :disable t) +#+end_src + +#+begin_src emacs-lisp +;; Nice gantt charts +(package! ob-mermaid) +#+end_src + +#+begin_src emacs-lisp +;; Vimrc +(package! vimrc-mode) + +(package! transient :pin "c2bdf7e12c530eb85476d3aef317eb2941ab9440") +(package! with-editor :pin "391e76a256aeec6b9e4cbd733088f30c677d965b") +#+end_src + #+begin_src emacs-lisp (package! org-xournalpp :recipe (:host gitlab @@ -3504,10 +3031,40 @@ Choose account label to feed msmtp -a option based on From header in Message buf :files ("resources" "*.el"))) #+end_src +** Not used anymore :noexport: +:PROPERTIES: +:header-args:emacs-lisp: :tangle no +:END: + #+begin_src emacs-lisp -(package! yasnippet-radical-snippets - :recipe (:host github :repo "Xaldew/yasnippet-radical-snippets" - :files (:defaults "snippets" "yasnippet-radical-snippets.el"))) +;; Web Server +(package! web-server) +#+end_src + +#+begin_src emacs-lisp +(package! mpv) +#+end_src + +#+begin_src emacs-lisp +(package! pretty-hydra) +#+end_src + +#+begin_src emacs-lisp +;; custom blocks and links for org-mode +(package! org-special-block-extras) +#+end_src + +#+begin_src emacs-lisp +;; Import file to Org-mode +(package! org-pandoc-import + :recipe (:host github + :repo "tecosaur/org-pandoc-import" + :files ("*.el" "filters" "preprocessors"))) +#+end_src + +#+begin_src emacs-lisp +(package! org-media-note + :recipe (:host github :repo "yuchen-lea/org-media-note")) #+end_src #+begin_src emacs-lisp @@ -3525,96 +3082,3 @@ Choose account label to feed msmtp -a option based on From header in Message buf :branch "main" :files ("*.el"))) #+end_src - -#+begin_src emacs-lisp -;; Vimrc -(package! vimrc-mode) -#+end_src - -#+begin_src emacs-lisp -(package! org-media-note - :recipe (:host github :repo "yuchen-lea/org-media-note")) -(package! mpv) -(package! pretty-hydra) -#+end_src - -#+begin_src emacs-lisp -;; Automatic toggling of LaTeX fragments -(package! org-fragtog) -(package! org-appear) -#+end_src - -#+begin_src emacs-lisp -;; custom blocks and links for org-mode -(package! org-special-block-extras) -#+end_src - -#+begin_src emacs-lisp -;; Nice theme -(package! poet-theme) -#+end_src - -#+begin_src emacs-lisp -;; Import file to Org-mode -(package! org-pandoc-import - :recipe (:host github - :repo "tecosaur/org-pandoc-import" - :files ("*.el" "filters" "preprocessors"))) -#+end_src - -#+begin_src emacs-lisp -;; Connector between Org-roam, BibTeX-completion, and Org-ref -(package! org-roam-bibtex - :recipe (:host github :repo "org-roam/org-roam-bibtex")) -(unpin! org-roam company-org-roam) -#+end_src - -#+begin_src emacs-lisp -;; Org-mode modules for citations, cross-references, bibliographies -(package! org-ref) -#+end_src - -#+begin_src emacs-lisp -;; Alert notifications for org-agenda -(package! org-wild-notifier) -#+end_src - -#+begin_src emacs-lisp -;; Turn table into subfigure -(package! ox-latex-subfigure - :recipe (:host github :repo "linktohack/ox-latex-subfigure")) -#+end_src - -#+begin_src emacs-lisp -;; Major Mode for Matlab -(package! matlab-mode - :recipe (:host github :repo "matlab-mode/mirror")) -#+end_src - -#+begin_src emacs-lisp -;; Org-mode query language -(package! org-ql :recipe (:host github :repo "alphapapa/org-ql" - :files ("*.el") - )) -;; (package! helm-org-ql) -#+end_src - -#+begin_src emacs-lisp -;; Display Org Mode priorities as custom strings -(package! org-fancy-priorities) -#+end_src - -#+begin_src emacs-lisp :tangle no -;; Web Server -(package! web-server) -#+end_src - -#+begin_src emacs-lisp -;; Don't use this default package in Doom -(package! evil-escape :disable t) -#+end_src - -#+begin_src emacs-lisp -;; Nice gantt charts -(package! ob-mermaid) -#+end_src diff --git a/git.org b/git.org index 61df5a3..db8d23d 100644 --- a/git.org +++ b/git.org @@ -1,9 +1,9 @@ #+TITLE: Git Configuration #+SETUPFILE: ./setup/org-setup-file.org -* =~/.gitconfig= +* =gitconfig= :PROPERTIES: -:header-args:conf: :tangle ~/.gitconfig +:header-args:conf: :tangle ~/.config/git/config :header-args:conf+: :comments both :mkdirp yes :END: @@ -157,12 +157,10 @@ # 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'" + # editor = "nvim -c ':Goyo' -c 'goto 1' -c 'startinsert'" #+END_SRC ** Credentials using pass @@ -180,24 +178,6 @@ username = dehaeze #+END_SRC -** Diff-so-fancy -#+begin_src conf -[diff-so-fancy] - markEmptyLines = false -#+end_src - -* =~/.gitignore_global= - Global Git Ignore -:PROPERTIES: -:header-args:conf: :tangle ~/.gitignore_global -:header-args:conf+: :comments both :mkdirp yes -:END: - -#+BEGIN_SRC conf -*~ -.DS_Store -Session.vim -#+END_SRC - * =pass-git-helper= - Use =pass= for git passwords :PROPERTIES: :header-args: :tangle ~/.config/pass-git-helper/git-pass-mapping.ini diff --git a/gtk.org b/gtk.org index 5fca80f..95e160f 100644 --- a/gtk.org +++ b/gtk.org @@ -3,7 +3,7 @@ * GTK-2.0 :PROPERTIES: -:header-args: :tangle ~/.gtkrc-2.0.mine +:header-args: :tangle ~/.config/gtkrc-2.0 :header-args+: :comments both :mkdirp yes :END: diff --git a/homelab.org b/homelab.org index bcb00ae..cdd7a6d 100644 --- a/homelab.org +++ b/homelab.org @@ -273,6 +273,22 @@ cd ~/docker && docker-compose up -d sudo -- sh -c 'apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y; apt-get autoclean -y' #+end_src +** Snapraid errors +If there are errors, you can check what is going on with: +#+begin_src bash :eval no +sudo snapraid status +#+end_src + +To fix the errors: +#+begin_src bash :eval no +sudo snapraid -e fix +#+end_src + +You can check again if everything is fixed using the =scrub= command: +#+begin_src bash :eval no +sudo snapraid scrub +#+end_src + ** Docker Commands - Starting a container: =$ docker start homeassistant= - Stopping a container: =$ docker stop homeassistant= @@ -293,58 +309,6 @@ This will delete all unused images, volumes and networks. docker system prune -f && docker image prune -f && docker volume prune -f #+end_src -** Restore Online backup with =restic= - -To list backups: -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic snapshots -#+end_src - -#+RESULTS: -: ID Time Host Tags Paths -: -------------------------------------------------------------------------------- -: a7b98408 2020-09-03 21:18:00 4803c2af7d4e /data/documents/manuals -: 088e31a4 2020-09-03 21:50:26 4803c2af7d4e /data/documents/manuals -: 9cf0b480 2020-09-03 22:05:47 4803c2af7d4e /data/documents/manuals -: -------------------------------------------------------------------------------- -: 3 snapshots - -Force backup of folder: -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic backup /data/documents/manuals -#+end_src - -#+RESULTS: -: -: Files: 0 new, 2 changed, 8475 unmodified -: Dirs: 0 new, 2 changed, 0 unmodified -: Added to the repo: 1.010 KiB -: -: processed 8477 files, 589.800 MiB in 0:02 -: snapshot 9cf0b480 saved - -Find the path to the file within the snapshot: -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic find file_name -#+end_src - -Find files only for a specific snapshot: -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic find -s latest file_name -#+end_src - -Restore files/folders (replace file/folders): -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic restore --include /data/documents/manuals --target / 088e31a4 -#+end_src - -You can use =latest= instead of the ID. - -If indeed, we want to make a copy of the file, we can use the backup folder -#+begin_src bash :dir /ssh:thomas@homelab:/ :results output replace -docker exec restic restic restore --include /data/documents/manuals --target /backup 088e31a4 -#+end_src - ** Add =wireguard= client *** With an Android client Show the QRcode corresponding the a specific peer with: @@ -399,7 +363,7 @@ Ask the new user to go to https://login.tdehaeze.xyz/ to reset his password. ** Basic Config #+begin_src yaml -version: "3.4" +version: "3.8" #+end_src #+begin_src yaml @@ -407,6 +371,8 @@ networks: t2_proxy: external: name: t2_proxy + immich: + external: false backend: external: false default: @@ -466,8 +432,11 @@ services: - "traefik.http.routers.traefik-rtr.tls=true" - "traefik.http.routers.traefik-rtr.middlewares=authelia@docker" - "traefik.http.routers.traefik-rtr.service=traefik-svc" + # - "traefik.http.routers.traefik-rtr.tls.certresolver=dns-cloudflare" # Comment out this line after first run of traefik to force the use of wildcard certs - "traefik.http.routers.traefik-rtr.tls.domains[0].main=$DOMAINNAME" - "traefik.http.routers.traefik-rtr.tls.domains[0].sans=*.$DOMAINNAME" + - "traefik.http.routers.traefik-rtr.tls.domains[1].main=wingaudio.fr" + - "traefik.http.routers.traefik-rtr.tls.domains[1].sans=*.wingaudio.fr" - "traefik.http.services.traefik-svc.loadbalancer.server.port=8080" # Services - API - "traefik.http.routers.traefik-rtr.service=api@internal" @@ -482,14 +451,11 @@ services: - "traefik.http.routers.valetudo.tls=true" - "traefik.http.routers.valetudo.middlewares=authelia@docker" - "traefik.http.routers.valetudo.service=valetudo@file" - # Basic Auth - - "traefik.http.middlewares.wasabi-auth.basicauth.users=wasabi:$$2y$$05$$GWMXPYbVPtIbnKR8nJBUseTfuLn4vgMzMXtIqs.3.0Je9eUGbRiwG" - - "traefik.http.middlewares.potaupho-auth.basicauth.users=potaupho:$$2y$$05$$0.hcoM36J1bhooHg6w/PBeP.HyxUpZwU7eFurq5RCrpaYNMVq1f4y" logging: *default-logging #+end_src =traefik.yaml= -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/traefik2/traefik.yaml +#+begin_src yaml :tangle /ssh:thomas@homelab:/home/thomas/docker/config/traefik2/traefik.yaml global: checkNewVersion: true sendAnonymousUsage: false @@ -512,7 +478,7 @@ log: metrics: influxDB2: - address: https://influxdb.tdehaeze.xyz + address: https://influxdb.$DOMAINNAME token: dhkvChi1tXrMY18plDTWifz8MZNUm2M4QGpEAd2FftmMlfsN7KLq96uQXADbiQxDb1Vo2pYTSblCGqrfVygqJw== org: homelab bucket: traefik @@ -532,20 +498,22 @@ providers: file: filename: /etc/traefik/services.yaml -serverstransport: - insecureskipverify: true +serversTransport: + insecureSkipVerify: true # Necessary for Unifi (but not recommended) certificatesResolvers: dns-cloudflare: acme: - email: $CLOUDFLARE_EMAIL + # caServer: https://acme-staging-v02.api.letsencrypt.org/directory # LetsEncrypt Staging Server - uncomment when testing + email: dehaeze.thomas@gmail.com storage: /acme.json dnsChallenge: provider: cloudflare resolvers: 1.1.1.1:53,1.0.0.1:53 + # delayBeforeCheck: 90 # To delay DNS check and reduce LE hitrate #+end_src -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/traefik2/services.yaml +#+begin_src yaml :tangle /ssh:thomas@homelab:/home/thomas/docker/config/traefik2/services.yaml http: services: openwrt: @@ -560,10 +528,6 @@ http: - url: "http://192.168.5.157/" healthCheck: path: / -#+end_src - -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/traefik2/http.yaml -http: middlewares: unifiHeaders: headers: @@ -605,7 +569,7 @@ http: #+end_src =configuration.yml= -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/authelia/configuration.yml +#+begin_src yaml :tangle /ssh:thomas@homelab:/home/thomas/docker/config/authelia/configuration.yml --- ############################################################### # Authelia configuration # @@ -767,11 +731,10 @@ notifier: restart: unless-stopped networks: - t2_proxy - volumes: environment: - TZ=$TZ - - UID=$PUID - - GID=$PGID + - PUID=$PUID + - PGID=$PGID volumes: - $CONFIGDIR/uptime-kuma:/app/data labels: @@ -814,26 +777,20 @@ In order to have notifications on Linux desktop use [[https://github.com/ztpnk/g *** =scrutiny= - Hard drive monitoring ([[https://hub.docker.com/r/hotio/scrutiny][link]]) #+begin_src yaml - scrutiny: - container_name: scrutiny - image: ghcr.io/analogj/scrutiny:master-omnibus + scrutiny-web: + container_name: scrutiny-web + image: ghcr.io/analogj/scrutiny:master-web restart: unless-stopped networks: - t2_proxy - cap_add: - - SYS_RAWIO + - backend environment: - PUID=$PUID - PGID=$PGID - TZ=$TZ + - SCRUTINY_WEB_INFLUXDB_HOST=influxdb volumes: - - $CONFIGDIR/scrutiny:/config - - /run/udev:/run/udev:ro - devices: - - /dev/sda:/dev/sda - - /dev/sdb:/dev/sdb - - /dev/sdc:/dev/sdc - - /dev/nvme0:/dev/nvme0 + - $CONFIGDIR/scrutiny:/opt/scrutiny/config labels: - "traefik.enable=true" - "traefik.http.routers.scrutiny-rtr.entrypoints=web-secure" @@ -845,6 +802,31 @@ In order to have notifications on Linux desktop use [[https://github.com/ztpnk/g logging: *default-logging #+end_src +#+begin_src yaml + scrutiny-collector: + container_name: scrutiny-collector + image: ghcr.io/analogj/scrutiny:master-collector + restart: unless-stopped + cap_add: + - SYS_RAWIO + - SYS_ADMIN + networks: + - backend + environment: + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + - COLLECTOR_API_ENDPOINT=http://scrutiny-web:8080 + volumes: + - /run/udev:/run/udev:ro + devices: + - /dev/sda:/dev/sda + - /dev/sdb:/dev/sdb + - /dev/sdc:/dev/sdc + - /dev/nvme0:/dev/nvme0 + logging: *default-logging +#+end_src + *** =wireguard= - VPN ([[https://github.com/linuxserver/docker-wireguard][link]]) #+begin_src yaml wireguard: @@ -905,7 +887,7 @@ In order to have notifications on Linux desktop use [[https://github.com/ztpnk/g #+end_src =nginx.conf= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/root/Caddyfile +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/root/nginx.conf events { } @@ -970,6 +952,7 @@ http { restart: unless-stopped networks: - backend + user: "${PUID}:${PGID}" environment: - POSTGRES_DB=commento - POSTGRES_USER=postgres @@ -981,6 +964,65 @@ http { *** =unifi-controller= - Software for Unifi devices ([[https://hub.docker.com/r/linuxserver/unifi-controller][link]]) #+begin_src yaml + unifi-mongodb: + container_name: unifi-mongodb + image: mongo:4 + networks: + - backend + restart: unless-stopped + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/unifi-mongodb/db:/data/db + logging: *default-logging +#+end_src + +#+begin_src yaml + unifi-controller: + container_name: unifi-controller + image: linuxserver/unifi-network-application + networks: + - t2_proxy + - backend + restart: unless-stopped + environment: + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + - MONGO_USER=unifi + - MONGO_PASS=bMhre3Nza6mZzz1m + - MONGO_HOST=unifi-mongodb + - MONGO_PORT=27017 + - MONGO_DBNAME=unifi + volumes: + - $CONFIGDIR/unifi/data:/config + ports: + # - 8443:8443 + - 3478:3478/udp + - 10001:10001/udp + - 8080:8080 + # - 1900:1900/udp #optional + # - 8843:8843 #optional + # - 8880:8880 #optional + # - 6789:6789 #optional + # - 5514:5514/udp #optional + labels: + - "traefik.enable=true" + - "traefik.http.routers.unifi-rtr.entrypoints=web-secure" + - "traefik.http.routers.unifi-rtr.rule=Host(`unifi.$DOMAINNAME`)" + - "traefik.http.routers.unifi-rtr.tls=true" + - "traefik.http.routers.unifi-rtr.service=unifi-svc" + - "traefik.http.routers.unifi-rtr.middlewares=unifiHeaders@file" + - "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https" + # - "traefik.http.routers.unifi-rtr.middlewares=authelia@docker" + - "traefik.http.services.unifi-svc.loadbalancer.server.port=8443" + - "traefik.http.services.unifi-svc.loadbalancer.server.scheme=https" + logging: *default-logging +#+end_src + +#+begin_src yaml :tangle no unifi-controller: container_name: unifi-controller image: jacobalberty/unifi @@ -988,30 +1030,32 @@ http { - t2_proxy restart: unless-stopped environment: - - PUID=$PUID - - PGID=$PGID + - RUNAS_UID0=false + - UNIFI_UID=$PUID + - UNIFI_GID=$PGID - TZ=$TZ volumes: - - $CONFIGDIR/unifi-controller:/unifi + - $CONFIGDIR/unifi-controller/data:/unifi/data + - $CONFIGDIR/unifi-controller/log:/unifi/log + - $CONFIGDIR/unifi-controller/cert:/unifi/cert + - $CONFIGDIR/unifi-controller/init.d:/unifi/init.d ports: - - 8443:8443 - - 3478:3478/udp - - 10001:10001/udp - - 8080:8080 - - 1900:1900/udp #optional - # - 8843:8843 # Unifi guest portal HTTPS redirect port - # - 8880:8880 # Unifi guest portal HTTP redirect port - # - 6789:6789 # For mobile throughput test - # - 5514:5514/udp # Remote syslog port + - 3478:3478/udp # STUN + - 10001:10001/udp # AP discovery + - 6789:6789/tcp # Speed test + - 8080:8080/tcp # Device/ controller comm. + - 8443:8443/tcp # Controller GUI/API as seen in a web browser + - 8880:8880/tcp # HTTP portal redirection + - 8843:8843/tcp # HTTPS portal redirection labels: - "traefik.enable=true" - "traefik.http.routers.unifi-rtr.entrypoints=web-secure" - "traefik.http.routers.unifi-rtr.rule=Host(`unifi.$DOMAINNAME`)" - "traefik.http.routers.unifi-rtr.tls=true" - "traefik.http.routers.unifi-rtr.service=unifi-svc" + - "traefik.http.services.unifi-svc.loadbalancer.serverstransport=ignorecert" - "traefik.http.services.unifi-svc.loadbalancer.server.scheme=https" - "traefik.http.services.unifi-svc.loadbalancer.server.port=8443" - logging: *default-logging #+end_src @@ -1024,6 +1068,7 @@ http { restart: unless-stopped networks: - t2_proxy + - backend environment: - PUID=$PUID - PGID=$PGID @@ -1037,6 +1082,11 @@ http { - "traefik.http.routers.influxdb-rtr.tls=true" - "traefik.http.routers.influxdb-rtr.service=influxdb-svc" - "traefik.http.services.influxdb-svc.loadbalancer.server.port=8086" + healthcheck: + test: "curl -f http://localhost:8086/ping" + interval: 5s + timeout: 10s + retries: 5 logging: *default-logging #+end_src @@ -1066,7 +1116,7 @@ http { #+end_src =config.yml= -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/homer/assets/config.yml +#+begin_src yaml :tangle /ssh:thomas@homelab:/home/thomas/docker/config/homer/assets/config.yml --- title: "Homepage" subtitle: "" @@ -1105,6 +1155,14 @@ services: logo: "/assets/tools/miam.png" subtitle: "Personnal Recipes" url: "https://miam.tdehaeze.xyz" + - name: "Miniflux" + logo: "/assets/tools/miniflux.png" + subtitle: "RSS Feeds" + url: "https://rss.tdehaeze.xyz" + - name: "LinkDing" + logo: "/assets/tools/linkding.png" + subtitle: "Bookmark Manager" + url: "https://bm.tdehaeze.xyz" - name: "Multimedia" icon: "fas fa-photo-video" items: @@ -1112,6 +1170,10 @@ services: logo: "/assets/tools/jellyfin.png" subtitle: "Media Library" url: "https://jellyfin.tdehaeze.xyz" + - name: "JFA-Go" + logo: "/assets/tools/jellyfin.png" + subtitle: "Manage Jellyfin Users" + url: "http://jfa.tdehaeze.xyz/" # - name: "Audioserve" # logo: "/assets/tools/audiobook.png" # subtitle: "Audiobook Server" @@ -1123,6 +1185,10 @@ services: - name: "Cloud" icon: "fas fa-cloud" items: + - name: "Cinny" + logo: "/assets/tools/cinny.png" + subtitle: "Matrix web client" + url: "https://cinny.tdehaeze.xyz" - name: "File Browser" logo: "/assets/tools/cloud.png" subtitle: "Simple Personnal Could" @@ -1147,14 +1213,6 @@ services: logo: "/assets/tools/radicale.png" subtitle: "CalDAV/CardDAV Server" url: "https://radicale.tdehaeze.xyz" - - name: "Miniflux" - logo: "/assets/tools/miniflux.png" - subtitle: "RSS Feeds" - url: "https://rss.tdehaeze.xyz" - - name: "LinkDing" - logo: "/assets/tools/linkding.png" - subtitle: "Bookmark Manager" - url: "https://bm.tdehaeze.xyz" - name: "Gitea" logo: "/assets/tools/gitea.png" subtitle: "Git Server" @@ -1194,14 +1252,6 @@ services: logo: "/assets/tools/transmission.png" subtitle: "Torrent Client" url: "http://torrent.tdehaeze.xyz/transmission/web/" - # - name: "Metube" - # logo: "/assets/tools/metube.png" - # subtitle: "Youtube Download" - # url: "https://metube.tdehaeze.xyz/" - # - name: "Joal" - # logo: "/assets/tools/joal.png" - # subtitle: "Increase Ratio" - # url: "https://joal.tdehaeze.xyz/joal/ui/#/" - name: "Config" icon: "fas fa-cog" items: @@ -1229,10 +1279,6 @@ services: logo: "/assets/tools/gotify.png" subtitle: "Messaging System" url: "https://gotify.tdehaeze.xyz" - - name: "JFA-Go" - logo: "/assets/tools/jellyfin.png" - subtitle: "Manage Jellyfin Users" - url: "http://jfa.tdehaeze.xyz/" - name: "Scrutiny" logo: "/assets/tools/scrutiny.png" subtitle: "S.M.A.R.T" @@ -1299,7 +1345,7 @@ services: #+end_src =config.yml= -#+begin_src yaml :tangle /ssh:thomas@homelab:~/docker/config/famille/assets/config.yml +#+begin_src yaml :tangle /ssh:thomas@homelab:/home/thomas/docker/config/famille/assets/config.yml --- title: "Homepage" subtitle: "" @@ -1397,7 +1443,7 @@ services: #+end_src =Caddyfile= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/caddy/Caddyfile +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/caddy/Caddyfile 0.0.0.0:2015 { root /srv/www/ @@ -1438,7 +1484,7 @@ services: #+end_src =Caddyfile= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/dotfiles/Caddyfile +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/dotfiles/Caddyfile 0.0.0.0:2015 { root /srv/www/docs/ @@ -1478,7 +1524,7 @@ services: #+end_src =Caddyfile= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/help/Caddyfile +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/help/Caddyfile 0.0.0.0:2015 { root /srv/www/ @@ -1501,8 +1547,8 @@ services: - t2_proxy environment: - db_type=sqlite - - UID=$PUID - - GID=$PGID + - PUID=$PUID + - PGID=$PGID - TZ=$TZ volumes: - $CONFIGDIR/mealie:/app/data @@ -1555,13 +1601,14 @@ services: - backend ports: - 3306:3306 + user: "${PUID}:${PGID}" environment: - MYSQL_ROOT_PASSWORD=$GITEA_DB_MYSQL_ROOT_PASSWORD - MYSQL_DATABASE=gitea - MYSQL_USER=gitea - MYSQL_PASSWORD=$GITEA_DB_MYSQL_PASSWORD volumes: - - $CONFIGDIR/mariadb:/var/lib/mysql + - $CONFIGDIR/gitea_db:/var/lib/mysql #+end_src *** =changedetection= - Detect change in websites ([[https://github.com/dgtlmoon/changedetection.io][link]]) @@ -1573,8 +1620,8 @@ services: networks: - t2_proxy environment: - - UID=$PUID - - GID=$PGID + - PUID=$PUID + - PGID=$PGID - TZ=$TZ - BASE_URL=https://change.tdehaeze.xyz volumes: @@ -1590,154 +1637,54 @@ services: logging: *default-logging #+end_src -** Affichtoo -*** =japonais= - Affichtoo +** WingAudio +*** =wordpress= #+begin_src yaml - affichtoo-japonais: - container_name: affichtoo-japonais - image: tdehaeze/affichtoo + wingaudio: + container_name: wingaudio + image: wordpress + depends_on: + - wingaudio_db restart: unless-stopped networks: - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ + - backend volumes: - - $CONFIGDIR/affichtoo/japonais:/app/static/conf + - $CONFIGDIR/wingaudio:/var/www/html + environment: + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + - WORDPRESS_DB_HOST=wingaudio_db + - WORDPRESS_DB_USER=wingaudio + - WORDPRESS_DB_PASSWORD=$WINGAUDIO_DB_MYSQL_PASSWORD + - WORDPRESS_DB_NAME=wingaudio + user: "${PUID}:${PGID}" labels: - "traefik.enable=true" - - "traefik.http.routers.japonais-rtr.entrypoints=web-secure" - - "traefik.http.routers.japonais-rtr.rule=Host(`japonais.$DOMAINNAME`)" - - "traefik.http.routers.japonais-rtr.tls=true" - - "traefik.http.routers.japonais-rtr.service=japonais-svc" - - "traefik.http.services.japonais-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.japonais-rtr.middlewares=japonais-auth" + - "traefik.http.routers.wingaudio-rtr.entrypoints=web-secure" + - "traefik.http.routers.wingaudio-rtr.rule=Host(`wingaudio.fr`)" + - "traefik.http.routers.wingaudio-rtr.tls=true" + - "traefik.http.routers.wingaudio-rtr.service=wingaudio-svc" + - "traefik.http.services.wingaudio-svc.loadbalancer.server.port=80" logging: *default-logging #+end_src -*** =creperie= - Affichtoo #+begin_src yaml - affichtoo-creperie: - container_name: affichtoo-creperie - image: tdehaeze/affichtoo + wingaudio_db: + container_name: wingaudio_db + image: mysql:5.7 restart: unless-stopped networks: - - t2_proxy + - backend + user: "${PUID}:${PGID}" environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ + - MYSQL_DATABASE=wingaudio + - MYSQL_USER=wingaudio + - MYSQL_PASSWORD=$WINGAUDIO_DB_MYSQL_PASSWORD + - MYSQL_RANDOM_ROOT_PASSWORD=$WINGAUDIO_DB_MYSQL_ROOT_PASSWORD volumes: - - $CONFIGDIR/affichtoo/creperie:/app/static/conf - labels: - - "traefik.enable=true" - - "traefik.http.routers.creperie-rtr.entrypoints=web-secure" - - "traefik.http.routers.creperie-rtr.rule=Host(`creperie.$DOMAINNAME`)" - - "traefik.http.routers.creperie-rtr.tls=true" - - "traefik.http.routers.creperie-rtr.service=creperie-svc" - - "traefik.http.services.creperie-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.creperie-rtr.middlewares=creperie-auth" - logging: *default-logging -#+end_src - -*** =burger= - Affichtoo -#+begin_src yaml - affichtoo-burger: - container_name: affichtoo-burger - image: tdehaeze/affichtoo - restart: unless-stopped - networks: - - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ - volumes: - - $CONFIGDIR/affichtoo/burger:/app/static/conf - labels: - - "traefik.enable=true" - - "traefik.http.routers.burger-rtr.entrypoints=web-secure" - - "traefik.http.routers.burger-rtr.rule=Host(`burger.$DOMAINNAME`)" - - "traefik.http.routers.burger-rtr.tls=true" - - "traefik.http.routers.burger-rtr.service=burger-svc" - - "traefik.http.services.burger-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.burger-rtr.middlewares=burger-auth" - logging: *default-logging -#+end_src - -*** =indien= - Affichtoo -#+begin_src yaml - affichtoo-indien: - container_name: affichtoo-indien - image: tdehaeze/affichtoo - restart: unless-stopped - networks: - - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ - volumes: - - $CONFIGDIR/affichtoo/indien:/app/static/conf - labels: - - "traefik.enable=true" - - "traefik.http.routers.indien-rtr.entrypoints=web-secure" - - "traefik.http.routers.indien-rtr.rule=Host(`indien.$DOMAINNAME`)" - - "traefik.http.routers.indien-rtr.tls=true" - - "traefik.http.routers.indien-rtr.service=indien-svc" - - "traefik.http.services.indien-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.indien-rtr.middlewares=indien-auth" - logging: *default-logging -#+end_src - -*** =italien= - Affichtoo -#+begin_src yaml - affichtoo-italien: - container_name: affichtoo-italien - image: tdehaeze/affichtoo - restart: unless-stopped - networks: - - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ - volumes: - - $CONFIGDIR/affichtoo/italien:/app/static/conf - labels: - - "traefik.enable=true" - - "traefik.http.routers.italien-rtr.entrypoints=web-secure" - - "traefik.http.routers.italien-rtr.rule=Host(`italien.$DOMAINNAME`)" - - "traefik.http.routers.italien-rtr.tls=true" - - "traefik.http.routers.italien-rtr.service=italien-svc" - - "traefik.http.services.italien-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.italien-rtr.middlewares=italien-auth" - logging: *default-logging -#+end_src - -*** =libanais= - Affichtoo -#+begin_src yaml - affichtoo-libanais: - container_name: affichtoo-libanais - image: tdehaeze/affichtoo - restart: unless-stopped - networks: - - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ - volumes: - - $CONFIGDIR/affichtoo/libanais:/app/static/conf - labels: - - "traefik.enable=true" - - "traefik.http.routers.libanais-rtr.entrypoints=web-secure" - - "traefik.http.routers.libanais-rtr.rule=Host(`libanais.$DOMAINNAME`)" - - "traefik.http.routers.libanais-rtr.tls=true" - - "traefik.http.routers.libanais-rtr.service=libanais-svc" - - "traefik.http.services.libanais-svc.loadbalancer.server.port=8000" - # - "traefik.http.routers.libanais-rtr.middlewares=libanais-auth" + - $CONFIGDIR/wingaudio_db:/var/lib/mysql logging: *default-logging #+end_src @@ -1967,7 +1914,7 @@ services: =.filebrowser.json= -#+begin_src json :tangle /ssh:thomas@homelab:~/docker/config/filebrowser/.filebrowser.json +#+begin_src json :tangle /ssh:thomas@homelab:/home/thomas/docker/config/filebrowser/.filebrowser.json { "port": 80, "baseURL": "", @@ -2013,7 +1960,7 @@ services: #+end_src =config= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/radicale/config/config +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/radicale/config/config [server] hosts = 0.0.0.0:5232 @@ -2036,6 +1983,7 @@ filesystem_folder = /data/collections - t2_proxy volumes: - $CONFIGDIR/linkding:/etc/linkding/data + user: "${PUID}:${PGID}" environment: - TZ=$TZ - PUID=$PUID @@ -2050,51 +1998,6 @@ filesystem_folder = /data/collections logging: *default-logging #+end_src -*** =restic-b2= - Automatic backups on BackBlaze ([[https://github.com/djmaze/resticker/][link]]) -#+begin_src yaml - restic-b2: - container_name: restic-b2 - image: mazzolino/restic - restart: unless-stopped - networks: - - t2_proxy - environment: - - BACKUP_CRON=0 30 0 * * * - - RESTIC_REPOSITORY=b2:tdehaeze:/restic - - RESTIC_PASSWORD=$RESTIC_PASSWORD - - RESTIC_BACKUP_SOURCES=/source - - RESTIC_FORGET_ARGS=--group-by tag --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune - - RESTIC_BACKUP_ARGS=--tag local --exclude-file /exclude.txt - - B2_ACCOUNT_ID=$RESTIC_B2_ACCOUNT_ID - - B2_ACCOUNT_KEY=$RESTIC_B2_ACCOUNT_KEY - - RESTIC_GOTIFY_TOKEN=$RESTIC_GOTIFY_TOKEN - - UID=$PUID - - GID=$PGID - - TZ=$TZ - - POST_COMMANDS_FAILURE=curl "https://gotify.tdehaeze.xyz/message?token=$RESTIC_GOTIFY_TOKEN" -F "title=Restic B2" -F "message=Backup failed" -F "priority=5" - volumes: - - $CONFIGDIR/restic-b2/exclude.txt:/exclude.txt:ro - - /srv/storage/Cloud/thesis:/source/Cloud/thesis:ro - - /home/thomas/docker:/source/docker:ro - logging: *default-logging -#+end_src - -=exclude.txt= - Exclude files - -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/restic-b2/exclude.txt -*.db -*.log -*.log.* -/source/docker/config/gitea/git/ -/source/docker/config/guacamole/ -/source/docker/config/guacamole_db/ -/source/docker/config/mariadb/ -/source/docker/config/miniflux_db/ -/source/docker/config/jellyfin/data/ -/source/docker/config/dotfiles/www/ -/source/docker/config/web/www/ -#+end_src - *** =restic-hc4= - Automatic backups on Odroid HC4 ([[https://github.com/djmaze/resticker/][link]]) #+begin_src yaml restic-hc4: @@ -2104,13 +2007,14 @@ filesystem_folder = /data/collections networks: - t2_proxy environment: - - BACKUP_CRON=10 13 * * * + - BACKUP_CRON=0 14 * * * # Backup at 3am every day - RESTIC_REPOSITORY=sftp://thomas@pierrick.tdehaeze.xyz:10022//srv/storage/backup - RESTIC_PASSWORD=$RESTIC_PASSWORD - RESTIC_BACKUP_SOURCES=/source - RESTIC_FORGET_ARGS=--group-by tag --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune - - RESTIC_BACKUP_ARGS=--tag local --exclude-file /exclude.txt + - RESTIC_BACKUP_ARGS=--tag local --exclude-file /exclude.txt --verbose - RESTIC_GOTIFY_TOKEN=$RESTIC_GOTIFY_TOKEN + - SUCCESS_ON_INCOMPLETE_BACKUP="true" - UID=$PUID - GID=$PGID - TZ=$TZ @@ -2118,16 +2022,18 @@ filesystem_folder = /data/collections - POST_COMMANDS_EXIT=ssh -p 10022 thomas@pierrick.tdehaeze.xyz "sudo systemctl poweroff" volumes: - $CONFIGDIR/restic-hc4/exclude.txt:/exclude.txt:ro - - /srv/storage/Users:/source/Users:ro + - /srv/storage/Users:/source/Users:ro # User Clouds + - /srv/storage/Cloud:/source/Cloud:ro # My Own Cloud + - /srv/storage/Music:/source/Music:ro # Musics + - /home/thomas:/source/home:ro # Homelab - home directory - /home/thomas/.ssh/known_hosts:/root/.ssh/known_hosts:ro - /home/thomas/.ssh/id_rsa:/root/.ssh/id_rsa:ro - logging: *default-logging #+end_src =exclude.txt= - Exclude files -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/restic-hc4/exclude.txt +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/restic-hc4/exclude.txt *.db *.log *.log.* @@ -2167,6 +2073,7 @@ filesystem_folder = /data/collections restart: unless-stopped networks: - backend + user: "${PUID}:${PGID}" environment: - POSTGRES_USER=miniflux - POSTGRES_PASSWORD=$MINIFLUX_POSTGRES_PASSWORD @@ -2250,6 +2157,8 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", SYMLINK+="z - TZ=$TZ volumes: - $CONFIGDIR/node-red:/data + ports: + - 1880:1880 labels: - "traefik.enable=true" - "traefik.http.routers.node-red-rtr.entrypoints=web-secure" @@ -2319,6 +2228,214 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 logging: *default-logging #+end_src +** Photo - Immich +*** =immich-proxy= +#+begin_src yaml + immich-proxy: + container_name: immich-proxy + image: ghcr.io/immich-app/immich-proxy:release + restart: unless-stopped + networks: + - t2_proxy + - immich + environment: + # Make sure these values get passed through from the env file + - IMMICH_SERVER_URL + - IMMICH_WEB_URL + depends_on: + - immich-server + labels: + - "traefik.enable=true" + - "traefik.http.routers.immich-rtr.entrypoints=web-secure" + - "traefik.http.routers.immich-rtr.rule=Host(`immich.$DOMAINNAME`)" + - "traefik.http.routers.immich-rtr.tls=true" + - "traefik.http.routers.immich-rtr.service=immich-svc" + - "traefik.http.services.immich-svc.loadbalancer.server.port=8080" + logging: *default-logging +#+end_src + +*** =immich-server= +#+begin_src yaml + immich-server: + container_name: immich-server + image: ghcr.io/immich-app/immich-server:release + restart: unless-stopped + entrypoint: ["/bin/sh", "./start-server.sh"] + networks: + - immich + volumes: + - /srv/storage/immich:/usr/src/app/upload + env_file: + - immich.env + depends_on: + - immich-redis + - immich-database + - immich-typesense + logging: *default-logging +#+end_src + +*** =immich-microservices= +#+begin_src yaml + immich-microservices: + container_name: immich-microservices + image: ghcr.io/immich-app/immich-server:release + restart: unless-stopped + command: ["start.sh", "microservices"] + networks: + - immich + volumes: + - /srv/storage/immich:/usr/src/app/upload + env_file: + - immich.env + depends_on: + - immich-redis + - immich-database + - immich-typesense + logging: *default-logging +#+end_src + +*** =immich-machine-learning= +#+begin_src yaml + immich-machine-learning: + container_name: immich-machine-learning + image: ghcr.io/immich-app/immich-machine-learning:release + restart: unless-stopped + networks: + - immich + volumes: + - /srv/storage/immich:/usr/src/app/upload + - $CONFIGDIR/immich/machine-learning-cache:/cache + env_file: + - immich.env + logging: *default-logging +#+end_src + +*** =immich-web= +#+begin_src yaml + immich-web: + container_name: immich-web + image: ghcr.io/immich-app/immich-web:release + restart: unless-stopped + networks: + - immich + env_file: + - immich.env + logging: *default-logging +#+end_src + +*** =immich-typesense= +#+begin_src yaml + immich-typesense: + container_name: immich-typesense + image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd + restart: unless-stopped + networks: + - immich + env_file: + - immich.env + environment: + - TYPESENSE_DATA_DIR=/data + volumes: + - $CONFIGDIR/immich/typesense-data:/data + logging: *default-logging +#+end_src + +*** =immich-redis= +#+begin_src yaml + immich-redis: + container_name: immich-redis + image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 + + restart: unless-stopped + networks: + - immich + logging: *default-logging +#+end_src + +*** =immich-database= +#+begin_src yaml + immich-database: + container_name: immich-database + image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 + restart: unless-stopped + networks: + - immich + env_file: + - immich.env + environment: + - POSTGRES_PASSWORD=$${DB_PASSWORD} + - POSTGRES_USER=$${DB_USERNAME} + - POSTGRES_DB=$${DB_DATABASE_NAME} + - PG_DATA=/var/lib/postgresql/data + volumes: + - $CONFIGDIR/immich/postgresql-data:/var/lib/postgresql/data + logging: *default-logging +#+end_src + +*** =immich.env= +:PROPERTIES: +:header-args: :tangle /ssh:thomas@homelab:~/docker/immich.env +:header-args+: :comments none :mkdirp yes :noweb yes +:END: + +#+begin_src conf +################################################################################### +# Database +################################################################################### + +DB_HOSTNAME=immich-database +DB_USERNAME=postgres +DB_PASSWORD=aC2fdTEHiRcrb0U5 +DB_DATABASE_NAME=immich + +# Optional Database settings: +# DB_PORT=5432 + +################################################################################### +# Redis +################################################################################### + +REDIS_HOSTNAME=immich-redis + +################################################################################### +# Log message level - [simple|verbose] +################################################################################### + +LOG_LEVEL=simple + +################################################################################### +# Typesense +################################################################################### +TYPESENSE_ENABLED=true +TYPESENSE_API_KEY=I7kSTDznqhmIcjPB +TYPESENSE_HOST=immich-typesense +# TYPESENSE_PORT: 8108 +# TYPESENSE_PROTOCOL: http + +#################################################################################### +# Alternative Service Addresses - Optional +# +# This is an advanced feature for users who may be running their immich services on different hosts. +# It will not change which address or port that services bind to within their containers, but it will change where other services look for their peers. +# Note: immich-microservices is bound to 3002, but no references are made +#################################################################################### + +IMMICH_WEB_URL=http://immich-web:3000 +IMMICH_SERVER_URL=http://immich-server:3001 +IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003 + +#################################################################################### +# Alternative API's External Address - Optional +# +# This is an advanced feature used to control the public server endpoint returned to clients during Well-known discovery. +# You should only use this if you want mobile apps to access the immich API over a custom URL. Do not include trailing slash. +# NOTE: At this time, the web app will not be affected by this setting and will continue to use the relative path: /api +# Examples: http://localhost:3001, http://immich-api.example.com, etc +#################################################################################### + +#IMMICH_API_URL_EXTERNAL=http://localhost:3001 +#+end_src + ** Download *** =transmission-openvpn= - Torrent server ([[https://hub.docker.com/r/haugene/transmission-openvpn][link]]) #+begin_src yaml @@ -2369,7 +2486,7 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 logging: *default-logging #+end_src -*** =flaresolverr= +*** =flaresolverr= - Proxy server to bypass Cloudflare protection ([[https://github.com/FlareSolverr/FlareSolverr][link]]) :noexport: #+begin_src yaml flaresolverr: container_name: flaresolverr @@ -2530,6 +2647,275 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 #+end_src * Docker-Compose OLD :noexport: +** =metube= - Download Youtube Videos ([[https://github.com/alexta69/metube][link]]) +#+begin_src yaml + metube: + container_name: metube + image: alexta69/metube + restart: unless-stopped + networks: + - t2_proxy + environment: + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + - STATE_DIR=/statedir + user: "1000:1000" + volumes: + - /srv/storage/Downloads/youtube:/downloads + - $CONFIGDIR/metube:/statedir + labels: + - "traefik.enable=true" + - "traefik.http.routers.metube-rtr.entrypoints=web-secure" + - "traefik.http.routers.metube-rtr.rule=Host(`metube.$DOMAINNAME`)" + - "traefik.http.routers.metube-rtr.tls=true" + # - "traefik.http.routers.metube-rtr.middlewares=authelia@docker" + - "traefik.http.routers.metube-rtr.service=metube-svc" + - "traefik.http.services.metube-svc.loadbalancer.server.port=8081" +#+end_src + +** =navidrome= - Music server +#+begin_src yaml + navidrome: + container_name: navidrome + image: deluan/navidrome + restart: unless-stopped + networks: + - t2_proxy + volumes: + - $CONFIGDIR/navidrome:/data + - /srv/storage/Music:/music:ro + environment: + - ND_MUSICFOLDER=/music + - ND_DATAFOLDER=/data + - ND_SCANINTERVAL=10m + - ND_LOGLEVEL=info + - ND_PORT=4533 + - ND_TRANSCODINGCACHESIZE=100MB + - ND_SESSIONTIMEOUT=24h + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + labels: + - "traefik.enable=true" + - "traefik.http.routers.navidrome-rtr.entrypoints=web-secure" + - "traefik.http.routers.navidrome-rtr.rule=Host(`navidrome.$DOMAINNAME`)" + - "traefik.http.routers.navidrome-rtr.tls=true" + - "traefik.http.routers.navidrome-rtr.service=navidrome-svc" + - "traefik.http.services.navidrome-svc.loadbalancer.server.port=4533" + logging: *default-logging +#+end_src + +** Affichtoo +*** =japonais= - Affichtoo +#+begin_src yaml + affichtoo-japonais: + container_name: affichtoo-japonais + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/japonais:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.japonais-rtr.entrypoints=web-secure" + - "traefik.http.routers.japonais-rtr.rule=Host(`japonais.$DOMAINNAME`)" + - "traefik.http.routers.japonais-rtr.tls=true" + - "traefik.http.routers.japonais-rtr.service=japonais-svc" + - "traefik.http.services.japonais-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.japonais-rtr.middlewares=japonais-auth" + logging: *default-logging +#+end_src + +*** =creperie= - Affichtoo +#+begin_src yaml + affichtoo-creperie: + container_name: affichtoo-creperie + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/creperie:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.creperie-rtr.entrypoints=web-secure" + - "traefik.http.routers.creperie-rtr.rule=Host(`creperie.$DOMAINNAME`)" + - "traefik.http.routers.creperie-rtr.tls=true" + - "traefik.http.routers.creperie-rtr.service=creperie-svc" + - "traefik.http.services.creperie-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.creperie-rtr.middlewares=creperie-auth" + logging: *default-logging +#+end_src + +*** =burger= - Affichtoo +#+begin_src yaml + affichtoo-burger: + container_name: affichtoo-burger + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/burger:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.burger-rtr.entrypoints=web-secure" + - "traefik.http.routers.burger-rtr.rule=Host(`burger.$DOMAINNAME`)" + - "traefik.http.routers.burger-rtr.tls=true" + - "traefik.http.routers.burger-rtr.service=burger-svc" + - "traefik.http.services.burger-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.burger-rtr.middlewares=burger-auth" + logging: *default-logging +#+end_src + +*** =indien= - Affichtoo +#+begin_src yaml + affichtoo-indien: + container_name: affichtoo-indien + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/indien:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.indien-rtr.entrypoints=web-secure" + - "traefik.http.routers.indien-rtr.rule=Host(`indien.$DOMAINNAME`)" + - "traefik.http.routers.indien-rtr.tls=true" + - "traefik.http.routers.indien-rtr.service=indien-svc" + - "traefik.http.services.indien-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.indien-rtr.middlewares=indien-auth" + logging: *default-logging +#+end_src + +*** =italien= - Affichtoo +#+begin_src yaml + affichtoo-italien: + container_name: affichtoo-italien + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/italien:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.italien-rtr.entrypoints=web-secure" + - "traefik.http.routers.italien-rtr.rule=Host(`italien.$DOMAINNAME`)" + - "traefik.http.routers.italien-rtr.tls=true" + - "traefik.http.routers.italien-rtr.service=italien-svc" + - "traefik.http.services.italien-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.italien-rtr.middlewares=italien-auth" + logging: *default-logging +#+end_src + +*** =libanais= - Affichtoo +#+begin_src yaml + affichtoo-libanais: + container_name: affichtoo-libanais + image: tdehaeze/affichtoo + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + volumes: + - $CONFIGDIR/affichtoo/libanais:/app/static/conf + labels: + - "traefik.enable=true" + - "traefik.http.routers.libanais-rtr.entrypoints=web-secure" + - "traefik.http.routers.libanais-rtr.rule=Host(`libanais.$DOMAINNAME`)" + - "traefik.http.routers.libanais-rtr.tls=true" + - "traefik.http.routers.libanais-rtr.service=libanais-svc" + - "traefik.http.services.libanais-svc.loadbalancer.server.port=8000" + # - "traefik.http.routers.libanais-rtr.middlewares=libanais-auth" + logging: *default-logging +#+end_src + +** =wishlist= +#+begin_src yaml + wishlist: + container_name: wishlist + image: wingysam/christmas-community + restart: unless-stopped + networks: + - t2_proxy + environment: + - UID=$PUID + - GID=$PGID + - TZ=$TZ + - SITE_TITLE=Ma Liste d'Envies + - SHORT_TITLE=Wishlist + - BULMASWATCH=Minty + - PFP=false + - LANGUAGE=fr-FR + - SINGLE_LIST=false + - LISTS_PUBLIC=true + - SMILE=false + - TABLE=true + volumes: + - $CONFIGDIR/wishlist:/data + labels: + - "traefik.enable=true" + - "traefik.http.routers.wishlist-rtr.entrypoints=web-secure" + - "traefik.http.routers.wishlist-rtr.rule=Host(`wishlist.$DOMAINNAME`)" + - "traefik.http.routers.wishlist-rtr.tls=true" + - "traefik.http.routers.wishlist-rtr.service=wishlist-svc" + - "traefik.http.services.wishlist-svc.loadbalancer.server.port=80" + logging: *default-logging +#+end_src + +** =ihatemoney= +#+begin_src yaml + ihatemoney: + image: ihatemoney/ihatemoney:6.1.0 + container_name: ihatemoney + restart: unless-stopped + networks: + - t2_proxy + environment: + - PUID=$PUID + - PGID=$PGID + - TZ=$TZ + - PORT=8000 + - ACTIVATE_DEMO_PROJECT=False + volumes: + - $CONFIGDIR/ihatemoney:/database + labels: + - "traefik.enable=true" + - "traefik.http.routers.ihatemoney-rtr.entrypoints=web-secure" + - "traefik.http.routers.ihatemoney-rtr.rule=Host(`ihatemoney.$DOMAINNAME`)" + - "traefik.http.routers.ihatemoney-rtr.tls=true" + - "traefik.http.routers.ihatemoney-rtr.service=ihatemoney-svc" + - "traefik.http.services.ihatemoney-svc.loadbalancer.server.port=8000" + logging: *default-logging +#+end_src + ** =adguardhome= - Network-wide ads & trackers blocking DNS server ([[https://github.com/AdguardTeam/AdGuardHome][link]]) #+begin_src yaml :tangle no adguardhome: @@ -2560,33 +2946,6 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 logging: *default-logging #+end_src -** =metube= - Download Youtube Videos ([[https://github.com/alexta69/metube][link]]) -#+begin_src yaml :tangle no - metube: - container_name: metube - image: alexta69/metube - restart: unless-stopped - networks: - - t2_proxy - environment: - - PUID=$PUID - - PGID=$PGID - - TZ=$TZ - - STATE_DIR=/statedir - user: "1000:1000" - volumes: - - /srv/storage/Downloads/youtube:/downloads - - $CONFIGDIR/metube:/statedir - labels: - - "traefik.enable=true" - - "traefik.http.routers.metube-rtr.entrypoints=web-secure" - - "traefik.http.routers.metube-rtr.rule=Host(`metube.$DOMAINNAME`)" - - "traefik.http.routers.metube-rtr.tls=true" - # - "traefik.http.routers.metube-rtr.middlewares=authelia@docker" - - "traefik.http.routers.metube-rtr.service=metube-svc" - - "traefik.http.services.metube-svc.loadbalancer.server.port=8081" -#+end_src - ** =joal= - Seeding Torrents ([[https://github.com/anthonyraymond/joal][link]]) :noexport: #+begin_src yaml :tangle no joal: @@ -2635,33 +2994,6 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 - "traefik.http.services.jackett-svc.loadbalancer.server.port=9117" #+end_src -** =alfawiseu20= - Web interface for 3D printing ([[https://github.com/OctoPrint/OctoPrint][link]]) -#+begin_src yaml - octoprint: - container_name: alfawiseu20 - image: octoprint/octoprint - restart: unless-stopped - networks: - - t2_proxy - environment: - - UID=$PUID - - GID=$PGID - - TZ=$TZ - privileged: true - volumes: - - $CONFIGDIR/alfawiseu20:/octoprint - - /dev/bus/usb:/dev/bus/usb - labels: - - "traefik.enable=true" - - "traefik.http.routers.alfawiseu20-rtr.entrypoints=web-secure" - - "traefik.http.routers.alfawiseu20-rtr.rule=Host(`alfawiseu20.$DOMAINNAME`)" - - "traefik.http.routers.alfawiseu20-rtr.tls=true" - - "traefik.http.routers.alfawiseu20-rtr.service=alfawiseu20-svc" - - "traefik.http.routers.alfawiseu20-rtr.middlewares=authelia@docker" - - "traefik.http.services.alfawiseu20-svc.loadbalancer.server.port=80" - logging: *default-logging -#+end_src - ** =portainer= - Manage docker ([[https://github.com/portainer/portainer][link]]) #+begin_src yaml :tangle no portainer: @@ -2716,35 +3048,6 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 logging: *default-logging #+end_src -** Wireguard -#+begin_src yaml - wireguard: - container_name: wireguard - image: linuxserver/wireguard - restart: unless-stopped - networks: - - t2_proxy - cap_add: - - NET_ADMIN - - SYS_MODULE - environment: - - PUID=$PUID - - PGID=$PGID - - TZ=$TZ - - SERVERURL=wireguard.tdehaeze.xyz - - SERVERPORT=51820 - - PEERS=4 - - PEERDNS=8.8.8.8 - volumes: - - $CONFIGDIR/wireguard:/config - - /lib/modules:/lib/modules - ports: - - 51820:51820/udp - sysctls: - - net.ipv4.conf.all.src_valid_mark=1 - logging: *default-logging -#+end_src - ** =docker-torrent= - Download Torrents from YGG ([[https://github.com/tdehaeze/qobuz-docker][link]]) #+begin_src yaml down: @@ -2797,7 +3100,7 @@ SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="3 #+end_src =snapraid.conf= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/snapraid/snapraid.conf +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/snapraid/snapraid.conf # Defines the file to use as parity storage # It must NOT be in a data disk # Format: "parity FILE_PATH" @@ -2842,7 +3145,7 @@ exclude .Trashes #+end_src =snapraid-runner.conf= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/snapraid/snapraid-runner.conf +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/snapraid/snapraid-runner.conf [snapraid] ; path to the snapraid executable (e.g. /bin/snapraid) executable = /usr/bin/snapraid @@ -3220,7 +3523,7 @@ older-than = 10 #+end_src *** =Caddyfile= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/acoustic/Caddyfile +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/acoustic/Caddyfile 0.0.0.0:2015 { root /srv/www/ @@ -3304,7 +3607,7 @@ Web-UI ([[https://hub.docker.com/r/p3terx/ariang][link]]): #+end_src *** =aria2.conf= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/aria2/aria2.conf :noweb yes +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/aria2/aria2.conf :noweb yes save-session=/config/aria2.session input-file=/config/aria2.session save-session-interval=60 @@ -3356,7 +3659,7 @@ split=16 #+end_src *** =.arl= -#+begin_src conf :tangle /ssh:thomas@homelab:~/docker/config/deemix/.arl :noweb yes +#+begin_src conf :tangle /ssh:thomas@homelab:/home/thomas/docker/config/deemix/.arl :noweb yes <> #+end_src @@ -3630,35 +3933,6 @@ split=16 - "traefik.http.services.buku-svc.loadbalancer.server.port=5001" #+end_src -** =navidrome= - Music server -#+begin_src yaml - navidrome: - container_name: navidrome - image: deluan/navidrome - restart: unless-stopped - networks: - - t2_proxy - environment: - ND_MUSICFOLDER: /music - ND_DATAFOLDER: /data - ND_SCANINTERVAL: 10m - ND_LOGLEVEL: info - ND_PORT: 4533 - ND_TRANSCODINGCACHESIZE: 100MB - ND_SESSIONTIMEOUT: 24h - ND_BASEURL: "" - volumes: - - $CONFIGDIR/navidrome:/data - - /srv/storage/Music:/music:ro - labels: - - "traefik.enable=true" - - "traefik.http.routers.navidrome-rtr.entrypoints=web-secure" - - "traefik.http.routers.navidrome-rtr.rule=Host(`music.$DOMAINNAME`)" - - "traefik.http.routers.navidrome-rtr.tls=true" - - "traefik.http.routers.navidrome-rtr.service=navidrome-svc" - - "traefik.http.services.navidrome-svc.loadbalancer.server.port=4533" -#+end_src - ** =duplicati= - Backup system #+begin_src yaml duplicati: @@ -3747,6 +4021,9 @@ split=16 PUID=1000 PGID=1000 TZ=Europe/Paris +#+end_src + +#+begin_src conf CONFIGDIR=/home/thomas/docker/config DOMAINNAME=tdehaeze.xyz #+end_src @@ -3764,12 +4041,11 @@ MINIFLUX_POSTGRES_PASSWORD=<> -RESTIC_B2_ACCOUNT_ID=<> -RESTIC_B2_ACCOUNT_KEY=<> #+end_src #+begin_src conf -AUDIOSERVE_SHARED_SECRET=<> +WINGAUDIO_DB_MYSQL_ROOT_PASSWORD=<> +WINGAUDIO_DB_MYSQL_PASSWORD=<> #+end_src #+begin_src conf @@ -3779,8 +4055,8 @@ GITEA_SSH_PORT=2222 #+end_src #+begin_src conf -NORDVPN_NAME=a2d_pierrick@hotmail.com -NORDVPN_PASS=<> +NORDVPN_NAME=AacP7CV8mjAkBtk5Bk6eGr1q +NORDVPN_PASS=<> #+end_src #+begin_src conf @@ -3798,16 +4074,15 @@ GOTIFY_DEFAULTUSER_NAME=tdehaeze GOTIFY_DEFAULTUSER_PASS=<> #+end_src +Gotify Tokken: #+begin_src conf -DOWN_GOTIFY_TOKEN=<> QOBUZ_GOTIFY_TOKEN=<> -DIUN_GOTIFY_TOKEN=<> -RESTIC_GOTIFY_TOKEN=<> +RESTIC_GOTIFY_TOKEN=<> #+end_src #+begin_src conf -QOBUZNAME=jeanmarie.dehaeze@wanadoo.fr -QOBUZPASS=<> +QOBUZNAME=dehaeze.thomas@gmail.com +QOBUZPASS=<> JELLYFINTOKEN=<> #+end_src @@ -3816,23 +4091,10 @@ AUTHELIA_NOTIFIER_SMTP_PASSWORD=<> #+end_src -#+begin_src conf -YGGTORRENTNAME=deoldeol -YGGTORRENTPASS=<> -#+end_src - #+begin_src conf JOALTOKEN=<> #+end_src -#+begin_src conf -GUACAMOLE_POSTGRES_PASSWORD=<> -#+end_src - -#+begin_src conf -DEEMIX_ARL=<> -#+end_src - #+begin_src conf GOOGLE_COMMENTO_PASS=<> GOOGLE_AUTHELIA_PASS=<> @@ -3948,7 +4210,7 @@ matrix_mautrix_telegram_api_hash: 29d6742e35799b88b9a7b5a46fe05ff2 * Backup server ** Hardware -odroid HC4 +[[https://www.hardkernel.com/shop/odroid-hc4-oled/][Odroid HC4]] ** Install *** Install MicroSD diff --git a/i3.org b/i3.org index 50cc7d3..7b91f42 100644 --- a/i3.org +++ b/i3.org @@ -16,9 +16,9 @@ set $mod Mod4 * Border Style #+begin_src conf -# Use custom colors for black -new_window pixel 1 -new_float normal +default_border pixel 2 +default_floating_border pixel 2 +for_window [class="^.*"] border pixel 2 #+end_src Hide borders @@ -72,11 +72,6 @@ workspace_layout default focus_follows_mouse no #+end_src -* Border -#+begin_src conf -default_border pixel 2 -#+end_src - * Settings for i3-gaps #+begin_src conf gaps inner 10 @@ -133,12 +128,17 @@ for_window [title="Simulink Library Browser"] floating enable for_window [class="Floating"] floating enable, resize set 800 600, move position 1100 460 for_window [class="mpv"] floating enable # Size/Position is defined in mpv.conf for_window [class="Sxiv"] floating enable, resize set 800 600, move position center +for_window [class="Cropgui"] floating enable, resize set 800 600, move position center for_window [title="khal"] floating enable, resize set 600 600, move position center for_window [title="ncmpcpp"] floating enable, resize set 800 400, move position center +for_window [title="stig"] floating enable, resize set 800 400, move position center for_window [title="Sensors"] floating enable, resize set 800 400, move position center +for_window [title="TexText"] floating enable, resize set 800 400, move position center for_window [title="nmtui"] floating enable, resize set 800 600, move position center for_window [title="Xournal"] floating enable, resize set 1100 750, move position center for_window [title="esrf-phonebook"] floating enable, resize set 1400 400, move position center +for_window [title="zoom "] floating enable +for_window [title="F3D"] floating enable, resize set 800 600, move position center #+end_src * Scratchpad diff --git a/index.org b/index.org index f1d965b..648c707 100644 --- a/index.org +++ b/index.org @@ -7,7 +7,7 @@ The general installation procedure is described [[file:install.org][here]]. There are Specific configuration files for: -- *Windows Manager*: [[file:bspwm.org][BSPWM]] and [[file:i3.org][I3]] +- *Windows Manager*: [[file:i3.org][I3]] - *Hotkey Manager*: [[file:sxhkd.org][SXHKD]] - *Status Bar*: [[file:polybar.org][Polybar]] - *Launcher*: [[file:rofi.org][Rofi]] @@ -24,7 +24,6 @@ There are Specific configuration files for: - *Video Setup*: [[file:video.org][Mpv]] - *Web Browser*: [[file:qutebrowser.org][Qutebrowser]] - *PDF Reader*: [[file:zathura.org][Zathura]] -- *GUI File Manager*: [[file:pcmanfm.org][PCManFM]] - *Terminal File Manager*: [[file:ranger.org][Ranger]] - *Calendar and Contacts*: [[file:calendar-contact.org][Vdirsyncer, Khal and Khard]] - *Mails*: [[file:mail.org][Mbsync, Msmtp, Mu and Neomutt]] diff --git a/inkscape.org b/inkscape.org index 1081967..21e2742 100644 --- a/inkscape.org +++ b/inkscape.org @@ -4,6 +4,29 @@ #+PROPERTY: header-args :comments no #+PROPERTY: header-args+ :mkdirp yes +#+begin_src conf :tangle /home/thomas/.config/inkscape/palettes/reasonable_colors.gpl +GIMP Palette +Name: Matlab Colors +# +# Last update: 26.04.2022 +# +# Original palette by Matthew Howell +# reasonable.work/colors +# +# GPL palette coded by Rob Mocci (with permission) +# patreon.com/rmocci +# + 0 114 189 +217 83 25 +237 177 32 +126 47 142 +119 172 48 + 77 190 238 +162 20 47 + 0 0 0 +255 255 255 +#+end_src + * Save Selection to SVG extension ** =ink= file diff --git a/install.org b/install.org index 4a16eda..28e82da 100644 --- a/install.org +++ b/install.org @@ -1,13 +1,23 @@ #+TITLE: Installation #+SETUPFILE: ./setup/org-setup-file.org -* TODO [#A] Issues to handle +* =paru= - Package Manager +Installation: +#+begin_src bash +mkdir ~/.local/soft && cd ~/.local/soft +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git +cd paru +makepkg -si +#+end_src + +After that, the =paru= folder may be removed. * =git= - Version Control System Installation: #+begin_src bash -sudo apt install git +paru -S git #+end_src [[file:git.org][Git]] Configuration: @@ -19,8 +29,7 @@ sudo apt install git It can be installed like so: #+begin_src bash -sudo add-apt-repository ppa:aslatter/ppa -sudo apt install alacritty +paru -S alacritty #+end_src Its configuration file is described [[file:alacritty.org][here]]. @@ -40,7 +49,7 @@ https://wiki.archlinux.org/index.php/Bash Installation: #+begin_src bash -sudo apt install bash bash-completion zsh +paru -S bash bash-completion zsh #+end_src [[file:bash.org][Bash]] configuration: @@ -54,7 +63,7 @@ https://github.com/tmux/tmux Installation: #+begin_src bash -sudo apt install tmux +paru -S tmux #+end_src [[file:tmux.org][TMUX]] configuration @@ -80,14 +89,12 @@ Ressources: * Fonts My font of choice is =nerd-fonts-hack= which can be installed as so: #+begin_src bash -git clone --depth 1 https://github.com/ryanoasis/nerd-fonts -cd nerd-fonts -./install.sh Hack +paru -S nerd-fonts-hack #+end_src For emojis, use: #+begin_src bash -sudo apt install fonts-noto-color-emoji +paru -S noto-fonts-emoji #+end_src Default font used: @@ -101,8 +108,10 @@ To list all fonts available: fc-list #+end_src -* TODO Syncthing -https://leandeep.com/installer-syncthing-sur-ubuntu-20.04/ +To select fonts using a GUI, =gtk2fontsel= can be used: +#+begin_src bash +paru -S gtk2fontsel +#+end_src * =emacs= and =vim= - Text Editors ** Neovim @@ -110,28 +119,20 @@ I use [[https://github.com/neovim/neovim][Neovim]] for all the small edits. Installation: #+begin_src bash -sudo apt install neovim +paru -S neovim nodejs-neovim python-pynvim #+end_src The Neovim configuration can be found [[file:vim.org][here]]. -Simlink the Vim config to Neovim: -#+begin_src bash -mkdir ~/.config/nvim -ln -s ~/.vimrc ~/.config/nvim/init.vim -#+end_src - Then install the plugin manager [[https://github.com/junegunn/vim-plug][plug]]: #+begin_src bash -sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' #+end_src And to install/setup all the plugins: #+begin_src bash nvim +PlugInstall -#+end_src - -#+begin_src bash nvim +UpdateRemotePlugins #+end_src @@ -140,15 +141,12 @@ I use [[https://www.gnu.org/software/emacs/][Emacs]] and the [[https://github.co Install Emacs: #+begin_src bash -sudo snap install emacs --edge --classic +paru -S emacs-nativecomp #+end_src And then the Doom framework: #+begin_src bash git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d -#+end_src - -#+begin_src bash ~/.emacs.d/bin/doom install #+end_src @@ -156,7 +154,7 @@ The Emacs configuration can be found [[./doom.org][here]]. SpellCheck with Aspell: #+begin_src bash -sudo apt install aspell aspell-en aspell-fr +paru -S aspell aspell-en aspell-fr #+end_src * SSH setup @@ -180,23 +178,23 @@ https://gnupg.org/ Install the gnupg package: #+begin_src bash -sudo apt install gnupg +paru -S gnupg #+end_src Create a key pair: #+begin_src bash -gpg --full-gen-key +paru --full-gen-key #+end_src -To configure the =gpg-agent= to cache the passphrase, edit the following file =~/.gnupg/gpg-agent.conf=: +To configure the =gpg-agent= to cache the passphrase, edit the following file =~/.local/share/gnupg/gpg-agent.conf=: #+begin_src conf default-cache-ttl 60480000 max-cache-ttl 60480000 #+end_src -Install =Gnome-Keyring= to automatically unlock the GnuPG keys: +Install =gnome-keyring= to automatically unlock the GnuPG keys: #+begin_src bash -sudo apt install gnome-keyring +paru -S gnome-keyring #+end_src * =rofi= - Application Launcher @@ -204,7 +202,7 @@ sudo apt install gnome-keyring Installation: #+begin_src bash -sudo apt install dmenu rofi +paru -S dmenu rofi rofi-calc #+end_src To be able to run sudo commands with =rofi= ([[https://github.com/DaveDavenport/rofi/issues/584#issuecomment-384555551][github issue]]), the command =sudo -A= can be used: it opens a =rofi= prompt to ask for the password. @@ -214,7 +212,7 @@ For that to work, we need to add the following code to =~/.profile=: export SUDO_ASKPASS=~/.local/bin/askpass-rofi #+end_src -The =askpass-rofi= script is: +The =askpass= script is: #+begin_src bash #!/bin/sh @@ -229,30 +227,34 @@ https://www.passwordstore.org/ Installation: #+begin_src bash -sudo apt install pass +paru -S pass #+end_src #+begin_src bash -git clone https://git.tdehaeze.xyz/tdehaeze/pass.git ~/.password-store +mkdir .config/pass +#+end_src + +Initialize the password store as a git repository +#+begin_src bash +cd .config/pass +pass git init +pass git remote add origin https://github.com/tdehaeze/pass.git #+end_src Gui Manager: [[https://github.com/IJHack/qtpass][qtpass]] #+begin_src bash -sudo apt install qtpass +paru -S qtpass #+end_src Integration with Rofi: [[https://github.com/carnager/rofi-pass][rofi-pass]] #+begin_src bash -cd ~/.local/soft/ -git clone https://github.com/carnager/rofi-pass -cd rofi-pass -sudo make install +paru -S rofi-pass #+end_src Then we can add a shortcut to =rofi-pass= on i3 config. Integration with Git: [[https://github.com/languitar/pass-git-helper][pass-git-helper]] #+begin_src bash -sudo apt install pass-git-helper +paru -S pass-git-helper #+end_src 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=: @@ -280,7 +282,7 @@ Integrate pass in other programs is usually very easy, here are few examples: ** Alternative - Bitwarden Bitwarden https://github.com/bitwarden/cli #+begin_src bash - yay -Ss bitwarden-bin bitwarden-cli-bin + paru -Ss bitwarden-bin bitwarden-cli-bin #+end_src * =qutebrowser= - Browser @@ -288,29 +290,13 @@ https://github.com/qutebrowser/qutebrowser ** Installation #+begin_src bash -mkdir ~/.local/soft -cd ~/.local/soft -git clone https://github.com/qutebrowser/qutebrowser.git -cd qutebrowser -sudo apt install --no-install-recommends git ca-certificates python3 python3-venv asciidoc libglib2.0-0 libgl1 libfontconfig1 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 libdbus-1-3 libyaml-dev gcc python3-dev libnss3 -python3 scripts/mkvenv.py -#+end_src - -Then it can be launched using [[file:binaries-private.org::#qutebrowser][file:~/.config/literate-dotfiles/binaries-private.org::#qutebrowser]] -#+begin_src bash -~/.local/soft/qutebrowser/.venv/bin/python3 -m qutebrowser -#+end_src - -And upgraded with: -#+begin_src bash -cd ~/.local/soft/qutebrowser/ -mkvenv.py --update +paru -S qutebrowser python-adblock #+end_src ** View Pdf inside qutebrowser with pdfjs *** Installation #+begin_src bash -sudo apt install pdf.js-common +paru -S pdfjs #+end_src *** Usage @@ -326,21 +312,21 @@ When opening a pdf file on qutebrowser, you'll be ask for options: Add the key-binding on =~/.config/qutebrowser/config.py= #+begin_src -config.bind(',p', 'spawn --userscript password_fill') + config.bind(',p', 'spawn --userscript password_fill') #+end_src The =password_fill= script can be found on [[https://github.com/qutebrowser/qutebrowser/blob/master/misc/userscripts/password_fill][github.com]]. It is configured using the =~/.config/qutebrowser/password_fill_rc= file. -** TODO Spell Checking +** Spell Checking #+begin_src bash -./scripts/dictcli.py install fr-FR -./scripts/dictcli.py install en-US +/usr/share/qutebrowser/scripts/dictcli.py install fr-FR +/usr/share/qutebrowser/scripts/dictcli.py install en-US #+end_src -** =firefox= +* =firefox= #+begin_src bash -sudo apt install firefox +paru -S firefox-developer-edition #+end_src Addons: @@ -349,9 +335,14 @@ Addons: - [[https://addons.mozilla.org/fr/firefox/addon/bukubrow/][Bukurow]] - [[https://addons.mozilla.org/fr/firefox/addon/i-dont-care-about-cookies/][I don't care about cookies]] +In order to have passwords: +#+begin_src bash +paru -S passff-host +#+end_src + * =xrandr= - Monitor Manager #+begin_src bash -sudo apt install arandr +paru -S xorg-xrandr arandr #+end_src [[https://wiki.archlinux.org/index.php/Xrandr][Xrandr]] is used in shell scripts ([[https://github.com/Ventto/mons][mons]] could be used as a layer on top of Xrandr). @@ -363,7 +354,7 @@ https://wiki.archlinux.org/index.php/PulseAudio Installation: #+begin_src bash -sudo apt install pulseaudio pulseaudio-module-bluetooth +paru -S pulseaudio pulseaudio-alsa pulseaudio-bluetooth #+end_src If sound is not working, should run =pulseaudio --kill= to kill the deamon and then =pulseaudio --daemonize= to run it again. @@ -374,7 +365,7 @@ https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/ =pavucontrol= is used as a sound manager: #+begin_src bash - sudo apt install pavucontrol +paru -S pavucontrol #+end_src ** =mopidy= - Audio Server @@ -382,17 +373,11 @@ https://github.com/mopidy/mopidy https://medium.com/@theos.space/using-mopidy-with-spotify-and-ncmpcpp-44352f4a2ce8 #+begin_src bash -sudo apt install mopidy +paru -S mopidy #+end_src #+begin_src bash -sudo apt install python3-pip -python3 -m pip install --use mopidy-jellyfin -#+end_src - -To update local files: -#+begin_src bash -mopidy local scan +python3 -m pip install --user mopidy-mpd mopidy-jellyfin mopidy-spotify #+end_src If mopidy is used, MPD should be disabled. (=systemctl disable --user mpd.service=) @@ -402,7 +387,7 @@ https://wiki.archlinux.org/index.php/Ncmpcpp Installation: #+begin_src bash -sudo apt install ncmpcpp +paru -S ncmpcpp #+end_src The main config is located here: =~/.ncmpcpp/config=. @@ -412,7 +397,7 @@ The key bindings can be configured here: =~/.ncmpcpp/bindings=. ** =mpv= - Media Player Installation: #+begin_src bash - sudo apt install mpv + paru -S mpv #+end_src The configuration is set in =/.config/mpv/input.conf=. @@ -422,7 +407,7 @@ The configuration is set in =/.config/mpv/input.conf=. https://github.com/scheibler/khard #+begin_src bash - yay -Ss khard +paru -S khard #+end_src This is the command line interface for contact management. @@ -434,7 +419,7 @@ To search with Khard: =khard = ** =mu= - Index Emails #+begin_src bash -sudo apt install maildir-utils +paru -S mu #+end_src This looks for contacts in all indexed emails. @@ -444,7 +429,7 @@ This looks for contacts in all indexed emails. http://jonls.dk/redshift/ #+begin_src bash - sudo apt install redshift +paru -S redshift-minimal #+end_src * Mail Setup @@ -456,7 +441,7 @@ https://wiki.archlinux.org/index.php/Isync *** Installation #+begin_src bash -sudo apt install isync +paru -S isync #+end_src *** Configuration @@ -487,28 +472,31 @@ https://marlam.de/msmtp/ *** Installation #+begin_src bash -sudo apt install msmtp + paru -S msmtp #+end_src ** =mu= - Mail Index, Search and Tagging https://github.com/djcb/mu +#+begin_src bash +paru -S mu +#+end_src + +#+begin_src bash +mu init -m ~/.mail/ +mu index +#+end_src ** =neomutt= - Mail Client https://github.com/neomutt/neomutt *** Installation #+begin_src bash -sudo apt install neomutt -#+end_src - -*** Display html mails -#+begin_src bash - sudo apt install w3m +paru -S neomutt #+end_src *** Open Url from mail #+begin_src bash - sudo apt install urlview +paru -S urlview #+end_src *** Ressources @@ -519,16 +507,19 @@ sudo apt install neomutt ** Notification system A script (=checkmail=) is used to retreive new mails and use =notify=send= is there are new received mails. -* =ranger=/=pcmanfm= - File Manager +* =ranger= and =pcmanfm= - File Manager Configuration files: -- GUI: [[file:pcmanfm.org][Pcmanfm]] - Terminal based: [[file:ranger.org][Ranger]] ** Ranger https://github.com/ranger/ranger *** Installation #+begin_src bash -sudo apt install ranger +paru -S ranger +#+end_src + +#+begin_src bash +paru -S dragon-drop #+end_src *** Configuration @@ -544,13 +535,17 @@ It works better with Urxvt. ** GUI File Manager: pcmanfm https://wiki.archlinux.org/index.php/PCManFM +#+begin_src bash +paru -S pcmanfm +#+end_src + * =sxiv= - Image viewer https://github.com/muennich/sxiv https://www.youtube.com/watch?v=GYW9i_u5PYs ** Installation #+begin_src bash -sudo apt install sxiv +paru -S sxiv #+end_src ** Open Gif @@ -570,7 +565,7 @@ sxiv -a file.gif * =sxhkd= - HotKey Manager #+begin_src bash -sudo apt install sxhkd +paru -S sxhkd #+end_src Configuration file: [[file:sxhkd.org][SXHKD]]. @@ -580,8 +575,7 @@ Configuration file: [[file:sxhkd.org][SXHKD]]. ** Installation #+begin_src bash -sudo add-apt-repository -y ppa:regolith-linux/stable -sudo apt install i3-gaps +paru -S i3-gaps #+end_src ** Configuration @@ -594,14 +588,7 @@ https://polybar.github.io/ ** Installation #+begin_src bash -cd ~/.local/soft -git clone https://github.com/jaagr/polybar.git -cd polybar -# Install necessary -sudo apt install build-essential git cmake cmake-data pkg-config python3-sphinx python3-packaging libuv1-dev libcairo2-dev libxcb1-dev libxcb-util0-dev libxcb-randr0-dev libxcb-composite0-dev python3-xcbgen xcb-proto libxcb-image0-dev libxcb-ewmh-dev libxcb-icccm4-dev -# Install optional -sudo apt install libxcb-xkb-dev libxcb-xrm-dev libxcb-cursor-dev libasound2-dev libpulse-dev i3-wm libjsoncpp-dev libmpdclient-dev libcurl4-openssl-dev libnl-genl-3-dev -./build.sh +paru -S polybar #+end_src * =picom= - Compositor @@ -611,7 +598,7 @@ https://wiki.archlinux.org/index.php/Picom ** Installation #+begin_src bash -sudo apt install picom +paru -S picom #+end_src ** Configuration @@ -629,7 +616,7 @@ https://wiki.archlinux.org/index.php/Dunst ** Installation #+begin_src bash -sudo apt install dunst notify-send +paru -S dunst #+end_src ** Configuration @@ -637,28 +624,97 @@ sudo apt install dunst notify-send ** Usage #+begin_src bash - notify-send "AppName" "Message" +dunstify --replace=16549 "AppName" "Message" #+end_src The number =--replace= can be used with an ID to merge notifications from the same application for instance. +* Office Suite +** =libreoffice= +#+begin_src bash +paru -S libreoffice-fresh libreoffice-fresh-fr +#+end_src + +** only-office +#+begin_src bash +paru -S onlyoffice-bin +#+end_src + +* =blueman= - Bluetooth Manager +Bluetooth manager: https://github.com/blueman-project/blueman + +#+begin_src bash +paru -S blueman +#+end_src + +* =udiskie= - Automatically Mount devices +udiskie - Mount and unmount disks (https://github.com/coldfix/udiskie) + +#+begin_src bash +paru -S udiskie +#+end_src + +Automatically run =udiskie= on startup. + * LaTeX Installation #+begin_src bash -sudo apt install texlive-full +paru -S texlive-most tllocalmgr-git +#+end_src + +Biber support for the bibliography: +#+begin_src bash +paru -S biber +#+end_src + +Support for source code using minted: +#+begin_src bash +paru -S minted #+end_src Every custom class or packages can be put under =~/.local/share/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. +* Matrix - Gomuks +#+begin_src bash +paru -S gomuks +#+end_src + +* Syncthing +#+begin_src bash +paru -S syncthing +#+end_src + +#+begin_src bash +systemctl --user enable --now syncthing +#+end_src + +* Gotify +#+begin_src bash +paru -S gotify-dunst-git +#+end_src + +* Custom Systemd Services +Tangle everything in the [[file:systemd.org][Systemd]] config file. + +Then enable and start all the services: +#+begin_src bash +systemctl --user enable --now homelab-tunnel +systemctl --user enable --now esrf-tunnel +systemctl --user enable --now syncthing +systemctl --user enable --now vdirsyncer.timer +systemctl --user enable --now syncmail.timer +systemctl --user enable --now checkmail.timer +#+end_src + * Mathematical Software ** Insect https://github.com/sharkdp/insect Installation #+begin_src bash - sudo apt install insect + paru -S insect #+end_src | Command | Usage | @@ -666,30 +722,52 @@ Installation | =3 m/s to km/h= | Convert Unit | ** Matlab -https://wiki.archlinux.org/index.php/MATLAB#Installation - [[file:matlab.org][Link]] to the configuration. -Installation -#+begin_src bash - sudo apt install matlab -#+end_src +Download Matlab here: https://fr.mathworks.com/downloads/ +Unzip, and run =./install=. +Then, choose the install directory to be =~/.local/soft/Matlab/R2019b=. -If there is a problem when opening a Simulink file, check the solution [[https://fr.mathworks.com/matlabcentral/answers/361053-can-t-reload-usr-local-matlab-r2017b-bin-glnxa64-libmwdastudio-so][here]]. +If there is a problem when opening a Simulink file, check the solution [[https://fr.mathworks.com/matlabcentral/answers/361053-can-t-reload-usr-local-matlab-r2017b-bin-glnxa64-libmwdastudio-so][here]] or [[https://bbs.archlinux.org/viewtopic.php?id=231299][here]]. -** SageMath -http://www.sagemath.org/ -https://wiki.archlinux.org/index.php/SageMath +Also, there might be a problem with displaying multi-body models. +In such case type =opengl('save', 'software')= (see [[https://fr.mathworks.com/matlabcentral/answers/342906-could-not-initialize-shared-resources-for-x11graphicsdevice][here]]). -Installation -#+begin_src bash - sudo apt install sagemath -#+end_src - -Run =sage -n jupyter= to run jupyter notebooks +To install a new package, run =./install= in =~/.local/soft/Matlab_Install=. ** Python and Jupyter-notebook +#+begin_src bash +paru -S python ipython python-pip +#+end_src + +* Download Manager +** =stig= +#+begin_src bash +paru -S stig +#+end_src + +** =youtube-dl= +#+begin_src bash +paru -S youtube-dl +#+end_src + +* Default Applications +https://wiki.archlinux.org/index.php/Default_applications +https://www.guyrutenberg.com/2018/01/20/set-default-application-using-xdg-mime/ + +=~/.config/mimeapps.list= + +#+begin_src bash +xdg-mime default qutebrowser.desktop x-scheme-handler/http +xdg-mime default qutebrowser.desktop x-scheme-handler/https +#+end_src + +* Desktop files +[[file:applications.org][Desktop Applications]] + +=~/.local/share/applications/= + * Calendar [[file:calendar-contact.org][Link]] to configuration @@ -698,22 +776,13 @@ https://github.com/pimutils/vdirsyncer Installation: #+begin_src bash -sudo apt install vdirsyncer python-requests-oauthlib-doc -#+end_src - -#+begin_src bash -sudo pip install requests-oauthlib +paru -S vdirsyncer #+end_src | Command | Usage | |-------------------+-------------| | =vdirsyncer sync= | Synchronize | -Setup the =google_calendar=: -#+begin_src bash -vdirsyncer discover radicale_calendar -#+end_src - And start the =systemd= timer that automatically synchronize the calendars; #+begin_src bash systemctl --user enable --now vdirsyncer.timer @@ -729,7 +798,7 @@ https://github.com/pimutils/khal Installation: #+begin_src bash -sudo apt install khal +paru -S khal #+end_src Import ICS files: @@ -741,14 +810,16 @@ khal import even.ics https://pwmt.org/projects/zathura/ ** Installation #+begin_src bash -sudo apt install zathura +paru -S zathura #+end_src Then add dependecies to view specific files: #+begin_src bash -sudo apt install zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb +paru -S zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb #+end_src +It seems that mupdf is better that poppler to view pdf. + ** Configuration =~/.config/zathura/zathurarc= @@ -780,12 +851,12 @@ pdfpc is a great tool for showing pdf presentations. It support: *** Installation #+begin_src bash - sudo apt install pdfpc + paru -S pdfpc #+end_src *** Video support #+begin_src bash - sudo apt install gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav + paru -S gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav #+end_src *** Usage @@ -793,58 +864,90 @@ pdfpc is a great tool for showing pdf presentations. It support: pdfpc filename.pdf #+end_src -* Display Manager -Before, I was using =lightDM=, but a single tty is enough. +* =gtk=/=qt= - 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=. -However, to make tools like Anydesk or Teamviewer to work: -Add "type=x11" in =/etc/pam.d/system-login=: -#+begin_src conf - -session optional pam_systemd.so type=x11 +*** Gui Manager + +To customize the look of the system using GUI application, run ~lxappearance~. + +Installation: +#+begin_src bash +paru -S lxappearance #+end_src -- When executing =loginctl session-status | grep Service= X11 should appear as initialized. -- =echo $XDG_SESSION_TYPE= should show =x11= instead of =tty= now +*** Icons and themes +#+begin_src bash +paru -S zukitwo-themes faenza-icon-theme +#+end_src + +#+begin_src bash +paru -S arc-gtk-theme +#+end_src + +** QT Themes +Run ~qt5ct~ to manage QT Themes. * =inkscape= - Graphical Editor - https://inkscape.org/ - Tikz #+begin_src bash -sudo add-apt-repository ppa:inkscape.dev/stable -sudo apt update -sudo apt install inkscape +paru -S inkscape #+end_src -* TODO =wireguard= - VPN +* Docker #+begin_src bash -sudo apt install wireguard-tools +paru -S docker docker-compose #+end_src +Add current user to =docker= group: +#+begin_src bash +sudo gpasswd -a thomas docker +#+end_src + +* =wireguard= - VPN +#+begin_src bash +paru -S wireguard-tools +#+end_src + +* =nordvpn= - VPN +https://aur.archlinux.org/packages/nordvpn-bin/ +https://wiki.archlinux.org/index.php/NordVPN + +#+begin_src bash +sudo groupadd -r nordvpn +sudo gpasswd -a $USER nordvpn +#+end_src + +Installation: +#+begin_src bash +paru -S nordvpn-bin +#+end_src + +Configuration: +#+begin_src bash +sudo systemctl enable --now nordvpnd.service +#+end_src + +| Command | Usage | +|---------------------------+-------| +| =nordvpn login= | | +| =nordvpn connect country= | | +| =nordvpn disconnect= | | +| =nordvpn status= | | +| =nordvpn countries= | | + * Others -** Things to install +** Useful utils #+begin_src bash -sudo apt install xwallpaper mpc mpv maim -sudo apt install freerdp2-x11 xsel xclip xdotool -sudo apt install unclutter xautolock redshift -sudo apt install atool unrar p7zip +paru -S sshfs poppler mpd xwallpaper sof-firmware usbutils xautolock atool unzip xsel man-db npm highlight-pointer-git xorg-xkill #+end_src -Diff so fancy +** ESRF related #+begin_src bash -sudo add-apt-repository ppa:aos1/diff-so-fancy -sudo apt-get update -sudo apt install diff-so-fancy -#+end_src - -#+begin_src bash -cd ~/.local/bin -wget https://raw.githubusercontent.com/carnager/rofi-pass/master/rofi-pass -chmod +x rofi-pass -#+end_src - -For image preview in =ranger=: -#+begin_src bash -sudo pip3 install ueberzug +paru -S zoom #+end_src ** =maim=/=flameshot= - Take Screenshots @@ -852,13 +955,24 @@ sudo pip3 install ueberzug - https://github.com/lupoDharkael/flameshot #+begin_src bash -sudo apt install maim flameshot +paru -S maim flameshot +#+end_src + +** =screenkey= - Show pressed keys +#+begin_src bash +paru -S screenkey +#+end_src + +** =croc= - File transfer +https://github.com/schollz/croc + +#+begin_src bash +paru -S croc #+end_src ** Find Files - #+begin_src bash -sudo apt install fd-find ripgrep fzf +paru -S fd ripgrep fzf #+end_src ** PDF/Image Utilities @@ -867,7 +981,7 @@ sudo apt install fd-find ripgrep fzf - https://github.com/Airblader/unclutter-xfixes #+begin_src bash -sudo apt install pdf2svg pdftk unclutter pdfarranger imagemagick +paru -S pdf2svg pdftk unclutter pdfarranger imagemagick #+end_src ** Trash @@ -875,7 +989,14 @@ sudo apt install pdf2svg pdftk unclutter pdfarranger imagemagick It is integrated with =ranger= and =pcmanFM=. #+begin_src bash -sudo apt install trash-cli +paru -S trash-cli +#+end_src + +** Show information about the machine +[[https://github.com/dylanaraps/neofetch][neofetch]] + +#+begin_src bash +paru -S neofetch #+end_src ** Nice other programs @@ -883,43 +1004,237 @@ sudo apt install trash-cli - Gnu Make alternative https://github.com/taskctl/taskctl * Printer +** CUPS https://wiki.archlinux.org/index.php/CUPS -Web based administration: http://localhost:631/ -To install the ESRF printer: #+begin_src bash -lpadmin -p ctb127c1u -v ipp://cups.esrf.fr/printers/ctb127c1u -E +paru -S cups #+end_src +Web based administration: http://localhost:631/ + =system-config-printer= Check the queue #+begin_src bash - lpq - lpq -a # on all queues +lpq +lpq -a # on all queues #+end_src Clear the queue #+begin_src bash - lprm # remove last entry only - lprm - # remove all entries +lprm # remove last entry only +lprm - # remove all entries #+end_src Print a file #+begin_src bash - lpr -P printer_name filename.pdf +lpr -P printer_name filename.pdf #+end_src List available printers #+begin_src bash - lpstat -a +lpstat -a #+end_src Stats about the printer #+begin_src bash - lpstat -p printer_name +lpstat -p printer_name #+end_src +** Network Lexmark +#+begin_src matlab +paru -S sane simple-scan lexmark-network-scan +#+end_src + +* Kernel Management +https://wiki.manjaro.org/index.php/Manjaro_Kernels + +| Command | Usage | +|------------------------------------+---------------------------------------| +| =mhwd-kernel -li= | Determine which kernel is used | +| =sudo mhwd-kernel -i linux419= | Install new kernel | +| =sudo mhwd-kernel -i linux419 rmc= | Install new kernel and remove old one | + +* Format disks +https://gparted.org/ + +=sudo gparted= to format disks + +Using command line: +- https://www.digitalocean.com/community/tutorials/how-to-partition-and-format-storage-devices-in-linux + +* Theme +#+begin_src bash +paru -S arc-gtk-theme +paru -S xcursor-breeze +#+end_src + +* Useful commands +** Readline +https://wiki.archlinux.org/index.php/Keyboard_shortcuts + +| Keyboard | Shortcut Description | +|----------+----------------------| +| Ctrl+l | Clear the screen | + +*** Cursor Movement +| Keyboard | Shortcut Description | +|----------+----------------------------------------| +| =Ctrl+b= | Move cursor one character to the left | +| =Ctrl+f= | Move cursor one character to the right | +| =Alt+b= | Move cursor one word to the left | +| =Alt+f= | Move cursor one word to the right | +| =Ctrl+a= | Move cursor to start of the line | +| =Ctrl+e= | Move cursor to end of the line | + +*** Copy & Paste +| Keyboard | Shortcut Description | +|--------------+---------------------------------------------------| +| =Ctrl+u= | Cut everything from line start to cursor | +| =Ctrl+k= | Cut everything from the cursor to end of the line | +| =Alt+d= | Cut the current word after the cursor | +| =Ctrl+w= | Cut the current word before the cursor | +| =Ctrl+y= | Paste the previous cut text | +| =Alt+y= | Paste the second latest cut text | +| =Alt+Ctrl+y= | Paste the first argument of the previous command | +| =Alt+./= | Paste the last argument of the previous command | + +*** History +| Keyboard | Shortcut Description | +|----------+---------------------------------------| +| =Ctrl+p= | Move to the previous line | +| =Ctrl+n= | Move to the next line | +| =Ctrl+s= | Search | +| =Ctrl+r= | Reverse search | +| =Ctrl+j= | End search | +| =Ctrl+g= | Abort search (restores original line) | +| =Alt+r= | Restores all changes made to line | + +*** Completion +| Keyboard | Shortcut Description | +|----------+---------------------------------| +| =Tab= | Auto-complete a name | +| =Alt+?= | List all possible completions | +| =Alt+*= | Insert all possible completions | + +** Others +| [[https://github.com/tldr-pages/tldr][tldr]] | Community-driven man pages | +| [[https://github.com/chubin/wttr.in][wttr.in]] | weather in terminal | +| [[https://github.com/michael-lazar/rtv][rtv]] | Reddit in terminal | +| awk | https://linuxhandbook.com/awk-command-tutorial/ | +| [[https://github.com/rupa/z][z]] | Jump around | +| [[https://github.com/nvbn/thefuck][thefuck]] | Magnificent app which corrects your previous console command | +| [[https://github.com/amanusk/s-tui/][s-tui]] | Terminal based CPU stress and monitoring utility | +| [[https://github.com/nicolargo/glances][glances]] | A top/htop alternative | +| [[https://github.com/asciinema/asciinema][asciinema]] | Reccord you terminal | +| [[https://dev.yorhel.nl/ncdu][ncdu]] | See what takes place on the disk | +| [[https://github.com/sharkdp/bat][bat]] | cat alternative | +| [[https://github.com/dalance/procs][procs]] | ps alternative | +| [[https://github.com/chmln/sd][sd]] | sed alternative | + + +| =meteo= | Get the meteo | +| =sudo cputhrottle PID %PROC= | Limiter l'accès au proc pour un processus | +| =nmap -sP “192.168.1.*"= | Check all ip addresses on local netword | +| =du -sh folder= | Return the size of the folder | +| =df -h= | Report disk usage | + +** Archive and Extract +Use =apack= and =aunpack=: +| | | +|-------------------------------+-----------------------------------| +| =aunpack foobar.tar.gz= | extract all files from archive | +| =apack myarchive.zip foo bar= | create a zip archive of two files | + +** Hardware +| =dmesg= | Detected hardware and boot messages | +| =lshw= | Display information on hardware | +| =lsusb -tv= | Show usb devices | + +** Network +| =ip addr show= | Show all network interfaces and ip address | +| =ethtooo eth0= | Tool to show ethernet status | +| =netstat -tulp= | List all active listening ports | + +* After Install +Enable TRIM (SSD only) +#+begin_src bash +sudo systemctl enable --now fstrim.timer +#+end_src + +Set the fastest mirror for Pacman +#+begin_src bash +sudo pacman-mirrors --fasttrack +#+end_src + +* Configuration for Laptops +** Power Management Tool: Powertop +https://wiki.archlinux.org/index.php/Powertop +https://wiki.manjaro.org/index.php?title=Power_Savings + +=PowerTop= a diagnostic tool used to identify and report issues with power consumption and management. +#+begin_src bash +paru -S powertop +#+end_src + + +=TLP= is used for Power Management. +#+begin_src bash +paru -S tlp +sudo systemctl enable tlp +sudo systemctl start tlp +sudo systemctl enable tlp-sleep +sudo systemctl start tlp-sleep +sudo tlp start +#+end_src + +=Thermald= is used to automatically handle CPU frequency scaling according to system load. +#+begin_src bash +paru -S thermald +sudo systemctl enable thermald +sudo systemctl start thermald +#+end_src + +** Lid open/close +https://wiki.archlinux.org/index.php/Power_management + +Should automatic show lock screen + +=/etc/systemd/logind.conf= + +* Some notes - Systemd +To improve the startup time. + +#+begin_src bash +sudo systemctl disable apparmor +sudo systemctl disable snapd +sudo systemctl disable systemd-backlight@backlight\:intel_backlight.service +#+end_src + +To see next timers +#+begin_src bash +systemctl --user list-timers +#+end_src + +* Resources +** Dotfiles +- https://github.com/LukeSmithxyz/voidrice +- https://github.com/wincent/wincent +- https://github.com/korolr/dotfiles +- https://github.com/Shougo/shougo-s-github +- https://github.com/addy-dclxvi/almighty-dotfiles + +** Linux Softwares +- [[https://github.com/k4m4/terminals-are-sexy][terminalare.sexy]] +- [[https://www.reddit.com/r/vim/comments/3tluqr/my_list_of_applications_with_vi_keybindings/][the big list of vim like software]] +- https://github.com/jlevy/the-art-of-command-line +- https://github.com/herrbischoff/awesome-command-line-apps +- https://github.com/luongvo209/Awesome-Linux-Software +- https://wiki.archlinux.org/index.php/List_of_applications +- https://ambrevar.xyz/power-apps/ +- https://enchiridion.red/2019/1/18/desktop-apps/ + * List of all the install programs ** Mutt | =neomutt= | Teaching an Old Dog New Tricks | @@ -935,6 +1250,14 @@ Stats about the printer | =ripmime= | Extract attachments out of MIME encoded email packages | | =shared= | mime-info - Database of common MIME types | +** Micro controllers +| =avrdude= | Atmel AVR MCU programmer | +| =bootloadhid= | USB boot loader for AVR microcontrollers | +| =dfu= | programmer - Device firmware update based USB programmer for Atmel chips | +| =platformio= | Ecosystem for IoT development (Arduino and ARM mbed compatible) | +| =micropython= | Python implementation for microcontrollers and constrained systems | +| =arduino= | mk - Makefile for Arduino sketches | + ** File Management | =grep= | GNU grep, egrep and fgrep | | =pdfgrep= | Search PDFs for strings matching a regular expression | @@ -961,6 +1284,8 @@ Stats about the printer | =gnome= | doc-utils - Documentation utilities for the GNOME project | | =moreutils= | Collection of tools that nobody wrote when UNIX was young | +https://gitlab.com/bztsrc/usbimager + ** A trier | =asciinema= | Terminal session recorder | | =automake= | tool for automatically generating Makefile | diff --git a/mail.org b/mail.org index a7dfcaf..c09597a 100644 --- a/mail.org +++ b/mail.org @@ -3,12 +3,12 @@ Installation: #+begin_src bash :tangle no -sudo apt install mbsync msmtp maildir-utils neomutt lynx +paru -S mbsync msmtp neomutt lynx urlview #+end_src * =mbsync= - Synchronize Mailboxes :PROPERTIES: -:header-args:conf: :tangle ~/.mbsyncrc +:header-args:conf: :tangle ~/.config/isync/mbsyncrc :header-args:conf+: :comments both :mkdirp yes :CUSTOM_ID: mbsync :END: @@ -40,8 +40,8 @@ IMAPStore gmail-remote Account gmail MaildirStore gmail-local -Path ~/.mail/gmail/ -Inbox ~/.mail/gmail/Inbox +Path ~/.local/share/mails/gmail/ +Inbox ~/.local/share/mails/gmail/Inbox Channel gmail-Home Far :gmail-remote:INBOX @@ -106,8 +106,8 @@ IMAPStore esrf-remote Account esrf MaildirStore esrf-local -Path ~/.mail/esrf/ -Inbox ~/.mail/esrf/Inbox +Path ~/.local/share/mails/esrf/ +Inbox ~/.local/share/mails/esrf/Inbox Channel esrf-Home Far :esrf-remote:INBOX @@ -171,8 +171,8 @@ protocol smtp from dehaeze.thomas@gmail.com user dehaeze.thomas@gmail.com passwordeval "pass email/dehaeze.thomas@gmail.com" -proxy_host localhost -proxy_port 8080 +# proxy_host localhost +# proxy_port 8080 #+END_SRC ** ESRF Account @@ -589,7 +589,6 @@ Write/Reply/Forward mail #+BEGIN_SRC conf bind index,pager p recall-message bind index,pager m mail -bind index,pager M resend-message bind index,pager r reply bind index,pager R group-reply bind index,pager b bounce-message @@ -603,6 +602,7 @@ bind index,pager s sync-mailbox Sync email #+BEGIN_SRC conf +macro index,pager e "$HOME/.config/neomutt/bin/get_new_esrf_mail.sh" macro index,pager o "$HOME/.config/neomutt/bin/get_new_mail.sh" macro index,pager O "$HOME/.config/neomutt/bin/get_new_mail.sh -a" #+END_SRC @@ -646,7 +646,7 @@ bind attach q exit bind attach view-mailcap -macro attach W ~/Downloads/y "Save entry" +macro attach W $HOME/Downloads/y "Save entry" #+end_src *** Compose @@ -684,7 +684,7 @@ tmpfile=/tmp/rangerpick if [ -z "$1" ]; then ranger --choosefiles $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile elif [ $1 == "dragon" ]; then - dragon --target --print-path --keep > $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile + dragon-drop --target --print-path --keep > $tmpfile && sed -i 's/\s/\\ /g' $tmpfile && echo "$(awk 'BEGIN {printf "%s", "push "} {printf "%s", ""$0""}' $tmpfile)" > $tmpfile elif [ $1 == "clean" ]; then ls $tmpfile fi @@ -721,7 +721,7 @@ bind index,pager \Ch sidebar-toggle-visible *** Reload Configuration #+begin_src conf -macro generic,index,pager,editor , ":source ~/.config/neomutt/neomuttrc\n" "Reload mutt's configuration file" +macro generic,index,pager,editor , ":source $HOME/.config/neomutt/neomuttrc\n" "Reload mutt's configuration file" #+end_src *** urlview - Open URL in emails @@ -738,11 +738,11 @@ macro attach,compose,index,pager \cw "\ *** Searching using Mu #+begin_src conf -macro index,pager \Cf "$HOME/.config/neomutt/bin/search_mail.sh~/.mail/search" \ +macro index,pager \Cf "$HOME/.config/neomutt/bin/search_mail.sh$HOME/.local/share/mails/search" \ "test" -# macro index,pager \Cf "mu find --clearlinks --format=links --linksdir=~/.mail/search " \ +# macro index,pager \Cf "mu find --clearlinks --format=links --linksdir=$HOME/.local/share/mails/search " \ # "mu find" -macro index,pager gf "~/.mail/search" \ +macro index,pager gf "$HOME/.local/share/mails/search" \ "mu find results" #+end_src @@ -782,7 +782,7 @@ message_to = message['to'] # Ask emacsclient to save a link to the message subprocess.Popen([ 'emacsclient', - f'org-protocol://capture?template=ps&url={message_id}&title={subject}&body={message_to}' + f'org-protocol://capture?template=pm&url={message_id}&title={subject}&body={message_to}' ]) #+end_src @@ -853,13 +853,13 @@ bind editor complete-query ** Paths #+BEGIN_SRC conf -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 +set folder = $HOME/.local/share/mails # mail location +set alias_file = $HOME/.config/neomutt/alias # where to store aliases +set header_cache = $HOME/.config/neomutt/cache/headers # where to store headers +set message_cachedir = $HOME/.config/neomutt/cache/bodies # where to store bodies +set certificate_file = $HOME/.config/neomutt/certificates # where to store certs +set mailcap_path = $HOME/.config/neomutt/mailcap # entries for filetypes +set tmpdir = $HOME/.config/neomutt/temp # where to keep temp files #+END_SRC ** Print @@ -875,8 +875,8 @@ set spoolfile = "+esrf/Inbox" # Default inbox set realname = "Dehaeze Thomas" set from = "thomas.dehaeze@esrf.fr" -folder-hook gmail/* source ~/.config/neomutt/accounts/gmail -folder-hook esrf/* source ~/.config/neomutt/accounts/esrf +folder-hook gmail/* source $HOME/.config/neomutt/accounts/gmail +folder-hook esrf/* source $HOME/.config/neomutt/accounts/esrf macro index,pager ge "+esrf/Inbox" "go to inbox" macro index,pager gm "+gmail/Inbox" "go to inbox" @@ -886,7 +886,7 @@ macro index,pager gm "+gmail/Inbox" "go to inbox" **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/gmail :comments none set from = "dehaeze.thomas@gmail.com" -set sendmail = "~/.config/neomutt/bin/send_mail.sh gmail" +set sendmail = "$HOME/.config/neomutt/bin/send_mail.sh gmail" # Other special folders. set mbox = "+gmail/Archive" # Archive Box @@ -894,7 +894,7 @@ set postponed = "+gmail/Drafts" unset record # Don't copy send message to Sent folder: Gmail does that for us -set signature = "~/.config/neomutt/accounts/gmail.signature" +set signature = "$HOME/.config/neomutt/accounts/gmail.signature" macro index,pager d \ "+gmail/Archive" \ @@ -917,14 +917,14 @@ This empty code block is used to add a new line after signature **** Configuration #+begin_src conf :tangle ~/.config/neomutt/accounts/esrf :comments none set from = "thomas.dehaeze@esrf.fr" -set sendmail = "~/.config/neomutt/bin/send_mail.sh esrf" +set sendmail = "$HOME/.config/neomutt/bin/send_mail.sh esrf" # Other special folders. set mbox = "+esrf/Archive" set record = "+esrf/Sent" set postponed = "+esrf/Drafts" -set signature = "~/.config/neomutt/accounts/esrf.signature" +set signature = "$HOME/.config/neomutt/accounts/esrf.signature" macro index,pager d \ "+esrf/Archive" \ @@ -1091,22 +1091,23 @@ set sidebar_format = '%D %* %?N?[%N]?' # path - mailbox path # unsorted - do not sort the mailboxes set sidebar_sort_method = 'unsorted' +set sort_browser = 'unsorted' #+END_SRC *** Mailboxes to show in the sidebar. #+BEGIN_SRC conf -named-mailboxes "  Search" =search +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 "  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 "  Archive" =esrf/Archive named-mailboxes "  Trash" =esrf/Trash #+END_SRC @@ -1145,16 +1146,16 @@ set abort_noattach_regex = "\\<(attach(|ed|ments?)|(attaché|attachés|attache|a *** Search Mail #+begin_src bash :tangle ~/.config/neomutt/bin/search_mail.sh -arg_subject=$(rofi -p "Search" -dmenu) +arg_subject=$(rofi -p "Contains" -dmenu) arg_from=$(rofi -p "From" -dmenu) if [ ! -z "$arg_from" ]; then - arg_from="from:${arg_from}" + arg_from="from:/.*${arg_from}.*/" fi arg_to=$(rofi -p "To" -dmenu) if [ ! -z "$arg_to" ]; then - arg_to="to:${arg_to}" + arg_to="to:/.*${arg_to}.*/" fi arg_mime=$(echo -e "\napplication/pdf\nimage/*\nvideo/*" | rofi -i -p "Mime" -dmenu) @@ -1162,16 +1163,16 @@ if [ ! -z "$arg_mime" ]; then arg_mime="mime:${arg_mime}" fi -mu find --clearlinks --format=links --linksdir=~/.mail/search "${arg_from} ${arg_to} ${arg_mime} ${arg_subject}" +mu find --clearlinks --format=links --linksdir=$HOME/.local/share/mails/search "${arg_from} ${arg_to} ${arg_mime} ${arg_subject}" #+end_src -*** Send Mail Script +*** Sync "Send Mail" Script #+begin_src bash :tangle ~/.config/neomutt/bin/send_mail.sh msmtp -a $1 ${@:2} && \ if [ $TMUX ]; then - tmux split -v -l 1 mbsync $1-Sent && tmux select-pane -U + tmux split -v -l 1 mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent && tmux select-pane -U else - mbsync $1-Sent + mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc $1-Sent fi #+end_src @@ -1184,6 +1185,15 @@ else fi #+end_src +*** Sync ESRF Mail Script +#+begin_src bash :tangle ~/.config/neomutt/bin/get_new_esrf_mail.sh +if [ $TMUX ]; then + tmux split -v -l 1 mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf && tmux select-pane -U +else + mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc esrf +fi +#+end_src + *** Openfile Scripts #+begin_src bash :tangle ~/.config/neomutt/bin/openfile.sh base=$(basename "$1") diff --git a/matlab.org b/matlab.org index 88e0020..0eee65d 100644 --- a/matlab.org +++ b/matlab.org @@ -7,7 +7,7 @@ * Startup :PROPERTIES: -:HEADER-ARGS:matlab+: :tangle ~/Documents/MATLAB/startup.m +:HEADER-ARGS:matlab+: :tangle ~/.config/matlab/startup.m :END: ** Setup LaTeX as a default interpreter @@ -16,7 +16,6 @@ set(groot, 'DefaultTextInterpreter', 'LaTeX'); set(groot, 'DefaultAxesTickLabelInterpreter', 'LaTeX'); set(groot, 'DefaultAxesFontName', 'LaTeX'); set(groot, 'DefaultLegendInterpreter', 'LaTeX'); -set(groot, 'DefaultConstantLineInterpreter', 'LaTeX'); #+end_src ** Default Line Width @@ -39,14 +38,12 @@ set(groot, 'DefaultTextFontSize', 10); set(groot, 'DefaultAxesFontUnits', 'points'); set(groot, 'DefaultAxesFontSize', 10); set(groot, 'DefaultUicontrolFontSize', 10); -set(groot, 'DefaultConstantLineFontSize', 10); #+end_src ** Default Fonts #+begin_src matlab set(groot, 'DefaultAxesFontName', 'Helvetica'); set(groot, 'DefaultTextFontName', 'Helvetica'); -set(groot, 'DefaultConstantLineFontName', 'Helvetica'); #+end_src ** Make figures into a Box @@ -88,6 +85,13 @@ format compact; format long g; #+end_src +** Change TMPDIR to deal with Archlinux issue +See https://fr.mathworks.com/matlabcentral/answers/1798895-invalid-cross-device-link-18-when-saving-a-file-on-arch-linux?s_tid=srchtitle + +#+begin_src matlab +setenv('TMPDIR', '/home/thomas/.cache') +#+end_src + ** Home Path #+begin_src matlab toolboxes_path = '~/Cloud/programming/matlab/'; @@ -161,7 +165,7 @@ clear; * Setup :PROPERTIES: -:HEADER-ARGS:matlab+: :tangle ~/Documents/MATLAB/setup.m +:HEADER-ARGS:matlab+: :tangle ~/.config/matlab/setup.m :END: This script should be run once after Matlab is installed. diff --git a/music.org b/music.org index a77c540..51e8016 100644 --- a/music.org +++ b/music.org @@ -33,7 +33,7 @@ hostname = 127.0.0.1 port = 6600 password = max_connections = 20 -connection_timeout = 60 +connection_timeout = 30 zeroconf = Mopidy MPD server on $hostname command_blacklist = listall,listallinfo default_playlist_scheme = m3u @@ -48,7 +48,7 @@ album_format = {ProductionYear} - {Name} max_bitrate = 10000 [file] -enabled = true +enabled = false media_dirs = /home/thomas/Music excluded_file_extensions = .db @@ -81,6 +81,7 @@ Cheatsheet: https://pkgbuild.com/~jelle/ncmpcpp/ Configuration directory. #+begin_src conf ncmpcpp_directory = ~/.config/ncmpcpp +lyrics_directory = ~/.local/share/lyrics #+end_src MPD Configuration. @@ -92,7 +93,7 @@ mpd_music_dir = ~/Music Notification of song change. #+begin_src conf -execute_on_song_change = notify-send --hint=string:x-dunst-stack-tag:Z7uCd3ZP "Now Playing ♫" "$(mpc current)" +execute_on_song_change = dunstify --replace=19845 "Now Playing ♫" "$(mpc current)" #+end_src Better user interface @@ -104,6 +105,11 @@ browser_display_mode = "columns" playlist_display_mode = "columns" #+end_src +Lyrics +#+begin_src conf +lyrics_fetchers = musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet +#+end_src + Sorting by tracking number and then title #+begin_src conf browser_sort_mode = "format" @@ -160,51 +166,3 @@ def_key "-" #+end_src -* =beets= - Media library management -:PROPERTIES: -:header-args:conf: :tangle ~/.config/beets/config.yaml -:header-args:conf+: :comments both :mkdirp yes -:CUSTOM_ID: beets -:END: -http://beets.io/ - -#+begin_src conf -directory: ~/Music -library: ~/Music/musiclibrary.db -art_filename: cover - -import: - move: yes - -plugins: fromfilename discogs -#+end_src - -* =curseradio= - Radio with curseradio -:PROPERTIES: -:header-args:conf: :tangle ~/.config/curseradio/curseradio.cfg -:header-args:conf+: :comments none :mkdirp yes -:CUSTOM_ID: curseradio -:END: - -#+begin_src conf -[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 -#+end_src diff --git a/newsboat.org b/newsboat.org deleted file mode 100644 index 68562a6..0000000 --- a/newsboat.org +++ /dev/null @@ -1,498 +0,0 @@ -#+TITLE: Newsboat Configuration -#+SETUPFILE: ./setup/org-setup-file.org - -https://wiki.archlinux.org/index.php/Newsboat -https://newsboat.org/releases/2.12/docs/newsboat.html - -* Config -:PROPERTIES: -:header-args: :tangle ~/.config/newsboat/config -:header-args+: :comments both :mkdirp yes -:END: - -** Reload configuration -#+BEGIN_SRC conf -# All feeds will be automatically reloaded after a certain time has passed -auto-reload yes - -# The number of minutes between automatic reloads. -reload-time 120 - -# 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 -#+END_SRC - -** Basic configuration -#+BEGIN_SRC conf -confirm-exit no - -external-url-viewer "urlscan -dc -r 'linkhandler {}'" - -goto-first-unread no -goto-next-feed no - -save-path "~/Documents/newsboat/saved" -download-path "~/Documents/newsboat/downloaded" - -# If set to no, then the keymap hints on the bottom of screen will not be displayed. -show-keymap-hint no - -player "mpv" -#+END_SRC - -** Queries -#+begin_src conf -prepopulate-query-feeds yes -#+end_src - -** Filters -#+begin_src conf :tangle no -define-filter "Unread Articles" "unread = \"yes\"" -#+end_src - -** Notifications -#+BEGIN_SRC conf -notify-format "%n unread articles" -notify-program ~/.config/newsboat/scripts/newsboat-notify.sh -notify-always no -#+END_SRC - -*** Notification Script -:PROPERTIES: -:header-args: :tangle ~/.config/newsboat/scripts/newsboat-notify.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" -:END: - -#+begin_src bash -notify-send "Newsboat " "$1" -#+end_src - -** Bindings -#+BEGIN_SRC conf -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 q toggle-show-read-feeds -bind-key Q quit - -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 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 -#+END_SRC - -** Bookmarking -#+begin_src conf -bookmark-autopilot no -bookmark-cmd "~/.config/newsboat/scripts/buku-add.sh" -bookmark-interactive no -#+end_src - -*** Buku Scripts -:PROPERTIES: -:header-args: :tangle ~/.config/newsboat/scripts/buku-add.sh -:header-args+: :comments both :mkdirp yes -:header-args+: :shebang "#!/usr/bin/env bash" -:END: - -#+begin_src bash -buku --add "$1" --title "$2" --comment "$3" && \ - notify-send "Buku" "Bookmark Added" && \ - exit 0 -#+end_src - -** Macros - Starts with , key -#+BEGIN_SRC conf -# Default Browser -browser linkhandler - -# Open in Browser -macro , open-in-browser - -# Download Video with Youtube-DL -macro v set browser "cd ~/Documents/to-watch && ~/.local/bin/yt-video %u" ; open-in-browser ; set browser linkhandler - -# Download Audio with Youtube-DL -macro a set browser "cd ~/Documents/to-watch && ~/.local/bin/yt-audio %u" ; open-in-browser ; set browser linkhandler - -# Open Video with MPV -macro m set browser "setsid nohup mpv %u &> /dev/null &" ; open-in-browser ; set browser linkhandler - -# Open With W3M -macro w set browser "w3m %u" ; open-in-browser ; set browser linkhandler - -# Copy Address to clipboard -macro c set browser "xsel -b <<<" ; open-in-browser ; set browser linkhandler - -# Quit -macro q set browser "tmux detach" ; open-in-browser ; set browser linkhandler -#+END_SRC - -** hide articles matching -#+BEGIN_SRC conf :tangle no -ignore-article "*" "title =~ \"Sponsor\"" -ignore-article "*" "title =~ \"Advertisement\"" -ignore-mode "display" -#+END_SRC - -** Feedlist and Article Format -#+BEGIN_SRC conf -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'" -#+END_SRC - -** Color Scheme -#+BEGIN_SRC conf -include "~/.config/newsboat/colors" -#+END_SRC - -* Colors -:PROPERTIES: -:header-args: :tangle ~/.config/newsboat/colors -:header-args+: :comments both :mkdirp yes -:END: - -#+BEGIN_SRC conf -color background default default -color listnormal default default -color listnormal_unread default default -color listfocus black yellow -color listfocus_unread black yellow -color info default black -color article default default - -# highlights -highlight article "^(Title):.*$" blue default -highlight article "https?://[^ ]+" red default -highlight article "\\[image\\ [0-9]+\\]" green default -#+END_SRC - -* URLS -:PROPERTIES: -:header-args: :tangle ~/.config/newsboat/urls -:header-args+: :comments both :mkdirp yes -:END: - -** Queries -#+begin_src conf :tangle no -"query:Unread:unread = \"yes\"" -"query:Unwatch - Youtube:unread = \"yes\" and tags # \"youtube\"" -"query:Unread - Linux:unread = \"yes\" and tags # \"linux\"" -"query:Unread - Emacs:unread = \"yes\" and tags # \"emacs\"" -"query:Unread - Sciences:unread = \"yes\" and tags # \"science\"" -#+end_src - -** Newsfeeds -*** Matlab and Control -#+begin_src conf -https://undocumentedmatlab.com/feed/ "~RSS undocumentedmatlab" matlab -http://blogs.mathworks.com/seth/feed/ "~RSS Guy on Simulink" matlab control -http://blogs.mathworks.com/loren/?feed=rss2 "~RSS Loren on the Art of MATLAB" matlab -http://blogs.mathworks.com/pick/feed/ "~RSS File Exchange Pick of the Week" matlab -https://enriquedelsol.com/feed/ "~RSS Enrique del Sol" control -http://brettbeauregard.com/blog/feed/ "~RSS Project Blog" control -https://mburkeonmbd.com/feed/ "~RSS Model-Based Design" control matlab -https://medium.com/feed/@mithi "~RSS Medium - Mithi" control -#+end_src - -*** Audio and Electronics -#+begin_src conf -http://jipihorn.wordpress.com/feed/ "~RSS Jipihorn's Blog" electronics audio -https://quantasylum.com/blogs/news.atom "~RSS QuantAsylum" audio -https://www.scrample.xyz/index.xml "~RSS Scrample" electronics -#+end_src - -*** Science -#+begin_src conf -http://sciencetonnante.wordpress.com/feed/ "~RSS Science étonnante" science -https://brushingupscience.com/feed/ "~RSS Brushing Up Science" science -#+end_src - -*** Linux, Emacs and Computer Science -#+begin_src conf -https://yiufung.net/index.xml "~RSS yiufung" emacs -https://bzg.fr/index.xml "~RSS bzg" emacs -https://thomashartmann.dev/rss.xml "~RSS thomashartmann.dev" emacs linux -http://cachestocaches.com/feed/ "~RSS CachesToCaches" emacs -http://frederic.bezies.free.fr/blog/?feed=rss2 "~RSS Le Weblog de Frederic Bezies" linux -https://la-bibliotex.fr/feed/ "~RSS La biblioTeX" latex -https://so.nwalsh.com/feed/ "~RSS so..." emacs -http://karl-voit.at/feeds/lazyblorg-all.atom_1.0.links-and-content.xml "~RSS Public Voit" emacs -https://people.umass.edu/weikaichen/index.xml "~RSS Weikai Chen" emacs -https://babbagefiles.xyz/index.xml "~RSS The Neo-Babbage Files" linux emacs -https://write.as/dani/feed/ "~RSS Dani" emacs -https://lepisma.xyz/atom.xml "~RSS Lepisma" emacs -http://kitchingroup.cheme.cmu.edu/blog/feed "~RSS The Kitchin Research Group" emacs -http://lukesmith.xyz/rss.xml "~RSS The Latest from Luke" linux -http://manuel-uberti.github.io/feed.xml "~RSS Manuel Uberti" emacs -https://lord.re/index.xml "~RSS /home/lord" linux -https://beepb00p.xyz/rss.xml "~RSS beepb00p" linux emacs -http://pragmaticemacs.com/feed/ "~RSS Pragmatic Emacs" emacs -https://jonathanabennett.github.io/rss.xml "~RSS Jonathan Bennett's Blog" emacs -https://joshrollinswrites.com/index.xml "~RSS The Art of Not Asking Why" emacs linux -http://endlessparentheses.com/atom.xml "~RSS Endless Parentheses" emacs -https://www.gonsie.com/blorg/feed.xml "~RSS Elsa Gonsiorowski" emacs -http://tiagoweber.github.io/blog.xml "~RSS Tiago Oliveira Weber" matlab emacs science -https://shreyas.ragavan.co/index.xml "~RSS Shreyas Ragavan" emacs -https://pinecast.com/feed/emacscast "~RSS EmacsCast" emacs -http://amitp.blogspot.com/feeds/posts/default "~RSS Amit's Thoughts" emacs -http://sachachua.com/wp/category/emacs/feed/ "~RSS Sacha Chua" emacs -https://cestlaz.github.io/rss.xml "~RSS C'est la Z" emacs -https://www-public.imtbs-tsp.eu/~berger_o/weblog/tag/org-mode/feed/ "~RSS WebLog Pro Olivier Berger" emacs -https://scripter.co/index.xml "~RSS A Scripter's Notes" linux emacs -https://assortedarray.com/index.xml "~RSS Assorted Array" emacs -https://www.with-emacs.com/rss.xml "~RSS with-emacs" emacs -https://linktohack.com/index.xml "~RSS QL's blog" emacs -https://itsfoss.com/feed "~RSS It's FOSS" linux -https://llazarek.com/feeds/all.rss.xml "~RSS llazarek" emacs -https://200ok.ch/rss.xml "~RSS 200ok" emacs -http://irreal.org/blog/?feed=rss2 "~RSS Irreal" emacs -https://emacs.cafe/feed.xml "~RSS Emacs café" emacs -http://vxlabs.com/feed/ "~RSS vxlabs" emacs linux -https://www.rousette.org.uk/index.xml "~RSS But she's a Girl..." emacs -https://www.anand-iyer.com/feed.xml "~RSS Anand Iyer" emacs -https://addy-dclxvi.github.io/index.xml "~RSS Addy's Blog" linux -https://ekaschalk.github.io/index.xml "~RSS Modern Emacs" emacs -http://howardism.org/index.xml "~RSS Howardism" emacs -http://xkcd.com/rss.xml "~RSS XKCD" random -https://blog.jethro.dev/index.xml "~RSS Jethro Kuan" emacs -https://lord.re/posts/index.xml "~RSS Lord~" linux -https://rgoswami.me/posts/index.xml "~RSS Rohit Goswami~" linux emacs -https://translucentink.gitlab.io/rss.xml "~RSS Translucent Ink" emacs -https://jherrlin.github.io/index.xml "~RSS Jherrlin" emacs linux -https://camsaul.com/feed.xml "~RSS Camsaul" emacs -https://ag91.github.io/rss.xml "~RSS Were Parallels Cross" emacs -# https://jonathanh.co.uk/ -#+end_src - -** Youtube -*** Matlab and Control -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCm5mt-A4w61lknZ9lCsZtBw "~YT Steve Brunton" youtube control science -https://www.youtube.com/feeds/videos.xml?channel_id=UCoUOaSVYkTV6W4uLvxvgiFA "~YT Nathan Kutz" youtube science control -https://www.youtube.com/feeds/videos.xml?channel_id=UCSlhlkPaq3RL1CP0Tv1xWBQ "~YT MIT Institute for Data, Systems, and Society" youtube science control -https://www.youtube.com/feeds/videos.xml?channel_id=UCmkP178NasnhR3TWQyyP4Gw "~YT How To Mechatronics" youtube science control -https://www.youtube.com/feeds/videos.xml?channel_id=UCGNxF654kRelnM0nKxM6QDQ "~YT Tom Oomen" youtube science control -https://www.youtube.com/feeds/videos.xml?channel_id=UCRCdl2SXma02BG384RuZPqg "~YT katkimshow" youtube science control -https://www.youtube.com/feeds/videos.xml?channel_id=UCq0imsn84ShAe9PBOFnoIrg "~YT Brian Douglas" youtube control -https://www.youtube.com/feeds/videos.xml?channel_id=UC7vVhkEfw4nOGp8TyDk7RcQ "~YT BostonDynamics" youtube control engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCPUuVY7w8brL0r__P8UBgyQ "~YT Christopher Lum" youtube matlab control -https://www.youtube.com/feeds/videos.xml?channel_id=UCNm2TzhsV5wGlFIAcpCx9hQ "~YT Jousef Murad" youtube engineering matlab -https://www.youtube.com/feeds/videos.xml?channel_id=UCMBXZxd-j6VqrynykO1dURw "~YT John Rossiter" youtube control -#+end_src - -*** Audio and Electronics -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCI-FgEdZQxBASsm3HNcWKxQ "~YT Red Robbo's Workshop" youtube linux audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCtpB66XKjAtFZfZyzmC-_Cg "~YT HexiBase" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCGIr92yrDW4cRLD-QaZmS6w "~YT Ethan Winer" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCslWMxX93gcaiXwxMv4asHA "~YT Jean Maurer Swiss Audio Manufacture SA" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UC6mzA8J7n0ylf0RnDpj-vrg "~YT PS Audio" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCy0tKL1T7wFoYcxCe0xjN6Q "~YT Technology Connections" youtube audio engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCSqyMHDUsc1gs6wz4sUy91w "~YT jipihorn" youtube electronics audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCOuow_HIYmeaIqi42zVs3qg "~YT Kirby Meets Audio" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCWOhWAOydPUqillkpt5UlaA "~YT Dakoustics" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCm2rchKqdoSKdB448TTVEnQ "~YT Impulse Audio" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UC5QPFDZ3Y4ylkkGJc6Y1OOA "~YT Philippe Demerliac" youtube electronics -https://www.youtube.com/feeds/videos.xml?channel_id=UCVqx3vXNghSqUcVg2nmegYA "~YT U꞊RI" youtube electronics diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCUJQSGHlYC9Xyz-uNfSpSsA "~YT ElectronikHeart" youtube electronics -https://www.youtube.com/feeds/videos.xml?channel_id=UC74xmXx1NfeIIa44J1IU84w "~YT Audio Fest" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCP_yR0wxxyLa46rRgsmje3Q "~YT DIY Speaker Building" youtube audio -https://www.youtube.com/feeds/videos.xml?channel_id=UCVryWqJ4cSlbTSETBHpBUWw "~YT Phil S" youtube electronics control -#+end_src - -*** Linux, Emacs and Computer Science -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCNqFXwI5gNcyxt2c1zTQAKw "~YT Yisrael Dov L" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UC2eYFnH61tmytImy1mTYvhA "~YT Luke Smith" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCkf4VIqu3Acnfzuk3kRIFwA "~YT gotbletu" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCVHICXXtKG7rZgtC5xonNdQ "~YT Howard Abrams" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCEfFUaIkjbI06PhALdcXNVA "~YT EmacsCast" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCzgkOWKcwy0uhYilE6bd1Lg "~YT Zaiste Programming" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UC5dAH2txWtKSsgmRglRB88A "~YT kyptin" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCld68syR8Wi-GY_n4CaoJGA "~YT Brodie Robertson" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCXPHFM88IlFn68OmLwtPmZA "~YT Greg Hurrell" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCxjDcP3Su59bg5VDnlwyt5A "~YT Bailey Ling" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCi8XrDg1bK_MJ0goOnbpTMQ "~YT budlabs" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCfbGTpcJyEOMwKP-eYz3_fg "~YT Rainer König" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCsnGwSIHyoYN0kiINAGUKxg "~YT Wolfgang's Channel" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCQp2VLAOlvq142YN3JO3y8w "~YT John Kitchin" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCFk8kgNu_bqsRZewxMGqkzQ "~YT Emacs SF" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCIFJHWyIlN0XFrW2vMKG6QA "~YT Alain M. Lafon" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCvA_wgsX6eFAOXI8Rbg_WiQ "~YT tutoriaLinux" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCUF4bHszxd8T4ulrvLejumA "~YT Alexander Fu" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCbW6-rTEn6nPj56K_9dLozQ "~YT Gilles Castel" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCUR1pFG_3XoZn3JNKjulqZg "~YT thoughtbot" youtube linux emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCVls1GmFKf6WlTraIb_IaJg "~YT DistroTube" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCDEtZ7AKmwS0_GNJog01D2g "~YT Uncle Dave" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCYnrHo7CDgKobmoJ3Borrnw "~YT Niklas Carlsson" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCljOhRB2a3sQgLCdK9CHQvQ "~YT Leafshade Software" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCwRXb5dUK4cvsHbx-rGzSgw "~YT Derek Banas" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCP2bshADPrVMoNrdJvZEQzw "~YT KeepItTechie" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCVRJ6D343dX-x730MRP8tNw "~YT cocadmin" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCxkMDXQ5qzYOgXPRnOBrp1w "~YT Mike Zamansky" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCgREucssIfY9e0Iy3yhse8w "~YT Conner McDaniel" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCkRmQ_G_NbdbCQMpALg6UPg "~YT emacsrocks" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UC0uTPqBCFIpZxlz_Lv1tk_g "~YT Protesilaos Stavrou" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCsJXkw_Ssp-1myJFm4_SMJA "~YT Seorenn" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCvrQyT2xhsxq2a4Xopf2JTA "~YT Zaeph" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCYnl1cugi7Lv1h8j6JNqNEg "~YT Dima Gerasimov" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCDKPGD9T00eS_l--D_DRTUQ "~YT Linuxtricks" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCcCeYbIBGQPB1G12psAPMKw "~YT Spudlyo" youtube emacs -https://www.youtube.com/feeds/videos.xml?channel_id=UCS97tchJDq17Qms3cux8wcA "~YT Chrisatmachine" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UCwFpzG5MK5Shg_ncAhrgr9g "~YT Awesome Open Source" youtube linux -https://www.youtube.com/feeds/videos.xml?channel_id=UC7YOGHUfC1Tb6E4pudI9STA "~YT Mental Outlaw" youtube linux -#+end_src - -*** 3D-Printing and DIY -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCGEBcDJ7QIY1LuEddDM9x9Q "~YT Oldies" youtube 3d-printing -https://www.youtube.com/feeds/videos.xml?channel_id=UCqdRx3JV3xRchi4_xwFJUTA "~YT 8FabLab" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCCsdIja21VT7AKkbVI5y8bQ "~YT Alain Vaillancourt" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCyi6pFP-lmaDD3Eb4dqsvdg "~YT ioduremetallique" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCYI8olK-jH9Ubc2FaA2LgPw "~YT Egalistel" youtube 3d-printing -https://www.youtube.com/feeds/videos.xml?channel_id=UCSULDz1yaHLVQWHpm4g_GHA "~YT monsieur bidouille" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UC2UT8pPDlUvRbQXTVOf5Ocw "~YT Henri Hihacks" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCLecVrux63S6aYiErxdiy4w "~YT BRUH Automation" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCQfMyugsjrVUWU0v_ZxQs2Q "~YT Machine Tech Video Blog" youtube diy engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCjED9uS41ioeFuPfbR-OBlw "~YT Les Freres Poulain" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCVSHXNNBitaPd5lYz48--yg "~YT Tech Ingredients" youtube diy -https://www.youtube.com/feeds/videos.xml?channel_id=UCPFChjpOgkUqckj3378jt5w "~YT Heliox" youtube 3d-printing -https://www.youtube.com/feeds/videos.xml?channel_id=UC9_nxvBohH1G2yR77XTdA2g "~YT Tommy Desrochers" youtube 3d-printing diy -https://www.youtube.com/feeds/videos.xml?channel_id=UC6mIxFTvXkWQVEHPsEdflzQ "~YT GreatScott" youtube diy -#+end_src - -*** Interesting - General -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UC5eOLQO5VUEFJukNg9cl5jg "~YT Histoire Brève" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCMFcMhePnH4onVHt2-ItPZw "~YT Hygiène Mentale" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UC9BnGZLT4iPaJtDOXYwQuHQ "~YT Primum Non Nocere" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCP46_MXP_WG_auH88FnfS1A "~YT Nota Bene" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCUR03ZSZlEvCO6EWwv4jU2w "~YT Absol Vidéos" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCWty1tzwZW_ZNSp5GVGteaA "~YT La statistique expliquée à mon chat" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCLbgxBMMEo6mAYe87esxGmg "~YT horror humanum est" youtube interesting -https://www.youtube.com/feeds/videos.xml?channel_id=UCOuIgj0CYCXCvjWywjDbauw "~YT Chat Sceptique" youtube interesting -#+end_src - -*** Science -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCwgqYNmYaij2_8hq_tOFyZw "~YT Aurelien Barrau" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCeR8BYZS7IHYjk_9Mh5JgkA "~YT Scilabus" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC1Ue7TuX3iH4y8-Qrjj-hyg "~YT J'm'énerve pas, j'explique" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCjsHDXUU3BjBCG7OaCbNDyQ "~YT Le Sense Of Wonder" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC4PasDd25MXqlXBogBw9CAg "~YT Mickaël Launay" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCsz9DiwPtgDvxJ-njWnieZw "~YT Passe-Science" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC_GlthPB9gzdxfkTTEIVxMA "~YT Incroyables Expériences" youtube science engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCxqAWLTk1CmBvZFPzeZMd9A "~YT Domain of Science" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCaNlbnghtwlsGF-KzAFThqA "~YT ScienceEtonnante" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCeQEKFH31vvD-InkTGSvCrA "~YT brusspup" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA "~YT Veritasium" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCH6ppHEvV3_WIXEwmhv9HEg "~YT Deus Ex Silicium" youtube engineering science -https://www.youtube.com/feeds/videos.xml?channel_id=UC2LZO6swZ9SLUEOks3WnsfA "~YT 2veritasium" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCvGag7MyHR8H9oRm9iL9Ifw "~YT Experimentboy" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC6107grRI4m0o2-emgoDnAA "~YT SmarterEveryDay" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCtqICqGbPSbTN09K1_7VZ3Q "~YT DirtyBiology" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC_ZChHhr5nDrUymz7qsRqRw "~YT Confér'ENS" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCNmLe68qKzdjuEpT_YTDFuA "~YT Etonnarium" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UCCSN5zJTKjl6UKvPcLzLuiw "~YT Macroscopie" youtube science -https://www.youtube.com/feeds/videos.xml?channel_id=UC7DdEm33SyaTDtWYGO2CwdA "~YT Physics Girl" youtube science -#+end_src - -*** Keyboard -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UC5ClFK9Ko4ACRgXjRZc_GfA "~YT Rhinofeed" youtube keyboards -https://www.youtube.com/feeds/videos.xml?channel_id=UC2yitP8oH86YBRVU4anycoA "~YT Quentin Lebastard" youtube keyboards -#+end_src - -*** Music -#+begin_src conf - -https://www.youtube.com/feeds/videos.xml?channel_id=UC3gZqwD45zGCsduBn-Q2lew "~YT Gabrielle Grau" youtube music -https://www.youtube.com/feeds/videos.xml?channel_id=UCZHPwKyeypWwU8SNJSzQhCw "~YT Révisons nos Classiques" youtube music -https://www.youtube.com/feeds/videos.xml?channel_id=UCPpNtkHeCnwN7Tl5oLq4AAg "~YT Une chanson, l'addition" youtube music -https://www.youtube.com/feeds/videos.xml?channel_id=UC_17P1ruDpCVujf7C_SxhOA "~YT Metalliquoi" youtube music -https://www.youtube.com/feeds/videos.xml?channel_id=UCzabZYC0MYRR2MFkq62d6yQ "~YT Florent Garcia" youtube music -#+end_src - -*** Space -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCdL3UpiseRlvxXuORJjmqZw "~YT Stardust" youtube space -https://www.youtube.com/feeds/videos.xml?channel_id=UC5X4e8ScZI2AFd_vkjSoyoQ "~YT AstronoGeek" youtube space -#+end_src - -*** Engineering -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCotwjyJnb-4KW7bmsOoLfkg "~YT Art of the Problem" youtube engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCR1IuLEqb6UEA_zQ81kwXfg "~YT Real Engineering" youtube engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCfsznjef2zGJnrCRQBXqo6Q "~YT Machine Thinking" youtube engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UC2bkHVIDjXS7sgrgjFtzOXQ "~YT engineerguy" youtube engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCivA7_KLKWo43tFcCkFvydw "~YT Applied Science" youtube science engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UCk0fGHsCEzGig-rSzkfCjMw "~YT The Engineering Mindset" youtube engineering -https://www.youtube.com/feeds/videos.xml?channel_id=UC5_Y-BKzq1uW_2rexWkUzlA "~YT New Mind" youtube engineering -#+end_src - -*** Random - Fun - Others -#+begin_src conf -https://www.youtube.com/feeds/videos.xml?channel_id=UCJM10Rp7G0h9j5S92QszJ5Q "~YT Tales From The Click" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCCMxHHciWRBBouzk-PGzmtQ "~YT Bazar du Grenier" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCTt2AnK--mnRmICnf-CCcrw "~YT Le Rire Jaune" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCJRljQ8OcyfzHBYpS_bDbow "~YT La Mezzanine" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCVTAmJvZOxuj9Kto8Ty9L8Q "~YT Rapha Gaming" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCTafEJoRl5myC8A50plIrng "~YT FabienOlicard" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCZeyUZmGAyRLDfM2ir3q-OQ "~YT Captain Popcorn" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCwzxu1j19ICnfW5zrBvUw-w "~YT Une bière et Jivay" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCPF7JOWMDWZmnP_cQfyAezg "~YT Scinéma" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCUK0HBIBWgM2c4vsPhkYY4w "~YT The Slow Mo Guys" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCxeA1l2E5AYrtpkqUbBEg3A "~YT Pierre Lecourt" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCYD22MFqaNqXp-ogTMosW_A "~YT Le Show Jaune" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UC4HANn7TBY-xcION-eL3rLA "~YT Daniil le Russe" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCf0mOxfawezlHIVuHd3L2VA "~YT Didi Chandouidoui" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCw3tZ7g_FljNjzGprCuptpA "~YT Taupe10" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCfXXAQ-mp1uUcvSpvMcAAtw "~YT LinksTheSun" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCWeg2Pkate69NFdBeuRFTAw "~YT Squeezie" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCtI6_1vGanPlH5lgVIDjJGQ "~YT MrAntoineDaniel" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCm3C3OSgcyzaTBXrNRupB3Q "~YT Le Woop" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCuBzVunAVbcwzMfQaJVacuw "~YT LE ROI DES RATS" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCyWqModMQlbIo8274Wh_ZsQ "~YT Cyprien" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCAFQjCZo5okIPkHUQlBZM-g "~YT Bonjour Tristesse" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCoZoRz4-y6r87ptDp4Jk74g "~YT Palmashow" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCww2zZWg4Cf5xcRKG-ThmXQ "~YT NORMAN FAIT DES VIDÉOS" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCkEa1AfdeB93-he4VziKGFg "~YT JIGMÉ" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCND0gjuG9ltEWDvh82VJITg "~YT Jeannot Nymouce" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCP5tjEmvPItGyLhmjdwP7Ww "~YT RealLifeLore" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCwbV8cTR4yBgFdfa_BXV2OA "~YT Le Fossoyeur de Films" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCGgvKW19IWVvUUblrr8EgHA "~YT Experimentboy 2" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCJZ94qp4dtCw0Q5UQqAkg7w "~YT larsandersen23" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UCDPK_MTu3uTUFJXRVcTJcEw "~YT Mcfly et Carlito" youtube random -https://www.youtube.com/feeds/videos.xml?channel_id=UC2_OG1L8DLTzQ7UrZVOk7OA "~YT Axolot" youtube random -#+end_src diff --git a/pcmanfm.org b/pcmanfm.org deleted file mode 100644 index 1807750..0000000 --- a/pcmanfm.org +++ /dev/null @@ -1,42 +0,0 @@ -#+TITLE: PCManFM -#+SETUPFILE: ./setup/org-setup-file.org -#+PROPERTY: header-args:bash :comments both -#+PROPERTY: header-args:bash+ :mkdirp yes -#+PROPERTY: header-args:bash+ :shebang "#!/bin/sh" -#+PROPERTY: header-args:bash+ :tangle ~/.config/pcmanfm/default/pcmanfm.conf - -* Config -#+BEGIN_SRC conf -[config] -bm_open_method=0 -#+END_SRC - -* Volume -#+BEGIN_SRC conf -[volume] -mount_on_startup=0 -mount_removable=0 -autorun=0 -#+END_SRC - -* UI -#+BEGIN_SRC conf -[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 -#+END_SRC diff --git a/polybar.org b/polybar.org index cdcce2e..fa296c7 100644 --- a/polybar.org +++ b/polybar.org @@ -52,7 +52,7 @@ line-size = 2 border-size = 0 padding-left = 2 -padding-right = 12 +padding-right = 16 module-margin-left = 1 module-margin-right = 1 @@ -62,7 +62,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0 modules-left = i3 xwindow modules-center = -modules-right = pulseaudio drive_monochromator drive_tmp drive_homelab drive_groupshare drive_data_id21 drive_unix_home dunst cursor unread_mail calendar battery date +modules-right = mpd pulseaudio tunnel_homelab tunnel_esrf dunst cursor unread_mail calendar timer battery date # wm-restack = i3 @@ -128,7 +128,7 @@ label-urgent-padding = 1 #+BEGIN_SRC conf [module/mpd] type = internal/mpd -format-online = %{A1:$TERMINAL -e ncmpcpp &:}%{A} +format-online = %{A1:$TERMINAL -e tmux new-session -A -s ncmpcpp ncmpcpp:}%{A} format-online-spacing = 0 format-online-padding = 0 @@ -141,13 +141,13 @@ 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 = 凌 +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 is used @@ -189,7 +189,7 @@ interval = 2 format-prefix-foreground = ${colors.fg} format-underline = ${colors.bg} -label = %{A1:$TERMINAL -e htop &:}﬙ %percentage:2%%%{A} +label = %{A1:$TERMINAL -e htop &:} %percentage:2%%%{A} #+END_SRC * Date @@ -221,7 +221,7 @@ format-volume =%{A1:pavucontrol &:} %{A} label-volume = %percentage%% label-volume-foreground = ${root.foreground} -label-muted = ﱝ muted +label-muted =  muted bar-volume-width = 10 bar-volume-foreground-0 = ${colors.green} @@ -291,6 +291,7 @@ ramp-foreground = ${colors.fg} #+end_src * Unread Mails +** Module #+BEGIN_SRC conf [module/unread_mail] type = custom/script @@ -310,12 +311,12 @@ interval = 2 :header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash -mail_nb=`du -a ~/.mail/*/Inbox/new/* 2>/dev/null | wc -l` +mail_nb=`du -a ~/.local/share/mails/*/Inbox/new/* 2>/dev/null | wc -l` if [ "$mail_nb" -eq "0" ]; then - echo ""; + echo ""; else - echo "%{F#859900} $mail_nb%{F-}"; + echo "%{F#859900} $mail_nb%{F-}"; fi #+end_src @@ -326,11 +327,11 @@ fi :header-args+: :shebang "#!/usr/bin/env bash" :END: #+begin_src bash -notify-send --hint=string:x-dunst-stack-tag:YpqAgorv "Mails " "Syncing..."; +dunstify --replace=98465 "Mails " "Syncing..."; checkmail -q && \ - mail_nb=`du -a ~/.mail/*/Inbox/new/* 2>/dev/null | wc -l` && \ + mail_nb=`du -a ~/.local/share/mails/*/Inbox/new/* 2>/dev/null | wc -l` && \ if [ "$mail_nb" -eq "0" ]; then - notify-send --hint=string:x-dunst-stack-tag:YpqAgorv "Mails " "No new mail"; + dunstify --replace=98465 "Mails " "No new mail"; fi #+end_src @@ -344,65 +345,8 @@ checkmail -q && \ $TERMINAL -e tmux new-session -A -s neomutt neomutt #+end_src -* Unread News -#+BEGIN_SRC conf -[module/unread_news] -type = custom/script - -format-underline = ${colors.bg} -click-left = ~/.config/polybar/scripts/news-open.sh >/dev/null 2>%1 & -click-right = ~/.config/polybar/scripts/news-refresh.sh >/dev/null 2>%1 & -format =