Modifiche ai file .desktop, ai file di yt-dlp,

agli script per rsync.
Creato workspace per VSCodium
This commit is contained in:
Luca Pellegrini 2022-11-16 19:47:55 +01:00
parent aeafeef826
commit ef227a3661
23 changed files with 328 additions and 23 deletions

View File

@ -15,5 +15,5 @@ In un terminale, eseguire questi comandi:
cd ~
git clone https://git.disroot.org/luca-pellegrini/config-files.git
cd config-files
stow */
stow --dotfiles bash desktop-files rsync yt-dlp varie
```

117
bash/.bashrc Normal file
View File

@ -0,0 +1,117 @@
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
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
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi

27
bash/.profile Normal file
View File

@ -0,0 +1,27 @@
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi

View File

@ -0,0 +1,8 @@
{
"folders": [
{
"path": "."
}
],
"settings": {}
}

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Name=python-lab Git-repo (workspace)
Name=Python-Lab (workspace)
Exec=codium --new-window /Data/Git/python-lab/python-lab.code-workspace
Comment=VSCodium Workspace per il repository Git 'python-lab'
Terminal=false

View File

@ -1,6 +1,6 @@
[Desktop Entry]
Name=Python (workspace)
Exec=codium --new-window /Data/Programmazione/Python/Python.code-workspace
Name=Python-Lezioni (workspace)
Exec=codium --new-window /Data/Programmazione/python-lezioni/python-lezioni.code-workspace
Comment=VSCodium Workspace per il corso univ. di programmazione in Python
Terminal=false
Icon=python

View File

@ -1,8 +0,0 @@
[Desktop Entry]
Name=Tor Browser
Exec=sh -c '"/home/luca/Scaricati/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ ! -x "/home/luca/Scaricati/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k
Comment=Naviga internet attraverso la rete Tor
Terminal=false
Icon=/home/luca/Scaricati/tor-browser_en-US/Browser/browser/chrome/icons/default/default128.png
Type=Application
Categories=Network;

7
rsync/rsync-HDD-1.sh Normal file → Executable file
View File

@ -0,0 +1,7 @@
# Audio e Video
rsync -av --exclude 'Backgrounds' /Data/Immagini/ /media/luca/HDD-1/Audio-e-Video/Immagini/
rsync -av --exclude 'opus_codec' --delete /Data/Musica/ /media/luca/HDD-1/Audio-e-Video/Musica/
rsync -av /home/luca/CD-audio/ /media/luca/HDD-1/Audio-e-Video/musica-altro/CD-audio/
rsync -av /Data/Podcast/ /media/luca/HDD-1/Audio-e-Video/Podcast/
rsync -av /Data/Video/ /media/luca/HDD-1/Audio-e-Video/Video/

35
rsync/rsync-Linux-backup.sh Normal file → Executable file
View File

@ -1,13 +1,34 @@
# Partizione "Data"
rsync -av --exclude 'Eseguibili-e-imm-disco' --exclude 'VMs' --delete /Data/ /media/luca/Linux-backup/Data/
#!/bin/bash
#rsync -av /Data/Eseguibili-e-imm-disco/ /media/luca/Linux-backup/Eseguibili-e-imm-disco/
# Partizione "Data"
rsync -av --exclude 'imm-disco' --exclude 'Immagini/temp' --exclude 'musica-altro' --exclude 'VMs' --delete /Data/ /media/luca/Linux-backup/Data/
#rsync -av /Data/imm-disco/ /media/luca/Linux-backup/imm-disco/
# Linux Mint 21
rsync -av --delete ~/Scaricati/ /media/luca/Linux-backup/Linux_Mint_21/Scaricati/
rsync -av --delete ~/Scrivania/ /media/luca/Linux-backup/Linux_Mint_21/Scrivania/
#rsync -av ~/Pubblici/ /media/luca/Linux-backup/Linux_Mint_21/Pubblici/
rsync -av ~/Modelli/ /media/luca/Linux-backup/Linux_Mint_21/Modelli/
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

25
varie/info.md Normal file
View File

@ -0,0 +1,25 @@
# Miei repository Git
~/Git/file.desktop/
* remote: github.com/luca-pellegrini/file.desktop.git
* ssh: git@github.com:luca-pellegrini/file.desktop.git
~/Git/python-lab/
* remote: github.com/luca-pellegrini/python-lab.git
* ssh: git@github.com:luca-pellegrini/python-lab.git
~/Git/linux-post-install/
* remote: git.disroot.org/luca-pellegrini/linux-post-install.git
* ssh: git@git.disroot.org:luca-pellegrini/linux-post-install.git
/Data/Dendron/
* remote: git.disroot.org/luca-pellegrini/dendron.git
* ssh: git@git.disroot.org:luca-pellegrini/dendron.git
## Git directory
~/Git -> /Data/Git/
# SSH pub key
~/.ssh/git.pub (Git repos on github.com, git.disroot.org)
# AppImage directory
~/AppImage -> /Data/AppImage/

View File

@ -0,0 +1,21 @@
# Config file per yt-dlp
# Pensato per: scaricare video da YouTube
# Scarica nel formato .mp4 a risoluzione 1280x720, 30FPS (720p) audio+video
-f 22
# Salva i file nell'HDD esterno (se collegato), in sotto-cartelle di .../Video
# organizzate in /"Canale YT"/Titolo.mp4
-o "/media/luca/HDD_1/Video/%(uploader)s/%(upload_date>%Y.%m.%d)s %(title)s.%(ext)s"
# Restrict filenames to only ASCII characters, and avoid "&" and spaces and other special characters in filenames
#--restrict-filenames
# (eccessivo: elimina pure le parentesi tonde)
# Force filenames to be Windows-compatible
#--windows-filenames
# (sembra non funzionare)
# Comando da inserire nel terminale: yt-dlp --config-location /Data/yt-dlp/ext_HDD-video_720p

View File

@ -0,0 +1,10 @@
# Config file per yt-dlp
# Per scaricare album musicali (con visibilità "non in elenco" o "pubblica") da YT Music
# Pensato per: tanti brani dello stesso artista/album
# Scarica nel formato .m4a (codec AAC) audio-only a c.a 129 kbps
-f 140
# Salva i file in apposite sotto-cartelle di ~/Musica/Downloads:
# ordinate per Artista/Album/"N° traccia" Titolo.m4a
-o "~/Musica/Downloads/%(artist)s/%(album)s/%(playlist_index)s %(title)s.%(ext)s"

View File

@ -0,0 +1,13 @@
# Config file per yt-dlp
# Per scaricare playlist di brani (con visibilità "non in elenco" o "pubblica") da YT Music
# Pensato per: album di "artisti vari"
# Scarica nel formato .m4a (codec AAC) audio-only a c.a 129 kbps
-f 140
# Salva i file in apposite sotto-cartelle di ~/Musica/Downloads
# ordinate per Album/"N° traccia" Titolo.m4a
-o "~/Musica/Downloads/%(album)s/%(playlist_index)s %(title)s.%(ext)s"
# NB: il campo "release_year" non è disponibile per i brani scaricati da YT Music
# (non è possibile smistare automaticamente i file scaricati dividendoli per anni)

View File

@ -0,0 +1,14 @@
# Config file per yt-dlp
# Per scaricare album musicali (con visibilità "non in elenco" o "pubblica") da YT Music
# Pensato per: tanti brani dello stesso artista/album
# Scarica nel nel codec opus a 137 kbps (audio-only, container webm)
-f 251
# Fa il remux del video/audio nel container ogg
--remux-video ogg
# Salva i file in apposite sotto-cartelle di ~/Musica/Downloads:
# ordinate per Artista/Album/"N° traccia" Titolo.m4a
-o "~/Musica/Downloads/Classica/%(album)s/%(playlist_index)s %(title)s.%(ext)s"
# Nel terminale: yt-dlp --config-location ~/.yt-dlp/opus-Classica-album

View File

@ -0,0 +1,14 @@
# Config file per yt-dlp
# Per scaricare album musicali (con visibilità "non in elenco" o "pubblica") da YT Music
# Pensato per: tanti brani dello stesso artista/album
# Scarica nel nel codec opus a 137 kbps (audio-only, container webm)
-f 251
# Fa il remux del video/audio nel container ogg
--remux-video ogg
# Salva i file in apposite sotto-cartelle di ~/Musica/Downloads:
# ordinate per Artista/Album/"N° traccia" Titolo.m4a
-o "~/Musica/Downloads/%(artist)s/%(album)s/%(playlist_index)s %(title)s.%(ext)s"
# Nel terminale: yt-dlp --config-location ~/.yt-dlp/opus-by_artist-album

View File

@ -0,0 +1,13 @@
# Config file per yt-dlp
# Per scaricare brani musicali (con visibilità "non in elenco" o "pubblica") da YT Music
# Scarica nel nel codec opus a 137 kbps (audio-only, container webm)
-f 251
# Fa il remux del video/audio nel container ogg
--remux-video ogg
# Salva i file in ~/Musica/Downloads:
# nominati come Artista - Titolo.m4a
-o "~/Musica/Downloads/%(artist)s - %(title)s.%(ext)s"
# Nel terminale: yt-dlp --config-location ~/.yt-dlp/opus-single_hit

21
yt-dlp/.yt-dlp/video_720p Normal file
View File

@ -0,0 +1,21 @@
# Config file per yt-dlp
# Pensato per: scaricare video da YouTube
# Scarica nel formato .mp4 a risoluzione 1280x720, 30FPS (720p) audio+video
-f 22
# Salva i file in sotto-cartelle di ~/Video
# organizzate in /"Canale YT"/Titolo.mp4
-o "~/Video/%(uploader)s/%(upload_date>%Y.%m.%d)s %(title)s.%(ext)s"
# Restrict filenames to only ASCII characters, and avoid "&" and spaces and other special characters in filenames
#--restrict-filenames
# (eccessivo: elimina pure le parentesi tonde)
# Force filenames to be Windows-compatible
#--windows-filenames
# (sembra non funzionare)
# Nel terminale: yt-dlp --config-location ~/.yt-dlp/video_720p

View File

@ -1,9 +1,11 @@
# Config file per yt-dlp
# Se posizionato nella cartella ~, definiscce le configurazioni di default di yt-dlp per l'utente corrente
# Pensato principalmente per scaricare brani musicali da YT Music
# Da posizionare nella cartella ~ (/home/luca/), definiscce le configurazioni di default di yt-dlp per l'utente corrente
# Pensato per: singoli brani musicali da YT Music
# Scarica nel formato .m4a (codec AAC) audio-only a c.a 129 kbps
-f 140
# Scarica nel nel codec opus a 137 kbps (audio-only, container webm)
-f 251
# Fa il remux del video/audio nel container opus
--remux-video ogg
#Salva il file nella cartella ~/Musica/Downloads; nome file: "Artista - Titolo.m4a"
-o "~/Musica/Downloads/%(artist)s - %(title)s.%(ext)s"