From 645b1d973ab5a8276063d186ce2f83b1c99f7a9d Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Sun, 28 Apr 2024 16:44:53 +0200 Subject: [PATCH] A few improvements from a new laptop --- .aliases | 4 +- .config/bootstrap/config_common | 7 ++ .config/nvim/lazy-lock.json | 2 +- .../polybar/scripts/filesystem.data.laptop | 4 +- .config/systemd/backup.service.desk | 7 -- .config/systemd/backup.timer.desk | 9 --- .config/user-dirs.dirs | 2 +- .env | 1 + .gitconfig | 23 +++++++ .init_config.sh | 68 ++++++++++--------- .zshrc | 2 - 11 files changed, 74 insertions(+), 55 deletions(-) delete mode 100644 .config/systemd/backup.service.desk delete mode 100644 .config/systemd/backup.timer.desk create mode 100644 .gitconfig diff --git a/.aliases b/.aliases index 26aef80..38f2246 100644 --- a/.aliases +++ b/.aliases @@ -6,6 +6,6 @@ alias rm='rmtrash' alias rrm='/usr/bin/rm' # cp is rsync alias cp='cpv' -# ls sorted by modification time -alias lt='ls -lath' alias vim='nvim' +alias ls='eza' +alias cat='bat' diff --git a/.config/bootstrap/config_common b/.config/bootstrap/config_common index ee882b8..b7038bd 100644 --- a/.config/bootstrap/config_common +++ b/.config/bootstrap/config_common @@ -3,11 +3,14 @@ ansible ansible-lint arc-gtk-theme arc-icon-theme +bat +bat-extras bluez bluetooth-autoconnect bind catppuccin-cursors-macchiato catppuccin-gtk-theme-macchiato +chafa chromium cups docker @@ -21,6 +24,8 @@ ffmpegthumbnailer firefox flameshot fzf +gcr +git-delta gthumb hplip htop @@ -29,6 +34,7 @@ i3lock-color imagemagick jq kwayland5 +lesspipe libreoffice-fresh libusb-compat less @@ -64,6 +70,7 @@ python-pyperclip python-requests qbittorrent restic +ripgrep rmtrash rofi rofimoji diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1b9c2e6..522becf 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,5 +1,5 @@ { "catppuccin": { "branch": "main", "commit": "c2034f7b549152e5cc757820426341ea5000bc7a" }, "formatter.nvim": { "branch": "master", "commit": "cb4778b8432f1ae86dae4634c0b611cb269a4c2f" }, - "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" } + "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" } } \ No newline at end of file diff --git a/.config/polybar/scripts/filesystem.data.laptop b/.config/polybar/scripts/filesystem.data.laptop index bfe6a3b..63b3bc7 100644 --- a/.config/polybar/scripts/filesystem.data.laptop +++ b/.config/polybar/scripts/filesystem.data.laptop @@ -1,2 +1,2 @@ -icons=( ) -parts=(/ /home) +icons=() +parts=(/) diff --git a/.config/systemd/backup.service.desk b/.config/systemd/backup.service.desk deleted file mode 100644 index a149ae5..0000000 --- a/.config/systemd/backup.service.desk +++ /dev/null @@ -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' diff --git a/.config/systemd/backup.timer.desk b/.config/systemd/backup.timer.desk deleted file mode 100644 index c7929c2..0000000 --- a/.config/systemd/backup.timer.desk +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Run backup daily - -[Timer] -OnCalendar=daily -Persistent=true - -[Install] -WantedBy=timers.target diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs index b0b10bf..c469b08 100644 --- a/.config/user-dirs.dirs +++ b/.config/user-dirs.dirs @@ -11,5 +11,5 @@ XDG_TEMPLATES_DIR="$HOME/" XDG_PUBLICSHARE_DIR="$HOME/" XDG_DOCUMENTS_DIR="$HOME/documents" XDG_MUSIC_DIR="$HOME/" -XDG_PICTURES_DIR="$HOME/" +XDG_PICTURES_DIR="$HOME/images" XDG_VIDEOS_DIR="$HOME/videos" diff --git a/.env b/.env index 76bf872..7017454 100644 --- a/.env +++ b/.env @@ -8,3 +8,4 @@ export PATH="$PATH:/home/go/bin:/usr/local/.local/bin:~/node_modules/.bin" export ELECTRON_TRASH="trash-cli" export ZSH_COLORIZE_TOOL="pygmentize" export ZSH_COLORIZE_STYLE="catppuccin-macchiato" +export LESSOPEN="|lesspipe.sh %s" diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..573cbc5 --- /dev/null +++ b/.gitconfig @@ -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 diff --git a/.init_config.sh b/.init_config.sh index 3d94ffd..bb4f708 100755 --- a/.init_config.sh +++ b/.init_config.sh @@ -82,24 +82,11 @@ function usage() { exit 0 } -# Use XDG_CONFIG_HOME if defined, default otherwise -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 +function init_system() { echo -e "* Installing base Arch packages..." yay -Syu --needed --noconfirm - < ${CONFIG}/${ARCH_PACKAGES}/${FINAL_CONFIG} echo -e "* Changing shell to ZSH..." - sudo chsh -s $(which zsh) + chsh -s $(which zsh) if [ "$ENV" = "desk" ]; then echo -e "* Add user to realtime group..." sudo usermod -aG realtime $(whoami) @@ -113,13 +100,14 @@ if [ ! -z "$INIT" ]; then sudo systemctl enable --now cups sudo systemctl enable --now bluetooth sudo systemctl enable --now bluetooth-autoconnect + sudo systemctl enable --now updatedb.timer # iwd will be used as a backend for NetworkManager sudo systemctl disable wpa_supplicant echo -e "* Ensure hardware clock is up to date..." sudo hwclock --systohc # So that "Open in Terminal" works inc 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 echo -e "* Install pychee for uploading screenshots on Lychee..." pip install --break-system-packages pychee @@ -163,22 +151,20 @@ if [ ! -z "$INIT" ]; then # See https://github.com/EliverLara/terminator-themes mkdir -p $HOME/.config/terminator/plugins wget https://git.io/v5Zww -O $HOME"/.config/terminator/plugins/terminator-themes.py" -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 +# Use XDG_CONFIG_HOME if defined, default otherwise +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 echo -e "\n=== Copy changed configuration which resides in outer directory ===" # Destination files are regular files @@ -198,12 +184,32 @@ for f in `find ${CONFIG} -type f -name ${DEST_FILENAME}`; do filename=${config_file##*/} # Now copy to destination real_dest=${DEST}/${subfolder} + echo $real_dest sudo mkdir -p ${real_dest} absolute_source=`realpath "${DIR}/${config_file}"` check_copy "${absolute_source}" "sudo cp ${absolute_source} ${real_dest}" "sudo rm ${real_dest}/${filename}" 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 echo -e "\n=== Restart graphical environment ===" # Reload i3 configuration diff --git a/.zshrc b/.zshrc index eda077d..8d36a38 100644 --- a/.zshrc +++ b/.zshrc @@ -27,8 +27,6 @@ plugins=( # acs command → print aliases by group aliases colored-man-pages - # cat with colors → ccat or cless - colorize # commands to copy file content or absolute path to clipboard copyfile copypath