A few improvements from a new laptop

master
Quentin Duchemin 2024-04-28 16:44:53 +02:00
parent c2a131e9ec
commit 645b1d973a
11 changed files with 74 additions and 55 deletions

View File

@ -6,6 +6,6 @@ alias rm='rmtrash'
alias rrm='/usr/bin/rm' alias rrm='/usr/bin/rm'
# cp is rsync # cp is rsync
alias cp='cpv' alias cp='cpv'
# ls sorted by modification time
alias lt='ls -lath'
alias vim='nvim' alias vim='nvim'
alias ls='eza'
alias cat='bat'

View File

@ -3,11 +3,14 @@ ansible
ansible-lint ansible-lint
arc-gtk-theme arc-gtk-theme
arc-icon-theme arc-icon-theme
bat
bat-extras
bluez bluez
bluetooth-autoconnect bluetooth-autoconnect
bind bind
catppuccin-cursors-macchiato catppuccin-cursors-macchiato
catppuccin-gtk-theme-macchiato catppuccin-gtk-theme-macchiato
chafa
chromium chromium
cups cups
docker docker
@ -21,6 +24,8 @@ ffmpegthumbnailer
firefox firefox
flameshot flameshot
fzf fzf
gcr
git-delta
gthumb gthumb
hplip hplip
htop htop
@ -29,6 +34,7 @@ i3lock-color
imagemagick imagemagick
jq jq
kwayland5 kwayland5
lesspipe
libreoffice-fresh libreoffice-fresh
libusb-compat libusb-compat
less less
@ -64,6 +70,7 @@ python-pyperclip
python-requests python-requests
qbittorrent qbittorrent
restic restic
ripgrep
rmtrash rmtrash
rofi rofi
rofimoji rofimoji

View File

@ -1,5 +1,5 @@
{ {
"catppuccin": { "branch": "main", "commit": "c2034f7b549152e5cc757820426341ea5000bc7a" }, "catppuccin": { "branch": "main", "commit": "c2034f7b549152e5cc757820426341ea5000bc7a" },
"formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" },
"lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" } "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }
} }

View File

@ -1,2 +1,2 @@
icons=() icons=()
parts=(/ /home) parts=(/)

View File

@ -1,7 +0,0 @@
[Unit]
Description=Back up chosto's documents
OnFailure=notify-backup-failure.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'RESTIC_PASSWORD=$(cat /root/restic) restic -r /backup/restic --verbose backup --exclude "/home/.*" /home'

View File

@ -1,9 +0,0 @@
[Unit]
Description=Run backup daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=timers.target

View File

@ -11,5 +11,5 @@ XDG_TEMPLATES_DIR="$HOME/"
XDG_PUBLICSHARE_DIR="$HOME/" XDG_PUBLICSHARE_DIR="$HOME/"
XDG_DOCUMENTS_DIR="$HOME/documents" XDG_DOCUMENTS_DIR="$HOME/documents"
XDG_MUSIC_DIR="$HOME/" XDG_MUSIC_DIR="$HOME/"
XDG_PICTURES_DIR="$HOME/" XDG_PICTURES_DIR="$HOME/images"
XDG_VIDEOS_DIR="$HOME/videos" XDG_VIDEOS_DIR="$HOME/videos"

1
.env
View File

@ -8,3 +8,4 @@ export PATH="$PATH:/home/go/bin:/usr/local/.local/bin:~/node_modules/.bin"
export ELECTRON_TRASH="trash-cli" export ELECTRON_TRASH="trash-cli"
export ZSH_COLORIZE_TOOL="pygmentize" export ZSH_COLORIZE_TOOL="pygmentize"
export ZSH_COLORIZE_STYLE="catppuccin-macchiato" export ZSH_COLORIZE_STYLE="catppuccin-macchiato"
export LESSOPEN="|lesspipe.sh %s"

23
.gitconfig 100644
View File

@ -0,0 +1,23 @@
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
# delta detects terminal colors automatically; set one of these to disable auto-detection
# dark = true
# light = true
[merge]
conflictstyle = diff3
[diff]
colorMoved = default
[user]
email = quentinduchemin@tuta.io
name = Quentin Duchemin
[push]
autoSetupRemote = true

View File

@ -82,24 +82,11 @@ function usage() {
exit 0 exit 0
} }
# Use XDG_CONFIG_HOME if defined, default otherwise function init_system() {
CONFIG=${XDG_CONFIG_HOME:-$HOME/.config}
ENV=${1}
for m in ${MERGE_DIRS}; do
if [ -f "${CONFIG}/${m}/${MERGE_CONFIG_FOLDER}/above" ]; then
merge_config $m ${ENV} true
else
merge_config $m ${ENV}
fi
done
if [ ! -z "$INIT" ]; then
echo -e "* Installing base Arch packages..." echo -e "* Installing base Arch packages..."
yay -Syu --needed --noconfirm - < ${CONFIG}/${ARCH_PACKAGES}/${FINAL_CONFIG} yay -Syu --needed --noconfirm - < ${CONFIG}/${ARCH_PACKAGES}/${FINAL_CONFIG}
echo -e "* Changing shell to ZSH..." echo -e "* Changing shell to ZSH..."
sudo chsh -s $(which zsh) chsh -s $(which zsh)
if [ "$ENV" = "desk" ]; then if [ "$ENV" = "desk" ]; then
echo -e "* Add user to realtime group..." echo -e "* Add user to realtime group..."
sudo usermod -aG realtime $(whoami) sudo usermod -aG realtime $(whoami)
@ -113,13 +100,14 @@ if [ ! -z "$INIT" ]; then
sudo systemctl enable --now cups sudo systemctl enable --now cups
sudo systemctl enable --now bluetooth sudo systemctl enable --now bluetooth
sudo systemctl enable --now bluetooth-autoconnect sudo systemctl enable --now bluetooth-autoconnect
sudo systemctl enable --now updatedb.timer
# iwd will be used as a backend for NetworkManager # iwd will be used as a backend for NetworkManager
sudo systemctl disable wpa_supplicant sudo systemctl disable wpa_supplicant
echo -e "* Ensure hardware clock is up to date..." echo -e "* Ensure hardware clock is up to date..."
sudo hwclock --systohc sudo hwclock --systohc
# So that "Open in Terminal" works inc Nemo # So that "Open in Terminal" works inc Nemo
echo -e "* Make 'Open Terminal' work in Nemo..." echo -e "* Make 'Open Terminal' work in Nemo..."
gsettings set org.cinnamon.desktop.default-applications.terminal exec i3-sensible-terminal sudo gsettings set org.cinnamon.desktop.default-applications.terminal exec i3-sensible-terminal
# For screenshots # For screenshots
echo -e "* Install pychee for uploading screenshots on Lychee..." echo -e "* Install pychee for uploading screenshots on Lychee..."
pip install --break-system-packages pychee pip install --break-system-packages pychee
@ -163,22 +151,20 @@ if [ ! -z "$INIT" ]; then
# See https://github.com/EliverLara/terminator-themes # See https://github.com/EliverLara/terminator-themes
mkdir -p $HOME/.config/terminator/plugins mkdir -p $HOME/.config/terminator/plugins
wget https://git.io/v5Zww -O $HOME"/.config/terminator/plugins/terminator-themes.py" wget https://git.io/v5Zww -O $HOME"/.config/terminator/plugins/terminator-themes.py"
fi }
if [ ! -z ${ENV} ]; then # Use XDG_CONFIG_HOME if defined, default otherwise
echo -e "\n=== Create symlink to *.${ENV} regular files ===" CONFIG=${XDG_CONFIG_HOME:-$HOME/.config}
# Take all specific files and create a symlink pointing to it without the extension
# This file will be used by applications ENV=${1}
for f in `find ${CONFIG} -type f -name "*.${ENV}"`; do
echo "${f%.*}${f}" for m in ${MERGE_DIRS}; do
ln -sf ${f} ${f%.*} if [ -f "${CONFIG}/${m}/${MERGE_CONFIG_FOLDER}/above" ]; then
done merge_config $m ${ENV} true
# Take care of config files at home level, outside ${CONFIG} (e.g. Xresources) else
for f in `find ${HOME} -maxdepth 1 -mindepth 1 -type f -name "*.${ENV}"`; do merge_config $m ${ENV}
echo "${f%.*}${f}" fi
ln -sf ${f} ${f%.*} done
done
fi
echo -e "\n=== Copy changed configuration which resides in outer directory ===" echo -e "\n=== Copy changed configuration which resides in outer directory ==="
# Destination files are regular files # Destination files are regular files
@ -198,12 +184,32 @@ for f in `find ${CONFIG} -type f -name ${DEST_FILENAME}`; do
filename=${config_file##*/} filename=${config_file##*/}
# Now copy to destination # Now copy to destination
real_dest=${DEST}/${subfolder} real_dest=${DEST}/${subfolder}
echo $real_dest
sudo mkdir -p ${real_dest} sudo mkdir -p ${real_dest}
absolute_source=`realpath "${DIR}/${config_file}"` absolute_source=`realpath "${DIR}/${config_file}"`
check_copy "${absolute_source}" "sudo cp ${absolute_source} ${real_dest}" "sudo rm ${real_dest}/${filename}" check_copy "${absolute_source}" "sudo cp ${absolute_source} ${real_dest}" "sudo rm ${real_dest}/${filename}"
done done
done done
if [ ! -z "$INIT" ]; then
init_system
fi
if [ ! -z ${ENV} ]; then
echo -e "\n=== Create symlink to *.${ENV} regular files ==="
# Take all specific files and create a symlink pointing to it without the extension
# This file will be used by applications
for f in `find ${CONFIG} -type f -name "*.${ENV}"`; do
echo "${f%.*}${f}"
ln -sf ${f} ${f%.*}
done
# Take care of config files at home level, outside ${CONFIG} (e.g. Xresources)
for f in `find ${HOME} -maxdepth 1 -mindepth 1 -type f -name "*.${ENV}"`; do
echo "${f%.*}${f}"
ln -sf ${f} ${f%.*}
done
fi
if [ ! -z "${WM_RESTART}" ]; then if [ ! -z "${WM_RESTART}" ]; then
echo -e "\n=== Restart graphical environment ===" echo -e "\n=== Restart graphical environment ==="
# Reload i3 configuration # Reload i3 configuration

2
.zshrc
View File

@ -27,8 +27,6 @@ plugins=(
# acs command → print aliases by group # acs command → print aliases by group
aliases aliases
colored-man-pages colored-man-pages
# cat with colors → ccat or cless
colorize
# commands to copy file content or absolute path to clipboard # commands to copy file content or absolute path to clipboard
copyfile copyfile
copypath copypath