From 49ab682669e4a30c99cb182ef0549ed584aa8470 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Wed, 15 Apr 2026 10:54:48 +0200 Subject: [PATCH] Add installation scripts --- bash.org | 103 +- binaries-laptop.org | 181 ++++ binaries-private.org | 226 +---- binaries.org | 185 +--- config.org | 2 +- doom.org | 91 +- homelab.org | 11 + install.org | 1824 ++++++++--------------------------- polybar.org | 2 +- qutebrowser.org | 2 +- scripts/install-calendar.sh | 9 + scripts/install-desktop.sh | 41 + scripts/install-emacs.sh | 19 + scripts/install-laptop.sh | 13 + scripts/install-latex.sh | 7 + scripts/install-mail.sh | 10 + scripts/install-main.sh | 113 +++ scripts/install-neovim.sh | 18 + sxhkd.org | 6 +- vim.org | 43 + xconfig.org | 32 +- 21 files changed, 1002 insertions(+), 1936 deletions(-) create mode 100644 binaries-laptop.org create mode 100755 scripts/install-calendar.sh create mode 100755 scripts/install-desktop.sh create mode 100755 scripts/install-emacs.sh create mode 100755 scripts/install-laptop.sh create mode 100755 scripts/install-latex.sh create mode 100755 scripts/install-mail.sh create mode 100755 scripts/install-main.sh create mode 100755 scripts/install-neovim.sh diff --git a/bash.org b/bash.org index f4c4bf6..78ca5fc 100644 --- a/bash.org +++ b/bash.org @@ -106,76 +106,17 @@ alias tmux='tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf' alias mbsync='mbsync -c $XDG_CONFIG_HOME/isync/mbsyncrc' #+END_SRC -*** One letter aliases -#+BEGIN_SRC bash -alias y="yazi" -alias t="tmux" -alias v="nvim" -alias sv='sudo -E nvim' -alias g="git" -alias m="neomutt" -alias o="xdg-open" -#+END_SRC - *** Neovim #+begin_src bash command -v nvim >/dev/null && alias vim="nvim" vimdiff="nvim -d" # Use neovim for vim if present. #+end_src -*** Vim-like -#+BEGIN_SRC bash -alias :q=exit -alias :e=nvim -#+END_SRC - *** Print each PATH entry on a separate line #+BEGIN_SRC bash alias path='echo -e ${PATH//:/\\n}' #+END_SRC ** Functions -*** =colors= - Display colors -#+BEGIN_SRC bash -colors() { - local fgc bgc vals seq0 - - printf "Color escapes are %s\n" '\e[${value};...;${value}m' - printf "Values 30..37 are \e[33mforeground colors\e[m\n" - printf "Values 40..47 are \e[43mbackground colors\e[m\n" - printf "Value 1 gives a \e[1mbold-faced look\e[m\n\n" - - # foreground colors - for fgc in {30..37}; do - # background colors - for bgc in {40..47}; do - fgc=${fgc#37} # white - bgc=${bgc#40} # black - - vals="${fgc:+$fgc;}${bgc}" - vals=${vals%%;} - - seq0="${vals:+\e[${vals}m}" - printf " %-9s" "${seq0:-(default)}" - printf " ${seq0}TEXT\e[m" - printf " \e[${vals:+${vals+$vals;}}1mBOLD\e[m" - done - echo; echo - done -} -#+END_SRC - -*** =tre= - Tree display -=tre= is a shorthand for =tree= with hidden files and color enabled, ignoring -the =.git= directory, listing directories first. The output gets piped into -=less= with options to preserve color and line numbers, unless the output is -small enough for one screen. - -#+BEGIN_SRC bash -function tre() { - tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX; -} -#+END_SRC - *** =mkd= - Create a new directory and enter it #+BEGIN_SRC bash function mkd() { @@ -183,29 +124,6 @@ function mkd() { } #+END_SRC -*** =fs= - Filesize of directory -#+BEGIN_SRC bash -function fs() { - if du -b /dev/null > /dev/null 2>&1; then - local arg=-sbh; - else - local arg=-sh; - fi - if [[ -n "$@" ]]; then - du $arg -- "$@"; - else - du $arg .[^.]* ./*; - fi; -} -#+END_SRC - -*** =nullify= - Redirect both standard output and standard error, as well as sending to background -#+BEGIN_SRC bash -function nullify() { - "$@" >/dev/null 2>&1 -} -#+END_SRC - ** Bash History Undocumented feature which sets the size to "unlimited". http://stackoverflow.com/questions/9457233/unlimited-bash-history @@ -276,7 +194,7 @@ export SUDO_ASKPASS=~/.local/bin/askpass-rofi ** Export some default applications #+begin_src bash export EDITOR="nvim" -export TERMINAL="kitty -1" +export TERMINAL="kitty" export BROWSER="qutebrowser" export READER="zathura" export FILE="yazi" @@ -326,21 +244,10 @@ export LINKDING_TOKEN=`pass nas/linkding_token` *** 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 +if [ "$(hostname)" = "ldehaeze" ]; then + export RESTIC_REPOSITORY=sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop + export RESTIC_PASSWORD_COMMAND="pass show restic" +fi #+end_src ** Path diff --git a/binaries-laptop.org b/binaries-laptop.org new file mode 100644 index 0000000..15663f5 --- /dev/null +++ b/binaries-laptop.org @@ -0,0 +1,181 @@ +#+TITLE: Binaries specific to my ESRF Laptop +#+SETUPFILE: ./setup/org-setup-file.org + +#+PROPERTY: header-args:bash :comments both :mkdirp yes +#+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash" +#+PROPERTY: header-args:bash+ :tangle-mode (identity #o555) + +* =phonebook= ESRF phone-book +:PROPERTIES: +:CUSTOM_ID: phonebook +:END: + +*Old phonebook*: 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= +*new phonebook*: Use the =etd= script + +#+begin_src bash :tangle ~/.local/bin/phonebook +cat ~/.local/data/annuaire.txt | fzf --header="NAME Surname Phone Office Room Email" +#+end_src + +#+begin_src bash :tangle ~/.local/bin/phonebook-gui +$TERMINAL --title esrf-phonebook -e phonebook +#+end_src + +#+begin_src bash :tangle ~/.local/bin/etd +#!/bin/bash + +ROOT_URL='https://phonedirectory.esrf.fr' +API_ENDPOINT="$ROOT_URL/api" +USAGE=" + ESRF Telephone Directory + + CLI to search $ROOT_URL + + Usage : + # Search for in first name or last name + $0 + +" + +function fail { + echo "$1" >&2 + exit 1 +} + +function json_curl { curl --get --fail --silent --show-error -H "Content-Type:application/json" -H "Accept: application/json" "$@"; } + +function lspersons { + # List users and output result in csv + json_curl --data-urlencode "search=$1" "$API_ENDPOINT/searchUsers" |\ + jq -r '. | (map(keys) | add | unique | sort) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $rows[] | @csv' 2>/dev/null +} + +if [ $# -eq 0 ]; then + fail "$USAGE" +fi + +# Print the list of persons as a table + +lspersons $1 | awk 'BEGIN { FS=OFS="," }; {print $4,$3,$5,$1,$6,$2,$7}' | sed 's/"//g' | column -t -s "," | sort + +exit $? +#+end_src + +* =contacts= Personnal phone-book +:PROPERTIES: +:CUSTOM_ID: contacts +:END: + +#+begin_src bash :tangle ~/.local/bin/contacts +khard | fzf --header="Index Name Phone E-Mail" +#+end_src + +#+begin_src bash :tangle ~/.local/bin/contacts-gui +$TERMINAL --title esrf-phonebook -e contacts +#+end_src + +* =wake-on-lan= - Wake on LAN +:PROPERTIES: +:CUSTOM_ID: wake-on-lan +:END: + +#+begin_src bash :tangle ~/.local/bin/wake-on-lan +computer=$(echo -e 'ZOTAC' | rofi -i -dmenu -p 'Computer:' -l 20); + +if [[ -z "$computer" ]]; then + exit 1 +fi + +dunstify --replace=99425 'Wake On Lan' "${computer}..." + +case "$computer" in + "ZOTAC") + ssh homelab 'wakeonlan 00:01:2E:A2:42:9C' ;; + +esac +#+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\nAouste" | rofi -i -dmenu -no-custom -p 'Screen:' -l 20) + +if [[ -z "$option" ]]; then + exit 1 +fi + +after_screen_change () { + # Fix background if screen size/arangement has changed. + setbg + + # Kill polybar + killall -q polybar + + # Wait until the processes have been shut down + while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done + + # Launch bars + polybar top & +} + +case "$option" in + "Work") + xrandr --output eDP-1 --off \ + --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal \ + --output DP-3-1 --primary --mode 2560x1440 --pos 2560x0 --rotate normal && \ + after_screen_change + ;; + "Laptop") + xrandr --output DP-1-1 --off \ + --output DP-1-2 --off \ + --output DP-3-1 --off \ + --output DP-3-2 --off \ + --output HDMI-1 --off \ + --output eDP-1 --primary --mode 1920x1200 --pos 0x0 --rotate normal && \ + after_screen_change + ;; + "Home") + xrandr --output eDP-1 --off \ + --output DP-3-1 --off \ + --output DP-3-2 --off \ + --output HDMI-1 --off \ + --output DP-1-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ + after_screen_change + ;; + "Aouste") + xrandr --output eDP-1 --off \ + --output HDMI-1 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ + after_screen_change + ;; + ,*) + echo "== ! missing or invalid argument ! ==" + exit 2 +esac + +exit 0 +#+end_src + +* =print-esrf= - Print on Rnice +:PROPERTIES: +:CUSTOM_ID: print-esrf +:END: + +- To list printers =lpstat -p -d= + +#+begin_src bash :tangle ~/.local/bin/print-esrf +nbpage=$(echo -e '1\n2\n4' | rofi -dmenu -no-custom -p 'Number of pages per sheet' -l 20); +sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | rofi -dmenu -no-custom -p 'Two Sided:' -l 20); +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 "$sides" || -z "$media" || -z "$printer" ]]; then + exit 1 +fi + +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 + diff --git a/binaries-private.org b/binaries-private.org index eb9672c..65011f6 100644 --- a/binaries-private.org +++ b/binaries-private.org @@ -5,75 +5,6 @@ #+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash" #+PROPERTY: header-args:bash+ :tangle-mode (identity #o555) -* =phonebook= ESRF phone-book -:PROPERTIES: -:CUSTOM_ID: phonebook -:END: - -*Old phonebook*: 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= -*new phonebook*: Use the =etd= script - -#+begin_src bash :tangle ~/.local/bin/phonebook -cat ~/.local/data/annuaire.txt | fzf --header="NAME Surname Phone Office Room Email" -#+end_src - -#+begin_src bash :tangle ~/.local/bin/phonebook-gui -$TERMINAL --title esrf-phonebook -e phonebook -#+end_src - -#+begin_src bash :tangle ~/.local/bin/etd -#!/bin/bash - -ROOT_URL='https://phonedirectory.esrf.fr' -API_ENDPOINT="$ROOT_URL/api" -USAGE=" - ESRF Telephone Directory - - CLI to search $ROOT_URL - - Usage : - # Search for in first name or last name - $0 - -" - -function fail { - echo "$1" >&2 - exit 1 -} - -function json_curl { curl --get --fail --silent --show-error -H "Content-Type:application/json" -H "Accept: application/json" "$@"; } - -function lspersons { - # List users and output result in csv - json_curl --data-urlencode "search=$1" "$API_ENDPOINT/searchUsers" |\ - jq -r '. | (map(keys) | add | unique | sort) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $rows[] | @csv' 2>/dev/null -} - -if [ $# -eq 0 ]; then - fail "$USAGE" -fi - -# Print the list of persons as a table - -lspersons $1 | awk 'BEGIN { FS=OFS="," }; {print $4,$3,$5,$1,$6,$2,$7}' | sed 's/"//g' | column -t -s "," | sort - -exit $? -#+end_src - -* =contacts= Personnal phone-book -:PROPERTIES: -:CUSTOM_ID: contacts -:END: - -#+begin_src bash :tangle ~/.local/bin/contacts -khard | fzf --header="Index Name Phone E-Mail" -#+end_src - -#+begin_src bash :tangle ~/.local/bin/contacts-gui -$TERMINAL --title esrf-phonebook -e contacts -#+end_src - * =remote-desktop= - Remote Desktop Connect :PROPERTIES: :CUSTOM_ID: remote-desktop @@ -124,27 +55,6 @@ case "$computer" in esac #+end_src -* =wake-on-lan= - Wake on LAN -:PROPERTIES: -:CUSTOM_ID: wake-on-lan -:END: - -#+begin_src bash :tangle ~/.local/bin/wake-on-lan -computer=$(echo -e 'ZOTAC' | rofi -i -dmenu -p 'Computer:' -l 20); - -if [[ -z "$computer" ]]; then - exit 1 -fi - -dunstify --replace=99425 'Wake On Lan' "${computer}..." - -case "$computer" in - "ZOTAC") - ssh homelab 'wakeonlan 00:01:2E:A2:42:9C' ;; - -esac -#+end_src - * =mount-dir= - Mount/Unmout directories #+begin_src text :tangle no # @@ -267,105 +177,47 @@ 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 - # Takes a lot of time with tmp_14_days is mounted... - # drive=$(ls ~/mnt/ | rofi -dmenu -no-custom -p 'Drive:' -l 20); - drive=$(find ~/mnt/* -maxdepth 0 -type d -not -empty -printf '%f\n' | rofi -dmenu -no-custom -p 'Drive:' -l 20); - if [[ -z "$drive" ]]; then - exit 1 +Unmounts all mounted directories under =~/mnt/=, skipping empty/unmounted ones. +Sends a =dunstify= notification listing what was unmounted, and a critical alert +for any failures. + +#+begin_src bash :tangle ~/.local/bin/umount-dirs +mnt_dir="$HOME/mnt" +unmounted=() +failed=() + +for dir in "$mnt_dir"/*/; do + [ -d "$dir" ] || continue + + # Skip directories that are not mount points + if ! mountpoint -q "$dir"; then + continue fi -else - exit 1 + + if umount "$dir" 2>/dev/null; then + unmounted+=("$(basename "$dir")") + else + failed+=("$(basename "$dir")") + fi +done + +if [ ${#failed[@]} -gt 0 ]; then + dunstify --urgency=critical "umount-dirs" "Failed to unmount:\n$(printf '• %s\n' "${failed[@]}")" 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\nAouste" | rofi -i -dmenu -no-custom -p 'Screen:' -l 20) - -if [[ -z "$option" ]]; then - exit 1 +if [ ${#unmounted[@]} -gt 0 ]; then + dunstify "umount-dirs" "Unmounted:\n$(printf '• %s\n' "${unmounted[@]}")" +elif [ ${#failed[@]} -eq 0 ]; then + dunstify "umount-dirs" "Nothing was mounted" fi - -after_screen_change () { - # Fix background if screen size/arangement has changed. - setbg - - # Kill polybar - killall -q polybar - - # Wait until the processes have been shut down - while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done - - # Launch bars - polybar top & -} - -case "$option" in - "Work") - xrandr --output eDP-1 --off \ - --output DP-3-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal \ - --output DP-3-1 --primary --mode 2560x1440 --pos 2560x0 --rotate normal && \ - after_screen_change - ;; - "Laptop") - xrandr --output DP-1-1 --off \ - --output DP-1-2 --off \ - --output DP-3-1 --off \ - --output DP-3-2 --off \ - --output HDMI-1 --off \ - --output eDP-1 --primary --mode 1920x1200 --pos 0x0 --rotate normal && \ - after_screen_change - ;; - "Home") - xrandr --output eDP-1 --off \ - --output DP-3-1 --off \ - --output DP-3-2 --off \ - --output HDMI-1 --off \ - --output DP-1-2 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ - after_screen_change - ;; - "Aouste") - xrandr --output eDP-1 --off \ - --output HDMI-1 --primary --mode 2560x1440 --pos 0x0 --rotate normal && \ - after_screen_change - ;; - ,*) - echo "== ! missing or invalid argument ! ==" - exit 2 -esac - -exit 0 #+end_src - -* =print-esrf= - Print on Rnice -:PROPERTIES: -:CUSTOM_ID: print-esrf -:END: - -- To list printers =lpstat -p -d= - -#+begin_src bash :tangle ~/.local/bin/print-esrf -nbpage=$(echo -e '1\n2\n4' | rofi -dmenu -no-custom -p 'Number of pages per sheet' -l 20); -sides=$(echo -e 'one-sided\ntwo-sided-long-edge\ntwo-sided-short-edge' | rofi -dmenu -no-custom -p 'Two Sided:' -l 20); -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 "$sides" || -z "$media" || -z "$printer" ]]; then - exit 1 -fi - -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"; +* =torrent-add= - Add Torrent using =stig= +Used to add notification when a torrent is added. +#+begin_src bash :tangle ~/.local/bin/torrent-add +stig add $@ && \ + dunstify --replace=22221 "Stif" 'Torrent Added' || \ + dunstify --replace=22221 --urgency=critical "Stif" 'Failed' #+end_src - * =readbib= - Open Bibliography File :PROPERTIES: :CUSTOM_ID: readbib @@ -388,10 +240,4 @@ List all =pdf= files and open selected one with zathura. cd ~/Cloud/brain/pdfs/ && ls *.pdf | rofi -dmenu -lines 20 | xargs -I {} zathura {} #+end_src -* =torrent-add= - Add Torrent using =stig= -Used to add notification when a torrent is added. -#+begin_src bash :tangle ~/.local/bin/torrent-add -stig add $@ && \ - dunstify --replace=22221 "Stif" 'Torrent Added' || \ - dunstify --replace=22221 --urgency=critical "Stif" 'Failed' -#+end_src + diff --git a/binaries.org b/binaries.org index d8ea588..199befd 100644 --- a/binaries.org +++ b/binaries.org @@ -5,50 +5,6 @@ #+PROPERTY: header-args:bash+ :shebang "#!/usr/bin/env bash" #+PROPERTY: header-args:bash+ :tangle-mode (identity #o555) -* =dmenukill= - Kill program using Dmenu -:PROPERTIES: -:CUSTOM_ID: dmenukill -:END: - -#+begin_src bash :tangle ~/.local/bin/dmenukill -ps_line=$(ps -u $USER k -size -o pid=,%mem=,%cpu=,comm= | dmenu -i -l 15) - -if [ ! -z "$ps_line" ]; then - pid=$(echo $ps_line | awk '{print $1}') - name=$(echo $ps_line | awk '{print $4}') - - kill -15 $pid && \ - dunstify "Kill" "$name (PID $pid)" & -fi - -#+end_src - -* =nordvpn-toggle= - Connect to VPN using NordVPN -:PROPERTIES: -:CUSTOM_ID: nordvpn-toggle -:END: - -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 && \ - 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'`; - dunstify --replace=23198 "VPN" "Connecting to $country..."; - nordvpn connect $country && \ - dunstify --replace=23198 "VPN" "Connected to $country" && \ - echo "on" > $tmpfile; -fi -#+end_src - * =i3exit= - Manage lock, suspend, reboot, ... :PROPERTIES: :CUSTOM_ID: i3exit @@ -165,41 +121,6 @@ case "$status" in esac #+end_src -* =network-toggle= - Toggle Network -:PROPERTIES: -:CUSTOM_ID: network-toggle -:END: - -Minimal network manager to just toggle the Wifi or Ethernet connection. - -#+begin_src bash :tangle ~/.local/bin/network-toggle -result=$(nmcli device | sed '1d' | dmenu -l 20); - -interface=$(echo $result | awk -F ' ' '{print $1}'); -status=$(echo $result | awk -F ' ' '{print $3}'); - -if [ $status == 'disconnected' ]; then - nmcli device connect $interface -else - nmcli device disconnect $interface -fi -#+end_src - -* =make-gif= - Convert an =MP4= video to =GIF= -:PROPERTIES: -:CUSTOM_ID: make-gif -:END: - -First argument is the =mp4= file and the second argument is the output =gif= file. - -#+begin_src bash :tangle ~/.local/bin/make-gif -palette="/tmp/palette.png" -filters="fps=15,scale=320:-1:flags=lanczos" - -ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette -ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 -#+end_src - * =yt-audio= - Download-Audio from youtube :PROPERTIES: :CUSTOM_ID: yt-audio @@ -269,20 +190,10 @@ fi The list of emojis is available [[file:data.org::#emojis][here]]. #+begin_src bash :tangle ~/.local/bin/insert-unicode -# Must have xclip installed to even show menu. -xclip -h 2>/dev/null || exit 1 - chosen=$(cut -d ';' -f1 ~/.local/data/emojis | rofi -dmenu -i -l 20 | sed "s/ .*//") - [ "$chosen" != "" ] || exit -# If you run this command with an argument, it will automatically insert the character. -if [ -n "$1" ]; then - xdotool key Shift+Insert -else - echo "$chosen" | tr -d '\n' | xsel -ib - dunstify "'$chosen' copied to clipboard." & -fi +xdotool type --clearmodifiers "$chosen" #+end_src * =insert-nerd-fonts= - Insert Nerd Font Icon @@ -293,20 +204,10 @@ fi The list of emojis is available [[file:data.org::#nerd-fonts][here]]. #+begin_src bash :tangle ~/.local/bin/insert-nerd-fonts -# Must have xsel installed to even show menu. -xsel -h 2>/dev/null || exit 1 - -chosen=$(cat ~/.local/data/nerd-fonts | rofi -dmenu -i -l 20 | sed "s/ .*//") - +chosen=$(cut -d ';' -f1 ~/.local/data/emojis | rofi -dmenu -i -l 20 | sed "s/ .*//") [ "$chosen" != "" ] || exit -# If you run this command with an argument, it will automatically insert the character. -if [ -n "$1" ]; then - xdotool key Shift+Insert -else - echo "$chosen" | tr -d '\n' | xsel -ib - dunstify "'$chosen' copied to clipboard." & -fi +xdotool type --clearmodifiers "$chosen" #+end_src * =linkhandler= - Open any URL with Default application @@ -384,74 +285,6 @@ i3lock --ignore-empty-password --nofork --image=$temp_file && \ killall -SIGUSR2 dunst && echo "on" > /tmp/dunststatus #+end_src -* =mopidy-restart= - Restart Mopidy -:PROPERTIES: -:CUSTOM_ID: mopidy-restart -:END: - -Sometimes =mopidy= need to be restarted... - -#+begin_src bash :tangle ~/.local/bin/mopidy-restart -pids=( $(pgrep -f mopidy) ) - -for pid in "${pids[@]}"; do - if [[ $pid != $$ ]]; then - kill "$pid" - fi -done -echo "Killed mopidy." - -echo "Restarting mopidy..." -~/.local/soft/mopidy-jellyfin/env/bin/mopidy -v >/tmp/mopidy.log 2>&1 & -echo "Done" -#+end_src - -* =upload= - Upload Script -:PROPERTIES: -:CUSTOM_ID: upload -:END: - -Upload a file to https://0x0.st/ and copy the generated url. - -#+begin_src bash :tangle ~/.local/bin/upload -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 && \ - dunstify 'Upload' 'Successful' || \ - dunstify --urgency=critical 'Upload' 'Failed' -fi -#+end_src - -* =weather= - Display Weather in terminal -:PROPERTIES: -:CUSTOM_ID: weather -:END: - -Get the weather from http://wttr.in/. - -#+begin_src bash :tangle ~/.local/bin/weather -if [ -n "$*" ]; then - address="wttr.in/" - address+=$* -else - address="wttr.in/" -fi - -if type nsxiv > /dev/null 2>&1; then - address+=".png" - - wget -qO- "$address" > /tmp/weather.png && \ - nsxiv -b /tmp/weather.png -elif type feh > /dev/null 2>&1; then - address+=".png" - - wget -qO- "$address" | feh - -else - curl "$address" -fi -#+end_src - * =convert-file= - Convert any file to another filetype :PROPERTIES: :CUSTOM_ID: convert-file @@ -1429,17 +1262,6 @@ printf "$pass" | xclip -sel clip && \ dunstify 'Password' 'Generated' #+end_src -* =sxhkd-help= - List of keybindings using Rofi -:PROPERTIES: -:CUSTOM_ID: sxhkd-help -:END: - -#+begin_src bash :tangle ~/.local/bin/sxhkd-help -awk '/^[a-z]/ && last {print "",$0,"\t",last,""} {last=""} /^#/{last=$0}' ~/.config/sxhkd/sxhkdrc{,.i3} | - column -t -s $'\t' | - rofi -dmenu -i -markup-rows -no-show-icons -width 1000 -lines 15 -yoffset 40 -#+end_src - * =qrdecode= - Decode QRcode by taking screenshot To install: #+begin_src bash :tangle no @@ -1479,3 +1301,4 @@ dunstify "qrshot" "$decoded_text" # Cleaning up the trash that was left behind rm $image_file #+end_src + diff --git a/config.org b/config.org index 90998b4..731d981 100644 --- a/config.org +++ b/config.org @@ -53,7 +53,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 "$(ping -c1 -W1 -q proxy.esrf.fr. &> /dev/null )" +ping -c1 -W1 -q proxy.esrf.fr &> /dev/null #+end_src * Font diff --git a/doom.org b/doom.org index d9b67d0..86aac4e 100644 --- a/doom.org +++ b/doom.org @@ -14,6 +14,50 @@ #+property: header-args:emacs-lisp :tangle ~/.config/doom/config.el :results none :padline no :END: +* Installation +:PROPERTIES: +:header-args:bash: :tangle scripts/install-emacs.sh :shebang "#!/bin/bash" :mkdirp yes +:END: + +#+begin_src bash +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" +DOOM="${HOME}/.config/emacs/bin/doom" +#+end_src + +** Packages + +#+begin_src bash +echo "==> Emacs packages" +paru -S --needed emacs aspell aspell-en aspell-fr +#+end_src + +** Doom Emacs + +#+begin_src bash +echo "==> Installing Doom Emacs" +git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs +"${DOOM}" install --no-config +#+end_src + +** Tangle Configuration + +Tangle =doom.org= to generate =config.el=, =init.el= and =packages.el=: + +#+begin_src bash +echo "==> Tangling doom.org" +emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" +#+end_src + +** Sync + +#+begin_src bash +echo "==> Running doom sync" +"${DOOM}" sync +#+end_src + * Introduction and Resources https://medium.com/urbint-engineering/emacs-doom-for-newbies-1f8038604e3b https://noelwelsh.com/posts/2019-01-10-doom-emacs.html @@ -1273,7 +1317,7 @@ https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in- (counter -1) (numberp)) - (setq results (loop for (begin . env) in + (setq results (cl-loop for (begin . env) in (org-element-map (org-element-parse-buffer) 'latex-environment (lambda (env) (cons @@ -1283,20 +1327,20 @@ https://kitchingroup.cheme.cmu.edu/blog/2016/11/07/Better-equation-numbering-in- (cond ((and (string-match "\\\\begin{equation}" env) (not (string-match "\\\\tag{" env))) - (incf counter) + (cl-incf counter) (cons begin counter)) ((string-match "\\\\begin{align}" env) (prog2 - (incf counter) + (cl-incf counter) (cons begin counter) (with-temp-buffer (insert env) (goto-char (point-min)) ;; \\ is used for a new line. Each one leads to a number - (incf counter (count-matches "\\\\$")) + (cl-incf counter (count-matches "\\\\$")) ;; unless there are nonumbers. (goto-char (point-min)) - (decf counter (count-matches "\\nonumber"))))) + (cl-decf counter (count-matches "\\nonumber"))))) (t (cons begin nil))))) @@ -3019,12 +3063,38 @@ Provides nice functions such as: ) #+end_src +* Claude Code +#+begin_src emacs-lisp +(use-package! agent-shell + :config + (setq agent-shell-anthropic-authentication + (agent-shell-anthropic-make-authentication :login t)) + + (setq agent-shell-preferred-agent-config (agent-shell-anthropic-make-claude-code-config)) + ;; Evil state-specific RET behavior: insert mode = newline, normal mode = send + (evil-define-key 'insert agent-shell-mode-map (kbd "M-RET") #'newline) + (evil-define-key 'insert agent-shell-mode-map (kbd "RET") #'comint-send-input) + (evil-define-key 'normal agent-shell-mode-map (kbd "RET") #'comint-send-input) + ;; n and p are bound in agent-shell-mode-map; restore self-insert in insert mode + (evil-define-key 'insert agent-shell-mode-map (kbd "n") #'self-insert-command) + (evil-define-key 'insert agent-shell-mode-map (kbd "p") #'self-insert-command) + + (evil-define-key 'normal agent-shell-diff-mode-map (kbd "C-c C-o") #'agent-shell-diff-open-file) + (evil-define-key 'normal agent-shell-diff-mode-map (kbd "C-c C-a") #'agent-shell-diff-accept-all) + + ;; Configure *agent-shell-diff* buffers to start in Emacs state + (add-hook 'diff-mode-hook + (lambda () + (when (string-match-p "\\*agent-shell-diff\\*" (buffer-name)) + (evil-emacs-state))))) +#+end_src + * Doom =init.el= #+begin_src emacs-lisp :tangle ~/.config/doom/init.el (doom! :completion company ; the ultimate code completion backend (corfu +orderless) ; complete with cap(f), cape and a flying feather! - helm ; the *other* search engine for love and life + ;;helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... ;;ivy ; a search engine for love and life vertico ; the search engine of the future @@ -3209,6 +3279,8 @@ https://github.com/doomemacs/doomemacs/issues/6478 #+begin_src emacs-lisp ;; Org-mode modules for citations, cross-references, bibliographies (package! org-ref) +;; helm-bibtex (declared explicitly since the helm Doom module is not used) +(package! helm-bibtex) #+end_src #+begin_src emacs-lisp @@ -3261,6 +3333,13 @@ https://github.com/doomemacs/doomemacs/issues/6478 :files ("resources" "*.el"))) #+end_src +** Claude Code +#+begin_src emacs-lisp +(package! shell-maker) +(package! acp) +(package! agent-shell) +#+end_src + ** Not used anymore :noexport: :PROPERTIES: :header-args:emacs-lisp: :tangle no diff --git a/homelab.org b/homelab.org index 15c6fdb..0b3fbce 100644 --- a/homelab.org +++ b/homelab.org @@ -373,6 +373,17 @@ Add an entry for the new user. Restart the container with =docker-compose restart authelia=. Ask the new user to go to https://login.tdehaeze.xyz/ to reset his password. +** Update Matrix +https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/maintenance-upgrading-services.md + +#+begin_src bash +cd ~/Cloud/programming/matrix-docker-ansible-deploy/ +git pull +# Look at CHANGELOG.md +just update +ansible-playbook -K -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-users-created,start +#+end_src + * Docker-Compose :PROPERTIES: :header-args: :tangle /ssh:thomas@homelab:~/docker/docker-compose.yaml diff --git a/install.org b/install.org index 918a7a0..7ee36e4 100644 --- a/install.org +++ b/install.org @@ -1,10 +1,33 @@ #+TITLE: Installation #+SETUPFILE: ./setup/org-setup-file.org -* =paru= - Package Manager -Installation: -#+begin_src bash -mkdir ~/.local/soft && cd ~/.local/soft +* Overview + +This file documents how to set up a fresh Arch Linux installation. +It tangles several install scripts: + +- =~/install-main.sh= — core desktop environment and tools +- =~/install-desktop.sh= — tangle and reload the full desktop environment (i3, polybar, sxhkd, picom, rofi, kitty, bash, X11) +- =~/install-mail.sh= — mail setup (mbsync, msmtp, neomutt, mu) +- =~/install-calendar.sh= — calendar and contacts (vdirsyncer, khal, khard) +- =~/install-music.sh= — music server and client (mopidy, ncmpcpp) +- =~/install-latex.sh= — LaTeX toolchain (texlive, biber) +- =~/install-laptop.sh= — laptop-specific tools (tlp, powertop, thermald) + +All scripts use =paru -S --needed= to be idempotent (safe to re-run). + +* Prerequisites +** =git= +#+begin_src bash :tangle no +sudo pacman -S git +#+end_src + +[[file:git.org][Git]] configuration: =~/.gitconfig=, =~/.gitignore_global= + +** =paru= - AUR Helper +Must be installed first before running any script: +#+begin_src bash :tangle no +mkdir -p ~/.local/soft && cd ~/.local/soft sudo pacman -S --needed base-devel git clone https://aur.archlinux.org/paru.git cd paru @@ -13,825 +36,483 @@ makepkg -si After that, the =paru= folder may be removed. -* =git= - Version Control System +* Desktop Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-desktop.sh :shebang "#!/bin/bash" :mkdirp yes +:END: + +Installs packages and tangles configs for the core desktop environment. +Run this after =paru= is available to get a working, familiar environment fast. -Installation: #+begin_src bash -paru -S git +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" + +tangle() { + emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/$1\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")" +} #+end_src -[[file:git.org][Git]] Configuration: -- =~/.gitconfig= -- =~/.gitignore_global= +** Packages -* =alacritty= - Terminal -[[https://github.com/alacritty/alacritty][Alacritty]] is a very nice keyboard-centric terminal. - -It can be installed like so: #+begin_src bash -paru -S alacritty +echo "==> Desktop packages" +paru -S --needed \ + i3-wm \ + sxhkd \ + polybar \ + picom \ + dunst \ + rofi rofi-calc dmenu \ + kitty \ + bash bash-completion \ + zoxide \ + nerd-fonts-hack noto-fonts-emoji \ + xorg-xrandr arandr \ + xautocfg \ + arc-gtk-theme xcursor-breeze \ + feh xwallpaper #+end_src -Its configuration file is described [[file:alacritty.org][here]]. +** Tangle Configs -#+caption: =alacritty= - Cheatsheet -| Command | Usage | -|--------------------+-------------------------| -| =ctrl-shift-x= | activate url hints mode | -| =ctrl-shift-c= | copy to CLIPBOARD | -| =ctrl-shift-v= | paste from CLIPBOARD | -| =ctrl-shift-space= | start selection mode | -| =ctrl += | increase font size | -| =ctrl -= | decrease font size | - -Also install =kitty= (better image support) #+begin_src bash -paru -S kitty +echo "==> Tangling desktop configs" +tangle "xconfig.org" # ~/.Xresources, ~/.xprofile, ~/.config/X11/xinitrc +tangle "bash.org" # ~/.bashrc, ~/.bash_profile, ~/.profile +tangle "kitty.org" # ~/.config/kitty/kitty.conf +tangle "i3.org" # ~/.config/i3/config +tangle "sxhkd.org" # ~/.config/sxhkd/sxhkdrc +tangle "polybar.org" # ~/.config/polybar/config.ini + scripts +tangle "compositor.org" # ~/.config/picom/picom.conf +tangle "rofi.org" # ~/.config/rofi/config.rasi +tangle "binaries.org" # ~/.local/bin/* scripts +tangle "binaries-private.org" # ~/.local/bin/* scripts #+end_src -* =bash= - Shell -https://wiki.archlinux.org/index.php/Bash +** Reload + +If already running inside i3, restart in place — no need to log out: -Installation: #+begin_src bash -paru -S bash bash-completion zsh +echo "==> Reloading desktop" +i3-msg restart 2>/dev/null || echo " (i3 not running, config will apply on next login)" #+end_src -[[file:bash.org][Bash]] configuration: -- =~/.bashrc= -- =~/.bash_profile= -- =~/.config/bash/= -- =~/.profile= +* Main Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-main.sh :shebang "#!/bin/bash" :mkdirp yes +:END: -* =tmux= - Terminal Multiplexer -https://github.com/tmux/tmux - -Installation: #+begin_src bash -paru -S tmux +set -euo pipefail #+end_src -[[file:tmux.org][TMUX]] configuration +** Shell and Terminal -Ressources: -- https://github.com/gpakosz/.tmux -- https://gist.github.com/MohamedAlaa/2961058 -- https://blog.bugsnag.com/tmux-and-vim/ -- https://github.com/tmux-plugins/tmux-resurrect -- https://github.com/rothgar/awesome-tmux -- https://thoughtbot.com/upcase/tmux - -#+caption: =tmux= - Cheatsheet -| Command | Usage | -|----------------+-------------------------------| -| =ctrl-spc= | Prefix | -| =c= | New pane | -| =/=, =-= | Split Vertically/Horizontally | -| =s= | Change session | -| =p=, =n= | Previous/Next Pane | -| =ctrl-h,j,k,l= | Move between windows | - -* Fonts -My font of choice is =nerd-fonts-hack= which can be installed as so: #+begin_src bash -paru -S nerd-fonts-hack +echo "==> Shell and Terminal" +paru -S --needed \ + bash bash-completion zsh \ + kitty \ + tmux #+end_src -For emojis, use: +[[file:bash.org][Bash]] configuration: =~/.bashrc=, =~/.bash_profile=, =~/.config/bash/=, =~/.profile= + +** Fonts + #+begin_src bash -paru -S noto-fonts-emoji +echo "==> Fonts" +paru -S --needed \ + nerd-fonts-hack \ + noto-fonts-emoji #+end_src -Default font used: +Default fonts: Monospace/Serif/Sans = =Hack Nerd Font=. -- Monospace Font: =Hack Nerd Font Mono= -- Serif Font: =Hack Nerd Font= -- Sans Font: =Hack Nerd Font= +** Text Editors -To list all fonts available: #+begin_src bash -fc-list +echo "==> Text Editors" +paru -S --needed \ + neovim python-pynvim nodejs-neovim \ + emacs \ + aspell aspell-en aspell-fr #+end_src -To select fonts using a GUI, =gtk2fontsel= can be used: -#+begin_src bash -paru -S gtk2fontsel -#+end_src +Neovim config: [[file:vim.org][vim.org]] -* =emacs= and =vim= - Text Editors -** Neovim -I use [[https://github.com/neovim/neovim][Neovim]] for all the small edits. - -Installation: -#+begin_src bash -paru -S neovim nodejs-neovim python-pynvim -#+end_src - -The Neovim configuration can be found [[file:vim.org][here]]. - -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' -#+end_src - -And to install/setup all the plugins: -#+begin_src bash -nvim +PlugInstall -nvim +UpdateRemotePlugins -#+end_src - -** Emacs -I use [[https://www.gnu.org/software/emacs/][Emacs]] and the [[https://github.com/hlissner/doom-emacs][Doom]] framework. - -Install Emacs: -#+begin_src bash -paru -S emacs-nativecomp -#+end_src - -And then the Doom framework: -#+begin_src bash +Install Doom Emacs framework: +#+begin_src bash :tangle no git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d ~/.emacs.d/bin/doom install #+end_src -The Emacs configuration can be found [[./doom.org][here]]. +Emacs config: [[./doom.org][doom.org]] + +** Security: GnuPG and Pass -SpellCheck with Aspell: #+begin_src bash -paru -S aspell aspell-en aspell-fr +echo "==> GnuPG and Pass" +paru -S --needed \ + gnupg gnome-keyring \ + pass rofi-pass pass-git-helper #+end_src -* SSH setup -Generate a new SSH key: -#+begin_src bash -ssh-keygen -t rsa -b 4096 -C "dehaeze.thomas@gmail.com" +Generate a GPG key: +#+begin_src bash :tangle no +gpg --full-gen-key #+end_src -Start the ssh-agent in the background: -#+begin_src bash -eval "$(ssh-agent -s)" -#+end_src - -Add the SSH key to the ssh-agent: -#+begin_src bash -ssh-add ~/.ssh/id_rsa -#+end_src - -* GnuPG -https://gnupg.org/ - -Install the gnupg package: -#+begin_src bash -paru -S gnupg -#+end_src - -Create a key pair: -#+begin_src bash -paru --full-gen-key -#+end_src - -To configure the =gpg-agent= to cache the passphrase, edit the following file =~/.local/share/gnupg/gpg-agent.conf=: -#+begin_src conf +To cache the passphrase, edit =~/.local/share/gnupg/gpg-agent.conf=: +#+begin_src conf :tangle no default-cache-ttl 60480000 max-cache-ttl 60480000 #+end_src -Install =gnome-keyring= to automatically unlock the GnuPG keys: -#+begin_src bash -paru -S gnome-keyring -#+end_src - -* =rofi= - Application Launcher -[[https://github.com/DaveDavenport/rofi][Rofi]] is a very nice alternative to [[https://tools.suckless.org/dmenu/][dmenu]]. - -Installation: -#+begin_src bash -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. - -For that to work, we need to add the following code to =~/.profile=: -#+begin_src bash -export SUDO_ASKPASS=~/.local/bin/askpass-rofi -#+end_src - -The =askpass= script is: -#+begin_src bash -#!/bin/sh - -rofi -dmenu \ - -password \ - -no-fixed-num-lines \ - -p "$(printf "$1" | sed s/://)" -#+end_src - -* =pass= - Password Manager -https://www.passwordstore.org/ - -Installation: -#+begin_src bash -paru -S pass -#+end_src - -#+begin_src bash -mkdir .config/pass -#+end_src - -Initialize the password store as a git repository -#+begin_src bash -cd .config/pass +Initialize the password store: +#+begin_src bash :tangle no pass git init pass git remote add origin https://github.com/tdehaeze/pass.git #+end_src -Gui Manager: [[https://github.com/IJHack/qtpass][qtpass]] +** SSH + +Generate a new SSH key: +#+begin_src bash :tangle no +ssh-keygen -t ed25519 -C "dehaeze.thomas@gmail.com" +eval "$(ssh-agent -s)" +ssh-add ~/.ssh/id_ed25519 +#+end_src + +** Window Manager and Desktop + #+begin_src bash -paru -S qtpass +echo "==> Window Manager and Desktop" +paru -S --needed \ + i3-wm \ + sxhkd \ + polybar \ + picom \ + dunst \ + rofi rofi-calc dmenu \ + xautocfg \ + xorg-xrandr arandr #+end_src -Integration with Rofi: [[https://github.com/carnager/rofi-pass][rofi-pass]] +- i3 config: [[file:i3.org][i3.org]] +- sxhkd config: [[file:sxhkd.org][sxhkd.org]] +- polybar config: [[file:polybar.org][polybar.org]] +- compositor config: [[file:compositor.org][compositor.org]] +- notifications config: [[file:notifications.org][notifications.org]] + +** File Manager + #+begin_src bash -paru -S rofi-pass +echo "==> File Manager" +paru -S --needed yazi #+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]] +Yazi config: [[file:yazi.org][yazi.org]] + +** Terminal Utilities + #+begin_src bash -paru -S pass-git-helper +echo "==> Terminal Utilities" +paru -S --needed \ + fd ripgrep fzf \ + xclip xsel \ + atool unzip \ + trash-cli \ + man-db \ + neofetch #+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=: -#+begin_src -[github.com*] -target=github.com/tdehaeze -#+end_src +** Browser -Then, add the credential helper on the git configuration file =~/.gitconfig= and add the default username for the repositories adresses. -#+begin_src -[credential] - helper = !pass-git-helper $@ - -[credential "https://github.com"] - username = tdehaeze -#+end_src - -** Integration with other programs -Integrate pass in other programs is usually very easy, here are few examples: -- =~/.msmtprc=: - - =passwordeval "pass email/dehaeze.thomas@gmail.com"= -- =~/.mbsyncrc= - - =PassCmd "pass email/dehaeze.thomas@gmail.com"= - -** Alternative - Bitwarden -Bitwarden https://github.com/bitwarden/cli #+begin_src bash - paru -Ss bitwarden-bin bitwarden-cli-bin +echo "==> Browser" +paru -S --needed \ + qutebrowser python-adblock pdfjs \ + firefox-developer-edition passff-host #+end_src -* =qutebrowser= - Browser -https://github.com/qutebrowser/qutebrowser +Qutebrowser config: [[file:qutebrowser.org][qutebrowser.org]] -** Installation -#+begin_src bash -paru -S qutebrowser python-adblock -#+end_src - -** View Pdf inside qutebrowser with pdfjs -*** Installation -#+begin_src bash -paru -S pdfjs -#+end_src - -*** Usage -When opening a pdf file on qutebrowser, you'll be ask for options: -| Command | Usage | -|------------+-------------------| -| == | Download the file | -| =Ctrl-x= | Download and open | -| =Ctrl-p= | Open with pdf.js | -| =Alt-y= | Yank the url | - -** Integration with Pass: the password manager -Add the key-binding on =~/.config/qutebrowser/config.py= - -#+begin_src - 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. - -** Spell Checking -#+begin_src bash +Spell checking for qutebrowser: +#+begin_src bash :tangle no /usr/share/qutebrowser/scripts/dictcli.py install fr-FR /usr/share/qutebrowser/scripts/dictcli.py install en-US #+end_src -* =firefox= +** Media + #+begin_src bash -paru -S firefox-developer-edition +echo "==> Media" +paru -S --needed \ + mpv \ + jellyfin-tui \ + nsxiv \ + zathura zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb \ + pdfpc \ + gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav #+end_src -Addons: -- [[https://addons.mozilla.org/fr/firefox/addon/ublock-origin/][uBlock Origin]] -- [[https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/][Adblock Plus]] -- [[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]] +** Sound (PipeWire) -In order to have passwords: #+begin_src bash -paru -S passff-host +echo "==> PipeWire" +paru -S --needed \ + pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse \ + wireplumber \ + pwvucontrol #+end_src -* =xrandr= - Monitor Manager -#+begin_src bash -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). -[[https://christian.amsuess.com/tools/arandr/][Arandr]] is a GUI application to manage monitors. - -* Music Setup -** =pipewire= - Sound Server -https://wiki.archlinux.org/title/PipeWire - -Installation: -#+begin_src bash -paru -S pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse wireplumber -#+end_src - -#+begin_src bash +Enable PipeWire services: +#+begin_src bash :tangle no systemctl --user enable --now pipewire.socket systemctl --user enable --now pipewire-pulse.socket systemctl --user enable --now wireplumber.service #+end_src -** =pwvucontrol= - Sound Manager -=pwvucontrol= is used as a sound manager: +** PDF and Image Utilities #+begin_src bash -paru -S pwvucontrol +echo "==> PDF and Image Utilities" +paru -S --needed \ + pdf2svg pdftk pdfarranger \ + imagemagick \ + maim flameshot \ + unclutter \ + poppler #+end_src -** =mopidy= - Audio Server -https://github.com/mopidy/mopidy -https://medium.com/@theos.space/using-mopidy-with-spotify-and-ncmpcpp-44352f4a2ce8 +** Office #+begin_src bash -paru -S mopidy +echo "==> Office" +paru -S --needed \ + onlyoffice-bin \ + libreoffice-fresh libreoffice-fresh-fr \ + inkscape #+end_src +** System Utilities + #+begin_src bash -python3 -m pip install --user mopidy-mpd mopidy-jellyfin mopidy-spotify +echo "==> System Utilities" +paru -S --needed \ + udiskie \ + blueman \ + sshfs \ + xwallpaper \ + sof-firmware \ + usbutils \ + xautolock \ + npm \ + xorg-xkill \ + syncthing \ + wireguard-tools \ + gotify-dunst-git \ + gomuks \ + yt-dlp \ + python ipython python-pip #+end_src -If mopidy is used, MPD should be disabled. (=systemctl disable --user mpd.service=) - -** =ncmpcpp= - MPD Client -https://wiki.archlinux.org/index.php/Ncmpcpp - -Installation: -#+begin_src bash -paru -S ncmpcpp +Enable Syncthing: +#+begin_src bash :tangle no +systemctl --user enable --now syncthing #+end_src -The main config is located here: =~/.ncmpcpp/config=. -The key bindings can be configured here: =~/.ncmpcpp/bindings=. +** GTK Theme -* Movies -** =mpv= - Media Player -Installation: #+begin_src bash - paru -S mpv +echo "==> GTK Theme" +paru -S --needed \ + lxappearance \ + arc-gtk-theme \ + xcursor-breeze \ + gtk2fontsel #+end_src -The configuration is set in =/.config/mpv/input.conf=. - -* Contact Manager -** =khard= - Google Conctacts -https://github.com/scheibler/khard +** Misc Utilities #+begin_src bash -paru -S khard +echo "==> Misc Utilities" +paru -S --needed \ + screenkey \ + xwallpaper \ + highlight-pointer-git \ + mpd #+end_src -This is the command line interface for contact management. +** Systemd Services -Contact synchronization: -Vdirsyncer is used for contact synchronization with Google. - -To search with Khard: =khard = - -** =mu= - Index Emails -#+begin_src bash -paru -S mu +Enable custom systemd services (tangle [[file:systemd.org][systemd.org]] first): +#+begin_src bash :tangle no +systemctl --user enable --now homelab-tunnel +systemctl --user enable --now esrf-tunnel +systemctl --user enable --now syncthing #+end_src -This looks for contacts in all indexed emails. -=mu cfind = +** After Install -* =redshift= -http://jonls.dk/redshift/ - -#+begin_src bash -paru -S redshift-minimal +Enable TRIM (SSD only): +#+begin_src bash :tangle no +sudo systemctl enable --now fstrim.timer #+end_src -* Mail Setup -[[file:mail.org][Link]] to the mail setup. +** Default Applications -** =mbsync= - Synchronize Mailboxes -http://isync.sourceforge.net/ -https://wiki.archlinux.org/index.php/Isync - -*** Installation -#+begin_src bash -paru -S isync +#+begin_src bash :tangle no +xdg-mime default qutebrowser.desktop x-scheme-handler/http +xdg-mime default qutebrowser.desktop x-scheme-handler/https #+end_src -*** Configuration -=~/.mbsyncrc= +* Mail Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-mail.sh :shebang "#!/bin/bash" :mkdirp yes +:END: -*** Automation using systemd -**** Retreive New mails -- =checkmail= -- =~/.config/systemd/user/checkmail.service= -- =~/.config/systemd/user/checkmail.timer= +Mail setup documentation: [[file:mail.org][mail.org]] #+begin_src bash -systemctl --user enable checkmail.timer -systemctl --user start checkmail.timer +set -euo pipefail #+end_src -**** Synchronize all the mailboxes -- =~/.config/systemd/user/syncmail.service= -- =~/.config/systemd/user/syncmail.timer= +** Packages #+begin_src bash -systemctl --user enable syncmail.timer -systemctl --user start syncmail.timer +echo "==> Mail packages" +paru -S --needed \ + isync \ + msmtp \ + neomutt \ + mu \ + lynx urlview #+end_src -** =msmtp= - Send Mails -https://marlam.de/msmtp/ +** Initialize mu -*** Installation -#+begin_src bash - 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 +#+begin_src bash :tangle no +echo "==> Initializing mu index" mu init -m ~/.mail/ mu index #+end_src -** =neomutt= - Mail Client -https://github.com/neomutt/neomutt +** Systemd Timers -*** Installation -#+begin_src bash -paru -S neomutt -#+end_src - -*** Open Url from mail -#+begin_src bash -paru -S urlview -#+end_src - -*** Ressources -- http://therandymon.com/woodnotes/mutt/using-mutt.html -- https://ankursinha.in/2017/12/16/transitioning-to-neomutt-and-friends-for-e-mail.html -- https://github.com/LukeSmithxyz/mutt-wizard - -** Notification system -A script (=checkmail=) is used to retreive new mails and use =notify=send= is there are new received mails. - -* =ranger= and =pcmanfm= - File Manager -Configuration files: -- Terminal based: [[file:ranger.org][Ranger]] - -** Ranger -https://github.com/ranger/ranger -*** Installation -#+begin_src bash -paru -S ranger -#+end_src - -#+begin_src bash -paru -S dragon-drop -#+end_src - -*** Configuration -The configuration file is =~/.config/ranger/rc.conf=. - -*** Display pdf -All the display of the files are defined in =~/.config/ranger/scope.sh=. - -It seems that Ranger is not working well with Termite. The screen is not refreshing after viewing one image ([[https://github.com/ranger/ranger/issues/859][Github Issue]]). - -It works better with Urxvt. - -** GUI File Manager: pcmanfm -https://wiki.archlinux.org/index.php/PCManFM - -#+begin_src bash -paru -S pcmanfm -#+end_src - -* =nsxiv= - Image viewer -https://github.com/nsxiv/nsxiv - -** Installation -#+begin_src bash -paru -S nsxiv -#+end_src - -** Open Gif -#+begin_src bash -nsxiv -a file.gif -#+end_src - -** Cheatsheet -| Command | Usage | -|--------------+--------------------------| -| =-t= | Start in Thumbmail mode | -| =f= | Toggle fullscreen | -| =Return= | Switch to thumbmail mode | -| =<=, =>= | Rotate the image | -| =\vert=, =_= | Flip the image | -| =n=, =p= | Next, Previous image | - -* =sxhkd= - HotKey Manager -#+begin_src bash -paru -S sxhkd -#+end_src - -Configuration file: [[file:sxhkd.org][SXHKD]]. - -* =i3= - Windows Manager -[[file:i3.org][Link]] to the documentation - -** Installation -#+begin_src bash -paru -S i3-gaps -#+end_src - -** Configuration -=~/.i3/config= - -* =polybar= - Top Bar -https://polybar.github.io/ - -[[file:polybar.org][Link]] to the documentation. - -** Installation -#+begin_src bash -paru -S polybar -#+end_src - -* =picom= - Compositor -https://wiki.archlinux.org/index.php/Picom - -[[file:compositor.org][Link]] to the documentation. - -** Installation -#+begin_src bash -paru -S picom -#+end_src - -** Configuration -=~/.config/picom/picom.conf= - -** Automatic run as daemon -Compton is run from =.xprofile= config in the background: -#+begin_src bash -picom --daemon -#+end_src - -* =dunst= - Notification Manager -https://github.com/dunst-project/dunst -https://wiki.archlinux.org/index.php/Dunst - -** Installation -#+begin_src bash -paru -S dunst -#+end_src - -** Configuration -=~/.config/dunst/dunstrc= - -** Usage -#+begin_src bash -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 -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 +#+begin_src bash :tangle no +echo "==> Enabling mail timers" systemctl --user enable --now checkmail.timer +systemctl --user enable --now syncmail.timer #+end_src -* Mathematical Software -** Insect -https://github.com/sharkdp/insect +* Calendar Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-calendar.sh :shebang "#!/bin/bash" :mkdirp yes +:END: + +Calendar/contact documentation: [[file:calendar-contact.org][calendar-contact.org]] -Installation #+begin_src bash - paru -S insect +set -euo pipefail #+end_src -| Command | Usage | -|-----------------+--------------| -| =3 m/s to km/h= | Convert Unit | +** Packages -** Matlab -[[file:matlab.org][Link]] to the configuration. +#+begin_src bash +echo "==> Calendar and contacts packages" +paru -S --needed \ + vdirsyncer \ + khal \ + khard \ + mu +#+end_src -Download Matlab here: https://fr.mathworks.com/downloads/ -Unzip, and run =./install=. -Then, choose the install directory to be =~/.local/soft/Matlab/R2024b=. +** Systemd Timer -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]]. +#+begin_src bash :tangle no +echo "==> Enabling vdirsyncer timer" +systemctl --user enable --now vdirsyncer.timer +#+end_src -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]]). +* LaTeX Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-latex.sh :shebang "#!/bin/bash" :mkdirp yes +:END: -To install a new package, run =./install= in =~/.local/soft/Matlab_Install=. +#+begin_src bash +set -euo pipefail +#+end_src -** Matlab - New way of installing +** Packages -Use [[https://github.com/mathworks-ref-arch/matlab-dockerfile][MPM]] to install Matlab. +#+begin_src bash +echo "==> LaTeX packages" +paru -S --needed \ + texlive-most tllocalmgr-git \ + biber +#+end_src -#+begin_src bash :eval no +Custom packages/classes go in =~/.local/share/texmf/tex/latex/local/=. +After adding new packages, run =sudo texhash=. + +* Laptop Install Script +:PROPERTIES: +:header-args:bash: :tangle scripts/install-laptop.sh :shebang "#!/bin/bash" :mkdirp yes +:END: + +#+begin_src bash +set -euo pipefail +#+end_src + +** Power Management + +#+begin_src bash +echo "==> Laptop power management" +paru -S --needed \ + powertop \ + tlp \ + thermald +#+end_src + +#+begin_src bash +sudo systemctl enable --now tlp +sudo systemctl enable --now tlp-sleep +sudo systemctl enable --now thermald +sudo tlp start +#+end_src + +** Lid Open/Close + +Configure in =/etc/systemd/logind.conf=. +See [[https://wiki.archlinux.org/index.php/Power_management][Arch Wiki: Power management]]. + +* Matlab + +Matlab is installed manually via [[https://github.com/mathworks-ref-arch/matlab-dockerfile][MPM]]: + +#+begin_src bash :eval no :tangle no wget https://www.mathworks.com/mpm/glnxa64/mpm chmod +x ./mpm ./mpm install --inputfile=./mpm_input_r2024b.txt #+end_src -With the input file: +The MPM input file: #+begin_src conf :tangle ~/Downloads/mpm_input_r2024b.txt ######################################################################## ## Configuration File for Installing or Downloading R2024b MathWorks Products ######################################################################## -## -## Use this file to configure the installation or download of MathWorks -## products and support packages from the command line using the -## MATLAB Package Manager (mpm). -## -## To configure your MATLAB installation or download: -## -## 1. Set configuration parameters by uncommenting lines that -## start with a single '#' and updating the values. The -## comments above each parameter describe the valid values. -## -## 2. Run mpm from the command line, using the --inputfile option -## to specify the full path to this configuration file. -## -## Install products: -## mpm install --inputfile -## -## Download products without installing: -## mpm download --inputfile -## -## You can download template input files for all supported releases from -## https://github.com/mathworks-ref-arch/matlab-dockerfile/blob/main/MPM.md -## -######################################################################## - - -######################################################################## -## RELEASE -######################################################################## -## -## By default, mpm gets the latest versions of R2024b MathWorks products -## and support packages using this input file. -## -## To get a specific update for R2024b, set the desired update -## number (for example, 1, 2, 3, and so on) and uncomment the following -## line. An updateLevel of 0 gets the general release. - -# updateLevel=0 - - -######################################################################## -## INSTALLATION OR DOWNLOAD FOLDER -######################################################################## -## -## When installing products using 'mpm install': -## -## Specify the full path to the folder where you want to install the -## products. When adding products or support packages to an -## existing MATLAB installation, specify the full path to the folder -## where MATLAB is installed. -## -## Example: -## (Linux) destinationFolder=/usr/local/MATLAB/RXXXX -## (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX -## (Mac) destinationFolder=/Applications/MATLAB_RXXXX.app -## -## When downloading products using 'mpm download': -## -## Specify the full path to the folder where you want to download the -## products. For 'mpm download', this option is required. -## -## Example: -## (Linux/Mac) destinationFolder=/home//downloads/mathworks -## (Windows) destinationFolder=C:\Users\\Downloads\MathWorks -## -## Set the desired value for destinationFolder and -## uncomment the following line. destinationFolder=/home/thomas/.local/soft/Matlab/R2024b - ######################################################################## ## PRODUCTS ######################################################################## -## -## Uncomment the lines for the products you want to install or download. #product.5G_Toolbox #product.AUTOSAR_Blockset @@ -954,228 +635,22 @@ product.System_Identification_Toolbox #product.Wireless_HDL_Toolbox #product.Wireless_Testbench - -######################################################################## -## SUPPORT PACKAGES -######################################################################## -## -## Uncomment the lines for the support packages you want to install or download. - -#product.6G_Exploration_Library_for_5G_Toolbox -#product.ASIC_Testbench_for_HDL_Verifier -#product.Aerospace_Blockset_Interface_for_Unreal_Engine_Projects -#product.Audio_Toolbox_Interface_for_SpeechBrain_and_Torchaudio_Libraries -#product.Automated_Driving_Toolbox_Importer_for_Zenrin_Japan_Map_API_3.0_(Itsumo_NAVI_API_3.0)_Service -#product.Automated_Driving_Toolbox_Interface_for_Unreal_Engine_Projects -#product.Automated_Driving_Toolbox_Model_for_Lidar_Lane_Detection -#product.Automated_Driving_Toolbox_Test_Suite_for_Euro_NCAP_Protocols -#product.Automated_Visual_Inspection_Library_for_Computer_Vision_Toolbox -#product.CI/CD_Automation_for_Simulink_Check -#product.Communications_Toolbox_Support_Package_for_Analog_Devices_ADALM-Pluto_Radio -#product.Communications_Toolbox_Support_Package_for_RTL-SDR_Radio -#product.Communications_Toolbox_Support_Package_for_USRP_Embedded_Series_Radio -#product.Communications_Toolbox_Support_Package_for_USRP_Radio -#product.Communications_Toolbox_Wireless_Network_Simulation_Library -#product.Component_Deployment_Guideline_for_Embedded_Coder -#product.Computer_Vision_Toolbox_Interface_for_OpenCV_in_MATLAB -#product.Computer_Vision_Toolbox_Interface_for_OpenCV_in_Simulink -#product.Computer_Vision_Toolbox_Model_for_Inflated-3D_Video_Classification -#product.Computer_Vision_Toolbox_Model_for_Mask_R-CNN_Instance_Segmentation -#product.Computer_Vision_Toolbox_Model_for_Object_Keypoint_Detection -#product.Computer_Vision_Toolbox_Model_for_Pose_Mask_R-CNN_6-DoF_Object_Pose_Estimation -#product.Computer_Vision_Toolbox_Model_for_R(2+1)D_Video_Classification -#product.Computer_Vision_Toolbox_Model_for_RAFT_Optical_Flow_Estimation -#product.Computer_Vision_Toolbox_Model_for_RTMDet_Object_Detection -#product.Computer_Vision_Toolbox_Model_for_SOLOv2_Instance_Segmentation -#product.Computer_Vision_Toolbox_Model_for_SlowFast_Video_Classification -#product.Computer_Vision_Toolbox_Model_for_Text_Detection -#product.Computer_Vision_Toolbox_Model_for_Vision_Transformer_Network -#product.Computer_Vision_Toolbox_Model_for_YOLO_v2_Object_Detection -#product.Computer_Vision_Toolbox_Model_for_YOLO_v3_Object_Detection -#product.Computer_Vision_Toolbox_Model_for_YOLO_v4_Object_Detection -#product.Computer_Vision_Toolbox_OCR_Language_Data -#product.Data_Acquisition_Toolbox_Support_Package_for_Analog_Devices_ADALM1000_Hardware -#product.Data_Acquisition_Toolbox_Support_Package_for_Digilent_Analog_Discovery_Hardware -#product.Data_Acquisition_Toolbox_Support_Package_for_Measurement_Computing_Hardware -#product.Data_Acquisition_Toolbox_Support_Package_for_National_Instruments_NI-DAQmx_Devices -#product.Data_Acquisition_Toolbox_Support_Package_for_Windows_Sound_Cards -#product.Database_Toolbox_Interface_for_Neo4j_Bolt_Protocol -#product.Databricks_ODBC_Driver_for_Database_Toolbox -#product.Deep_Learning_HDL_Toolbox_Support_Package_for_Intel_FPGA_and_SoC_Devices -#product.Deep_Learning_HDL_Toolbox_Support_Package_for_Xilinx_FPGA_and_SoC_Devices -#product.Deep_Learning_Toolbox_Converter_for_ONNX_Model_Format -#product.Deep_Learning_Toolbox_Converter_for_PyTorch_Model_Format -#product.Deep_Learning_Toolbox_Converter_for_TensorFlow_models -#product.Deep_Learning_Toolbox_Importer_for_Caffe_Models -#product.Deep_Learning_Toolbox_Interface_for_TensorFlow_Lite -#product.Deep_Learning_Toolbox_Model_Quantization_Library -#product.Deep_Learning_Toolbox_Model_for_AlexNet_Network -#product.Deep_Learning_Toolbox_Model_for_DarkNet-19_Network -#product.Deep_Learning_Toolbox_Model_for_DarkNet-53_Network -#product.Deep_Learning_Toolbox_Model_for_DenseNet-201_Network -#product.Deep_Learning_Toolbox_Model_for_EfficientNet-b0_Network -#product.Deep_Learning_Toolbox_Model_for_GoogLeNet_Network -#product.Deep_Learning_Toolbox_Model_for_Inception-ResNet-v2_Network -#product.Deep_Learning_Toolbox_Model_for_Inception-v3_Network -#product.Deep_Learning_Toolbox_Model_for_MobileNet-v2_Network -#product.Deep_Learning_Toolbox_Model_for_NASNet-Large_Network -#product.Deep_Learning_Toolbox_Model_for_NASNet-Mobile_Network -#product.Deep_Learning_Toolbox_Model_for_Places365-GoogLeNet_Network -#product.Deep_Learning_Toolbox_Model_for_ResNet-101_Network -#product.Deep_Learning_Toolbox_Model_for_ResNet-18_Network -#product.Deep_Learning_Toolbox_Model_for_ResNet-50_Network -#product.Deep_Learning_Toolbox_Model_for_ShuffleNet_Network -#product.Deep_Learning_Toolbox_Model_for_VGG-16_Network -#product.Deep_Learning_Toolbox_Model_for_VGG-19_Network -#product.Deep_Learning_Toolbox_Model_for_Xception_Network -#product.Deep_Learning_Toolbox_Verification_Library -#product.Embedded_Coder_Interface_to_QEMU_Emulator -#product.Embedded_Coder_Support_Package_For_Linux_Applications -#product.Embedded_Coder_Support_Package_for_AMD_SoC_Devices -#product.Embedded_Coder_Support_Package_for_ARM_Cortex-A_Processors -#product.Embedded_Coder_Support_Package_for_ARM_Cortex-M_Processors -#product.Embedded_Coder_Support_Package_for_ARM_Cortex-R_Processors -#product.Embedded_Coder_Support_Package_for_BeagleBone_Black_Hardware -#product.Embedded_Coder_Support_Package_for_Infineon_AURIX_TC3x_Microcontrollers -#product.Embedded_Coder_Support_Package_for_Infineon_AURIX_TC4x_Microcontrollers -#product.Embedded_Coder_Support_Package_for_Intel_SoC_Devices -#product.Embedded_Coder_Support_Package_for_Qualcomm_Hexagon_Processors -#product.Embedded_Coder_Support_Package_for_STMicroelectronics_STM32_Processors -#product.Ephemeris_Data_for_Aerospace_Toolbox -#product.Extended_Tire_Features_for_Vehicle_Dynamics_Blockset -#product.FMU_Builder_For_Simulink -#product.GPU_Coder_Interface_for_Deep_Learning_Libraries -#product.GUIDE_to_App_Designer_Migration_Tool_for_MATLAB -#product.Geoid_Data_for_Aerospace_Toolbox -#product.HDL_Coder_Support_Package_for_Intel_FPGA_and_SoC_Devices -#product.HDL_Coder_Support_Package_for_Microchip_FPGA_and_SoC_Devices -#product.HDL_Coder_Support_Package_for_Xilinx_FPGA_and_SoC_Devices -#product.HDL_Verifier_Support_Package_for_AMD_FPGA_and_SoC_Devices -#product.HDL_Verifier_Support_Package_for_Intel_FPGA_Boards -#product.HDL_Verifier_Support_Package_for_Microsemi_FPGA_Boards -#product.Hyperspectral_Imaging_Library_for_Image_Processing_Toolbox -#product.Image_Acquisition_Toolbox_Support_Package_for_DCAM_Hardware -#product.Image_Acquisition_Toolbox_Support_Package_for_Kinect_for_Windows_Sensor -#product.Image_Acquisition_Toolbox_Support_Package_for_Matrox_Hardware -#product.Image_Acquisition_Toolbox_Support_Package_for_National_Instruments_Frame_Grabbers -#product.Image_Acquisition_Toolbox_Support_Package_for_OS_Generic_Video_Interface -#product.Image_Acquisition_Toolbox_Support_Package_for_Point_Grey_Hardware -#product.Image_Acquisition_Toolbox_Support_Package_for_Teledyne_DALSA_Sapera_Hardware -#product.Image_Processing_Toolbox_Image_Data -#product.Image_Processing_Toolbox_Model_for_Segment_Anything_Model -#product.Instrument_Control_Toolbox_Support_Package_for_IVI_and_VXIplug&play_Drivers -#product.Instrument_Control_Toolbox_Support_Package_for_Keysight_(Agilent)_IO_Libraries_and_VISA_Interface -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-845x_I2C/SPI_Interface -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-DCPower_Power_Supplies -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-DMM_Digital_Multimeters -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-FGEN_Function_Generators -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-SCOPE_Oscilloscopes -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_NI-SWITCH_Hardware -#product.Instrument_Control_Toolbox_Support_Package_for_National_Instruments_VISA_and_ICP_Interfaces -#product.Instrument_Control_Toolbox_Support_Package_for_Rohde_Schwarz_VISA_Interface -#product.Instrument_Control_Toolbox_Support_Package_for_Total_Phase_Aardvark_I2C/SPI_Interface -#product.Integro-Differential_Modeling_Framework_for_MATLAB -#product.Lidar_Toolbox_Interface_for_OpenPCDet_Library -#product.Lidar_Toolbox_Model_for_RandLA-Net_Semantic_Segmentation -#product.Lidar_Toolbox_Support_Package_for_Hokuyo_LiDAR_Sensors -#product.Lidar_Toolbox_Support_Package_for_Ouster_Lidar_Sensors -#product.Lidar_Toolbox_Support_Package_for_Velodyne_LiDAR_Sensors -#product.MATLAB_Basemap_Data_-_bluegreen -#product.MATLAB_Basemap_Data_-_colorterrain -#product.MATLAB_Basemap_Data_-_grayland -#product.MATLAB_Basemap_Data_-_grayterrain -#product.MATLAB_Basemap_Data_-_landcover -#product.MATLAB_Client_for_MATLAB_Production_Server -#product.MATLAB_Coder_Interface_for_Deep_Learning_Libraries -#product.MATLAB_Coder_Interface_for_Visual_Studio_Code_Debugging -#product.MATLAB_Coder_Support_Package_for_NVIDIA_Jetson_and_NVIDIA_DRIVE_Platforms -#product.MATLAB_Support_Package_for_Android_Sensors -#product.MATLAB_Support_Package_for_Apple_iOS_Sensors -#product.MATLAB_Support_Package_for_Arduino_Hardware -#product.MATLAB_Support_Package_for_BeagleBone_Black_Hardware -#product.MATLAB_Support_Package_for_LEGO_MINDSTORMS_EV3_Hardware -#product.MATLAB_Support_Package_for_Quantum_Computing -#product.MATLAB_Support_Package_for_Raspberry_Pi_Hardware -#product.MATLAB_Support_Package_for_USB_Webcams -#product.MATLAB_Support_for_MinGW-w64_C/C++/Fortran_Compiler -#product.Machine_Learning_Pipelines_for_Statistics_and_Machine_Learning_Toolbox_(Beta) -#product.MariaDB_ODBC_Driver_for_Database_Toolbox -#product.Medical_Imaging_Toolbox_Interface_for_Cellpose -#product.Medical_Imaging_Toolbox_Interface_for_MONAI_Label_Library -#product.Medical_Imaging_Toolbox_Model_for_Medical_Segment_Anything_Model -#product.Mixed-Signal_Blockset_Models -#product.Modelscape_for_MATLAB -#product.Multi-Version_Co-Simulation_for_Simulink -#product.PostgreSQL_ODBC_Driver_for_Database_Toolbox -#product.Powertrain_Blockset_Drive_Cycle_Data -#product.RF_Blockset_Models_for_Analog_Devices_RF_Transceivers -#product.ROS_Toolbox_Support_Package_for_TurtleBot-Based_Robots -#product.Radar_Toolbox_Support_Package_for_Texas_Instruments_mmWave_Radar_Sensors -#product.Robotics_System_Toolbox_Interface_for_Unreal_Engine_Projects -#product.Robotics_System_Toolbox_Offroad_Autonomy_Library -#product.Robotics_System_Toolbox_Robot_Library_Data -#product.Robotics_System_Toolbox_Support_Package_for_Kinova_Gen3_Manipulators -#product.Robotics_System_Toolbox_Support_Package_for_Universal_Robots_UR_Series_Manipulators -#product.Scenario_Builder_for_Automated_Driving_Toolbox -#product.Signal_Processing_Toolbox_Support_Package_for_Linux_IIO_Devices -#product.Simulink_Coder_Support_Package_for_ARM_Cortex-based_VEX_Microcontroller -#product.Simulink_Coder_Support_Package_for_BeagleBone_Blue_Hardware -#product.Simulink_Coder_Support_Package_for_NXP_FRDM-K64F_Board -#product.Simulink_Coder_Support_Package_for_NXP_FRDM-KL25Z_Board -#product.Simulink_Coder_Support_Package_for_STMicroelectronics_Nucleo_Boards -#product.Simulink_Coder_Support_Package_for_VEX_EDR_V5_Robot_Brain -#product.Simulink_Interface_for_Siemens_MF-Tyre/MF-Swift_Tire_Model -#product.Simulink_Real-Time_XIL_Support_Package -#product.Simulink_Support_Package_for_Android_Devices -#product.Simulink_Support_Package_for_Arduino_Hardware -#product.Simulink_Support_Package_for_LEGO_MINDSTORMS_EV3_Hardware -#product.Simulink_Support_Package_for_Parrot_Minidrones -#product.Simulink_Support_Package_for_Raspberry_Pi_Hardware -#product.Simulink_Test_Support_Package_for_ASAM_XIL -#product.SoC_Blockset_Support_Package_for_AMD_FPGA_and_SoC_Devices -#product.SoC_Blockset_Support_Package_for_Embedded_Linux_Devices -#product.SoC_Blockset_Support_Package_for_Intel_Devices -#product.Streaming_Data_Framework_for_MATLAB_Production_Server -#product.Text_Analytics_Toolbox_Model_for_BERT-Base_Multilingual_Cased_Network -#product.Text_Analytics_Toolbox_Model_for_BERT-Base_Network -#product.Text_Analytics_Toolbox_Model_for_BERT-Large_Network -#product.Text_Analytics_Toolbox_Model_for_BERT-Mini_Network -#product.Text_Analytics_Toolbox_Model_for_BERT-Small_Network -#product.Text_Analytics_Toolbox_Model_for_BERT-Tiny_Network -#product.Text_Analytics_Toolbox_Model_for_all-MiniLM-L12-v2_Network -#product.Text_Analytics_Toolbox_Model_for_all-MiniLM-L6-v2_Network -#product.Text_Analytics_Toolbox_Model_for_fastText_English_16_Billion_Token_Word_Embedding -#product.Text_Analytics_Toolbox_Model_from_UDify_Data -#product.UAV_Toolbox_Interface_for_Unreal_Engine_Projects -#product.UAV_Toolbox_Support_Package_for_PX4_Autopilots -#product.Variant_Manager_for_Simulink -#product.Vehicle_Dynamics_Blockset_Interface_for_Unreal_Engine_Projects -#product.Vehicle_Dynamics_Blockset_Maneuver_Data -#product.WINNER_II_Channel_Model_for_Communications_Toolbox -#product.Wireless_Testbench_Support_Package_for_NI_USRP_Radios - - ######################################################################## ## CHECKSUM ######################################################################## -## -## NOTE: DO NOT edit this field. MathWorks uses this field to -## check the integrity of the input file. Changing the value -## of the checksum field invalidates this input file. ?checksum=UjIwMjRi #+end_src -Then, add some binaries to the path with: -#+begin_src bash :eval no +Add Matlab binaries to PATH: +#+begin_src bash :eval no :tangle no ln -s ~/.local/soft/Matlab/R2024b/bin/mex ~/.local/bin ln -s ~/.local/soft/Matlab/R2024b/bin/matlab ~/.local/bin ln -s ~/.local/soft/Matlab/R2024b/bin/glnxa64/mlint ~/.local/bin #+end_src -With R2024b on Arch Linux, some crash are due to gnutls. -This can be resolves as explain in #10 [[https://bbs.archlinux.org/viewtopic.php?id=306939][here]]: -#+begin_src bash :eval no +Fix for gnutls crash on Arch (R2024b), see [[https://bbs.archlinux.org/viewtopic.php?id=306939][bbs.archlinux.org #10]]: +#+begin_src bash :eval no :tangle no MATLABPATH=$HOME/.local/soft/Matlab/R2024B/bin/glnxa64/ GNUTLSPATH=/tmp/gnutls-3.8.9-1-x86_64.pkg wget https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.9-1-x86_64.pkg.tar.zst @@ -1187,589 +662,46 @@ cd "${MATLABPATH}" ln -s gnutls/* ./ #+end_src -Most of other issues are well explained in the [[https://wiki.archlinux.org/title/MATLAB][Arch Wiki]]. - -** 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 - -** =vdirsyncer= - Sync calendars -https://github.com/pimutils/vdirsyncer - -Installation: -#+begin_src bash -paru -S vdirsyncer -#+end_src - -| Command | Usage | -|-------------------+-------------| -| =vdirsyncer sync= | Synchronize | - -And start the =systemd= timer that automatically synchronize the calendars; -#+begin_src bash -systemctl --user enable --now vdirsyncer.timer -#+end_src - -To check the status of the service: -#+begin_src bash -systemctl --user status vdirsyncer.service -#+end_src - -** =khal= - Calendar Client -https://github.com/pimutils/khal - -Installation: -#+begin_src bash -paru -S khal -#+end_src - -Import ICS files: -#+begin_src bash -khal import even.ics -#+end_src - -* =zathura= - PDF Reader -https://pwmt.org/projects/zathura/ -** Installation -#+begin_src bash -paru -S zathura -#+end_src - -Then add dependecies to view specific files: -#+begin_src bash -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= - -** Cheatsheet -| Command | Usage | -|---------+----------------------------| -| =p= | Print the current pdf | -| =tab= | Show the outline | -| =r= | Reload | -| =J/K= | Next/previous page | -| =H/L= | Zoom in/out | -| =a= | Fit height | -| =s= | Fit width | -| =D= | Double page | -| =f= | Follow link | -| =i= | Night Mode | -| =gg= | Go to page n | -| =mm= | Mark current location to m | -| ='m= | Goto location m | - -** Multi-monitor pdf presentation - pdfpc -https://github.com/pdfpc/pdfpc - -pdfpc is a great tool for showing pdf presentations. It support: -- screen splitting -- support for videos in pdf presentations -- support for notes -- support for annotations - -*** Installation -#+begin_src bash - paru -S pdfpc -#+end_src - -*** Video support -#+begin_src bash - paru -S gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav -#+end_src - -*** Usage -#+begin_src bash - pdfpc filename.pdf -#+end_src - -* =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=. - -*** Gui Manager - -To customize the look of the system using GUI application, run ~lxappearance~. - -Installation: -#+begin_src bash -paru -S lxappearance -#+end_src - -*** 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 -paru -S inkscape -#+end_src - -* Docker -#+begin_src bash -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 -** Useful utils -#+begin_src bash -paru -S sshfs poppler mpd xwallpaper sof-firmware usbutils xautolock atool unzip xsel man-db npm highlight-pointer-git xorg-xkill -#+end_src - -** ESRF related -#+begin_src bash -paru -S zoom -#+end_src - -** =colorpicker= ([[https://github.com/Jack12816/colorpicker][github]]) -Copy hexadecimal value of the color to the clipboard: -#+begin_src bash :eval no -colorpicker --short --one-shot --preview | xsel -b -#+end_src - -Also colorbrag: https://aur.archlinux.org/packages/colorgrab - -** =maim=/=flameshot= - Take Screenshots -- https://github.com/naelstrof/maim -- https://github.com/lupoDharkael/flameshot - -#+begin_src bash -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 -paru -S fd ripgrep fzf -#+end_src - -** PDF/Image Utilities -- https://github.com/dawbarton/pdf2svg -- https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/ -- https://github.com/Airblader/unclutter-xfixes - -#+begin_src bash -paru -S pdf2svg pdftk unclutter pdfarranger imagemagick -#+end_src - -** Trash -=trash-cli= is used to manage the trash. -It is integrated with =ranger= and =pcmanFM=. - -#+begin_src bash -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 -- https://github.com/leonwind/cli2cloud -- Gnu Make alternative https://github.com/taskctl/taskctl - -* Printer -** CUPS -https://wiki.archlinux.org/index.php/CUPS - -#+begin_src bash -paru -S cups -#+end_src - -Web based administration: http://localhost:631/ - -=system-config-printer= - -Starts to cups service: -#+begin_src bash :eval no -sudo systemctl start cups -#+end_src - -Check the queue -#+begin_src bash -lpq -lpq -a # on all queues -#+end_src - -Clear the queue -#+begin_src bash -lprm # remove last entry only -lprm - # remove all entries -#+end_src - -Print a file -#+begin_src bash -lpr -P printer_name filename.pdf -#+end_src - -List available printers -#+begin_src bash -lpstat -a -#+end_src - -Stats about the printer -#+begin_src bash -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 | +See also the [[https://wiki.archlinux.org/title/MATLAB][Arch Wiki]] for other issues. + +* Useful Reference +** Readline shortcuts +| Keyboard | Description | +|------------+--------------------------------| +| =Ctrl+a= | Move to start of line | +| =Ctrl+e= | Move to end of line | +| =Alt+b/f= | Move word left/right | +| =Ctrl+u= | Cut to start of line | +| =Ctrl+k= | Cut to end of line | +| =Ctrl+w= | Cut word before cursor | +| =Ctrl+y= | Paste | +| =Ctrl+r= | Reverse history search | +| =Alt+r= | Restore original line | ** 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 | +Use =apack= / =aunpack= (from =atool=): +| Command | Usage | +|-------------------------------+--------------------------------| +| =aunpack foobar.tar.gz= | Extract all files from archive | +| =apack myarchive.zip foo bar= | Create zip archive | ** Hardware | =dmesg= | Detected hardware and boot messages | | =lshw= | Display information on hardware | -| =lsusb -tv= | Show usb devices | +| =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 rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist -#+end_src - -Enable =SysRq= key by created this file =/etc/sysctl.d/99-sysctl.conf=: -#+begin_src conf -kernel.sysrq = 1 -#+end_src - -Then, =Alt-prtsc-F= can be used when the system freezes due to lack of memory. -It basically kills the process with the most used memory. - -* 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 +| =ip addr show= | Show all network interfaces | +| =netstat -tulp= | List all active ports | * 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]] +** Linux Software Lists +- [[https://github.com/k4m4/terminals-are-sexy][terminals-are-sexy]] +- [[https://wiki.archlinux.org/index.php/List_of_applications][Arch Wiki: List of applications]] - 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 | -| =msmtp= | SMTP client that can be used as an SMTP plugin for Mutt | -| =isync= | Synchronize a maildir with an IMAP server | -| =vdirsyncer= | Synchronize calendars and contacts | -| =abook= | Address book with mutt support | -| =urlview= | URL extractor/launcher | -| =w3m= | Pager/text based browser | -| =lynx= | Text mode web browser | -| =lbdb= | Little brother's database for the mutt mail reader | -| =mu= | Tool for searching e-mail messages stored in the maildir-format | -| =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 | -| =the_platinum_searcher= | Multi-platform code-search similar to ack and ag | -| =the_silver_searcher= | Code-search similar to ack | -| =fdupes= | Identify or delete duplicate files | -| =findutils= | Collection of GNU find, xargs, and locate | -| =ranger= | File browser | -| =vifm= | Ncurses based file manager with vi like keybindings | -| =tree= | Display directories as trees (with optional color/HTML output) | -| =p7zip= | 7-Zip (high compression file archiver) implementation | -| =unrar= | Extract, view, and test RAR archives | -| =atool= =zip= | script for managing file archives of various types | - -** File Downloader -| =wget= | Internet file retriever | -| =htop= | Improved top (interactive process viewer) | -| =httpie= | User-friendly cURL replacement (command-line HTTP client) | -| =curl= | Get a file from an HTTP, HTTPS or FTP server | - -** Utils -| =binutils= | GNU Binary Utilities | -| =coreutils= | GNU File, Shell, and Text utilities | -| =gnome= | doc-utils - Documentation utilities for the GNOME project | -| =moreutils= | Collection of tools that nobody wrote when UNIX was young | -| =usbimager= | https://gitlab.com/bztsrc/usbimager | - -** A trier -| =asciinema= | Terminal session recorder | -| =automake= | tool for automatically generating Makefile | -| =cmake= | Cross-platform make | -| =cputhrottle= | Limit the CPU usage of a process | -| =ctags= | Reimplementation of ctags | -| =gdb= | GNU debugger | -| =ghostscript= | Interpreter for PostScript and PDF | -| =go= | Open source programming language to build simple/reliable/efficient software | -| =hugo= | Configurable static site generator | -| =markdown= | Text-to-HTML conversion tool | -| =pandoc= | Swiss-army knife of markup format conversion | -| =uni= | Query the Unicode database from the commandline | diff --git a/polybar.org b/polybar.org index 641997f..f76ccb5 100644 --- a/polybar.org +++ b/polybar.org @@ -1020,7 +1020,7 @@ fi #+begin_src bash ~/.local/bin/lockscreen & -xset s activate +sleep 1 && xset s activate & #+end_src * Network diff --git a/qutebrowser.org b/qutebrowser.org index 5f32176..25cf611 100644 --- a/qutebrowser.org +++ b/qutebrowser.org @@ -419,7 +419,7 @@ config.bind(',q', 'QRcode') ** Create a new password #+begin_src bash :tangle ~/.config/qutebrowser/userscripts/add-passowrd.sh -url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | rofi -i -p "URL" -dmenu -lines 1) +url=$(echo "$QUTE_URL" | awk -F[/:] '{print $4}' | grep -oP '[\w-]+\.[\w-]+$' | rofi -i -p "URL" -dmenu -lines 1) username=$(echo -e "dehaeze.thomas@gmail.com\nthomas.dehaeze@esrf.fr\ntdehaeze" | rofi -p "Username" -dmenu -lines 5) password=$(rofi -p "Password" -dmenu -password -lines 1) diff --git a/scripts/install-calendar.sh b/scripts/install-calendar.sh new file mode 100755 index 0000000..34e91b4 --- /dev/null +++ b/scripts/install-calendar.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -euo pipefail + +echo "==> Calendar and contacts packages" +paru -S --needed \ + vdirsyncer \ + khal \ + khard \ + mu diff --git a/scripts/install-desktop.sh b/scripts/install-desktop.sh new file mode 100755 index 0000000..112fb50 --- /dev/null +++ b/scripts/install-desktop.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" + +tangle() { + emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/$1\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")" +} + +echo "==> Desktop packages" +paru -S --needed \ + i3-wm \ + sxhkd \ + polybar \ + picom \ + dunst \ + rofi rofi-calc dmenu \ + kitty \ + bash bash-completion \ + zoxide \ + nerd-fonts-hack noto-fonts-emoji \ + xorg-xrandr arandr \ + xautocfg \ + arc-gtk-theme xcursor-breeze \ + feh xwallpaper + +echo "==> Tangling desktop configs" +tangle "xconfig.org" # ~/.Xresources, ~/.xprofile, ~/.config/X11/xinitrc +tangle "bash.org" # ~/.bashrc, ~/.bash_profile, ~/.profile +tangle "kitty.org" # ~/.config/kitty/kitty.conf +tangle "i3.org" # ~/.config/i3/config +tangle "sxhkd.org" # ~/.config/sxhkd/sxhkdrc +tangle "polybar.org" # ~/.config/polybar/config.ini + scripts +tangle "compositor.org" # ~/.config/picom/picom.conf +tangle "rofi.org" # ~/.config/rofi/config.rasi +tangle "binaries.org" # ~/.local/bin/* scripts +tangle "binaries-private.org" # ~/.local/bin/* scripts + +echo "==> Reloading desktop" +i3-msg restart 2>/dev/null || echo " (i3 not running, config will apply on next login)" diff --git a/scripts/install-emacs.sh b/scripts/install-emacs.sh new file mode 100755 index 0000000..76b6429 --- /dev/null +++ b/scripts/install-emacs.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" +DOOM="${HOME}/.config/emacs/bin/doom" + +echo "==> Emacs packages" +paru -S --needed emacs aspell aspell-en aspell-fr + +echo "==> Installing Doom Emacs" +git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs +"${DOOM}" install --no-config + +echo "==> Tangling doom.org" +emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")" + +echo "==> Running doom sync" +"${DOOM}" sync diff --git a/scripts/install-laptop.sh b/scripts/install-laptop.sh new file mode 100755 index 0000000..84d5bca --- /dev/null +++ b/scripts/install-laptop.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -euo pipefail + +echo "==> Laptop power management" +paru -S --needed \ + powertop \ + tlp \ + thermald + +sudo systemctl enable --now tlp +sudo systemctl enable --now tlp-sleep +sudo systemctl enable --now thermald +sudo tlp start diff --git a/scripts/install-latex.sh b/scripts/install-latex.sh new file mode 100755 index 0000000..4424025 --- /dev/null +++ b/scripts/install-latex.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail + +echo "==> LaTeX packages" +paru -S --needed \ + texlive-most tllocalmgr-git \ + biber diff --git a/scripts/install-mail.sh b/scripts/install-mail.sh new file mode 100755 index 0000000..46dc2df --- /dev/null +++ b/scripts/install-mail.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -euo pipefail + +echo "==> Mail packages" +paru -S --needed \ + isync \ + msmtp \ + neomutt \ + mu \ + lynx urlview diff --git a/scripts/install-main.sh b/scripts/install-main.sh new file mode 100755 index 0000000..37df236 --- /dev/null +++ b/scripts/install-main.sh @@ -0,0 +1,113 @@ +#!/bin/bash +set -euo pipefail + +echo "==> Shell and Terminal" +paru -S --needed \ + bash bash-completion zsh \ + kitty \ + tmux + +echo "==> Fonts" +paru -S --needed \ + nerd-fonts-hack \ + noto-fonts-emoji + +echo "==> Text Editors" +paru -S --needed \ + neovim python-pynvim \ + emacs \ + aspell aspell-en aspell-fr + +echo "==> GnuPG and Pass" +paru -S --needed \ + gnupg gnome-keyring \ + pass rofi-pass pass-git-helper + +echo "==> Window Manager and Desktop" +paru -S --needed \ + i3-wm \ + sxhkd \ + polybar \ + picom \ + dunst \ + rofi rofi-calc dmenu \ + xautocfg \ + xorg-xrandr arandr + +echo "==> File Manager" +paru -S --needed yazi + +echo "==> Terminal Utilities" +paru -S --needed \ + fd ripgrep fzf \ + xclip xsel \ + atool unzip \ + trash-cli \ + man-db \ + neofetch + +echo "==> Browser" +paru -S --needed \ + qutebrowser python-adblock pdfjs \ + firefox-developer-edition passff-host + +echo "==> Media" +paru -S --needed \ + mpv \ + jellyfin-tui \ + nsxiv \ + zathura zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb \ + pdfpc \ + gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav + +echo "==> PipeWire" +paru -S --needed \ + pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse \ + wireplumber \ + pwvucontrol + +echo "==> PDF and Image Utilities" +paru -S --needed \ + pdf2svg pdftk pdfarranger \ + imagemagick \ + maim flameshot \ + unclutter \ + poppler + +echo "==> Office" +paru -S --needed \ + onlyoffice-bin \ + libreoffice-fresh libreoffice-fresh-fr \ + inkscape + +echo "==> System Utilities" +paru -S --needed \ + udiskie \ + blueman \ + sshfs \ + xwallpaper \ + sof-firmware \ + usbutils \ + xautolock \ + npm \ + xorg-xkill \ + syncthing \ + wireguard-tools \ + gotify-dunst-git \ + gomuks \ + yt-dlp \ + python ipython python-pip + +echo "==> GTK Theme" +paru -S --needed \ + lxappearance \ + arc-gtk-theme \ + xcursor-breeze \ + gtk2fontsel + +echo "==> Misc Utilities" +paru -S --needed \ + screenkey \ + xwallpaper \ + highlight-pointer-git \ + mpd diff --git a/scripts/install-neovim.sh b/scripts/install-neovim.sh new file mode 100755 index 0000000..c95639b --- /dev/null +++ b/scripts/install-neovim.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" + +echo "==> Neovim packages" +paru -S --needed neovim python-pynvim nodejs-neovim + +echo "==> Installing vim-plug" +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' + +echo "==> Tangling vim.org" +emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/vim.org\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/vim.org\")" + +echo "==> Installing neovim plugins" +nvim --headless +PlugInstall +UpdateRemotePlugins +qa diff --git a/sxhkd.org b/sxhkd.org index 50bb15b..6c02ae9 100644 --- a/sxhkd.org +++ b/sxhkd.org @@ -125,7 +125,7 @@ super + z #+begin_src conf # Start Terminal super + Return - $TERMINAL + $TERMINAL --instance-group 9 # Start Terminal (floating) super + shift + Return @@ -173,6 +173,10 @@ super + shift + s super + shift + p rofi-pass +# Umount all directories +super + shift + u + ~/.local/bin/umount-dirs + # Fill ESRF password super + shift + f xdotool key $(pass esrf.fr/dehaeze | head -n 1 | sed 's/./& /g' | sed 's/}/braceright/g') diff --git a/vim.org b/vim.org index 0981d86..fe08241 100644 --- a/vim.org +++ b/vim.org @@ -4,6 +4,49 @@ #+PROPERTY: header-args+ :mkdirp yes #+PROPERTY: header-args+ :tangle ~/.config/nvim/init.vim +* Installation +:PROPERTIES: +:header-args:bash: :tangle scripts/install-neovim.sh :shebang "#!/bin/bash" :mkdirp yes +:END: + +#+begin_src bash +set -euo pipefail + +DOTFILES="${HOME}/.config/literate-dotfiles" +#+end_src + +** Packages + +#+begin_src bash +echo "==> Neovim packages" +paru -S --needed neovim python-pynvim nodejs-neovim +#+end_src + +** vim-plug + +#+begin_src bash +echo "==> Installing vim-plug" +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 + +** Tangle Configuration + +Tangle =vim.org= to generate =~/.config/nvim/init.vim=: + +#+begin_src bash +echo "==> Tangling vim.org" +emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/vim.org\")" \ + || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/vim.org\")" +#+end_src + +** Install Plugins + +#+begin_src bash +echo "==> Installing neovim plugins" +nvim --headless +PlugInstall +UpdateRemotePlugins +qa +#+end_src + * Plugins Install ** Plug start #+BEGIN_SRC vimrc diff --git a/xconfig.org b/xconfig.org index b7b2556..a009b4d 100644 --- a/xconfig.org +++ b/xconfig.org @@ -132,6 +132,24 @@ fi exec i3 #+end_src +* =setup-display= Script +:PROPERTIES: +:header-args:bash: :tangle ~/.local/bin/setup-display :mkdirp yes :tangle-mode (identity #o755) :comments none +:END: + +Detects connected outputs and applies the appropriate =xrandr= configuration. + +#+begin_src bash :shebang "#!/bin/bash" +# Desktop: DP-5 connected +if xrandr | grep -q "^DP-5 connected"; then + xrandr --output DP-5 --mode 2560x1440 --dpi 192 + +# Laptop: eDP-1 connected +elif xrandr | grep -q "^eDP-1 connected"; then + xrandr --output eDP-1 --mode 1920x1200 --dpi 192 +fi +#+end_src + * =~/.xprofile= :PROPERTIES: :header-args: :tangle ~/.xprofile @@ -149,7 +167,7 @@ setxkbmap -layout us -variant intl -option caps:escape & Start programs related to display: #+begin_src bash # Screen options -xrandr --output eDP-1 --mode 1920x1200 --dpi 192 & +~/.local/bin/setup-display & # Set random wallpaper setbg ~/.local/data/wallpapers/ & @@ -159,7 +177,8 @@ pgrep -xu "$USER" unclutter >/dev/null || \ unclutter --timeout 5 & # Autolock screen after x minutes -xautolock -locker "~/.local/bin/lockscreen" -detectsleep -time 30 -notify 60 -notifier "notify-send -u critical -t 10000 -- 'Locking Screen' '60 seconds'" & +pgrep -xu "$USER" xautolock >/dev/null || \ + xautolock -locker "~/.local/bin/lockscreen" -detectsleep -time 30 -notify 60 -notifier "dunstify --replace=31846 -u critical -t 10000 -- 'Locking Screen' '60 seconds'" & # Redshift pgrep -xu "$USER" redshift >/dev/null || \ @@ -176,15 +195,6 @@ blueman-applet & # Udiskie - Automatic USB mount udiskie --notify --automount --tray & - -# Japanese input -# fcitx -d & -#+end_src - -Manually start =mopidy= as it seems to not start automatically: -#+begin_src bash -# Mopidy -~/.local/soft/mopidy-jellyfin/env/bin/mopidy >/tmp/mopidy.log 2>&1 & #+end_src Finally, run SXHKD for the key bindings: