Compare commits

...

4 Commits

Author SHA1 Message Date
Luca Pellegrini 0347351dfd Aggiunto .gitignore
Aggiunto .gitignore: ignora cartelle 'temp' e 'old', ignora file che
contengono il termine 'fedora' nel nome, in quanto copie dei file
gestiti nel branch 'fedora-kde'.
Ignora file `.directory` generati da Dolphin
2023-02-03 16:31:07 +01:00
Luca Pellegrini 15f8bb5031 Modifiche agli script per rsync
Spostati script esistenti sotto la cartella `rsync/bin/`.
Modificati script esistenti, al fine di usare variabili, ove possibile,
per indicare il percorso della destinazione.
Rinominato `rsync-Linux-backup.sh` in `rsync-Backup.sh`.
Aggiunto file `exclude-Data.txt` che elenca file/cartelle da escludere
nel backup della cartella `/Data` sul disco esterno 'Backup'.
Aggiunti nuovi script per casi particolari.
2023-02-03 16:03:28 +01:00
Luca Pellegrini edbd3baaba Configurazione per Zsh shell
Creati file di configurazione per shell zsh
(basati sui corrispondenti file del branch fedora-kde),
con leggere modifiche specifiche per Linux Mint.

File `.zsh_aliases` è circa uguale a `.bash_aliases`
2023-02-03 15:39:15 +01:00
Luca Pellegrini 64ab6e567a Definizioni di alias per bash
Spostate le definizioni di alias per le shell bash in un file
dedicato `.bash_aliases` (coerente con `.zsh_aliases`)
2023-02-03 15:32:34 +01:00
17 changed files with 2114 additions and 103 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
temp/
old/
# File del branch fedora-kde
*fedora*
# KDE directory preferences
.directory

62
bash/.bash_aliases Normal file
View File

@ -0,0 +1,62 @@
#!/usr/bin/bash
# .bash_aliases
# Alias definitions
# Questo file viene letto da ogni shell bash, dopo il file '~/.bashrc'
# Common commands
alias q='exit'
alias c='clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias o='xdg-open' # open any file in the configured default application
#alias t='time'
#alias k='kill'
# exa/ls aliases
alias ls="exa --icons --color=auto --group-directories-first"
alias la="ls -a"
alias ll="ls -al -g -h"
alias tree="ll --tree -L 3"
# Colorize grep output (good for log files)
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# confirm before overwriting something
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
# Directories
alias home='cd ~'
alias data='cd /Data'
alias root='cd /'
alias ..='cd ..'
alias ...='cd ..; cd ..'
alias ....='cd ..; cd ..; cd ..'
# Cartelle in home e partizione Data
alias libri="cd $HOME/Libri"
alias dendron-git="cd /Data/Dendron && git status"
alias nextcloud="cd /Data/Nextcloud && la"
alias python-lab="cd /Data/Git/python-lab && la"
alias python-lezioni="cd /Data/Programmazione/python-lezioni && la"
alias programmazione="cd /Data/Programmazione && la"
# Git
alias g='git'
alias g-ad='git add'
alias g-st='git status'
alias g-com='git commit'
#alias g-pl='git pull'
#alias g-ps='git push'
# apt
alias upgrade="sudo apt update && sudo apt upgrade"
alias apt-info="apt show"
# Altri programmi usati di frequente
alias dolphin='dolphin --new-window'
alias dendron="/usr/bin/codium --new-window /Data/Dendron/dendron.code-workspace"
alias email="thunderbird"

View File

@ -87,10 +87,6 @@ fi
# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert

View File

@ -0,0 +1,13 @@
# cartelle e file nella partizione Data, da escludere nei backup con rsync
.Trash-1000/
.vscode-oss/
imm-disco/
Immagini/temp/
musica-altro/
Musica/Downloads/
Nextcloud/**
SCGP/Immagini/
Programmazione/venv/
temp/
VMs/

56
rsync/bin/rsync-Backup.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av --exclude-from=$EXCLUDES --delete /Data/ $MNT_POINT/Data/
#rsync -av --mkpath /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,56 @@
#!/bin/bash
MNT_POINT='/media/luca/Backup'
# Partizione "Data"
EXCLUDES=$HOME/bin/exclude-Data.txt
rsync -av -n --exclude-from=$EXCLUDES --delete /Data/ $MNT_POINT/Data/
#rsync -av --mkpath -n /Data/imm-disco/ $MNT_POINT/imm-disco/
# Linux Mint 21
rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Linux_Mint/Scaricati/
rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Linux_Mint/Scrivania/
## Config files (Git repository)
rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Linux_Mint/config-files/
## file nascosti
#rsync -av --mkpath -n $HOME/.thunderbird/ $MNT_POINT/Linux_Mint/.thunderbird/
#rsync -av --mkpath -n $HOME/.gnupg/ $MNT_POINT/Linux_Mint/.gnupg/
# Fedora KDE
#rsync -av --mkpath -n --delete $HOME/Scaricati/ $MNT_POINT/Fedora/Scaricati/
#rsync -av --mkpath -n --delete $HOME/Scrivania/ $MNT_POINT/Fedora/Scrivania/
## Config files (Git repository)
#rsync -av --mkpath -n --delete $HOME/config-files/ $MNT_POINT/Fedora/config-files/
# home (generica)
rsync -av --mkpath -n $HOME/Pubblici/ $MNT_POINT/home/Pubblici/
rsync -av --mkpath -n $HOME/Modelli/ $MNT_POINT/home/Modelli/
## bin
rsync -av --mkpath -n $HOME/bin/ $MNT_POINT/home/bin/
rsync -av --mkpath -n $HOME/.local/bin/ $MNT_POINT/home/.local/bin/
## file nascosti
rsync -av --mkpath -n $HOME/.local/share/strawberry/ $MNT_POINT/home/.local/share/strawberry/
rsync -av --mkpath -n $HOME/.config/strawberry/ $MNT_POINT/home/.config/strawberry/
rsync -a --mkpath -n --delete $HOME/.local/share/TelegramDesktop/ $MNT_POINT/home/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --mkpath -n --delete $HOME/.icons/ $MNT_POINT/home/.icons/
#rsync -av --mkpath -n --delete $HOME/.themes/ $MNT_POINT/home/.themes/
## altro
rsync -av --mkpath -n --delete $HOME/CD-audio/ $MNT_POINT/home/CD-audio/
## VSCodium extensions
#rsync -a --mkpath -n --delete $HOME/.vscode-oss/extensions/ $MNT_POINT/home/.vscode-oss/extensions/
## SSH keys
#rsync -av --mkpath -n $HOME/.ssh/ $MNT_POINT/home/.ssh/
# Argomenti di rsync
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,18 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av -n --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av -n --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av -n --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av -n --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av -n --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av -n --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av -n --mkpath /Data/Libri/ $DOCS/Libri/

18
rsync/bin/rsync-HDD-1.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
MNT_POINT='/media/luca/HDD-1'
rsync -av --mkpath /Data/temp/ $MNT_POINT/temp/
# Audio e Video
MULTIMEDIA=$MNT_POINT/Multimedia
rsync -av --mkpath /Data/Immagini/ $MULTIMEDIA/Immagini/
rsync -av --mkpath --delete /Data/Musica/ $MULTIMEDIA/Musica/
rsync -av --mkpath /home/luca/CD-audio/ $MULTIMEDIA/musica-altro/CD-audio/
rsync -av --mkpath /Data/Podcast/ $MULTIMEDIA/Podcast/
rsync -av --mkpath /Data/Video/ $MULTIMEDIA/Video/
# Documenti e altro
DOCS=$MNT_POINT/Documenti_e_altro
rsync -av --mkpath /Data/Libri/ $DOCS/Libri/

View File

@ -0,0 +1,16 @@
#!/bin/bash
MNT_POINT='/media/luca/LUCA-32GB'
rsync -av -n --delete --exclude "Downloads" /Data/Musica/ $MNT_POINT/Musica/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -0,0 +1,3 @@
#!/bin/bash
rsync -av --delete --exclude "Downloads" /Data/Musica/ /run/media/luca/SD-CARD/Musica/

View File

@ -1,43 +0,0 @@
#!/bin/bash
# Partizione "Data"
rsync -avn --exclude 'imm-disco' --exclude 'Immagini/temp' --exclude 'musica-altro' --exclude 'VMs' --exclude 'SCGP/Immagini' --exclude 'temp' --delete /Data/ /media/luca/Linux-backup/Data/
#rsync -av /Data/imm-disco/ /media/luca/Linux-backup/imm-disco/
# Linux Mint 21
rsync -avn --delete /home/luca/Scaricati/ /media/luca/Linux-backup/Linux_Mint_21/Scaricati/
rsync -avn --delete /home/luca/Scrivania/ /media/luca/Linux-backup/Linux_Mint_21/Scrivania/
#rsync -av /home/luca/Pubblici/ /media/luca/Linux-backup/Linux_Mint_21/Pubblici/
rsync -avn /home/luca/Modelli/ /media/luca/Linux-backup/Linux_Mint_21/Modelli/
## file nascosti
rsync -avn --delete /home/luca/.thunderbird/ /media/luca/Linux-backup/Linux_Mint_21/.thunderbird/
rsync -avn /home/luca/.gnupg/ /media/luca/Linux-backup/Linux_Mint_21/.gnupg/
rsync -avn /home/luca/.local/share/strawberry/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/strawberry/
rsync -avn --delete /home/luca/.local/share/TelegramDesktop/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/TelegramDesktop/
## themes e icons
#rsync -avn --delete /home/luca/.icons/ /media/luca/Linux-backup/Linux_Mint_21/.icons/
rsync -avn --delete /home/luca/.themes/ /media/luca/Linux-backup/Linux_Mint_21/.themes/
# Home directory (generale)
rsync -avn --delete /home/luca/CD-audio/ /media/luca/Linux-backup/home/CD-audio/
## Configuration files
rsync -avn --delete /home/luca/config-files/ /media/luca/Linux-backup/home/config-files/
## VSCodium extensions
rsync -avn --delete /home/luca/.vscode-oss/extensions/ /media/luca/Linux-backup/home/.vscode-oss/extensions/
## SSH keys
rsync -avn /home/luca/.ssh/ /media/luca/Linux-backup/home/.ssh/
# bin
rsync -avn /home/luca/.local/bin/ /media/luca/Linux-backup/home/.local/bin/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1,12 +0,0 @@
#!/bin/bash
# Audio e Video
rsync -av /Data/Immagini/ /media/luca/HDD-1/Multimedia/Immagini/
rsync -av --delete /Data/Musica/ /media/luca/HDD-1/Multimedia/Musica/
rsync -av /home/luca/CD-audio/ /media/luca/HDD-1/Multimedia/musica-altro/CD-audio/
rsync -av /Data/Podcast/ /media/luca/HDD-1/Multimedia/Podcast/
rsync -av /Data/Video/ /media/luca/HDD-1/Multimedia/Video/
# Documenti e altro
rsync -av /Data/Libri/ /media/luca/HDD-1/Documenti_e_altro/Libri/

View File

@ -1,43 +0,0 @@
#!/bin/bash
# Partizione "Data"
rsync -av --exclude 'imm-disco' --exclude 'Immagini/temp' --exclude 'musica-altro' --exclude 'VMs' --exclude 'SCGP/Immagini' --exclude 'temp' --delete /Data/ /media/luca/Linux-backup/Data/
#rsync -av /Data/imm-disco/ /media/luca/Linux-backup/imm-disco/
# Linux Mint 21
rsync -av --delete /home/luca/Scaricati/ /media/luca/Linux-backup/Linux_Mint_21/Scaricati/
rsync -av --delete /home/luca/Scrivania/ /media/luca/Linux-backup/Linux_Mint_21/Scrivania/
#rsync -av /home/luca/Pubblici/ /media/luca/Linux-backup/Linux_Mint_21/Pubblici/
rsync -av /home/luca/Modelli/ /media/luca/Linux-backup/Linux_Mint_21/Modelli/
## file nascosti
rsync -av --delete /home/luca/.thunderbird/ /media/luca/Linux-backup/Linux_Mint_21/.thunderbird/
rsync -av /home/luca/.gnupg/ /media/luca/Linux-backup/Linux_Mint_21/.gnupg/
rsync -av /home/luca/.local/share/strawberry/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/strawberry/
rsync -av --delete /home/luca/.local/share/TelegramDesktop/ /media/luca/Linux-backup/Linux_Mint_21/.local/share/TelegramDesktop/
## themes e icons
#rsync -av --delete /home/luca/.icons/ /media/luca/Linux-backup/Linux_Mint_21/.icons/
rsync -av --delete /home/luca/.themes/ /media/luca/Linux-backup/Linux_Mint_21/.themes/
# Home directory (generale)
rsync -av --delete /home/luca/CD-audio/ /media/luca/Linux-backup/home/CD-audio/
## Configuration files
rsync -av --delete /home/luca/config-files/ /media/luca/Linux-backup/home/config-files/
## VSCodium extensions
rsync -av --delete /home/luca/.vscode-oss/extensions/ /media/luca/Linux-backup/home/.vscode-oss/extensions/
## SSH keys
rsync -av /home/luca/.ssh/ /media/luca/Linux-backup/home/.ssh/
# bin
rsync -av /home/luca/.local/bin/ /media/luca/Linux-backup/home/.local/bin/
# -a = -rlptgoD (no -A -X -U -N -H)
# -r = recursive
# -l = copy symlinks as symlinks
# -p = preserve permissions
# -t = preserve modification times
# -g = preserve group
# -o = preserve owner
# -D = --devices --specials
# --devices = preserve device-files (super-user only)
# --specials = preserve special files

View File

@ -1 +0,0 @@
rsync -av --delete --exclude ".thumbnails" /home/luca/Musica/ /media/luca/3335-3239/Music/

1761
zsh/.p10k.zsh Normal file

File diff suppressed because it is too large Load Diff

60
zsh/.zsh_aliases Normal file
View File

@ -0,0 +1,60 @@
# .zsh_aliases
# Alias definitions
# Questo file viene letto da ogni shell zsh, dopo il file '~/.zshrc'
# Common commands
alias q='exit'
alias c='clear'
alias h='history'
alias cs='clear;ls'
alias p='cat'
alias o='xdg-open' # open any file in the configured default application
#alias t='time'
#alias k='kill'
# exa/ls aliases (overwritten if 'exa' zsh plugin is enabled)
alias ls="exa --icons --color=auto --group-directories-first"
alias la="ls -a"
alias ll="ls -al -g -h"
alias tree="ll --tree -L 3"
# Colorize grep output (good for log files)
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
# Confirm before overwriting something
alias cp="cp -i"
alias mv='mv -i'
alias rm='rm -i'
# Directories
alias home='cd ~'
alias data='cd /Data'
alias root='cd /'
alias ..='cd ..'
alias ...='cd ..; cd ..'
alias ....='cd ..; cd ..; cd ..'
# Directories in home and Data partition
alias libri="cd $HOME/Libri"
alias dendron-git="cd /Data/Dendron && git status"
alias nextcloud="cd /Data/Nextcloud && la"
alias python-lab="cd /Data/Git/python-lab && la"
alias programmazione="cd /Data/Programmazione && la"
# Git
alias g='git'
alias g-ad='git add'
alias g-st='git status'
alias g-com='git commit'
#alias g-pl='git pull'
#alias g-ps='git push'
# apt
alias upgrade="sudo apt update && sudo apt upgrade"
alias apt-info="apt show"
# Altri programmi usati di frequente
alias dolphin="dolphin --new-window"
alias dendron="/usr/bin/codium --new-window /Data/Dendron/dendron.code-workspace"
alias email="thunderbird"

43
zsh/.zshrc Normal file
View File

@ -0,0 +1,43 @@
#!/bin/zsh
# .zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# Zap plugin manager
# Source '~/.local/share/zap/zap.zsh' if it exists
if [ -f "$HOME/.local/share/zap/zap.zsh" ]; then
source "$HOME/.local/share/zap/zap.zsh"
fi
# History
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=2000
# Export some variables
export EDITOR="xed"
export TERMINAL="gnome-terminal"
export BROWSER="firefox"
# Alias definitions
# Must be sourced before the zsh plugins
if [ -f "$HOME/.zsh_aliases" ]; then
source "$HOME/.zsh_aliases"
fi
# Plugins (Zap plugin manager)
plug "zsh-users/zsh-autosuggestions"
plug "zsh-users/zsh-syntax-highlighting"
#plug "zap-zsh/supercharge"
#plug "zap-zsh/exa"
# Custom prompt
plug "romkatv/powerlevel10k"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f "$HOME/.local/share/zap/zap.zsh" ] && source "$HOME/.local/share/zap/zap.zsh"