Compare commits

1 Commits

Author SHA1 Message Date
6e4c5eee38 wip4 2026-03-09 09:54:53 +08:00
5 changed files with 91 additions and 68 deletions

69
install/keyd Executable file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env bash
##makedesc: Install keyd
# https://github.com/rvaiya/keyd
set -eo pipefail
mkdir -p "$HOME/install"
install() {
echo
echo "==============================================="
echo "Installing keyd (latest)"
echo "==============================================="
echo
hash git || { echo "ERROR: git not installed" ; exit 1; }
cd "$HOME/install"
git clone --depth=1 --single-branch https://github.com/rvaiya/keyd.git "$HOME/install/keyd"
cd "$HOME/install/keyd"
make && sudo make install
sudo systemctl enable --now keyd
echo
echo "Finish!"
}
upgrade() {
echo
echo "==============================================="
echo "Upgrading keyd"
echo "==============================================="
echo
hash git || { echo "ERROR: git not installed" ; exit 1; }
[ -d "$HOME/install/keyd" ] || { echo "ERROR: repo not found: $HOME/install/keyd" ; exit 1; }
cd "$HOME/install/keyd"
make && sudo make install
sudo systemctl enable --now keyd
sudo usermod -aG keyd "$(whoami)"
echo
echo "Finish!"
}
restart() {
sudo systemctl restart keyd
}
reload() {
sudo systemctl reload keyd
}
remove() {
echo
echo "==============================================="
echo "Removing keyd"
echo "==============================================="
echo
sudo dpkg -r keyd
echo
echo "Finish!"
echo
}
case "$1" in
restart) restart ;;
reload) reload ;;
u|upgrade|update) upgrade ;;
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
# X11:
# xrandr --listactivemonitors
# xrandr --output $OUTPUT --rotate (left|right|normal|...)
# Wayland KDE: https://www.reddit.com/r/kde/comments/11vrbwc/how_do_i_rotate_the_screen_on_kde_with_wayland/
# kscreen-doctor --outputs
OUTPUT='HDMI-A-1'
[ "$1" ] && DIRECTION="$1" || DIRECTION="normal" # (left|right|normal|inverted)
kscreen-doctor "output.$OUTPUT.rotation.$DIRECTION"

View File

@@ -1,57 +0,0 @@
#!/usr/bin/env bash
# Очистка места на диске
# https://gist.github.com/anthonyaxenov/02c00c965be4eb5bb163a153abdf4c2b
# https://itsfoss.com/free-up-space-ubuntu-linux/
echo
echo
df -hx tmpfs
echo
echo
echo "[1/5] Removing apt caches and unused packages"
echo
sudo apt autoremove --purge
sudo apt autoclean
sudo apt clean
echo
echo "[2/5] Removing old system logs"
echo
sudo journalctl --vacuum-time=1d
sudo rm -rf /var/log/journal/user-*@*
sudo rm -rf /var/log/journal/system*@*
sudo rm /var/log/{syslog,dmesg,btmp}.*
sudo rm /var/log/{auth,dpkg,kern,alternatives,dmesg}.log.*
echo
echo "[3/5] Cleaning user trash and thumbnails"
echo
rm -rf ~/.local/share/Trash/files/*
rm -rf ~/.cache/thumbnails/*
echo
echo "[4/5] Cleaning out dangling docker objects"
echo
docker system prune -f
# docker system prune -af
echo
echo "[5/5] Removing disabled unused snaps"
echo
sudo snap list --all \
| awk '/disabled/{print $1, $3}' \
| while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
echo
echo
df -hx tmpfs
echo
echo

22
scripts/vscode-fix-cache.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
rename() {
local dir="$1"
echo "Processing: $dir"
[ -d "$dir.bak" ] && rm -rf "$dir.bak"
mv "$dir" "$dir.bak"
}
dirs=(
"$HOME/.config/Code/Cache"
"$HOME/.config/Code/CachedData"
"$HOME/.config/Code/Code Cache"
"$HOME/.config/Code/GPUCache"
"$HOME/.config/Code/Service Worker"
)
for dir in "${dirs[@]}"; do
rename "$dir"
done
echo "Success"