Compare commits

...

29 Commits

Author SHA1 Message Date
tdehaeze 3bb6d2fac7 Add some installation documentation 2026-04-16 23:34:03 +02:00
tdehaeze 128f6f1bab Installation script for mails 2026-04-16 23:33:47 +02:00
tdehaeze 6f7db148b8 Music setup now relies on jellyfin-tui 2026-04-16 23:33:30 +02:00
tdehaeze ce4c61ad35 Better stig theme 2026-04-16 23:33:19 +02:00
tdehaeze de2dc3c62a Add missing dependency 2026-04-16 23:33:03 +02:00
tdehaeze e84076bb08 Corrected stig configuration 2026-04-16 23:05:26 +02:00
tdehaeze 38bed9f247 Remove timer in polybar 2026-04-16 22:53:32 +02:00
tdehaeze bf6c7e024d Remove ranger as yazi is now used 2026-04-16 22:53:23 +02:00
tdehaeze a2edbc33e7 Add tmux installation script 2026-04-16 22:52:25 +02:00
tdehaeze ace4b0c7f7 Add --noconfirm to paru commands for non-interactive installs 2026-04-15 15:25:50 +02:00
tdehaeze 6afc232505 Move pwvucontrol to optional package (currently broken in AUR) 2026-04-15 15:20:34 +02:00
tdehaeze 24adaf03c3 Just generate one ssh key per machine 2026-04-15 15:17:06 +02:00
tdehaeze b8eb9cbc0e Tangle script 2026-04-15 15:08:14 +02:00
tdehaeze 96f57c1c78 Automatic key generation 2026-04-15 15:07:30 +02:00
tdehaeze f87c433fe8 Might solve some issue with ssh and kitty (tbc) 2026-04-15 14:53:30 +02:00
tdehaeze 2245f91b5b Add Calendar install script 2026-04-15 14:53:19 +02:00
tdehaeze a29050a389 Switch from RSA to ED25519 ssh keys 2026-04-15 14:52:33 +02:00
tdehaeze 38e8ea43cd Improvements when installing the new machine 2026-04-15 13:35:39 +02:00
tdehaeze d11455427c hostnamectl instead of hostname 2026-04-15 13:11:59 +02:00
tdehaeze 05da66e888 Remove some gtk installation 2026-04-15 11:45:34 +02:00
tdehaeze 452ce78c46 Move from pdftk to qpdf
Remove dependency on java
2026-04-15 11:39:19 +02:00
tdehaeze 579d141d93 neofetch => fastfetch 2026-04-15 11:12:45 +02:00
tdehaeze 855902bd61 Update install script 2026-04-15 11:11:02 +02:00
tdehaeze 49ab682669 Add installation scripts 2026-04-15 10:54:48 +02:00
tdehaeze 20c3536ae5 Fix google calendar client_secret noweb reference syntax 2026-03-10 16:24:22 +01:00
tdehaeze da78b850b3 Remove dead sxhkdrc.i3 section (i3 bindings handled by i3 config) 2026-03-10 16:22:39 +01:00
tdehaeze 09c0acf2a7 Fix X11 focus stealing from WM_TAKE_FOCUS apps (OnlyOffice) 2026-03-10 16:22:35 +01:00
tdehaeze 4bce143d3e Add Claude Code email refinement prompt (CLAUDE.md) 2026-03-10 16:22:32 +01:00
tdehaeze 9afcc87711 Add claudecode.nvim for email refinement in neomutt 2026-03-10 16:22:28 +01:00
31 changed files with 2106 additions and 3144 deletions
+11 -102
View File
@@ -86,7 +86,7 @@ bind '"\e[B": history-search-forward'
** Kitty for SSH
#+begin_src bash
[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
[ "$TERM" = "xterm-kitty" ] && [ -n "$KITTY_WINDOW_ID" ] && alias ssh="kitty +kitten ssh"
#+end_src
** Aliases
@@ -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"
@@ -320,27 +238,18 @@ export TEXMFHOME=$HOME/.local/share/texmf
*** Linkding
#+begin_src bash
export LINKDING_URL=`pass nas/linkding_url`
export LINKDING_TOKEN=`pass nas/linkding_token`
if [ "$(hostnamectl hostname)" = "ldehaeze" ]; then
export LINKDING_URL=`pass nas/linkding_url`
export LINKDING_TOKEN=`pass nas/linkding_token`
fi
#+end_src
*** Restic
#+begin_src bash
export RESTIC_REPOSITORY=sftp:thomas@homelab:/srv/storage/Backups/esrf-laptop
export RESTIC_PASSWORD_COMMAND="pass show restic"
#+end_src
*** Go
#+begin_src bash
export GOPATH=$HOME/.config/go
#+end_src
*** Japanese input
#+begin_src bash
# Japanese input
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
if [ "$(hostnamectl 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
@@ -351,7 +260,7 @@ export PATH
** Automatically run =startx=
#+begin_src bash
if [ -z "${DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
if [ -z "${DISPLAY}" ] && [ -n "${XDG_VTNR}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
exec startx
fi
#+end_src
+181
View File
@@ -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 <search term> in first name or last name
$0 <search term>
"
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
+36 -190
View File
@@ -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 <search term> in first name or last name
$0 <search term>
"
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
# <file system> <mount point> <type> <options> <dump> <pass>
@@ -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
+18 -195
View File
@@ -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
@@ -545,7 +378,7 @@ List of useful programs:
- =inkscape=
- =gs=
- =pdfcrop=
- =pdftk=
- =qpdf=
*** PDF to PNG
#+begin_src bash
@@ -606,7 +439,7 @@ pdftrim_function() { \
*** PDF Extract Pages
#+begin_src bash
pdfextract_function() { \
if command -v pdftk &> /dev/null; then
if command -v qpdf &> /dev/null; then
pages=$(echo -e "get first\ndelete first\nextract i-j" | rofi -i -dmenu -p "Extract pages")
if [ -z "$pages" ]; then
@@ -615,21 +448,21 @@ pdfextract_function() { \
case "$pages" in
"get first")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 1-1 output "$filename_without_extension.first.pdf"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 1 -- "$filename_with_extension" "$filename_without_extension.first.pdf"
fi
;;
"delete first")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 2-end output "$filename_with_extension"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 2-z -- "$filename_with_extension" "$filename_with_extension"
fi
;;
"extract i-j")
# TODO
page_i=$(rofi -dmenu -p "From")
page_j=$(rofi -dmenu -p "To")
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat "$page_i-$page_j" output "$filename_with_extension.slice.pdf"
if command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" "$page_i-$page_j" -- "$filename_with_extension" "$filename_with_extension.slice.pdf"
fi
;;
esac
@@ -641,9 +474,9 @@ pdfextract_function() { \
#+begin_src bash
pdf_delete_first_page_function() { \
if command -v stapler &> /dev/null; then
stapler del "$filename_with_extension" 1 /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
elif command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" cat 2-end output /tmp/pdftk_out.pdf && mv /tmp/pdftk_out.pdf "$filename_with_extension"
stapler del "$filename_with_extension" 1 /tmp/qpdf_out.pdf && mv /tmp/qpdf_out.pdf "$filename_with_extension"
elif command -v qpdf &> /dev/null; then
qpdf --pages "$filename_with_extension" 2-z -- "$filename_with_extension" /tmp/qpdf_out.pdf && mv /tmp/qpdf_out.pdf "$filename_with_extension"
fi
}
#+end_src
@@ -651,10 +484,10 @@ pdf_delete_first_page_function() { \
*** Remove Annotations
#+begin_src bash
pdf_remove_annotations_function() { \
if command -v pdftk &> /dev/null; then
pdftk "$filename_with_extension" output /tmp/uncompressed.pdf uncompress
if command -v qpdf &> /dev/null; then
qpdf --qdf "$filename_with_extension" /tmp/uncompressed.pdf
LANG=C sed -n '/^\/Annots/!p' /tmp/uncompressed.pdf > /tmp/stripped.pdf
pdftk /tmp/stripped.pdf output "$filename_with_extension" compress
qpdf /tmp/stripped.pdf "$filename_with_extension"
fi
}
#+end_src
@@ -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 "<small>",$0,"\t",last,"</small>"} {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
+43 -1
View File
@@ -1,6 +1,48 @@
#+TITLE:Calendar and Contact Configuration
#+SETUPFILE: ./setup/org-setup-file.org
* 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]]
#+begin_src bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
#+end_src
** Packages
#+begin_src bash
echo "==> Calendar and contacts packages"
paru -S --needed --noconfirm \
vdirsyncer \
python-aiohttp-oauthlib \
khal \
khard
#+end_src
** Tangle Systemd Configs
#+begin_src bash
echo "==> Tangling systemd configs for calendar"
tangle "systemd.org"
#+end_src
** Systemd Timer
#+begin_src bash
echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer
#+end_src
* =vdirsyncer= - Synchronize calendars and contacts
:PROPERTIES:
:header-args: :tangle ~/.config/vdirsyncer/config
@@ -55,7 +97,7 @@ conflict_resolution = "a wins"
type = "google_calendar"
token_file = "~/.local/share/calendars/google/credentials.txt"
client_id = "188415318767-802h28ig8gromo0f72blrbg6cgcop6m8.apps.googleusercontent.com"
client_secret = <<get-password(passname="google_calendar_client_secret")>>
client_secret = "<<get-password(passname='google_calendar_client_secret')>>"
[storage google_calendar_local]
type = "filesystem"
+14 -10
View File
@@ -13,31 +13,35 @@ Host backup
hostname pierrick.tdehaeze.xyz
Port 10022
user thomas
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
Host pierrick
hostname pierrick.tdehaeze.xyz
Port 56432
user pierrick
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
Host homelab
hostname <<get-password(passname="ip/homelab")>>
Port 22
user thomas
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
Host zotac
hostname 192.168.5.75
Port 22
user thomas
IdentityFile ~/.ssh/id_ed25519
Host router
hostname 192.168.1.1
Port 22
user root
IdentityFile ~/.ssh/id_rsa
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa
IdentityFile ~/.ssh/id_ed25519
Host *.esrf.fr
User dehaeze
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
Host firewall.esrf.fr
Port 5022
@@ -49,11 +53,11 @@ Match host *.esrf.fr !host firewall.esrf.fr !exec "~/.ssh/esrf-test"
Host rnice
Port 22
user dehaeze
IdentityFile ~/.ssh/id_rsa
IdentityFile ~/.ssh/id_ed25519
#+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
@@ -757,4 +761,4 @@ delay = 200
rate = 40
#+end_src
And then enable the service with: =systemctl --user enable xautocfg.service=
And then enable the service with: =systemctl --user enable --now xautocfg.service=
+80 -8
View File
@@ -14,6 +14,43 @@
#+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 --noconfirm emacs aspell aspell-en aspell-fr
#+end_src
** Tangle Configuration
Tangle =doom.org= to generate =config.el=, =init.el= and =packages.el=:
#+begin_src bash
echo "==> Tangling doom.org"
mkdir ${HOME}/.config/doom
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/doom.org\")"
#+end_src
** Doom Install
#+begin_src bash
echo "==> Installing Doom Emacs"
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs
"${DOOM}" install
#+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
@@ -316,7 +353,7 @@ Function that opens current pdf page as an SVG file with Inkscape.
(setq filename (read-string "Enter file name:" (car (split-string (file-name-base buffer-file-name) "_"))))
(setq filename (read-string "Enter file name:")))
(setq filepath (concat "/tmp/" filename ".svg"))
(shell-command (concat "pdftk " buffer-file-name " cat " (number-to-string (pdf-view-current-page)) " output /tmp/pdf_page.pdf"))
(shell-command (concat "qpdf --pages " buffer-file-name " " (number-to-string (pdf-view-current-page)) " -- " buffer-file-name " /tmp/pdf_page.pdf"))
(shell-command (concat "pdf2svg /tmp/pdf_page.pdf " filepath))
(start-process "" nil "inkscape" filepath))
@@ -1273,7 +1310,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 +1320,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 +3056,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
@@ -3140,7 +3203,7 @@ Provides nice functions such as:
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +pretty +roam2 +hugo +noter) ; organize your plain life in plain text
(org +pretty +roam +hugo +noter) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;graphviz ; diagrams for confusing yourself even more
@@ -3209,6 +3272,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 +3326,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
+11
View File
@@ -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
+29 -5
View File
@@ -72,6 +72,7 @@ workspace_layout default
* Focus Configuration
#+begin_src conf
focus_follows_mouse no
focus_on_window_activation none
#+end_src
* Settings for i3-gaps
@@ -210,10 +211,10 @@ bindsym $mod+y sticky toggle
** focus/swap
#+begin_src conf
# Focus/swap the node in the given direction
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+h exec --no-startup-id i3-msg focus left && i3-focus-sync
bindsym $mod+j exec --no-startup-id i3-msg focus down && i3-focus-sync
bindsym $mod+k exec --no-startup-id i3-msg focus up && i3-focus-sync
bindsym $mod+l exec --no-startup-id i3-msg focus right && i3-focus-sync
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
@@ -227,7 +228,7 @@ bindsym $mod+p workspace prev
bindsym $mod+n workspace next
# Focus the last Desktop
bindsym $mod+b workspace back_and_forth
bindsym $mod+b exec --no-startup-id i3-msg workspace back_and_forth && i3-focus-sync
# Focus to the given desktop
bindsym $mod+1 workspace 1
@@ -286,6 +287,29 @@ bindsym $mod+$alt+k resize shrink height 10 px or 10 ppt
bindsym $mod+$alt+l resize grow width 10 px or 10 ppt
#+end_src
* Fix focus for =WM_TAKE_FOCUS= applications
Some applications (e.g. OnlyOffice, Electron apps) use the =WM_TAKE_FOCUS= protocol and
fail to release X11 keyboard focus when i3 moves focus elsewhere.
This keybinding forces X11 focus to the window i3 currently considers focused.
#+begin_src bash :tangle ~/.local/bin/i3-focus-sync :comments none :mkdirp yes :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o755)
win=$(i3-msg -t get_tree | python3 -c "
import json, sys
def find_focused(node):
if node.get('focused') and node.get('window'):
return node['window']
for child in node.get('nodes', []) + node.get('floating_nodes', []):
r = find_focused(child)
if r is not None:
return r
return None
w = find_focused(json.load(sys.stdin))
if w is not None: print(w)
" 2>/dev/null)
[ -n "$win" ] && xdotool windowfocus --sync "$win" 2>/dev/null
#+end_src
* Run Polybar and SXHKD
#+begin_src conf
# exec --no-startup-id sxhkd -m 1 -c ~/.config/sxhkd/sxhkdrc.i3
+514 -1454
View File
File diff suppressed because it is too large Load Diff
+97 -8
View File
@@ -1,9 +1,103 @@
#+TITLE: Mail Configuration
#+SETUPFILE: ./setup/org-setup-file.org
Installation:
* Mail Install Script
:PROPERTIES:
:header-args:bash: :tangle scripts/install-mail.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
Mail setup documentation: [[file:mail.org][mail.org]]
#+begin_src bash
set -euo pipefail
#+end_src
** Packages
#+begin_src bash
echo "==> Mail packages"
paru -S --needed --noconfirm \
isync \
msmtp \
neomutt \
mu \
lynx urlview
#+end_src
** Tangle Configuration
#+begin_src bash
echo "==> Tangling mail.org"
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/mail.org")'
#+end_src
** Mail Directories
#+begin_src bash
echo "==> Creating mail directories"
mkdir -p ~/.local/share/mails/{gmail,esrf,search,empty}
mkdir -p ~/.local/share/mails/gmail/{Inbox,Sent,Drafts,Archive,Trash}
mkdir -p ~/.local/share/mails/esrf/{Inbox,Sent,Drafts,Archive,Trash}
mkdir -p ~/.local/share/mails/search/{cur,new,tmp}
mkdir -p ~/.local/share/mails/empty/gmail/{cur,new,tmp}
mkdir -p ~/.local/share/mails/empty/esrf/{cur,new,tmp}
#+end_src
** Getting the emails
#+begin_src bash
echo "==> Getting all the emails"
mbsync -a
#+end_src
** Initialize mu
#+begin_src bash :tangle no
paru -S mbsync msmtp neomutt lynx urlview
echo "==> Initializing mu index"
mu init -m ~/.local/share/mails
mu index
#+end_src
** Systemd Timers
#+begin_src bash :tangle no
echo "==> Enabling mail timers"
systemctl --user enable --now checkmail.timer
systemctl --user enable --now syncmail.timer
#+end_src
* Claude Code — Email Assistant
#+begin_src markdown :tangle ~/.config/neomutt/CLAUDE.md :comments none :mkdirp yes
# Email Refinement Assistant
You are helping refine professional emails composed in Neomutt.
The file you receive is a raw email in RFC 2822 format: a header block
(lines like `From:`, `To:`, `Subject:`, `Cc:`) followed by a blank line,
then the body text.
## Your task
When asked to "refine" (or similar), edit the file directly so that a diff
can be reviewed. Apply all of the following:
- **Subject**: if it starts with `Re:`, this is a reply — do not change it; otherwise make it specific, informative and professional (avoid vague subjects like "Question" or "Update")
- **Grammar & spelling**: fix all errors
- **Clarity**: remove ambiguity; one idea per sentence
- **Conciseness**: cut filler words, redundant phrases and unnecessary
preamble; get to the point quickly
- **Tone**: professional but natural; avoid overly formal or stiff language
- **Structure**: ensure a proper greeting, clear body paragraphs and a
polite closing
- **Signature**: do not modify anything from the `-- ` line onwards (dash dash space — the trailing space is required by RFC 3676 and must not be removed)
- **Line breaks**: write one sentence per line in the body
## Constraints
- Preserve the header block exactly (do not reorder or remove headers),
only edit the `Subject:` value, and of course the main code text
- **Single edit**: you MUST apply every change (subject, grammar, tone, structure) in one single call to the file edit tool — do not make multiple sequential edits
- Do not invent facts or add content that was not implied by the original
- Preserve the author's intent and voice
#+end_src
* =mbsync= - Synchronize Mailboxes
@@ -193,12 +287,6 @@ account default : esrf
#+END_SRC
* =mu= - Mail Indexer
:PROPERTIES:
:header-args:conf: :tangle ~/.config/neomutt/neomuttrc
:header-args:conf+: :comments both :mkdirp yes
:CUSTOM_ID: mu
:END:
=Mu= ([[https://github.com/djcb/mu][github]]) it used as a "maildir indexer/searcher".
Useful commands are described in the [[http://www.djcbsoftware.nl/code/mu/cheatsheet.html][Cheat-sheet]].
@@ -1685,3 +1773,4 @@ application/msword; onlyoffice-desktopeditors '%s'; copiousoutput
application/wordperfect; onlyoffice-desktopeditors '%s'; copiousoutput
text/rtf; onlyoffice-desktopeditors '%s'; copiousoutput
#+end_src
+26 -154
View File
@@ -1,170 +1,42 @@
#+TITLE: Music/Sound Configuration
#+TITLE:Music Setup
#+SETUPFILE: ./setup/org-setup-file.org
* =pwvucontrol= - Volume Control for Pipewire
* =mopidy= - Music Server
* Music Install Script
:PROPERTIES:
:header-args:conf: :tangle ~/.config/mopidy/mopidy.conf
:header-args:conf+: :comments none :mkdirp yes :noweb no-export
:CUSTOM_ID: mopidy
:header-args:bash: :tangle scripts/install-music.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
Things done to get mopidy to work:
#+begin_src bash :eval no :tangle no
cd ~/.local/soft/
git clone git@github.com:jellyfin/mopidy-jellyfin.git && cd mopidy-jellyfin
python -m venv env --system-site-packages
env/bin/python setup.py develop
env/bin/pip install mopidy-mpd
#+begin_src bash
set -euo pipefail
#+end_src
To run mopidy:
#+begin_src bash :eval no :tangle no
~/.local/soft/mopidy-jellyfin/env/bin/mopidy
** Packages
#+begin_src bash
echo "==> Music packages"
paru -S --needed --noconfirm jellyfin-tui playerctl
#+end_src
#+begin_src conf
[core]
cache_dir = ~/.cache/mopidy
config_dir = ~/.config/mopidy
data_dir = ~/.local/data/mopidy
** Tangle Configuration
[audio]
output = queue2 max-size-buffers=20000 max-size-time=0 max-size-bytes=0 ! audioconvert ! pulsesink
[stream]
enabled = true
protocols =
http
https
timeout = 30000
[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist = listall,listallinfo
default_playlist_scheme = m3u
[jellyfin]
hostname = https://jellyfin.tdehaeze.xyz
username = tdehaeze
password = <<get-password(passname="music.tdehaeze.xyz/tdehaeze")>>
libraries = Music
albumartistsort = True
album_format = {ProductionYear} - {Name}
[file]
enabled = false
[logging]
verbosity = 4
format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s
color = true
#+begin_src bash
echo "==> Tangling music.org"
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/music.org")'
#+end_src
* =ncmpcpp= - Ncurses based MPD client
:PROPERTIES:
:CUSTOM_ID: ncmpcpp
:END:
* Jellyfin-tui config
https://rybczak.net/ncmpcpp/
Cheatsheet: https://pkgbuild.com/~jelle/ncmpcpp/
#+begin_src conf :noweb yes :tangle ~/.config/jellyfin-tui/config.yaml
servers:
- name: Home Server
password: <<get-password(passname="jellyfin.tdehaeze.xyz/tdehaeze")>>
url: https://jellyfin.tdehaeze.xyz
username: tdehaeze
** Config
:PROPERTIES:
:header-args:conf: :tangle ~/.config/ncmpcpp/config
:header-args:conf+: :comments both :mkdirp yes
:END:
persist: true
always_show_lyrics: false
keymap:
q: !Shell "tmux detach"
Configuration directory.
#+begin_src conf
ncmpcpp_directory = ~/.config/ncmpcpp
lyrics_directory = ~/.local/share/lyrics
#+end_src
MPD Configuration.
#+begin_src conf
mpd_host = localhost
mpd_port = 6600
mpd_music_dir = ~/Music
#+end_src
Notification of song change.
#+begin_src conf
execute_on_song_change = dunstify --replace=19845 "Now Playing ♫" "$(mpc current)"
#+end_src
Better user interface
#+begin_src conf
user_interface = "alternative"
playlist_editor_display_mode = "columns"
search_engine_display_mode = "columns"
browser_display_mode = "columns"
playlist_display_mode = "columns"
#+end_src
Lyrics
#+begin_src conf
lyrics_fetchers = musixmatch, sing365, metrolyrics, justsomelyrics, jahlyrics, plyrics, tekstowo, zeneszoveg, internet
#+end_src
Sorting by tracking number and then title
#+begin_src conf
browser_sort_mode = "format"
browser_sort_format = '{%n - %t}|{%t}'
#+end_src
#+begin_src conf
ask_before_clearing_playlists = "no"
#+end_src
** Bindings
:PROPERTIES:
:header-args:conf: :tangle ~/.config/ncmpcpp/bindings
:header-args:conf+: :comments none :mkdirp yes
:END:
#+begin_src conf
def_key "q"
run_external_command "sh -c 'if [ $TMUX ] ; then tmux detach; fi'"
def_key "Q"
quit
def_key "g"
move_home
def_key "G"
move_end
def_key "j"
scroll_down
def_key "k"
scroll_up
def_key "ctrl-u"
page_up
def_key "ctrl-d"
page_down
def_key "l"
enter_directory
def_key "h"
jump_to_parent_directory
def_key "."
show_lyrics
def_key "n"
next_found_item
def_key "N"
previous_found_item
def_key "J"
move_sort_order_down
def_key "K"
move_sort_order_up
def_key "d"
delete_playlist_items
def_key "+"
volume_up
def_key "-"
volume_down
#+end_src
+2
View File
@@ -3,6 +3,8 @@
#+PROPERTY: header-args :comments both :mkdirp yes
#+PROPERTY: header-args+ :tangle ~/.config/dunst/dunstrc
After tangling this config, restart the service with =systemctl --user restart dunst=.
* Global
#+begin_src conf
[global]
+2 -2
View File
@@ -62,7 +62,7 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
modules-left = i3 xwindow
modules-center =
modules-right = pipewire music tunnel_homelab tunnel_esrf dunst lockscreen cursor unread_mail calendar timer battery date tray
modules-right = pipewire music tunnel_homelab tunnel_esrf dunst lockscreen cursor unread_mail calendar battery date tray
# wm-restack = i3
#+END_SRC
@@ -1020,7 +1020,7 @@ fi
#+begin_src bash
~/.local/bin/lockscreen &
xset s activate
sleep 1 && xset s activate &
#+end_src
* Network
+1 -1
View File
@@ -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)
-856
View File
@@ -1,856 +0,0 @@
#+TITLE: Ranger
#+SETUPFILE: ./setup/org-setup-file.org
* Documentation
#+begin_quote
%f the highlighted file
%d the path of the current directory
%s the selected files in the current directory
%t all tagged files in the current directory
%c the full paths of the currently copied/cut files
%p the full paths of selected files
#+end_quote
After install, run:
#+begin_src bash :tangle no
ranger --copy-config=scope
#+end_src
To add =scope.sh=.
The following has been added to preview =xournalpp= file:
#+begin_src bash
case "${FILE_EXTENSION_LOWER}" in
## xournall file
xopp)
xournalpp-thumbnailer "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
;;
esac
#+end_src
To have image preview:
#+begin_src bash :tangle no
sudo pip3 install ueberzug
#+end_src
* Config
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/rc.conf
:header-args+: :comments both :mkdirp yes
:END:
** Options
#+BEGIN_SRC conf
# Which viewmode should be used? Possible values are:
# miller: Use miller columns which show multiple levels of the hierarchy
# multipane: Midnight-commander like multipane view showing all tabs next
# to each other
set viewmode miller
# How many columns are there, and what are their relative widths?
set column_ratios 1,1
# Which files should be hidden? (regular expression)
set hidden_filter ^\.|\.(?:pyc|vrb|pyo|lof|bak|swp|aux|log|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl|xopp~)$|^lost\+found$|^__(py)?cache__$
# Show hidden files? You can toggle this by typing 'zh'
set show_hidden false
# Ask for a confirmation when running the "delete" command?
# Valid values are "always", "never", "multiple" (default)
# With "multiple", ranger will ask only if you delete multiple files at once.
set confirm_on_delete multiple
# Which script is used to generate file previews?
# ranger ships with scope.sh, a script that calls external programs (see
# README.md for dependencies) to preview images, archives, etc.
set preview_script /home/thomas/.config/ranger/scope.sh
# Use the external preview script or display simple plain text or image previews?
set use_preview_script true
# Automatically count files in the directory, even before entering them?
set automatically_count_files true
# Open all images in this directory when running certain image viewers
set open_all_images true
# Be aware of version control systems and display information.
set vcs_aware false
# Use one of the supported image preview protocols
set preview_images true
# Set the preview image method
set preview_images_method ueberzug
set colorscheme default
# Preview files on the rightmost column?
# And collapse (shrink) the last column if there is nothing to preview?
set preview_files true
set preview_directories true
set collapse_preview true
# Draw the status bar on top of the browser window (default: bottom)
set status_bar_on_top false
# Draw a progress bar in the status bar which displays the average state of all
# currently running tasks which support progress bars?
set draw_progress_bar_in_status_bar true
# Draw borders around columns?
set draw_borders true
# Display the directory name in tabs?
set dirname_in_tabs false
# Enable the mouse support?
set mouse_enabled true
# Display the file size in the main column or status bar?
set display_size_in_main_column true
set display_size_in_status_bar false
# Display files tags in all columns or only in main column?
set display_tags_in_all_columns false
# Set a title for the window?
set update_title false
# Set the title to "ranger" in the tmux program?
set update_tmux_title true
# Shorten the title if it gets long? The number defines how many
# directories are displayed at once, 0 turns off this feature.
set shorten_title 3
# Abbreviate $HOME with ~ in the titlebar (first line) of ranger?
set tilde_in_titlebar true
# How many directory-changes or console-commands should be kept in history?
set max_history_size 20
set max_console_history_size 50
# Try to keep so much space between the top/bottom border when scrolling:
set scroll_offset 8
# Flush the input after each key hit? (Noticeable when ranger lags)
set flushinput true
# Padding on the right when there's no preview?
# This allows you to click into the space to run the file.
set padding_right true
set autosave_bookmarks false
set autoupdate_cumulative_size false
# Turning this on makes sense for screen readers:
set show_cursor false
# One of: size, natural, basename, atime, ctime, mtime, type, random
set sort natural
# Additional sorting options
set sort_reverse false
set sort_case_insensitive true
set sort_directories_first true
set sort_unicode false
# Enable this if key combinations with the Alt Key don't work for you.
# (Especially on xterm)
set xterm_alt_key false
# Whether to include bookmarks in cd command
set cd_bookmarks false
# Avoid previewing files larger than this size, in bytes. Use a value of 0 to
# disable this feature.
set preview_max_size 5000000
# Add the highlighted file to the path in the titlebar
set show_selection_in_titlebar true
# The delay that ranger idly waits for user input, in milliseconds, with a
# resolution of 100ms. Lower delay reduces lag between directory updates but
# increases CPU load.
set idle_delay 2000
# When the metadata manager module looks for metadata, should it only look for
# a ".metadata.json" file in the current directory, or do a deep search and
# check all directories above the current one as well?
set metadata_deep_search false
# Clear all existing filters when leaving a directory
set clear_filters_on_dir_change false
# Disable displaying line numbers in main column
set line_numbers false
#+END_SRC
** Command Aliases in the Console
#+BEGIN_SRC conf
alias q quit
alias filter scout -prt
alias find scout -aeit
alias mark scout -mr
alias unmark scout -Mr
alias search scout -rs
alias search_inc scout -rts
alias travel scout -aefiklst
#+END_SRC
** Some Custom Keybindings
Extract:
#+BEGIN_SRC conf
map ,x shell ~/.config/ranger/scripts/extract.sh %f
#+END_SRC
Compress:
#+BEGIN_SRC conf
map ,z shell ~/.config/ranger/scripts/compress.sh %f
#+END_SRC
Convert images/pdf/...:
#+BEGIN_SRC conf
map ,c shell convert-file %f
#+END_SRC
Extract BibTeX:
#+begin_src conf
map ,b shell ~/.config/ranger/scripts/add-reference.sh %d/%f
#+end_src
Open SXIV on current directory:
#+BEGIN_SRC conf
map ,s shell nohup sxiv -t %d &
#+END_SRC
Upload to https://0x0.st/:
#+BEGIN_SRC conf
map ,t shell upload %f
#+END_SRC
Open current folder with PCManFM:
#+begin_src conf
map ,o shell nohup pcmanfm %d &
#+end_src
Print on Rnice:
#+BEGIN_SRC conf
map ,p shell print-esrf %f &
#+END_SRC
Backup to NAS:
#+BEGIN_SRC conf
map ,B shell ~/.config/ranger/scripts/backup-to-nas.sh %s &
#+END_SRC
#+begin_src conf
map ,y shell ~/.config/ranger/scripts/copy-content.sh %s &
#+end_src
** Scripts
*** Extract DOI, create BibTeX and rename file
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/add-reference.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
add_reference () {
doi=$(pdf2doi $1 | sed 's/^DOI *//' | sed 's/ \+.*//')
# If empty DOI, ask manually
if [ -z $doi ]; then
doi=$(rofi -dmenu -p "DOI")
fi
# If DOI, add it to Emacs
if [ ! -z $doi ]; then
emacsclient --eval "(tdh-org-ref-import-pdf \"$doi\" \"$1\")" && \
dunstify --replace=49496 "BibTeX" "File copied."
else
dunstify --replace=49496 "BibTeX" "Failed to get DOI"
fi
}
add_reference "$1"
#+end_src
*** Extract Script
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/extract.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 2 atool -x "$1" && tmux select-pane -U
else
atool -x "$1"
fi
#+end_src
*** Compress Script
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/compress.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 2 apack "${1%.*}.zip" "$1" && tmux select-pane -U
else
apack "${1%.*}.zip" "$1"
fi
#+end_src
*** Copy File Content
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/copy-content.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
#+begin_src bash
xclip -sel c < "$1" && notify-send "Ranger" "Copied to clipboard"
#+end_src
*** Paste with Rsync
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/scripts/paste-rsync.sh
:header-args+: :comments both :mkdirp yes
:header-args+: :shebang "#!/usr/bin/env bash"
:END:
- First argument is the directory where to copy files
- All other arguments are files that are to be copied
#+begin_src bash
if [ $TMUX ]; then
tmux split -v -l 1 rsync -a --info=progress2 --no-inc-recursive "${@:2}" "$1" && tmux select-pane -U
else
rsync -a --info=progress2 --no-inc-recursive "${@:2}" "$1"
fi
#+end_src
** Define keys for the browser
*** Basic
#+BEGIN_SRC conf
map Q quit!
map q eval fm.execute_console("shell tmux detach") if 'TMUX' in os.environ.keys() else fm.execute_console("quit")
#+END_SRC
#+BEGIN_SRC conf
map <C-c> abort
map <esc> change_mode normal
map ~ set viewmode!
#+END_SRC
#+BEGIN_SRC conf
map ? help
#+END_SRC
#+BEGIN_SRC conf
map : console
map ; console
#+END_SRC
#+BEGIN_SRC conf
map ! console shell%space
#+END_SRC
#+BEGIN_SRC conf
map @ console -p6 shell %%s
#+END_SRC
*** Open Shell in current directory
#+BEGIN_SRC conf
map s shell $SHELL
map S shell nohup $TERMINAL &
#+END_SRC
*** Open With
#+BEGIN_SRC conf
map O chain draw_possible_programs; console open_with%space
#+END_SRC
*** Filter
#+BEGIN_SRC conf
map f console filter%space
# Reset filter
map F filter
#+END_SRC
*** Tagging / Marking
#+BEGIN_SRC conf
map <Space> mark_files toggle=True
map v mark_files all=True toggle=True
#+END_SRC
*** VIM-like
#+BEGIN_SRC conf
copymap <UP> k
copymap <DOWN> j
copymap <LEFT> h
copymap <RIGHT> l
copymap <HOME> gg
copymap <END> G
#+END_SRC
*** Jumping around
#+BEGIN_SRC conf
map H history_go -1
map L history_go 1
#+END_SRC
#+BEGIN_SRC conf
map ] move_parent 1
map [ move_parent -1
#+END_SRC
#+BEGIN_SRC conf
map } traverse
#+END_SRC
#+BEGIN_SRC conf
map cd console cd%space
#+END_SRC
*** Go to special folders
#+BEGIN_SRC conf
map gh cd ~/
map gw cd ~/Cloud/work-projects
map gp cd ~/Cloud/personnal
map gP cd ~/Cloud/pictures/phone
map gs cd ~/Cloud/pictures/screenshots
map gT cd ~/.local/share/Trash/files
map gd cd ~/Downloads
map gD cd ~/Cloud/documents
map gc cd ~/Cloud
map gV cd ~/.config/literate-dotfiles
map gm cd ~/Cloud/meetings
#+END_SRC
*** Get size of folders
#+BEGIN_SRC conf
# Get size of all folders
map du shell -p du --max-depth=1 -h --apparent-size
# Get size of all folders and sort them
map dU shell -p du --max-depth=1 -h --apparent-size | sort -rh
#+END_SRC
*** Yank path of directory/file
#+BEGIN_SRC conf
# Yank path of current directory/file
map yp shell -f echo -n %d/%f | xsel -i; xsel -o | xsel -i -b
# Yank path of directory
map yd shell -f echo -n %d | xsel -i; xsel -o | xsel -i -b
# Yank filename
map yn shell -f echo -n %f | xsel -i; xsel -o | xsel -i -b
#+END_SRC
*** Drag and Drop
#+BEGIN_SRC conf
map D shell dragon-drop -a -x %p
#+END_SRC
*** Rename files
#+BEGIN_SRC conf
map a rename_append
map C eval fm.execute_console("bulkrename") if fm.thisdir.marked_items else fm.open_console("rename ")
map A eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"))
map I eval fm.open_console('rename ' + fm.thisfile.relative_path.replace("%", "%%"), position=7)
#+END_SRC
*** Paste files
#+BEGIN_SRC conf
map pp paste
map po paste overwrite=True
map pP paste append=True
map pO paste overwrite=True append=True
map pl paste_symlink relative=False
map pL paste_symlink relative=True
map phl paste_hardlink
map pht paste_hardlinked_subtree
#+END_SRC
Paste with Rsync
#+BEGIN_SRC conf
map pr shell ~/.config/ranger/scripts/paste-rsync.sh %d %c
#+END_SRC
*** Delete and move files
#+BEGIN_SRC conf
map dD shell -s trash-put %s
map dd cut
map du uncut
#+END_SRC
*** Copy files
#+BEGIN_SRC conf
map yy copy
map yu uncut
#+END_SRC
*** Searching
#+BEGIN_SRC conf
map / console search%space
map n search_next
map N search_next forward=False
#+END_SRC
*** Tabs
#+BEGIN_SRC conf
map <C-n> tab_new ~
map <C-w> tab_close
map <TAB> tab_move 1
map <S-TAB> tab_move -1
map gn tab_new ~
map gt tab_move 1
#+END_SRC
*** Settings
#+BEGIN_SRC conf
map zh set show_hidden!
map zi set preview_images!
map zv set use_preview_script!
#+END_SRC
*** Bookmarks
#+BEGIN_SRC conf
map `<any> enter_bookmark %any
map '<any> enter_bookmark %any
map m<any> set_bookmark %any
map um<any> unset_bookmark %any
map m<bg> draw_bookmarks
copymap m<bg> um<bg> `<bg> '<bg>
#+END_SRC
*** FZF
#+BEGIN_SRC conf
map <C-f> fzf_select
#+END_SRC
** Define keys for the console
*** Basic
#+BEGIN_SRC conf
cmap <tab> eval fm.ui.console.tab()
cmap <s-tab> eval fm.ui.console.tab(-1)
cmap <ESC> eval fm.ui.console.close()
cmap <CR> eval fm.ui.console.execute()
cmap <C-l> redraw_window
copycmap <ESC> <C-c>
copycmap <CR> <C-j>
#+END_SRC
*** Move around
#+BEGIN_SRC conf
cmap <up> eval fm.ui.console.history_move(-1)
cmap <down> eval fm.ui.console.history_move(1)
cmap <left> eval fm.ui.console.move(left=1)
cmap <right> eval fm.ui.console.move(right=1)
#+END_SRC
*** Line Editing
#+BEGIN_SRC conf
cmap <backspace> eval fm.ui.console.delete(-1)
cmap <delete> eval fm.ui.console.delete(0)
cmap <C-w> eval fm.ui.console.delete_word()
cmap <C-y> eval fm.ui.console.paste()
copycmap <home> <C-a>
copycmap <end> <C-e>
#+END_SRC
* Rifle
:PROPERTIES:
:CUSTOM_ID: rifle
:header-args: :tangle ~/.config/ranger/rifle.conf
:header-args+: :comments both :mkdirp yes
:END:
** Documentation
#+BEGIN_SRC conf :tangle no
# This is the configuration file of "rifle", ranger's file executor/opener.
# Each line consists of conditions and a command. For each line the conditions
# are checked and if they are met, the respective command is run.
#
# Syntax:
# <condition1> , <condition2> , ... = command
#
# The command can contain these environment variables:
# $1-$9 | The n-th selected file
# $@ | All selected files
#
# If you use the special command "ask", rifle will ask you what program to run.
#
# Prefixing a condition with "!" will negate its result.
# These conditions are currently supported:
# match <regexp> | The regexp matches $1
# ext <regexp> | The regexp matches the extension of $1
# mime <regexp> | The regexp matches the mime type of $1
# name <regexp> | The regexp matches the basename of $1
# path <regexp> | The regexp matches the absolute path of $1
# has <program> | The program is installed (i.e. located in $PATH)
# env <variable> | The environment variable "variable" is non-empty
# file | $1 is a file
# directory | $1 is a directory
# number <n> | change the number of this command to n
# terminal | stdin, stderr and stdout are connected to a terminal
# X | $DISPLAY is not empty (i.e. Xorg runs)
#
# There are also pseudo-conditions which have a "side effect":
# flag <flags> | Change how the program is run. See below.
# label <label> | Assign a label or name to the command so it can
# | be started with :open_with <label> in ranger
# | or `rifle -p <label>` in the standalone executable.
# else | Always true.
#
# Flags are single characters which slightly transform the command:
# f | Fork the program, make it run in the background.
# | New command = setsid $command >& /dev/null &
# r | Execute the command with root permissions
# | New command = sudo $command
# t | Run the program in a new terminal. If $TERMCMD is not defined,
# | rifle will attempt to extract it from $TERM.
# | New command = $TERMCMD -e $command
# Note: The "New command" serves only as an illustration, the exact
# implementation may differ.
# Note: When using rifle in ranger, there is an additional flag "c" for
# only running the current file even if you have marked multiple files.
#+END_SRC
** Websites
#+BEGIN_SRC conf
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
ext x?html?, has firefox, X, flag f = firefox -- "$@"
ext x?html?, has elinks, terminal = elinks "$@"
ext x?html?, has w3m, terminal = w3m "$@"
#+END_SRC
** Text Files
3D files (before the rest)
#+begin_src conf
ext stp, X, flag f = f3d -- "$@"
ext step, X, flag f = f3d -- "$@"
ext stl, X, flag f = f3d -- "$@"
#+end_src
Calendar files
#+begin_src conf
ext ics, X, flag f = ics-add "$@"
#+end_src
Define the =$EDITOR= for text files as first action:
#+BEGIN_SRC conf
mime ^text, label editor = $EDITOR -- "$@"
mime ^text, label pager = "$PAGER" -- "$@"
#+END_SRC
Favorite editors:
#+begin_src conf
mime ^text, has nvim, flag f = nvim "$@"
mime ^text, has emacsclient, X, flag f = emacsclient -c "$@"
#+end_src
Org mode files
#+BEGIN_SRC conf
ext org, has emacsclient, X, flag f = emacsclient -c "$@"
#+END_SRC
#+BEGIN_SRC conf
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
ext py = python -- "$1"
ext pl = perl -- "$1"
ext rb = ruby -- "$1"
ext js = node -- "$1"
ext sh = sh -- "$1"
ext php = php -- "$1"
#+END_SRC
** PDF, Epub and jdvu
#+BEGIN_SRC conf
ext pdf, has zathura, X, flag f = zathura -- "$@"
ext pdf, has mupdf, X, flag f = mupdf "$@"
ext pdf, X, flag f = "$BROWSER" "$@"
#+END_SRC
#+BEGIN_SRC conf
ext epub, has zathura, X, flag f = zathura -- "$@"
ext epub, has mupdf, X, flag f = mupdf "$@"
#+END_SRC
#+BEGIN_SRC conf
ext djvu, has zathura, X, flag f = zathura -- "$@"
ext djvu, has evince, X, flag f = evince -- "$@"
ext djvu, has atril, X, flag f = atril -- "$@"
#+END_SRC
** Xournalpp
#+begin_src conf
ext xopp, X, flag f = xournalpp "$@"
#+end_src
** Archives
#+BEGIN_SRC conf
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool -- "$@" | "$PAGER"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool -- "$@" | "$PAGER"
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has aunpack = aunpack -- "$@"
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has aunpack = aunpack -- "$@"
ext tar|gz, has tar = tar vvtf "$@" | "$PAGER"
ext tar|gz, has tar = tar vvxf "$@"
#+END_SRC
** Torrent
#+BEGIN_SRC conf
ext torrent, X, flag f = stig add -- "$@"
#+END_SRC
** Word, Excel and Presentation files
#+BEGIN_SRC conf
ext docx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext docx?, has wps, X, flag f = wps "$@"
ext docx?, has libreoffice, X, flag f = libreoffice "$@"
#+END_SRC
#+begin_src conf
ext pptx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext pptx?, has wps, X, flag f = wps "$@"
ext pptx?, has libreoffice, X, flag f = libreoffice "$@"
#+end_src
#+begin_src conf
ext csv|xlsx?, has sc-im = sc-im -- "$@"
ext csv|xlsx?, has onlyoffice-desktopeditors, X, flag f = onlyoffice-desktopeditors "$@"
ext csv|xlsx?, has wps, X, flag f = wps "$@"
ext csv|xlsx?, has libreoffice, X, flag f = libreoffice "$@"
#+end_src
** Images
#+BEGIN_SRC conf
mime ^image/svg, has inkview, X, flag f = inkview -- "$@"
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
mime ^image/svg, has display, X, flag f = display -- "$@"
#+END_SRC
#+BEGIN_SRC conf
mime ^image/gif, has mpv, X, flag f = mpv --loop -- "$@"
mime ^image/gif, has qutebrowser, X, flag f = qutebrowser -- "$@"
#+END_SRC
#+BEGIN_SRC conf
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
mime ^image, has feh, X, flag f = feh --scale-down --auto-zoom -- "$@"
#+END_SRC
** Audio
#+BEGIN_SRC conf
mime ^audio|ogg$, terminal, has mpv = mpv --no-audio-display -- "$@"
mime ^audio|ogg$, X, flag f, has vlc = vlc -- "$@"
#+END_SRC
** Video
#+BEGIN_SRC conf
mime ^video, has mpv, X, flag f = mpv -- "$@"
mime ^video, has vlc, X, flag f = vlc -- "$@"
#+END_SRC
** Misc
#+BEGIN_SRC conf
ext 1 = man "$1"
ext s[wmf]c, has zsnes, X = zsnes "$1"
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
ext nes, has fceux, X = fceux "$1"
ext exe = wine "$1"
name ^[mM]akefile$ = make
mime application/vnd.ms-tnef = winmail-add "$@"
#+END_SRC
#+BEGIN_SRC conf
# Define the editor for non-text files + pager as last action
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = ask
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = $EDITOR -- "$@"
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php = "$PAGER" -- "$@"
has dragon-drop, X, flag f = dragon-drop -a -x "$@"
#+END_SRC
* Ranger Commands
:PROPERTIES:
:header-args: :tangle ~/.config/ranger/commands.py
:header-args+: :comments both :mkdirp yes
:END:
** Import
#+begin_src python
from ranger.api.commands import *
import os
#+end_src
** fzf_select
#+begin_src python
class fzf_select(Command):
"""
:fzf_select
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
# match only directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
else:
# match files and directories
command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
# fzf_locate
class fzf_locate(Command):
"""
:fzf_locate
Find a file using fzf.
With a prefix argument select only directories.
See: https://github.com/junegunn/fzf
"""
def execute(self):
import subprocess
if self.quantifier:
command="locate home media | fzf -e -i"
else:
command="locate home media | fzf -e -i"
fzf = self.fm.execute_command(command, stdout=subprocess.PIPE)
stdout, stderr = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.decode('utf-8').rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
self.fm.select_file(fzf_file)
#+end_src
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
echo "==> Calendar and contacts packages"
paru -S --needed --noconfirm \
vdirsyncer \
khal \
khard
echo "==> Tangling systemd configs for calendar"
tangle "systemd.org"
echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
echo "==> Desktop packages"
paru -S --needed --noconfirm \
i3-wm \
sxhkd \
polybar \
picom \
dunst \
rofi rofi-calc dmenu \
kitty \
bash bash-completion \
zoxide \
xorg-xrandr arandr \
xautocfg \
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)"
+19
View File
@@ -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
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
set -euo pipefail
echo "==> Laptop power management"
paru -S --needed --noconfirm \
powertop \
tlp \
thermald
sudo systemctl enable --now tlp
sudo systemctl enable --now tlp-sleep
sudo systemctl enable --now thermald
sudo tlp start
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
echo "==> LaTeX packages"
paru -S --needed --noconfirm \
texlive-most tllocalmgr-git \
biber
+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
set -euo pipefail
echo "==> Mail packages"
paru -S --needed --noconfirm \
isync \
msmtp \
neomutt \
mu \
lynx urlview
+185
View File
@@ -0,0 +1,185 @@
#!/bin/bash
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
echo "==> Shell and Terminal"
paru -S --needed --noconfirm \
bash bash-completion zsh \
kitty \
tmux
echo "==> Fonts"
paru -S --needed --noconfirm \
ttf-hack-nerd \
ttf-sourcecodepro-nerd \
adobe-source-code-pro-fonts \
noto-fonts-emoji
echo "==> Text Editors"
paru -S --needed --noconfirm \
neovim python-pynvim nodejs-neovim \
emacs \
aspell aspell-en aspell-fr
echo "==> GnuPG and Pass"
paru -S --needed --noconfirm \
gnupg gnome-keyring \
pass rofi-pass pass-git-helper
echo "==> Window Manager and Desktop"
paru -S --needed --noconfirm \
i3-wm \
sxhkd \
polybar \
picom \
dunst \
rofi rofi-calc dmenu \
xautocfg \
xorg-xrandr arandr
echo "==> File Manager"
paru -S --needed --noconfirm yazi
echo "==> Terminal Utilities"
paru -S --needed --noconfirm \
fd ripgrep fzf \
xclip xsel \
atool unzip \
trash-cli \
man-db \
fastfetch
echo "==> Browser"
paru -S --needed --noconfirm \
qutebrowser python-adblock pdfjs \
firefox-developer-edition passff-host
echo "==> Media"
paru -S --needed --noconfirm \
mpv \
jellyfin-tui \
nsxiv \
tesseract tesseract-data-eng tesseract-data-fra tesseract-data-osd \
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 --noconfirm \
pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse \
wireplumber
echo "==> PDF and Image Utilities"
paru -S --needed --noconfirm \
pdf2svg qpdf pdfarranger \
imagemagick \
maim flameshot \
unclutter \
poppler
echo "==> Office"
paru -S --needed --noconfirm \
onlyoffice-bin \
libreoffice-fresh libreoffice-fresh-fr \
inkscape
echo "==> System Utilities"
paru -S --needed --noconfirm \
udiskie \
blueman \
sshfs \
xwallpaper \
sof-firmware \
usbutils \
xautolock \
npm \
xorg-xkill \
syncthing \
wireguard-tools \
gotify-dunst-git \
gomuks \
yt-dlp \
freerdp \
python ipython python-pip
echo "==> Misc Utilities"
paru -S --needed --noconfirm \
xwallpaper \
highlight-pointer-git \
mpd
KEY_FILE="$HOME/.ssh/id_ed25519"
HOMELAB_OK=1
ESRF_OK=1
# Generate main SSH key if it doesn't exist
if [ ! -f "${KEY_FILE}" ]; then
echo ""
echo "==> Generating main SSH key"
read -p "Generate new SSH key at ${KEY_FILE}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-keygen -t ed25519 -C "thomas@$(hostname)" -f "${KEY_FILE}" -N ""
else
echo "Skipping SSH key generation"
fi
fi
# Deploy key to a remote host if needed
deploy_ssh_key() {
local host_name="$1"
local remote_host="$2"
local remote_port="${3:-22}"
echo ""
echo "==> Checking SSH key for ${host_name}"
# Check if we can connect without password
if ssh -o BatchMode=yes -o ConnectTimeout=5 -p "${remote_port}" "${remote_host}" exit 2>/dev/null; then
echo "SSH key for ${host_name} is already deployed ✓"
return 0
fi
# Prompt to deploy key
read -p "Deploy SSH key to ${remote_host}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-copy-id -i "${KEY_FILE}.pub" -p "${remote_port}" "${remote_host}"
return 0
else
echo "Skipping ${host_name} key deployment"
return 1
fi
}
# Setup homelab
deploy_ssh_key "homelab" "homelab" 22
HOMELAB_OK=$?
# Setup ESRF
deploy_ssh_key "esrf" "dehaeze@firewall.esrf.fr" 8022
ESRF_OK=$?
echo "==> Tangling systemd configs"
tangle "systemd.org"
echo "==> Enabling systemd services"
if [ $HOMELAB_OK -eq 0 ]; then
systemctl --user enable --now homelab-tunnel
else
echo " Skipping homelab-tunnel (SSH key not configured)"
fi
if [ $ESRF_OK -eq 0 ]; then
systemctl --user enable --now esrf-tunnel
else
echo " Skipping esrf-tunnel (SSH key not configured)"
fi
systemctl --user enable --now syncthing
+18
View File
@@ -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
+37
View File
@@ -0,0 +1,37 @@
#!/bin/bash
# Tmux Install Script
# :PROPERTIES:
# :header-args:bash: :tangle scripts/install-tmux.sh :shebang "#!/bin/bash" :mkdirp yes
# :END:
# [[file:../tmux.org::*Tmux Install Script][Tmux Install Script:1]]
set -euo pipefail
# Tmux Install Script:1 ends here
# Packages
# [[file:../tmux.org::*Packages][Packages:1]]
echo "==> Tmux packages"
paru -S --needed --noconfirm tmux
# Packages:1 ends here
# Tangle Configuration
# [[file:../tmux.org::*Tangle Configuration][Tangle Configuration:1]]
echo "==> Tangling tmux.org"
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/tmux.org")'
# Tangle Configuration:1 ends here
# Install TPM Plugins
# [[file:../tmux.org::*Install TPM Plugins][Install TPM Plugins:1]]
echo "==> Installing TPM plugins"
if [ ! -d ~/.config/tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
fi
tmux source ~/.config/tmux/tmux.conf
# Install TPM Plugins:1 ends here
+5 -100
View File
@@ -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')
@@ -204,102 +208,3 @@ super + space ; p
super + space ; t
$TERMINAL -e tmux new-session -A -s stig stig
#+end_src
* I3 related
:PROPERTIES:
:header-args:conf+: :tangle ~/.config/sxhkd/sxhkdrc.i3
:END:
** Kill Window
#+begin_src conf
# close and kill
super + q
i3-msg kill
#+end_src
** Set the window State
#+begin_src conf
# Set the window to full-screen
super + f
i3-msg fullscreen toggle
# Set the window to floating
super + s
i3-msg floating toggle
# Alternate between the tiled and normal layout
super + t
i3-msg layout toggle tabbed split
# Change focus between tiling / floating windows
super + c
i3-msg focus mode_toggle
# Sticky window
super + y
i3-msg sticky toggle
#+end_src
** focus/swap
#+begin_src conf
# Focus/swap the node in the given direction
super + {_,shift + }{h,Left}
i3-msg {focus,move} left
super + {_,shift + }{j,Down}
i3-msg {focus,move} down
super + {_,shift + }{k,Up}
i3-msg {focus,move} up
super + {_,shift + }{l,Right}
i3-msg {focus,move} right
#+end_src
#+begin_src conf
# Focus the next/previous desktop in the current monitor
super + {p,n}
i3-msg workspace {prev,next}
# Focus the last Desktop
super + b
i3-msg workspace back_and_forth
# Focus to the given desktop
super + {1-9}
i3-msg workspace '{1-9}'
# Send to the given desktop
super + ctrl + {1-9}
i3-msg move container to workspace '{1-9}'
# Focus and Send to the given desktop
super + shift + {1-9}
WP={1-9} && i3-msg move container to workspace $WP && i3-msg workspace $WP
#+end_src
** Preselect
Preselect the direction
#+begin_src conf
# Set Horizontal Layout
super + ctrl + {h,l,Left,Right}
i3-msg split h
# Set Vertical Layout
super + ctrl + {j,k,Up,Down}
i3-msg split v
#+end_src
** Resize
Expand/Shrink a window
#+begin_src conf
# Horizontal Shrink
super + alt + h
i3-msg resize shrink width 10 px or 10 ppt
# Vertical Grow
super + alt + j
i3-msg resize grow height 10 px or 10 ppt
# Vertical Shrink
super + alt + k
i3-msg resize shrink height 10 px or 10 ppt
# Horizontal Grow
super + alt + l
i3-msg resize grow width 10 px or 10 ppt
#+end_src
+34 -43
View File
@@ -3,6 +3,39 @@
#+PROPERTY: header-args :tangle ~/.config/tmux/tmux.conf
#+PROPERTY: header-args+ :comments both :mkdirp yes
* Tmux Install Script
:PROPERTIES:
:header-args:bash: :tangle scripts/install-tmux.sh :shebang "#!/bin/bash" :mkdirp yes
:END:
#+begin_src bash
set -euo pipefail
#+end_src
** Packages
#+begin_src bash
echo "==> Tmux packages"
paru -S --needed --noconfirm tmux
#+end_src
** Tangle Configuration
#+begin_src bash
echo "==> Tangling tmux.org"
emacsclient -e '(org-babel-tangle-file "/home/thomas/.config/literate-dotfiles/tmux.org")'
#+end_src
** Install TPM Plugins
#+begin_src bash
echo "==> Installing TPM plugins"
if [ ! -d ~/.config/tmux/plugins/tpm ]; then
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
fi
tmux source ~/.config/tmux/tmux.conf
#+end_src
* Line
#+begin_src conf
# Activate the status bar
@@ -206,52 +239,10 @@ set-window-option -g aggressive-resize
** Install plugins
#+BEGIN_SRC conf
set -g @plugin 'tmux-plugins/tpm'
# set -g @plugin 'tmux-plugins/tmux-sessionist'
# set -g @plugin 'tmux-plugins/tmux-resurrect'
# set -g @plugin 'tmux-plugins/tmux-continuum'
# set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'seebi/tmux-colors-solarized'
#+END_SRC
** Configuration
#+BEGIN_SRC conf
# =============================================================
# tmux-resurrect
# =============================================================
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
# Restoring pane contents
set -g @resurrect-capture-pane-contents 'on'
run-shell ~/.tmux/plugins/tmux-resurrect/resurrect.tmux
# =============================================================
# =============================================================
# tmux-continuum
# =============================================================
set -g @continuum-boot 'on'
set -g @continuum-boot-options 'iterm,fullscreen'
set -g @continuum-save-interval '15'
run-shell ~/.tmux/plugins/tmux-continuum/continuum.tmux
# =============================================================
# =============================================================
# tmux-battery
# =============================================================
set -g @batt_charged_icon "="
set -g @batt_charging_icon "+"
set -g @batt_discharging_icon "-"
set -g @batt_attached_icon "o"
# =============================================================
#+END_SRC
* Colors
#+BEGIN_SRC conf
set -g @colors-solarized 'light'
@@ -259,5 +250,5 @@ set -g @colors-solarized 'light'
* Initialize TMUX plugin manager
#+BEGIN_SRC conf
run '~/.tmux/plugins/tpm/tpm'
run '~/.config/tmux/plugins/tpm/tpm'
#+END_SRC
+529 -3
View File
@@ -9,12 +9,11 @@ set connect.host <<get-password(passname="ip/homelab")>>
set connect.port 9091
set connect.tls false
set connect.user tdehaeze
set connect.host <<get-password(passname="nas/transmission")>>
set connect.path /
set connect.url /transmission/
set connect.password <<get-password(passname="nas/transmission")>>
# Update torrent/peer/file/etc lists every 10 seconds
set tui.poll 10
set tui.theme gruvbox.theme
# Tabs
tab ls all --columns size,ratio,status,rate-down,rate-up,%downloaded,name
@@ -30,6 +29,533 @@ set columns.trackers tier domain error last-announce next-announce leeches seeds
set columns.settings name value default description
#+end_src
** Gruvbox Theme
#+begin_src conf :comments none :mkdirp yes :tangle ~/.config/stig/gruvbox.theme
# Gruvbox Dark theme for stig
# Based on https://github.com/morhetz/gruvbox
# Background colors
$bg0 = #282828
$bg1 = #32302f
$bg2 = #3c3836
$bg3 = #504945
$bg4 = #665c54
# Foreground colors
$fg0 = #f5f0e1
$fg1 = #ebdbb2
$fg2 = #d5c4a1
$fg3 = #bdae93
$fg4 = #a89984
# Colors
$red = #fb4934
$green = #b8bb26
$yellow = #fabd2f
$blue = #83a598
$purple = #d3869b
$aqua = #8ec07c
$orange = #fe8019
$gray = #928374
cli $fg1 on $bg1
prompt $bg0 on $yellow
find.highlight $bg0 on $yellow
tabs.unfocused $fg4 on $bg0
tabs.focused $bg0 on $fg1
tabs.torrentlist.unfocused $aqua on $bg1
tabs.torrentlist.focused $bg0 on $aqua
tabs.torrentdetails.unfocused $blue on $bg1
tabs.torrentdetails.focused $bg0 on $blue
tabs.filelist.unfocused $purple on $bg1
tabs.filelist.focused $bg0 on $purple
tabs.peerlist.unfocused $green on $bg1
tabs.peerlist.focused $bg0 on $green
tabs.trackerlist.unfocused $fg4 on $bg1
tabs.trackerlist.focused $bg0 on $fg4
tabs.settinglist.unfocused $yellow on $bg0
tabs.settinglist.focused $bg0 on $yellow
tabs.help.unfocused $green on $bg0
tabs.help.focused $bg0 on $green
$topbar_bg = $bg0
topbar $fg3 on $topbar_bg
topbar.host.connected $green on $topbar_bg
topbar.host.connecting $bg0 on $purple
topbar.host.disconnected $bg0 on $red
topbar.help.key $aqua on $topbar_bg
topbar.help.equals $aqua on $topbar_bg
topbar.help.label $aqua on $topbar_bg
topbar.help.space $aqua on $topbar_bg
$bottombar_bg = $bg1
bottombar $fg2 on $bottombar_bg
bottombar.important $red,bold on $bottombar_bg
bottombar.marked $bg0 on $yellow
bottombar.bandwidth.up $green on $bottombar_bg
bottombar.bandwidth.up.highlighted $fg1 on $bottombar_bg
bottombar.bandwidth.down $aqua on $bottombar_bg
bottombar.bandwidth.down.highlighted $fg1 on $bottombar_bg
$log_bg = $bg1
log $fg2 on $log_bg
log.timestamp $aqua on $log_bg
log.info $green on $log_bg
log.error $red,bold on $log_bg
log.debug $yellow on $log_bg
log.dupecount $aqua on $log_bg
log.scrollbar $fg2 on $bg1
$keychains_bg = $bg0
keychains $fg2 on $keychains_bg
keychains.header $fg2 on $bg2
keychains.keys $fg2 on $keychains_bg
keychains.keys.next $yellow on $keychains_bg
keychains.action $fg1 on $keychains_bg
keychains.description $fg1 on $keychains_bg
$completion_bg = $bg1
completion $fg2 on $completion_bg
completion.category $fg2,bold,underline on $completion_bg
completion.item $fg2 on $completion_bg
completion.item.focused $bg0,bold on $yellow
completion.scrollbar $fg2 on $completion_bg
helptext $fg2 on $bg0
helptext.scrollbar $fg2 on $bg1
$tlist_bg.uf = $bg0
$tlist_bg.f = $bg1
torrentlist default on $tlist_bg.uf
torrentlist.focused default on $tlist_bg.f
torrentlist.header $fg4,underline on $tlist_bg.uf
torrentlist.scrollbar $fg4 on $bg1
$id_fg = $fg3
torrentlist.id.header $id_fg,underline on $tlist_bg.uf
torrentlist.id.unfocused $id_fg on $tlist_bg.uf
torrentlist.id.focused $id_fg on $tlist_bg.f
torrentlist.infohash.header $id_fg,underline on $tlist_bg.uf
torrentlist.infohash.unfocused $id_fg on $tlist_bg.uf
torrentlist.infohash.focused $id_fg on $tlist_bg.f
torrentlist.downloaded.header $aqua,underline on $tlist_bg.uf
torrentlist.downloaded.unfocused $aqua on $tlist_bg.uf
torrentlist.downloaded.focused $aqua on $tlist_bg.f
torrentlist.downloaded.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.downloaded.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.uploaded.header $green,underline on $tlist_bg.uf
torrentlist.uploaded.unfocused $green on $tlist_bg.uf
torrentlist.uploaded.focused $green on $tlist_bg.f
torrentlist.uploaded.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.uploaded.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.available.header $blue,underline on $tlist_bg.uf
torrentlist.available.unfocused $blue on $tlist_bg.uf
torrentlist.available.focused $blue on $tlist_bg.f
torrentlist.available.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.available.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.marked.header $fg1,underline on $tlist_bg.uf
torrentlist.marked.unfocused $fg1 on $tlist_bg.uf
torrentlist.marked.focused $fg1 on $tlist_bg.f
torrentlist.path.header $fg3,underline on $tlist_bg.uf
torrentlist.path.unfocused $fg3 on $tlist_bg.uf
torrentlist.path.focused $fg3 on $tlist_bg.f
torrentlist.peers.header $fg3,underline on $tlist_bg.uf
torrentlist.peers.unfocused $fg3 on $tlist_bg.uf
torrentlist.peers.focused $fg3 on $tlist_bg.f
torrentlist.peers.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.peers.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.seeds.header $fg3,underline on $tlist_bg.uf
torrentlist.seeds.unfocused $fg3 on $tlist_bg.uf
torrentlist.seeds.focused $fg3 on $tlist_bg.f
torrentlist.seeds.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.seeds.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.%downloaded.header $blue,underline on $tlist_bg.uf
torrentlist.%downloaded.unfocused $blue on $tlist_bg.uf
torrentlist.%downloaded.focused $blue on $tlist_bg.f
torrentlist.%downloaded.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.%downloaded.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.%available.header $blue,underline on $tlist_bg.uf
torrentlist.%available.unfocused $blue on $tlist_bg.uf
torrentlist.%available.focused $blue on $tlist_bg.f
torrentlist.%available.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.%available.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.rate-down.header $aqua,underline on $tlist_bg.uf
torrentlist.rate-down.unfocused $aqua on $tlist_bg.uf
torrentlist.rate-down.focused $aqua on $tlist_bg.f
torrentlist.rate-down.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.rate-down.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.rate-up.header $green,underline on $tlist_bg.uf
torrentlist.rate-up.unfocused $green on $tlist_bg.uf
torrentlist.rate-up.focused $green on $tlist_bg.f
torrentlist.rate-up.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.rate-up.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.limit-rate-down.header $aqua,underline on $tlist_bg.uf
torrentlist.limit-rate-down.unfocused $aqua on $tlist_bg.uf
torrentlist.limit-rate-down.focused $aqua on $tlist_bg.f
torrentlist.limit-rate-down.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.limit-rate-down.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.limit-rate-up.header $green,underline on $tlist_bg.uf
torrentlist.limit-rate-up.unfocused $green on $tlist_bg.uf
torrentlist.limit-rate-up.focused $green on $tlist_bg.f
torrentlist.limit-rate-up.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.limit-rate-up.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.ratio.header $blue,underline on $tlist_bg.uf
torrentlist.ratio.unfocused $blue on $tlist_bg.uf
torrentlist.ratio.focused $blue on $tlist_bg.f
torrentlist.ratio.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.ratio.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.size.header $purple,underline on $tlist_bg.uf
torrentlist.size.unfocused $purple on $tlist_bg.uf
torrentlist.size.focused $purple on $tlist_bg.f
torrentlist.tracker.header $fg3,underline on $tlist_bg.uf
torrentlist.tracker.unfocused $fg3 on $tlist_bg.uf
torrentlist.tracker.focused $fg3 on $tlist_bg.f
torrentlist.error.header $red,underline on $tlist_bg.uf
torrentlist.error.unfocused $red on $tlist_bg.uf
torrentlist.error.focused $red on $tlist_bg.f
torrentlist.added.header $orange,underline on $tlist_bg.uf
torrentlist.added.unfocused $orange on $tlist_bg.uf
torrentlist.added.focused $orange on $tlist_bg.f
torrentlist.activity.header $orange,underline on $tlist_bg.uf
torrentlist.activity.unfocused $orange on $tlist_bg.uf
torrentlist.activity.focused $orange on $tlist_bg.f
torrentlist.created.header $orange,underline on $tlist_bg.uf
torrentlist.created.unfocused $orange on $tlist_bg.uf
torrentlist.created.focused $orange on $tlist_bg.f
torrentlist.completed.header $yellow,underline on $tlist_bg.uf
torrentlist.completed.unfocused $yellow on $tlist_bg.uf
torrentlist.completed.focused $yellow on $tlist_bg.f
torrentlist.completed.highlighted.unfocused $fg1 on $tlist_bg.uf
torrentlist.completed.highlighted.focused $fg1 on $tlist_bg.f
torrentlist.eta.header $orange,underline on $tlist_bg.uf
torrentlist.eta.unfocused $orange on $tlist_bg.uf
torrentlist.eta.focused $orange on $tlist_bg.f
torrentlist.eta.highlighted.unfocused $yellow on $tlist_bg.uf
torrentlist.eta.highlighted.focused $yellow on $tlist_bg.f
torrentlist.started.header $orange,underline on $tlist_bg.uf
torrentlist.started.unfocused $orange on $tlist_bg.uf
torrentlist.started.focused $orange on $tlist_bg.f
$status.idle_fg = $fg3
$status.downloading_fg = $aqua
$status.uploading_fg = $green
$status.connected_fg = $purple
$status.seeding_fg = $fg3
$status.stopped_fg = $blue
$status.queued_fg = $orange
$status.isolated_fg = $red
$status.verifying_fg = $yellow
$status.discovering_fg = $blue
torrentlist.status.header $status.idle_fg,underline on $tlist_bg.uf
torrentlist.status.idle.unfocused $status.idle_fg on $tlist_bg.uf
torrentlist.status.idle.focused $status.idle_fg on $tlist_bg.f
torrentlist.status.uploading.unfocused $status.uploading_fg on $tlist_bg.uf
torrentlist.status.uploading.focused $status.uploading_fg on $tlist_bg.f
torrentlist.status.downloading.unfocused $status.downloading_fg on $tlist_bg.uf
torrentlist.status.downloading.focused $status.downloading_fg on $tlist_bg.f
torrentlist.status.connected.unfocused $status.connected_fg on $tlist_bg.uf
torrentlist.status.connected.focused $status.connected_fg on $tlist_bg.f
torrentlist.status.seeding.unfocused $status.seeding_fg on $tlist_bg.uf
torrentlist.status.seeding.focused $status.seeding_fg on $tlist_bg.f
torrentlist.status.stopped.unfocused $status.stopped_fg on $tlist_bg.uf
torrentlist.status.stopped.focused $status.stopped_fg on $tlist_bg.f
torrentlist.status.isolated.unfocused $status.isolated_fg on $tlist_bg.uf
torrentlist.status.isolated.focused $status.isolated_fg on $tlist_bg.f
torrentlist.status.queued.unfocused $status.queued_fg on $tlist_bg.uf
torrentlist.status.queued.focused $status.queued_fg on $tlist_bg.f
torrentlist.status.verifying.unfocused $status.verifying_fg on $tlist_bg.uf
torrentlist.status.verifying.focused $status.verifying_fg on $tlist_bg.f
torrentlist.status.discovering.unfocused $status.discovering_fg on $tlist_bg.uf
torrentlist.status.discovering.focused $status.discovering_fg on $tlist_bg.f
$name.idle_fg = $status.idle_fg
torrentlist.name.header $name.idle_fg,underline on $tlist_bg.uf
torrentlist.name.idle.progress1.unfocused $name.idle_fg,underline on $tlist_bg.uf
torrentlist.name.idle.progress1.focused $name.idle_fg,underline on $tlist_bg.f
torrentlist.name.idle.progress2.unfocused $name.idle_fg on $tlist_bg.uf
torrentlist.name.idle.progress2.focused $name.idle_fg on $tlist_bg.f
torrentlist.name.idle.complete.unfocused $name.idle_fg on $tlist_bg.uf
torrentlist.name.idle.complete.focused $name.idle_fg on $tlist_bg.f
$name.seeding_fg = $status.seeding_fg
torrentlist.name.seeding.progress1.unfocused $name.seeding_fg,underline on $tlist_bg.uf
torrentlist.name.seeding.progress1.focused $name.seeding_fg,underline on $tlist_bg.f
torrentlist.name.seeding.progress2.unfocused $name.seeding_fg on $tlist_bg.uf
torrentlist.name.seeding.progress2.focused $name.seeding_fg on $tlist_bg.f
torrentlist.name.seeding.complete.unfocused $name.seeding_fg on $tlist_bg.uf
torrentlist.name.seeding.complete.focused $name.seeding_fg on $tlist_bg.f
$name.uploading_fg = $status.uploading_fg
torrentlist.name.uploading.progress1.unfocused $name.uploading_fg,underline on $tlist_bg.uf
torrentlist.name.uploading.progress1.focused $name.uploading_fg,underline on $tlist_bg.f
torrentlist.name.uploading.progress2.unfocused $name.uploading_fg on $tlist_bg.uf
torrentlist.name.uploading.progress2.focused $name.uploading_fg on $tlist_bg.f
torrentlist.name.uploading.complete.unfocused $name.uploading_fg on $tlist_bg.uf
torrentlist.name.uploading.complete.focused $name.uploading_fg on $tlist_bg.f
$name.downloading_fg = $status.downloading_fg
torrentlist.name.downloading.progress1.unfocused $name.downloading_fg,underline on $tlist_bg.uf
torrentlist.name.downloading.progress1.focused $name.downloading_fg,underline on $tlist_bg.f
torrentlist.name.downloading.progress2.unfocused $name.downloading_fg on $tlist_bg.uf
torrentlist.name.downloading.progress2.focused $name.downloading_fg on $tlist_bg.f
torrentlist.name.downloading.complete.unfocused $name.downloading_fg on $tlist_bg.uf
torrentlist.name.downloading.complete.focused $name.downloading_fg on $tlist_bg.f
$name.isolated_fg = $status.isolated_fg
torrentlist.name.isolated.progress1.unfocused $name.isolated_fg,underline on $tlist_bg.uf
torrentlist.name.isolated.progress1.focused $name.isolated_fg,underline on $tlist_bg.f
torrentlist.name.isolated.progress2.unfocused $name.isolated_fg on $tlist_bg.uf
torrentlist.name.isolated.progress2.focused $name.isolated_fg on $tlist_bg.f
torrentlist.name.isolated.complete.unfocused $name.isolated_fg on $tlist_bg.uf
torrentlist.name.isolated.complete.focused $name.isolated_fg on $tlist_bg.f
$name.connected_fg = $status.connected_fg
torrentlist.name.connected.progress1.unfocused $name.connected_fg,underline on $tlist_bg.uf
torrentlist.name.connected.progress1.focused $name.connected_fg,underline on $tlist_bg.f
torrentlist.name.connected.progress2.unfocused $name.connected_fg on $tlist_bg.uf
torrentlist.name.connected.progress2.focused $name.connected_fg on $tlist_bg.f
torrentlist.name.connected.complete.unfocused $name.connected_fg on $tlist_bg.uf
torrentlist.name.connected.complete.focused $name.connected_fg on $tlist_bg.f
$name.queued_fg = $status.queued_fg
torrentlist.name.queued.progress1.unfocused $name.queued_fg,underline on $tlist_bg.uf
torrentlist.name.queued.progress1.focused $name.queued_fg,underline on $tlist_bg.f
torrentlist.name.queued.progress2.unfocused $name.queued_fg on $tlist_bg.uf
torrentlist.name.queued.progress2.focused $name.queued_fg on $tlist_bg.f
torrentlist.name.queued.complete.unfocused $name.queued_fg on $tlist_bg.uf
torrentlist.name.queued.complete.focused $name.queued_fg on $tlist_bg.f
$name.stopped_fg = $status.stopped_fg
torrentlist.name.stopped.progress1.unfocused $name.stopped_fg,underline on $tlist_bg.uf
torrentlist.name.stopped.progress1.focused $name.stopped_fg,underline on $tlist_bg.f
torrentlist.name.stopped.progress2.unfocused $name.stopped_fg on $tlist_bg.uf
torrentlist.name.stopped.progress2.focused $name.stopped_fg on $tlist_bg.f
torrentlist.name.stopped.complete.unfocused $name.stopped_fg on $tlist_bg.uf
torrentlist.name.stopped.complete.focused $name.stopped_fg on $tlist_bg.f
$name.verifying_fg = $status.verifying_fg
torrentlist.name.verifying.progress1.unfocused $name.verifying_fg,underline on $tlist_bg.uf
torrentlist.name.verifying.progress1.focused $name.verifying_fg,underline on $tlist_bg.f
torrentlist.name.verifying.progress2.unfocused $name.verifying_fg on $tlist_bg.uf
torrentlist.name.verifying.progress2.focused $name.verifying_fg on $tlist_bg.f
torrentlist.name.verifying.complete.unfocused $name.verifying_fg on $tlist_bg.uf
torrentlist.name.verifying.complete.focused $name.verifying_fg on $tlist_bg.f
$name.discovering_fg = $status.discovering_fg
torrentlist.name.discovering.progress1.unfocused $name.discovering_fg,underline on $tlist_bg.uf
torrentlist.name.discovering.progress1.focused $name.discovering_fg,underline on $tlist_bg.f
torrentlist.name.discovering.progress2.unfocused $name.discovering_fg on $tlist_bg.uf
torrentlist.name.discovering.progress2.focused $name.discovering_fg on $tlist_bg.f
torrentlist.name.discovering.complete.unfocused $name.discovering_fg on $tlist_bg.uf
torrentlist.name.discovering.complete.focused $name.discovering_fg on $tlist_bg.f
torrentdetails $fg2 on $bg0
torrentdetails.error $red on $bg0
torrentdetails.scrollbar $fg2 on $bg1
$flist_bg.uf = $bg0
$flist_bg.f = $bg1
filelist default on $flist_bg.uf
filelist.focused default on $flist_bg.f
filelist.header $fg4,underline on $flist_bg.uf
filelist.scrollbar $fg4 on $bg1
filelist.marked.header $fg1,underline on $flist_bg.uf
filelist.marked.unfocused $fg1 on $flist_bg.uf
filelist.marked.focused $fg1 on $flist_bg.f
filelist.name.header $fg4,underline on $flist_bg.uf
filelist.name.file.unfocused $fg3 on $flist_bg.uf
filelist.name.file.focused $fg3 on $flist_bg.f
filelist.name.folder.unfocused $fg1 on $flist_bg.uf
filelist.name.folder.focused $fg1 on $flist_bg.f
filelist.size.header $purple,underline on $flist_bg.uf
filelist.size.unfocused $purple on $flist_bg.uf
filelist.size.focused $purple on $flist_bg.f
filelist.downloaded.header $aqua,underline on $flist_bg.uf
filelist.downloaded.unfocused $aqua on $flist_bg.uf
filelist.downloaded.focused $aqua on $flist_bg.f
filelist.downloaded.highlighted.unfocused $fg1 on $flist_bg.uf
filelist.downloaded.highlighted.focused $fg1 on $flist_bg.f
filelist.%downloaded.header $blue,underline on $flist_bg.uf
filelist.%downloaded.unfocused $blue on $flist_bg.uf
filelist.%downloaded.focused $blue on $flist_bg.f
filelist.%downloaded.highlighted.unfocused $fg1 on $flist_bg.uf
filelist.%downloaded.highlighted.focused $fg1 on $flist_bg.f
filelist.priority.header $orange,underline on $flist_bg.uf
filelist.priority.unfocused $orange on $flist_bg.uf
filelist.priority.focused $orange on $flist_bg.f
filelist.priority.low.unfocused $orange on $flist_bg.uf
filelist.priority.low.focused $orange on $flist_bg.f
filelist.priority.high.unfocused $yellow on $flist_bg.uf
filelist.priority.high.focused $yellow on $flist_bg.f
filelist.priority.off.unfocused $blue on $flist_bg.uf
filelist.priority.off.focused $blue on $flist_bg.f
$plist_bg = $bg0
peerlist default on $plist_bg
peerlist.focused default on $plist_bg
peerlist.header $fg4,underline on $plist_bg
peerlist.scrollbar $fg4 on $bg1
peerlist.torrent.header $fg3,underline on $plist_bg
peerlist.torrent.unfocused $fg3 on $plist_bg
peerlist.host.header $fg3,underline on $plist_bg
peerlist.host.unfocused $fg3 on $plist_bg
peerlist.port.header $fg3,underline on $plist_bg
peerlist.port.unfocused $fg3 on $plist_bg
peerlist.client.header $purple,underline on $plist_bg
peerlist.client.unfocused $purple on $plist_bg
peerlist.%downloaded.header $blue,underline on $plist_bg
peerlist.%downloaded.unfocused $blue on $plist_bg
peerlist.%downloaded.highlighted.unfocused $fg1 on $plist_bg
peerlist.rate-down.header $aqua,underline on $plist_bg
peerlist.rate-down.unfocused $aqua on $plist_bg
peerlist.rate-down.highlighted.unfocused $fg1 on $plist_bg
peerlist.rate-up.header $green,underline on $plist_bg
peerlist.rate-up.unfocused $green on $plist_bg
peerlist.rate-up.highlighted.unfocused $fg1 on $plist_bg
peerlist.rate-est.header $green,underline on $plist_bg
peerlist.rate-est.unfocused $green on $plist_bg
peerlist.rate-est.highlighted.unfocused $fg1 on $plist_bg
peerlist.eta.header $orange,underline on $plist_bg
peerlist.eta.unfocused $orange on $plist_bg
peerlist.eta.highlighted.unfocused $yellow on $plist_bg
$trklist_bg.uf = $bg0
$trklist_bg.f = $bg1
trackerlist default on $trklist_bg.uf
trackerlist.focused default on $trklist_bg.f
trackerlist.header $fg4,underline on $trklist_bg.uf
trackerlist.scrollbar $fg4 on $bg1
trackerlist.torrent.header $fg3,underline on $trklist_bg.uf
trackerlist.torrent.unfocused $fg3 on $trklist_bg.uf
trackerlist.torrent.focused $fg3 on $trklist_bg.f
trackerlist.tier.header $orange,underline on $trklist_bg.uf
trackerlist.tier.unfocused $orange on $trklist_bg.uf
trackerlist.tier.focused $orange on $trklist_bg.f
trackerlist.domain.header $purple,underline on $trklist_bg.uf
trackerlist.domain.unfocused $purple on $trklist_bg.uf
trackerlist.domain.focused $purple on $trklist_bg.f
trackerlist.url-announce.header $blue,underline on $trklist_bg.uf
trackerlist.url-announce.unfocused $blue on $trklist_bg.uf
trackerlist.url-announce.focused $blue on $trklist_bg.f
trackerlist.url-scrape.header $blue,underline on $trklist_bg.uf
trackerlist.url-scrape.unfocused $blue on $trklist_bg.uf
trackerlist.url-scrape.focused $blue on $trklist_bg.f
trackerlist.status.header $aqua,underline on $trklist_bg.uf
trackerlist.status.unfocused $aqua on $trklist_bg.uf
trackerlist.status.focused $aqua on $trklist_bg.f
trackerlist.error.header $red,underline on $trklist_bg.uf
trackerlist.error.unfocused $red on $trklist_bg.uf
trackerlist.error.focused $red on $trklist_bg.f
trackerlist.error-announce.header $red,underline on $trklist_bg.uf
trackerlist.error-announce.unfocused $red on $trklist_bg.uf
trackerlist.error-announce.focused $red on $trklist_bg.f
trackerlist.error-scrape.header $red,underline on $trklist_bg.uf
trackerlist.error-scrape.unfocused $red on $trklist_bg.uf
trackerlist.error-scrape.focused $red on $trklist_bg.f
trackerlist.downloads.header $fg3,underline on $trklist_bg.uf
trackerlist.downloads.unfocused $fg3 on $trklist_bg.uf
trackerlist.downloads.focused $fg3 on $trklist_bg.f
trackerlist.leeches.header $fg3,underline on $trklist_bg.uf
trackerlist.leeches.unfocused $fg3 on $trklist_bg.uf
trackerlist.leeches.focused $fg3 on $trklist_bg.f
trackerlist.seeds.header $fg3,underline on $trklist_bg.uf
trackerlist.seeds.unfocused $fg3 on $trklist_bg.uf
trackerlist.seeds.focused $fg3 on $trklist_bg.f
trackerlist.last-announce.header $fg1,underline on $trklist_bg.uf
trackerlist.last-announce.unfocused $fg1 on $trklist_bg.uf
trackerlist.last-announce.focused $fg1 on $trklist_bg.f
trackerlist.next-announce.header $fg1,underline on $trklist_bg.uf
trackerlist.next-announce.unfocused $fg1 on $trklist_bg.uf
trackerlist.next-announce.focused $fg1 on $trklist_bg.f
trackerlist.last-scrape.header $fg1,underline on $trklist_bg.uf
trackerlist.last-scrape.unfocused $fg1 on $trklist_bg.uf
trackerlist.last-scrape.focused $fg1 on $trklist_bg.f
trackerlist.next-scrape.header $fg1,underline on $trklist_bg.uf
trackerlist.next-scrape.unfocused $fg1 on $trklist_bg.uf
trackerlist.next-scrape.focused $fg1 on $trklist_bg.f
$slist_bg.uf = $bg0
$slist_bg.f = $bg1
settinglist default on $slist_bg.uf
settinglist.focused default on $slist_bg.f
settinglist.header $fg4,underline on $slist_bg.uf
settinglist.scrollbar $fg4 on $bg1
settinglist.name.header $blue,underline on $slist_bg.uf
settinglist.name.unfocused $blue on $slist_bg.uf
settinglist.name.focused $blue on $slist_bg.f
settinglist.value.header $fg3,underline on $slist_bg.uf
settinglist.value.unfocused $fg3 on $slist_bg.uf
settinglist.value.focused $fg3 on $slist_bg.f
settinglist.value.highlighted.unfocused $fg1,bold on $slist_bg.uf
settinglist.value.highlighted.focused $fg1,bold on $slist_bg.f
settinglist.default.header $fg3,underline on $slist_bg.uf
settinglist.default.unfocused $fg3 on $slist_bg.uf
settinglist.default.focused $fg3 on $slist_bg.f
settinglist.description.header $fg3,underline on $slist_bg.uf
settinglist.description.unfocused $fg3 on $slist_bg.uf
settinglist.description.focused $fg3 on $slist_bg.f
#+end_src
* =aria2c= - Lightweight download utility
#+begin_src conf :comments none :mkdirp yes :tangle ~/.config/aria2/aria2.conf :noweb no-export
continue
+104
View File
@@ -4,6 +4,48 @@
#+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 --noconfirm 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"
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
@@ -131,6 +173,12 @@ Plug 'nvim-telescope/telescope-ui-select.nvim'
Plug 'folke/which-key.nvim'
#+end_src
** Claude Code
#+begin_src vimrc
Plug 'folke/snacks.nvim'
Plug 'coder/claudecode.nvim'
#+end_src
** Plug End
#+begin_src vimrc
call plug#end()
@@ -526,6 +574,13 @@ snoremap <C-K> <Esc>b[sviw<C-G>
#+begin_src vimrc
autocmd FileType mail set spell spelllang=en_us,fr
autocmd FileType mail set textwidth=0
autocmd FileType mail lcd %:p:h
" Start Claude: save, open Claude, add current buffer, then ask to refine
autocmd FileType mail nnoremap <buffer> <leader>ae <cmd>lua ClaudeMailRefine()<cr>
" Finish: accept diff, close Claude pane, save and quit
autocmd FileType mail nnoremap <buffer> <leader>aq <cmd>ClaudeCodeDiffAccept<cr><cmd>ClaudeCode<cr>
function! Mailcomplete(findstart, base)
if a:findstart == 1
@@ -788,6 +843,55 @@ lua << EOF
EOF
#+end_src
** Diff wrap
#+begin_src vimrc
autocmd OptionSet diff if v:option_new | setlocal wrap linebreak | endif
#+end_src
** =claudecode=
#+begin_src vimrc
lua << EOF
require('claudecode').setup({
split_side = "right",
split_width_percentage = 0.35,
})
function ClaudeMailRefine()
local win = vim.api.nvim_get_current_win()
vim.cmd('w')
vim.cmd('ClaudeCode')
vim.defer_fn(function()
if vim.api.nvim_win_is_valid(win) then
vim.api.nvim_set_current_win(win)
end
vim.cmd('ClaudeCodeAdd %')
vim.defer_fn(function()
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
local name = vim.api.nvim_buf_get_name(buf)
if name:match('claude') then
local job_id = vim.b[buf].terminal_job_id
if job_id then
vim.api.nvim_chan_send(job_id, "Refine this email using a single file edit tool call: fix the subject, grammar, clarity and tone all at once. Do not make multiple edits.\r")
break
end
end
end
end, 500)
end, 1000)
end
EOF
nnoremap <leader>ac <cmd>ClaudeCode<cr>
nnoremap <leader>af <cmd>ClaudeCodeFocus<cr>
nnoremap <leader>ar <cmd>ClaudeCode --resume<cr>
nnoremap <leader>aC <cmd>ClaudeCode --continue<cr>
nnoremap <leader>am <cmd>ClaudeCodeSelectModel<cr>
nnoremap <leader>ab <cmd>ClaudeCodeAdd %<cr>
vnoremap <leader>as <cmd>ClaudeCodeSend<cr>
nnoremap <leader>aa <cmd>ClaudeCodeDiffAccept<cr>
nnoremap <leader>ad <cmd>ClaudeCodeDiffDeny<cr>
#+end_src
* Key Bindings
** Quit
#+begin_src vimrc
+21 -11
View File
@@ -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:
+1 -1
View File
@@ -99,7 +99,7 @@ tmpfile=/tmp/pdf_page.pdf
# Ideally would get the page from Zathura...
# pagenum=$(rofi -dmenu -p "Page Number")
pdftk "$1" cat $2 output "$tmpfile.pdf" && \
qpdf --pages "$1" "$2" -- "$1" "$tmpfile.pdf" && \
pdf2svg "$tmpfile.pdf" "$tmpfile.svg" && \
inkscape "$tmpfile.svg"
#+end_src