diff options
Diffstat (limited to 'public/.local')
| -rwxr-xr-x | public/.local/bin/laptop-backup.sh | 21 | ||||
| -rwxr-xr-x | public/.local/bin/laptop-xinput_setup.sh | 8 |
2 files changed, 25 insertions, 4 deletions
diff --git a/public/.local/bin/laptop-backup.sh b/public/.local/bin/laptop-backup.sh index 0fcd0cd..64f39b0 100755 --- a/public/.local/bin/laptop-backup.sh +++ b/public/.local/bin/laptop-backup.sh @@ -1,6 +1,18 @@ #!/bin/bash # Fast backup using rsync +# +# This script is meant to be executed manually every so often (weekly, monthly). +# If an automatic solution where to be made (e.g., run daily via cron job). +# Then make sure the rsync target is always the same (e.g., minipc:/mnt/backup) +# and the `--delete` flag is NOT used (you'll need to figure out a way to +# "purge" duplicated files in the backup storage every so often). +# +# Steps: +# 1. Connect external storage device and get the block device path (`lsblk`) +# 2. Run this script +# +# See also: http://wiki.pulse15/index.php?title=Backup if [ $# -ne 2 ]; then echo "Usage: $(basename "$0") /dev/sdX backup" @@ -13,10 +25,14 @@ if [ "$(id -u)" -ne 0 ]; then fi rsync_options="-auvP --delete" +# path of the device (block device file) (e.g., /dev/sda) device=$1 +# cryptsetup name (e.g., backup) name=$2 -# Note: `name` (nor `device`) should not contain spaces +# FIXME +# Everything breaks if `name` or `device` contain spaces. Exit if that's the +# case. cryptsetup open --type luks $device $name if [ $? -ne 0 ]; then @@ -24,7 +40,8 @@ if [ $? -ne 0 ]; then exit 1 fi mount /dev/mapper/$name /mnt/$name -# TODO: stop backing up /var. Backup is just for Postgres and Mediawiki. +# TODO +# Stop backing up /var. Backup is just for Postgres and Mediawiki. # `/var` is used by too many applications. Specialy pacman that clutters it # with cached binaries. rsync $rsync_options /var /mnt/$name # <10G diff --git a/public/.local/bin/laptop-xinput_setup.sh b/public/.local/bin/laptop-xinput_setup.sh index b707549..fcf1378 100755 --- a/public/.local/bin/laptop-xinput_setup.sh +++ b/public/.local/bin/laptop-xinput_setup.sh @@ -17,11 +17,15 @@ pulse15() { # Mice # 3-bit prop meanings for convenience (see libinput man for more info): # * "profile": adaptive, flat, custom + # https://man.archlinux.org/man/libinput.4#libinput~2 # * "scroll method": twofinger, edge, button + # https://man.archlinux.org/man/libinput.4#libinput~22 + # https://wiki.archlinux.org/title/Libinput#Scroll_with_mouse_by_holding_a_button # Buffalo BSMBU19 (125 Hz) xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Accel Profile Enabled" 1 0 0 - xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Accel Speed" .5 - xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Scroll Method Enabled" 0 0 1 + xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Accel Speed" .9 + xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Scroll Method Enabled" 0 0 0 + xinput set-prop "HID 1bcf:08a0 Mouse" "libinput Button Scrolling Button" 2 } pulse15 |
